From 115827cac7eb5753160b63339f48108937ed673e Mon Sep 17 00:00:00 2001 From: Lichao Xue <68891670+xuelichao@users.noreply.github.com> Date: Mon, 3 Jun 2024 19:44:38 +0800 Subject: [PATCH] Fixes-20537 SBOM tab should not exist when the artifact is helm package (#20538) Fixes-20537 SBOM tab should not exist when the artifact is oci-compliant helm-chart Signed-off-by: xuelichao --- .../artifact-additions/artifact-additions.component.ts | 5 ++++- .../artifact/sbom-scanning/sbom-scan.component.spec.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.ts index a0f5007b8..9845fc7f9 100644 --- a/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.ts +++ b/src/portal/src/app/base/project/repository/artifact/artifact-additions/artifact-additions.component.ts @@ -59,7 +59,10 @@ export class ArtifactAdditionsComponent implements AfterViewChecked, OnInit { } hasScannerSupportSBOM(): boolean { - return this.artifactListPageService.hasScannerSupportSBOM(); + if (this.additionLinks && this.additionLinks[ADDITIONS.SBOMS]) { + return true; + } + return false; } getVulnerability(): AdditionLink { diff --git a/src/portal/src/app/base/project/repository/artifact/sbom-scanning/sbom-scan.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/sbom-scanning/sbom-scan.component.spec.ts index 34c17cf35..a8f41df22 100644 --- a/src/portal/src/app/base/project/repository/artifact/sbom-scanning/sbom-scan.component.spec.ts +++ b/src/portal/src/app/base/project/repository/artifact/sbom-scanning/sbom-scan.component.spec.ts @@ -179,8 +179,8 @@ describe('ResultSbomComponent (inline template)', () => { component.artifactDigest = mockedSbomDigest; component.sbomDigest = mockedSbomDigest; component.accessories = mockedAccessories; + fixture.detectChanges(); fixture.whenStable().then(() => { - fixture.detectChanges(); const el: HTMLElement = fixture.nativeElement.querySelector('.tip-block'); expect(el).not.toBeNull();