Skip to content

Commit

Permalink
Issue #40: Added fallback values for form in multiple-service-launch-…
Browse files Browse the repository at this point in the history
…panel (#43)
  • Loading branch information
felixApplatix authored Aug 26, 2017
1 parent 15e9a10 commit e922b72
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ export class MultipleServiceLaunchPanelComponent {
private setParamValue(parameterValue: string) {
let vTemp = parameterValue;
this.session = {
commit: this.commit.revision,
repo: this.commit.repo,
branch: this.commit.branch
commit: this.commit.revision || this.getFallbackTemplateValue('commit'),
repo: this.commit.repo || this.getFallbackTemplateValue('repo'),
branch: this.commit.branch || this.getFallbackTemplateValue('branch')
};

// this is required to GUI-1367 launch a workflow using the workflow instance's exported artifact
Expand All @@ -376,6 +376,13 @@ export class MultipleServiceLaunchPanelComponent {
return this.session[parameterValue.substring(parameterValue.indexOf('.') + 1).toString()] || vTemp;
}

private getFallbackTemplateValue(prop: string) {
if (this.templatesToSubmit.length === 1 && this.templatesToSubmit[0][prop]) {
return this.templatesToSubmit[0][prop];
}
return;
}

private resubmitTask(task, runPartial = false): any {
if (runPartial) {
task.parameters = this.listParameters(this.allForms.controls[0]['controls']);
Expand Down

0 comments on commit e922b72

Please sign in to comment.