Fix - 20469 sbom status and download issue (#20471)

Fix sbom status and download issue

Signed-off-by: xuelichao <xuel@vmware.com>
This commit is contained in:
Lichao Xue 2024-05-23 13:23:45 +08:00 committed by GitHub
parent 2f4fa29537
commit 3352a72b7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View File

@ -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,

View File

@ -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();

View File

@ -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 {