Skip to content

Commit

Permalink
chore: show version from application if empty in license
Browse files Browse the repository at this point in the history
Signed-off-by: Jakob Steiner <[email protected]>
  • Loading branch information
kosmoz committed Feb 13, 2025
1 parent 76d4200 commit 5d4608c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,14 @@ export class DeploymentFormComponent implements OnInit, OnDestroy, ControlValueA
protected availableApplicationVersions$ = this.shouldShowLicense$.pipe(
switchMap((shouldShowLicense) =>
shouldShowLicense
? this.selectedLicense$.pipe(map((license) => license?.versions ?? []))
? this.selectedLicense$.pipe(
switchMap((license) =>
// if the license has no version associations, assume that the application has all available versions
license?.versions.length
? of(license.versions)
: this.selectedApplication$.pipe(map((application) => application?.versions ?? []))
)
)
: this.selectedApplication$.pipe(map((application) => application?.versions ?? []))
)
);
Expand Down
4 changes: 3 additions & 1 deletion frontend/ui/src/app/services/license.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export class LicenseService {
id: 'ced3992d-6717-498e-8726-6845ec3069b4',
name: 'test',
applicationId,
versions: [{id: 'bf58c94e-0c5b-476a-a647-09464d85bcae', name: 'v4.2.0'}],
versions: [
// {id: 'bf58c94e-0c5b-476a-a647-09464d85bcae', name: 'v4.2.0'}
],
},
],
]);
Expand Down

0 comments on commit 5d4608c

Please sign in to comment.