From a9792c9c9a3803626ce72ce77bc2d5509c52febc Mon Sep 17 00:00:00 2001 From: "Deng, Qian" Date: Wed, 1 Aug 2018 17:10:21 +0800 Subject: [PATCH] Back to charts page when delete whole versions Jump to charts page after you delete all the versions in a chart. Because if you not do it, page will return 404. --- .../helm-chart/versions/helm-chart-version.component.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ui_ng/lib/src/helm-chart/versions/helm-chart-version.component.ts b/src/ui_ng/lib/src/helm-chart/versions/helm-chart-version.component.ts index 733a18e31..1d2864c02 100644 --- a/src/ui_ng/lib/src/helm-chart/versions/helm-chart-version.component.ts +++ b/src/ui_ng/lib/src/helm-chart/versions/helm-chart-version.component.ts @@ -119,9 +119,6 @@ export class ChartVersionComponent implements OnInit { this.versionsCopy = versions.map(x => Object.assign({}, x)); }, err => { - if (err.status && err.status === 404) { - this.backEvt.emit(); - } this.errorHandler.error(err); } ); @@ -163,7 +160,11 @@ export class ChartVersionComponent implements OnInit { deleteVersions(versions: HelmChartVersion[]) { if (versions && versions.length < 1) { return; } let versionObs = versions.map(v => this.deleteVersion(v)); - Observable.forkJoin(versionObs).finally(() => this.refresh()).subscribe(); + Observable.forkJoin(versionObs).finally(() => this.refresh()).subscribe(res => { + if (this.chartVersions.length === versionObs.length) { + this.backEvt.emit(); + } + }); } versionDownload(item?: HelmChartVersion) {