Skip to content

Commit

Permalink
Fix - 20469 sbom status and download issue (#20471)
Browse files Browse the repository at this point in the history
Fix sbom status and download issue

Signed-off-by: xuelichao <[email protected]>
xuelichao authored May 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 2f4fa29 commit 3352a72
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -198,7 +198,9 @@ export class ArtifactSbomComponent implements OnInit, OnDestroy {
this.downloadSbomBtnState = ClrLoadingState.LOADING;
if (
this.artifact?.sbom_overview?.scan_status ===
SBOM_SCAN_STATUS.SUCCESS
SBOM_SCAN_STATUS.SUCCESS ||
!!this.sbomDigest ||
(this.artifactSbom.sbomJsonRaw && this.artifactSbom.sbomName)
) {
downloadJson(
this.artifactSbom.sbomJsonRaw,
Original file line number Diff line number Diff line change
@@ -213,7 +213,7 @@ describe('ResultSbomComponent (inline template)', () => {
component.sbomOverview = mockedSbomOverview;
fixture.detectChanges();
expect(component.status).toBe(SBOM_SCAN_STATUS.ERROR);
expect(component.completed).toBeFalsy();
expect(component.completed).toBeTruthy();
expect(component.queued).toBeFalsy();
expect(component.generating).toBeFalsy();
expect(component.stopped).toBeFalsy();
Original file line number Diff line number Diff line change
@@ -129,7 +129,7 @@ export class ResultSbomComponent implements OnInit, OnDestroy {
}

public get completed(): boolean {
return this.status === SBOM_SCAN_STATUS.SUCCESS;
return this.status === SBOM_SCAN_STATUS.SUCCESS || !!this.sbomDigest;
}

public get error(): boolean {

0 comments on commit 3352a72

Please sign in to comment.