fix: disable the scan related button when installation without scanner or scanner deactived (#20652)

Signed-off-by: chlins <chlins.zhang@gmail.com>
This commit is contained in:
Chlins Zhang 2024-06-25 14:24:38 +08:00 committed by GitHub
parent 04b0cc0b08
commit 35d1032ff7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View File

@ -127,6 +127,12 @@ export class ArtifactListPageService {
ClrLoadingState.ERROR
);
}
} else {
this.updateStates(
false,
ClrLoadingState.ERROR,
ClrLoadingState.ERROR
);
}
},
error => {

View File

@ -15,7 +15,6 @@
<clr-dg-action-bar class="action-bar">
<div>
<button
*ngIf="hasEnabledScanner"
id="scan-btn"
[clrLoading]="scanBtnState"
type="button"
@ -35,7 +34,6 @@
<span>{{ 'VULNERABILITY.SCAN_NOW' | translate }}</span>
</button>
<button
*ngIf="hasEnabledSbom()"
id="generate-sbom-btn"
[clrLoading]="generateSbomBtnState"
type="button"
@ -69,7 +67,6 @@
<button
clrDropdownItem
id="stop-scan"
*ngIf="hasEnabledScanner"
[clrLoading]="stopBtnState"
type="button"
class="btn btn-secondary scan-btn action-dropdown-item"
@ -84,7 +81,6 @@
<button
clrDropdownItem
id="stop-sbom-btn"
*ngIf="hasEnabledSbom()"
[clrLoading]="stopBtnState"
type="button"
class="btn btn-secondary scan-btn action-dropdown-item"
@ -99,7 +95,6 @@
<span>{{ 'SBOM.STOP' | translate }}</span>
</button>
<div
*ngIf="hasEnabledScanner || hasEnabledSbom()"
class="dropdown-divider"
role="separator"
aria-hidden="true"></div>