Skip to content

Commit

Permalink
Merge pull request #157 from onepanelio/docs/env-var-notes
Browse files Browse the repository at this point in the history
docs: Update notes about environment variables
  • Loading branch information
Vafilor authored Aug 24, 2020
2 parents 96b8e21 + 6154ace commit b1c10ad
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="font-roboto-bold font-weight-bold font-size-regular">Environment variables</div>
<div class="mt-1 font-roboto font-size-regular color-black">
<div>
Any environment variables you have created will be mounted on workflow execution.
Any environment variables you have created will be automatically mounted to this Workflow execution.
</div>
<div class="color-primary underline pointer-hover mt-1" (click)="goToEnvironmentVariables()">
Add or manage environment variables
Expand Down
8 changes: 8 additions & 0 deletions src/app/secrets/secrets.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@

<div class="page-body mt-8">
<div class="page-title-text">Manage environment variables</div>
<div class="environment bg-primary-light op-rounded-regular mt-5">
<div class="mt-1 font-roboto font-size-regular color-black">
<div>
<p>These environment variables are automatically added to any Workspace or Workflow execution.</p>
<p>They are also available in <strong>onepanel-default-env</strong> secret in the current namespace if you need to access them in other resources.</p>
</div>
</div>
</div>
<app-secret-list class="mt-8" [namespace]="this.namespace"></app-secret-list>

<button mat-stroked-button color="primary" class="font-roboto-bold mt-8 font-weight-bold font-size-regular add-environment-variable vertical-align-icon op-rounded" (click)="createEnvironmentVariable()">
Expand Down
5 changes: 5 additions & 0 deletions src/app/secrets/secrets.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@
display: block;
}
}

.environment {
padding: 20px;
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="font-roboto-bold font-weight-bold font-size-regular">Environment variables</div>
<div class="mt-1 font-roboto font-size-regular color-black">
<div>
Any environment variables you have created will be mounted on workflow execution.
Any environment variables you have created will be automatically mounted to this Workflow execution.
</div>
<div class="color-primary underline pointer-hover mt-1" (click)="goToEnvironmentVariables()">
Add or manage environment variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@
[errors]="errors"
class="parameters mb-3 d-block">
</app-form>
<div class="environment bg-primary-light op-rounded-regular mt-5">
<div class="font-roboto-bold font-weight-bold font-size-regular">Environment variables</div>
<div class="mt-1 font-roboto font-size-regular color-black">
<div>
Any environment variables you have created will be automatically mounted to this Workspace.
</div>
<div class="color-primary underline pointer-hover mt-1" (click)="goToEnvironmentVariables()">
Add or manage environment variables
</div>
</div>
</div>
</div>


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.environment {
padding: 20px;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, Inject, OnInit } from '@angular/core';
import { Router } from "@angular/router";
import {
CreateWorkspaceBody,
KeyValue,
Expand Down Expand Up @@ -49,6 +50,7 @@ export class WorkspaceExecuteDialogComponent implements OnInit {
public dialogRef: MatDialogRef<WorkspaceExecuteDialogComponent>,
public namespaceTracker: NamespaceTracker,
private appRouter: AppRouter,
private router: Router,
private formBuilder: FormBuilder,
private workspaceService: WorkspaceServiceService,
private workspaceTemplateService: WorkspaceTemplateServiceService,
Expand Down Expand Up @@ -143,4 +145,12 @@ export class WorkspaceExecuteDialogComponent implements OnInit {
this.dialogRef.close();
this.appRouter.navigateToWorkspaceTemplates(this.namespaceTracker.activeNamespace);
}

goToEnvironmentVariables() {
this.dialogRef.afterClosed().subscribe(res => {
this.router.navigate(['/', this.namespaceTracker.activeNamespace, 'secrets']);
});

this.dialogRef.close();
}
}

0 comments on commit b1c10ad

Please sign in to comment.