From 5b440082dc0e0dfdff68dbfd05f5babbdbb8f104 Mon Sep 17 00:00:00 2001 From: AllForNothing Date: Thu, 5 Mar 2020 15:33:28 +0800 Subject: [PATCH] Add new status "scan unsupported" for artifact list Signed-off-by: AllForNothing --- .../artifact-list-tab.component.html | 7 +++++-- .../artifact-list-tab/artifact-list-tab.component.ts | 12 ++++++++++-- .../artifact-list/artifact-list.component.html | 2 +- src/portal/src/i18n/lang/en-us-lang.json | 3 ++- src/portal/src/i18n/lang/es-es-lang.json | 3 ++- src/portal/src/i18n/lang/fr-fr-lang.json | 3 ++- src/portal/src/i18n/lang/pt-br-lang.json | 3 ++- src/portal/src/i18n/lang/tr-tr-lang.json | 3 ++- src/portal/src/i18n/lang/zh-cn-lang.json | 3 ++- 9 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html b/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html index 7b74209c3..68613ba9c 100644 --- a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html +++ b/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html @@ -91,7 +91,7 @@ [(clrDgSelected)]="selectedRow"> @@ -238,7 +238,10 @@
- + {{'ARTIFACT.SCAN_UNSUPPORTED' | translate}} + + diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts b/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts index c73c3a137..9b90fc58e 100644 --- a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts +++ b/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts @@ -370,7 +370,12 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy { let childParams: NewArtifactService.GetArtifactParams = { repositoryName: this.repoName, projectName: this.projectName, - reference: child.child_digest + reference: child.child_digest, + withImmutableStatus: true, + withLabel: true, + withScanOverview: true, + withSignature: true, + withTag: true }; observableLists.push(this.newArtifactService.getArtifact(childParams)); } @@ -864,12 +869,15 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy { this.channel.publishScanEvent(this.repoName + "/" + this.selectedRow[0].digest); } } - hasVul(): boolean { + selectedRowHasVul(): boolean { return !!(this.selectedRow && this.selectedRow[0] && this.selectedRow[0].addition_links && this.selectedRow[0].addition_links[ADDITIONS.VULNERABILITIES]); } + hasVul(artifact: Artifact): boolean { + return !!(artifact && artifact.addition_links && artifact.addition_links[ADDITIONS.VULNERABILITIES]); + } submitFinish(e: boolean) { this.onSendingScanCommand = e; } diff --git a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.html b/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.html index 8c0ce3a46..dcc33942b 100644 --- a/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.html +++ b/src/portal/src/app/project/repository/artifact-list-page/artifact-list/artifact-list.component.html @@ -5,7 +5,7 @@

{{showCurrentTitle}}

-

{{artifactDigest | slice:1:15}}

+

{{artifactDigest | slice:0:15}}

diff --git a/src/portal/src/i18n/lang/en-us-lang.json b/src/portal/src/i18n/lang/en-us-lang.json index aa592cf9f..065d3bc65 100644 --- a/src/portal/src/i18n/lang/en-us-lang.json +++ b/src/portal/src/i18n/lang/en-us-lang.json @@ -1004,7 +1004,8 @@ "TAGGED": "Tagged", "UNTAGGED": "Untagged", "ALL": "All", - "PLACEHOLDER": "We couldn't find any artifactds!" + "PLACEHOLDER": "We couldn't find any artifactds!", + "SCAN_UNSUPPORTED": "Scan Unsupported" }, "TAG": { "CREATION_TIME_PREFIX": "Create on", diff --git a/src/portal/src/i18n/lang/es-es-lang.json b/src/portal/src/i18n/lang/es-es-lang.json index 6aad75fa7..47a1a3d53 100644 --- a/src/portal/src/i18n/lang/es-es-lang.json +++ b/src/portal/src/i18n/lang/es-es-lang.json @@ -1003,7 +1003,8 @@ "TAGGED": "Tagged", "UNTAGGED": "Untagged", "ALL": "All", - "PLACEHOLDER": "We couldn't find any artifacts!" + "PLACEHOLDER": "We couldn't find any artifacts!", + "SCAN_UNSUPPORTED": "Scan Unsupported" }, "TAG": { "CREATION_TIME_PREFIX": "Create on", diff --git a/src/portal/src/i18n/lang/fr-fr-lang.json b/src/portal/src/i18n/lang/fr-fr-lang.json index 01f310b31..8e33f5312 100644 --- a/src/portal/src/i18n/lang/fr-fr-lang.json +++ b/src/portal/src/i18n/lang/fr-fr-lang.json @@ -976,7 +976,8 @@ "TAGGED": "Tagged", "UNTAGGED": "Untagged", "ALL": "All", - "PLACEHOLDER": "We couldn't find any artifacts!" + "PLACEHOLDER": "We couldn't find any artifacts!", + "SCAN_UNSUPPORTED": "Scan Unsupported" }, "TAG": { "CREATION_TIME_PREFIX": "Créer le", diff --git a/src/portal/src/i18n/lang/pt-br-lang.json b/src/portal/src/i18n/lang/pt-br-lang.json index 53f85909b..aebbd34dc 100644 --- a/src/portal/src/i18n/lang/pt-br-lang.json +++ b/src/portal/src/i18n/lang/pt-br-lang.json @@ -999,7 +999,8 @@ "TAGGED": "Tagged", "UNTAGGED": "Untagged", "ALL": "All", - "PLACEHOLDER": "We couldn't find any artifacts!" + "PLACEHOLDER": "We couldn't find any artifacts!", + "SCAN_UNSUPPORTED": "Scan Unsupported" }, "TAG": { "CREATION_TIME_PREFIX": "Criado em", diff --git a/src/portal/src/i18n/lang/tr-tr-lang.json b/src/portal/src/i18n/lang/tr-tr-lang.json index b35bb47bd..750f366c5 100644 --- a/src/portal/src/i18n/lang/tr-tr-lang.json +++ b/src/portal/src/i18n/lang/tr-tr-lang.json @@ -1003,7 +1003,8 @@ "TAGGED": "Tagged", "UNTAGGED": "Untagged", "ALL": "All", - "PLACEHOLDER": "We couldn't find any artifacts!" + "PLACEHOLDER": "We couldn't find any artifacts!", + "SCAN_UNSUPPORTED": "Scan Unsupported" }, "TAG": { "CREATION_TIME_PREFIX": "Oluştur", diff --git a/src/portal/src/i18n/lang/zh-cn-lang.json b/src/portal/src/i18n/lang/zh-cn-lang.json index 32cf3b969..f35b0692d 100644 --- a/src/portal/src/i18n/lang/zh-cn-lang.json +++ b/src/portal/src/i18n/lang/zh-cn-lang.json @@ -1003,7 +1003,8 @@ "TAGGED": "含有 Tag", "UNTAGGED": "不含有 Tag", "ALL": "所有", - "PLACEHOLDER": "未发现任何 artifacts!" + "PLACEHOLDER": "未发现任何 artifacts!", + "SCAN_UNSUPPORTED": "不支持扫描" }, "TAG": { "CREATION_TIME_PREFIX": "创建时间:",