From f54a2ad8ee019bc4bb6de69a95f72522a01d1c18 Mon Sep 17 00:00:00 2001 From: Alex Karpov Date: Wed, 11 Sep 2024 17:08:55 +0300 Subject: [PATCH] NAS-130478: Fix app statuses (#10659) --- src/app/enums/app-state.enum.ts | 5 ----- .../app-info-card/app-info-card.component.html | 2 +- .../app-info-card/app-info-card.component.ts | 6 +----- .../installed-apps/app-row/app-row.component.html | 2 +- .../installed-apps/app-row/app-row.component.ts | 6 +----- .../app-workloads-card.component.html | 2 +- .../app-workloads-card.component.ts | 2 +- .../installed-apps/installed-apps.component.ts | 13 ++++++++++++- .../apps/store/installed-apps-store.service.ts | 4 ++-- src/assets/i18n/af.json | 1 + src/assets/i18n/ar.json | 1 + src/assets/i18n/ast.json | 1 + src/assets/i18n/az.json | 1 + src/assets/i18n/be.json | 1 + src/assets/i18n/bg.json | 1 + src/assets/i18n/bn.json | 1 + src/assets/i18n/br.json | 1 + src/assets/i18n/bs.json | 1 + src/assets/i18n/ca.json | 1 + src/assets/i18n/cs.json | 1 + src/assets/i18n/cy.json | 1 + src/assets/i18n/da.json | 1 + src/assets/i18n/de.json | 1 + src/assets/i18n/dsb.json | 1 + src/assets/i18n/el.json | 1 + src/assets/i18n/en-au.json | 1 + src/assets/i18n/en-gb.json | 1 + src/assets/i18n/en.json | 1 + src/assets/i18n/eo.json | 1 + src/assets/i18n/es-ar.json | 1 + src/assets/i18n/es-co.json | 1 + src/assets/i18n/es-mx.json | 1 + src/assets/i18n/es-ni.json | 1 + src/assets/i18n/es-ve.json | 1 + src/assets/i18n/es.json | 1 + src/assets/i18n/et.json | 1 + src/assets/i18n/eu.json | 1 + src/assets/i18n/fa.json | 1 + src/assets/i18n/fi.json | 1 + src/assets/i18n/fr.json | 1 + src/assets/i18n/fy.json | 1 + src/assets/i18n/ga.json | 1 + src/assets/i18n/gd.json | 1 + src/assets/i18n/gl.json | 1 + src/assets/i18n/he.json | 1 + src/assets/i18n/hi.json | 1 + src/assets/i18n/hr.json | 1 + src/assets/i18n/hsb.json | 1 + src/assets/i18n/hu.json | 1 + src/assets/i18n/ia.json | 1 + src/assets/i18n/id.json | 1 + src/assets/i18n/io.json | 1 + src/assets/i18n/is.json | 1 + src/assets/i18n/it.json | 1 + src/assets/i18n/ja.json | 1 + src/assets/i18n/ka.json | 1 + src/assets/i18n/kk.json | 1 + src/assets/i18n/km.json | 1 + src/assets/i18n/kn.json | 1 + src/assets/i18n/ko.json | 1 + src/assets/i18n/lb.json | 1 + src/assets/i18n/lt.json | 1 + src/assets/i18n/lv.json | 1 + src/assets/i18n/mk.json | 1 + src/assets/i18n/ml.json | 1 + src/assets/i18n/mn.json | 1 + src/assets/i18n/mr.json | 1 + src/assets/i18n/my.json | 1 + src/assets/i18n/nb.json | 1 + src/assets/i18n/ne.json | 1 + src/assets/i18n/nl.json | 1 + src/assets/i18n/nn.json | 1 + src/assets/i18n/os.json | 1 + src/assets/i18n/pa.json | 1 + src/assets/i18n/pl.json | 1 + src/assets/i18n/pt-br.json | 1 + src/assets/i18n/pt.json | 1 + src/assets/i18n/ro.json | 1 + src/assets/i18n/ru.json | 1 + src/assets/i18n/sk.json | 1 + src/assets/i18n/sl.json | 1 + src/assets/i18n/sq.json | 1 + src/assets/i18n/sr-latn.json | 1 + src/assets/i18n/sr.json | 1 + src/assets/i18n/strings.json | 1 + src/assets/i18n/sv.json | 1 + src/assets/i18n/sw.json | 1 + src/assets/i18n/ta.json | 1 + src/assets/i18n/te.json | 1 + src/assets/i18n/th.json | 1 + src/assets/i18n/tr.json | 1 + src/assets/i18n/tt.json | 1 + src/assets/i18n/udm.json | 1 + src/assets/i18n/uk.json | 1 + src/assets/i18n/vi.json | 1 + src/assets/i18n/zh-hans.json | 1 + src/assets/i18n/zh-hant.json | 1 + 97 files changed, 108 insertions(+), 22 deletions(-) diff --git a/src/app/enums/app-state.enum.ts b/src/app/enums/app-state.enum.ts index 0194171de5e..83e15a7fb86 100644 --- a/src/app/enums/app-state.enum.ts +++ b/src/app/enums/app-state.enum.ts @@ -4,21 +4,16 @@ export enum AppState { Running = 'RUNNING', Deploying = 'DEPLOYING', Stopped = 'STOPPED', - - // TODO: Assumed that stopping status will be implemented https://ixsystems.atlassian.net/browse/NAS-130482 - Stopping = 'STOPPING', } export const appStateIcons = new Map([ [AppState.Running, 'mdi-check-circle'], [AppState.Deploying, 'mdi-progress-wrench'], - [AppState.Stopping, 'mdi-progress-wrench'], [AppState.Stopped, 'mdi-stop-circle'], ]); export const appStateLabels = new Map([ [AppState.Running, T('Running')], [AppState.Deploying, T('Deploying')], - [AppState.Stopping, T('Stopping')], [AppState.Stopped, T('Stopped')], ]); diff --git a/src/app/pages/apps/components/installed-apps/app-info-card/app-info-card.component.html b/src/app/pages/apps/components/installed-apps/app-info-card/app-info-card.component.html index 164972a7d39..b599480ed53 100644 --- a/src/app/pages/apps/components/installed-apps/app-info-card/app-info-card.component.html +++ b/src/app/pages/apps/components/installed-apps/app-info-card/app-info-card.component.html @@ -119,7 +119,7 @@

matTooltipPosition="above" [ixTest]="[app().name, 'stop']" [matTooltip]="'Stop' | translate" - [disabled]="isStartingOrStopping" + [disabled]="inProgress" (click)="stopApp.emit(); $event.stopPropagation()" > {{ 'Stop' | translate }} diff --git a/src/app/pages/apps/components/installed-apps/app-info-card/app-info-card.component.ts b/src/app/pages/apps/components/installed-apps/app-info-card/app-info-card.component.ts index 33aedcf2ad5..2dd4f32a815 100644 --- a/src/app/pages/apps/components/installed-apps/app-info-card/app-info-card.component.ts +++ b/src/app/pages/apps/components/installed-apps/app-info-card/app-info-card.component.ts @@ -52,17 +52,13 @@ export class AppInfoCardComponent { }, { allowSignalWrites: true }); get inProgress(): boolean { - return [AppState.Deploying].includes(this.app().state) || this.isStartingOrStopping; + return [AppState.Deploying].includes(this.app().state); } get isAppStopped(): boolean { return this.app().state === AppState.Stopped; } - get isStartingOrStopping(): boolean { - return [AppState.Deploying, AppState.Stopping].includes(this.app().state); - } - get appDetailsRouterUrl(): string[] { const app = this.app(); return ['/apps', 'available', app.metadata.train, app.id]; diff --git a/src/app/pages/apps/components/installed-apps/app-row/app-row.component.html b/src/app/pages/apps/components/installed-apps/app-row/app-row.component.html index d59b39690c4..750598253ec 100644 --- a/src/app/pages/apps/components/installed-apps/app-row/app-row.component.html +++ b/src/app/pages/apps/components/installed-apps/app-row/app-row.component.html @@ -78,7 +78,7 @@ matTooltipPosition="above" [ixTest]="[app().name, 'stop']" [matTooltip]="'Stop' | translate" - [disabled]="isStartingOrStopping()" + [disabled]="inProgress()" (click)="stop(); $event.stopPropagation()" > diff --git a/src/app/pages/apps/components/installed-apps/app-row/app-row.component.ts b/src/app/pages/apps/components/installed-apps/app-row/app-row.component.ts index a16d9c61354..8e4abe9b253 100644 --- a/src/app/pages/apps/components/installed-apps/app-row/app-row.component.ts +++ b/src/app/pages/apps/components/installed-apps/app-row/app-row.component.ts @@ -35,11 +35,7 @@ export class AppRowComponent { }); readonly inProgress = computed(() => { - return [AppState.Deploying].includes(this.app().state) || this.isStartingOrStopping(); - }); - - readonly isStartingOrStopping = computed(() => { - return [AppState.Deploying, AppState.Stopping].includes(this.app().state); + return [AppState.Deploying].includes(this.app().state); }); readonly incomingTraffic = computed(() => { diff --git a/src/app/pages/apps/components/installed-apps/app-workloads-card/app-workloads-card.component.html b/src/app/pages/apps/components/installed-apps/app-workloads-card/app-workloads-card.component.html index eef8ffea1bc..a8f1e3cc427 100644 --- a/src/app/pages/apps/components/installed-apps/app-workloads-card/app-workloads-card.component.html +++ b/src/app/pages/apps/components/installed-apps/app-workloads-card/app-workloads-card.component.html @@ -46,7 +46,7 @@

{{ container.state | mapValue: appContainerStateLabels | translate }}
- @if (app().state === CatalogAppState.Running || app().state === CatalogAppState.Deploying) { + @if (app().state === AppState.Running || app().state === AppState.Deploying) {
@if (container.state === AppContainerState.Running) {