Skip to content

Commit

Permalink
feat: Update task launch builder
Browse files Browse the repository at this point in the history
Hide Default version on app if a version has been selected
  • Loading branch information
oodamien authored May 15, 2024
1 parent ba60f31 commit 2a6d25b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,9 @@
<div class="cell">
<clr-select-container style="margin-top: 0">
<select tabindex="{{ 300 }}" [formControlName]="app.name" clrSelect>
<option value="">{{ getLabelAppVersion(builder.taskLaunchConfig, app) }}</option>
<option *ngIf="showDefaultVersion(builder.taskLaunchConfig, app)" value="">
{{ getLabelAppVersion(builder.taskLaunchConfig, app) }}
</option>
<option *ngFor="let version of app.versions" [value]="version.version">
{{ version.version }}
</option>
Expand Down
10 changes: 10 additions & 0 deletions ui/src/app/tasks-jobs/tasks/launch/builder/builder.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,16 @@ export class BuilderComponent implements OnInit, OnDestroy {
return version !== '' && !app.versions.find(v => v.version === version);
}

showDefaultVersion(config: any, app: any): boolean {
const version = config.deploymentProperties
.map((prop: string) => prop.split('=')[0])
.find((prop: string) => prop === `version.${app.name}`);
if (version) {
return false;
}
return true;
}

/**
* Return true if the builder is valid
* @param builder
Expand Down

0 comments on commit 2a6d25b

Please sign in to comment.