From d102a73e5299f87434e627d05856ed3909643af6 Mon Sep 17 00:00:00 2001 From: RehanY147 Date: Thu, 9 Jan 2025 11:27:21 +0500 Subject: [PATCH] NAS-133213: Handle null latest_version (#11305) --- .../app-update-cell.component.html | 2 +- .../app-update-cell.component.ts | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/app/pages/apps/components/installed-apps/app-update-cell/app-update-cell.component.html b/src/app/pages/apps/components/installed-apps/app-update-cell/app-update-cell.component.html index 7afc527d6da..dd25b423e3a 100644 --- a/src/app/pages/apps/components/installed-apps/app-update-cell/app-update-cell.component.html +++ b/src/app/pages/apps/components/installed-apps/app-update-cell/app-update-cell.component.html @@ -4,7 +4,7 @@ class="icon" matTooltipPosition="above" name="mdi-alert-circle" - [matTooltip]="'{version} is available!' | translate: { version: app().latest_version | appVersion }" + [matTooltip]="getVersionMsg(app().latest_version)" > } @else { (); @@ -26,4 +27,16 @@ export class AppUpdateCellComponent { @HostBinding('class') get hostClasses(): string[] { return ['update', this.showIcon() ? 'has-icon' : 'has-cell']; } + + constructor( + private translate: TranslateService, + private appVersionPipe: AppVersionPipe, + ) {} + + protected getVersionMsg(version: string): string { + return this.translate.instant( + '{version} is available!', + { version: this.appVersionPipe.transform(version) || 'Upgrade' }, + ); + } }