Skip to content

Commit

Permalink
Fix sbom status and download issue
Browse files Browse the repository at this point in the history
Signed-off-by: xuelichao <xuel@vmware.com>
  • Loading branch information
xuelichao committed May 22, 2024
1 parent 2f4fa29 commit 2b3d3e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2b3d3e0

Please sign in to comment.