From e2a53c497ae7e3a480e002ee9a40a51b715578dd Mon Sep 17 00:00:00 2001 From: "Deng, Qian" Date: Wed, 8 Aug 2018 16:06:17 +0800 Subject: [PATCH] Fix repo is undefined issue on chart summary ui Because HTML render before component initialize, so assign value on onInit --- .../chart-detail/chart-detail-summary.component.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts index a26a4e042..e2b7a9650 100644 --- a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts +++ b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts @@ -26,9 +26,9 @@ export class ChartDetailSummaryComponent implements OnInit { @Input() readme: string; copiedCMD = ''; - addCMD = `helm repo add --ca-file --cert-file --key-file --username --password ${this.repoURL}/chartrepo/${this.projectName}`; - installCMD = `helm install --ca-file --cert-file --key-file --username= --password= --version ${this.chartVersion} /${this.chartName}`; - verifyCMD = `helm verify --keyring ${this.chartName}-${this.chartVersion}.tgz`; + addCMD: string; + installCMD: string; + verifyCMD: string; constructor( private errorHandler: ErrorHandler, @@ -36,6 +36,9 @@ export class ChartDetailSummaryComponent implements OnInit { ) {} ngOnInit(): void { + this.addCMD = `helm repo add --ca-file --cert-file --key-file --username --password ${this.repoURL}/chartrepo/${this.projectName}`; + this.installCMD = `helm install --ca-file --cert-file --key-file --username= --password= --version ${this.chartVersion} /${this.chartName}`; + this.verifyCMD = `helm verify --keyring ${this.chartName}-${this.chartVersion}.tgz`; } isCopied(cmd: string) {