From 2e99719d076112096f803ec27e255af5b0f2a5d7 Mon Sep 17 00:00:00 2001 From: "Deng, Qian" Date: Tue, 7 Aug 2018 12:10:47 +0800 Subject: [PATCH 1/3] Fix wording of group list Fix i18n key in group list --- .../src/app/project/member/add-group/add-group.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui_ng/src/app/project/member/add-group/add-group.component.html b/src/ui_ng/src/app/project/member/add-group/add-group.component.html index 3c1c0cfaf..d723dd837 100644 --- a/src/ui_ng/src/app/project/member/add-group/add-group.component.html +++ b/src/ui_ng/src/app/project/member/add-group/add-group.component.html @@ -76,7 +76,7 @@ - {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'USER.OF' | translate }} {{pagination.totalItems}} {{'MEMBER.GROUPS' | translate}} + {{pagination.totalItems}} {{'MEMBER.ITEMS' | translate}} From 173100be6dae0531012dc6a26deb39c419ad2c2b Mon Sep 17 00:00:00 2001 From: "Deng, Qian" Date: Tue, 7 Aug 2018 15:28:46 +0800 Subject: [PATCH 2/3] Refactor Chart Summary Commands UI 1. Add Clipboard after command 2. Change the layout of command table --- .../chart-detail-summary.component.html | 66 ++++++++++++++----- .../chart-detail-summary.component.scss | 9 +++ .../chart-detail-summary.component.ts | 23 ++++++- .../src/helm-chart/helm-chart.component.ts | 1 - src/ui_ng/src/i18n/lang/en-us-lang.json | 4 +- src/ui_ng/src/i18n/lang/es-es-lang.json | 4 +- src/ui_ng/src/i18n/lang/fr-fr-lang.json | 4 +- src/ui_ng/src/i18n/lang/zh-cn-lang.json | 4 +- 8 files changed, 92 insertions(+), 23 deletions(-) diff --git a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html index 463729673..a1683d2e8 100644 --- a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html +++ b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html @@ -24,7 +24,7 @@ {{'HELM_CHART.SRC_REPO' | translate }} - + {{src}} @@ -48,28 +48,62 @@
- +
- + + + - -
{{addCMD}}{{'HELM_CHART.ADD_REPO' | translate }} + + + + + +
-
-
-
- -
- - - + + + + + + + +
{{installCMD}}{{'HELM_CHART.INSTALL_CHART' | translate }} + + + + + +
{{'HELM_CHART.VERIFY_CHART' | translate }} + + + + + +
+
@@ -78,14 +112,14 @@ {{'HELM_CHART.SIGNED' | translate }} -
- +
+  {{'HELM_CHART.SIGNED' | translate }} - + diff --git a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.scss b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.scss index 042c13fdd..db3e2976a 100644 --- a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.scss +++ b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.scss @@ -25,4 +25,13 @@ word-break: break-all; } } + + .cmd-title { + white-space: nowrap; + vertical-align: middle; + } + + .cmd-content { + width: 100%; + } } \ No newline at end of file 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 5b2c4fd24..6c7052972 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 @@ -22,17 +22,36 @@ export class ChartDetailSummaryComponent implements OnInit { @Input() chartVersion: string; @Input() readme: string; + copiedCMD = ''; + constructor() {} ngOnInit(): void { } + isCopied(cmd: string) { + return this.copiedCMD === cmd; + } + + onCopySuccess(e: Event, cmd: string) { + this.copiedCMD = cmd; + } + + public get addCMD() { - return `helm repo add REPO_NAME ${this.repoURL}/chartrepo/${this.projectName}`; + return `helm repo add --ca-file --cert-file --key-file --username --password ${this.repoURL}/chartrepo/${this.projectName}`; } public get installCMD() { - return `helm install --version ${this.chartVersion} REPO_NAME/${this.chartName}`; + return `helm install --ca-file --cert-file --key-file --username= --password= --version ${this.chartVersion} /${this.chartName}`; + } + + public get verifyCMD() { + return `helm verify --keyring ${this.chartName}-${this.chartVersion}.tgz`; +} + + public get prov_ready() { + return this.security && this.security.signature && this.security.signature.signed; } } diff --git a/src/ui_ng/lib/src/helm-chart/helm-chart.component.ts b/src/ui_ng/lib/src/helm-chart/helm-chart.component.ts index 0f943559b..83be7e148 100644 --- a/src/ui_ng/lib/src/helm-chart/helm-chart.component.ts +++ b/src/ui_ng/lib/src/helm-chart/helm-chart.component.ts @@ -75,7 +75,6 @@ export class HelmChartComponent implements OnInit { .catch(error => this.errorHandler.error(error)); this.lastFilteredChartName = ""; this.refresh(); - } updateFilterValue(value: string) { diff --git a/src/ui_ng/src/i18n/lang/en-us-lang.json b/src/ui_ng/src/i18n/lang/en-us-lang.json index dd241ea95..638191321 100644 --- a/src/ui_ng/src/i18n/lang/en-us-lang.json +++ b/src/ui_ng/src/i18n/lang/en-us-lang.json @@ -516,7 +516,9 @@ "NO_README": "No readme file provided by this chart.", "SECURITY": "Security", "ACTIVE": "Active", - "DEPRECATED": "Deprecated" + "DEPRECATED": "Deprecated", + "VERIFY_CHART": "Verify Chart", + "COMMAND": "Commands" }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "Some changes are not saved yet. Do you want to cancel?" diff --git a/src/ui_ng/src/i18n/lang/es-es-lang.json b/src/ui_ng/src/i18n/lang/es-es-lang.json index db95f0413..b8a52c5fa 100644 --- a/src/ui_ng/src/i18n/lang/es-es-lang.json +++ b/src/ui_ng/src/i18n/lang/es-es-lang.json @@ -515,7 +515,9 @@ "NO_README": "No readme file provided by this chart.", "SECURITY": "Security", "ACTIVE": "Active", - "DEPRECATED": "Deprecated" + "DEPRECATED": "Deprecated", + "VERIFY_CHART": "Verify Chart", + "COMMAND": "Commands" }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "Algunos cambios no se han guardado aún. ¿Quiere cancelar?" diff --git a/src/ui_ng/src/i18n/lang/fr-fr-lang.json b/src/ui_ng/src/i18n/lang/fr-fr-lang.json index 16d0faaf4..101f30af1 100644 --- a/src/ui_ng/src/i18n/lang/fr-fr-lang.json +++ b/src/ui_ng/src/i18n/lang/fr-fr-lang.json @@ -490,7 +490,9 @@ "ITEMS": "items", "SECURITY": "Security", "ACTIVE": "Active", - "DEPRECATED": "Deprecated" + "DEPRECATED": "Deprecated", + "VERIFY_CHART": "Verify Chart", + "COMMAND": "Commands" }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "Certaines modifications ne sont pas encore enregistrées. Voulez-vous annuler ?" diff --git a/src/ui_ng/src/i18n/lang/zh-cn-lang.json b/src/ui_ng/src/i18n/lang/zh-cn-lang.json index 93092c1c6..be46fd8aa 100644 --- a/src/ui_ng/src/i18n/lang/zh-cn-lang.json +++ b/src/ui_ng/src/i18n/lang/zh-cn-lang.json @@ -515,7 +515,9 @@ "NO_README": "此Chart未提供README文件", "SECURITY": "安全", "ACTIVE": "正常", - "DEPRECATED": "废弃" + "DEPRECATED": "废弃", + "VERIFY_CHART": "验证Chart", + "COMMAND": "命令" }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "表单内容改变,确认是否取消?" From cff8fc52ba9a63c01f122c34c0620f8c9fce8d1d Mon Sep 17 00:00:00 2001 From: "Deng, Qian" Date: Tue, 7 Aug 2018 17:10:25 +0800 Subject: [PATCH 3/3] Change UI about security table 1. Change wording from 'sign' to 'ready' 2. Provide download for prov file --- .../chart-detail-summary.component.html | 6 +-- .../chart-detail-summary.component.ts | 42 ++++++++++++------- src/ui_ng/src/i18n/lang/en-us-lang.json | 5 ++- src/ui_ng/src/i18n/lang/es-es-lang.json | 5 ++- src/ui_ng/src/i18n/lang/fr-fr-lang.json | 5 ++- src/ui_ng/src/i18n/lang/zh-cn-lang.json | 5 ++- 6 files changed, 47 insertions(+), 21 deletions(-) diff --git a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html index a1683d2e8..bdcdfd4a0 100644 --- a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html +++ b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html @@ -111,19 +111,19 @@ - +
+  {{'HELM_CHART.READY' | translate }} +  {{'HELM_CHART.NOT_READY' | translate }} 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 6c7052972..a26a4e042 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 @@ -6,6 +6,9 @@ import { } from "@angular/core"; import { HelmChartMetaData, HelmChartSecurity } from "./../../service/interface"; +import { downloadFile } from './../../utils'; +import { HelmChartService } from "../../service/index"; +import { ErrorHandler } from "./../../error-handler/error-handler"; @Component({ selector: "hbr-chart-detail-summary", @@ -23,8 +26,14 @@ 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`; - constructor() {} + constructor( + private errorHandler: ErrorHandler, + private helmChartService: HelmChartService + ) {} ngOnInit(): void { } @@ -37,21 +46,26 @@ export class ChartDetailSummaryComponent implements OnInit { this.copiedCMD = cmd; } - - public get addCMD() { - return `helm repo add --ca-file --cert-file --key-file --username --password ${this.repoURL}/chartrepo/${this.projectName}`; - } - - public get installCMD() { - return `helm install --ca-file --cert-file --key-file --username= --password= --version ${this.chartVersion} /${this.chartName}`; - } - - public get verifyCMD() { - return `helm verify --keyring ${this.chartName}-${this.chartVersion}.tgz`; -} - public get prov_ready() { return this.security && this.security.signature && this.security.signature.signed; } + downloadChart() { + if (!this.summary || + !this.summary.urls || + this.summary.urls.length < 1) { + return; + } + let filename = `${this.summary.urls[0]}.prov`; + + this.helmChartService.downloadChart(this.projectName, filename).subscribe( + res => { + downloadFile(res); + }, + error => { + this.errorHandler.error(error); + }, + ); + } + } diff --git a/src/ui_ng/src/i18n/lang/en-us-lang.json b/src/ui_ng/src/i18n/lang/en-us-lang.json index 638191321..844d7f2bb 100644 --- a/src/ui_ng/src/i18n/lang/en-us-lang.json +++ b/src/ui_ng/src/i18n/lang/en-us-lang.json @@ -518,7 +518,10 @@ "ACTIVE": "Active", "DEPRECATED": "Deprecated", "VERIFY_CHART": "Verify Chart", - "COMMAND": "Commands" + "COMMAND": "Commands", + "PROV_FILE": "Prov File", + "READY": "Ready", + "NOT_READY": "Not Ready" }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "Some changes are not saved yet. Do you want to cancel?" diff --git a/src/ui_ng/src/i18n/lang/es-es-lang.json b/src/ui_ng/src/i18n/lang/es-es-lang.json index b8a52c5fa..0f4ba2a9e 100644 --- a/src/ui_ng/src/i18n/lang/es-es-lang.json +++ b/src/ui_ng/src/i18n/lang/es-es-lang.json @@ -517,7 +517,10 @@ "ACTIVE": "Active", "DEPRECATED": "Deprecated", "VERIFY_CHART": "Verify Chart", - "COMMAND": "Commands" + "COMMAND": "Commands", + "PROV_FILE": "Prov File", + "READY": "Ready", + "NOT_READY": "Not Ready" }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "Algunos cambios no se han guardado aún. ¿Quiere cancelar?" diff --git a/src/ui_ng/src/i18n/lang/fr-fr-lang.json b/src/ui_ng/src/i18n/lang/fr-fr-lang.json index 101f30af1..8683bd2cc 100644 --- a/src/ui_ng/src/i18n/lang/fr-fr-lang.json +++ b/src/ui_ng/src/i18n/lang/fr-fr-lang.json @@ -492,7 +492,10 @@ "ACTIVE": "Active", "DEPRECATED": "Deprecated", "VERIFY_CHART": "Verify Chart", - "COMMAND": "Commands" + "COMMAND": "Commands", + "PROV_FILE": "Prov File", + "READY": "Ready", + "NOT_READY": "Not Ready" }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "Certaines modifications ne sont pas encore enregistrées. Voulez-vous annuler ?" diff --git a/src/ui_ng/src/i18n/lang/zh-cn-lang.json b/src/ui_ng/src/i18n/lang/zh-cn-lang.json index be46fd8aa..efa056850 100644 --- a/src/ui_ng/src/i18n/lang/zh-cn-lang.json +++ b/src/ui_ng/src/i18n/lang/zh-cn-lang.json @@ -517,7 +517,10 @@ "ACTIVE": "正常", "DEPRECATED": "废弃", "VERIFY_CHART": "验证Chart", - "COMMAND": "命令" + "COMMAND": "命令", + "PROV_FILE": "Prov 文件", + "READY": "就绪", + "NOT_READY": "未就绪" }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "表单内容改变,确认是否取消?"
{{'HELM_CHART.SIGNED' | translate }}{{'HELM_CHART.PROV_FILE' | translate }} -  {{'HELM_CHART.SIGNED' | translate }} -  {{'HELM_CHART.UNSIGNED' | translate }}