Skip to content

Commit

Permalink
fix(ui): display default payload (#5074)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguiheux authored Mar 24, 2020
1 parent 1900c22 commit 9c2ac89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class WorkflowNodeRunParamComponent implements AfterViewInit {
return;
}
this.open = true;
this.nodeToRun = this._store.selectSnapshot(WorkflowState.nodeSnapshot);
this.nodeToRun = cloneDeep(this._store.selectSnapshot(WorkflowState.nodeSnapshot));
this.currentNodeRun = this._store.selectSnapshot(WorkflowState.nodeRunSnapshot);
this.currentWorkflowRun = this._store.selectSnapshot(WorkflowState.workflowRunSnapshot);
this.workflow = this._store.selectSnapshot(WorkflowState.workflowSnapshot);
Expand All @@ -109,6 +109,11 @@ export class WorkflowNodeRunParamComponent implements AfterViewInit {
if (this.currentNodeRun && this.currentNodeRun.workflow_node_id !== this.nodeToRun.id) {
delete this.currentNodeRun;
}

if (!this.nodeToRun) {
this.nodeToRun = this.workflow.workflow_data.node;
}

this.updateDefaultPipelineParameters();
if (this.nodeToRun && this.nodeToRun.context) {
// TODO fix condition when optinal chaining (? operator) when angular 9
Expand Down Expand Up @@ -137,7 +142,6 @@ export class WorkflowNodeRunParamComponent implements AfterViewInit {
}
this.num = num;


// if the pipeline was already launched, we refresh data from API
// relaunch a workflow or a pipeline
if (num > 0 && nodeRunID > 0) {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/shared/workflow/node/run/node.run.param.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="ui form payload">
<ng-container *ngIf="nodeToRun && nodeToRun.type === nodeTypeEnum.PIPELINE && parameters?.length > 0 ">
<h3>{{ 'workflow_node_context_pipeline_parameter' | translate}}</h3>
<app-parameter-list [project]="project" [parameters]="parameters"
<app-parameter-list [parameters]="parameters"
[paramsRef]="workflow.pipelines[nodeToRun.context.pipeline_id]?.parameters" mode="launcher"
[suggest]="[]"></app-parameter-list>
</ng-container>
Expand Down

0 comments on commit 9c2ac89

Please sign in to comment.