Skip to content

Commit

Permalink
Fix - 20469 sbom status and download issue (goharbor#20475)
Browse files Browse the repository at this point in the history
Signed-off-by: xuelichao <[email protected]>
  • Loading branch information
xuelichao authored May 23, 2024
1 parent 88fad92 commit a763d6b
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 a763d6b

Please sign in to comment.