mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 10:15:35 +01:00
Fix null pointer issue for creating reolication rule (#17274)
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
0fe5eed55d
commit
455ebf51fc
@ -26,7 +26,6 @@
|
||||
<clr-dropdown-menu *clrIfOpen>
|
||||
<button
|
||||
[disabled]="!hasPermission || !canClickExport"
|
||||
[clrLoading]="checkingPermission"
|
||||
clrDropdownItem
|
||||
(click)="exportCVE()">
|
||||
<clr-icon shape="export" size="16"></clr-icon>
|
||||
|
@ -91,7 +91,6 @@ export class ListProjectComponent implements OnDestroy {
|
||||
@ViewChild(ExportCveComponent)
|
||||
exportCveComponent: ExportCveComponent;
|
||||
hasPermission: boolean = false;
|
||||
checkingPermission: boolean = false;
|
||||
canClickExport: boolean = true;
|
||||
constructor(
|
||||
private session: SessionService,
|
||||
@ -409,14 +408,11 @@ export class ListProjectComponent implements OnDestroy {
|
||||
)
|
||||
);
|
||||
});
|
||||
this.checkingPermission = true;
|
||||
forkJoin(obs)
|
||||
.pipe(finalize(() => (this.checkingPermission = false)))
|
||||
.subscribe(res => {
|
||||
if (res?.length) {
|
||||
this.hasPermission = res.every(item => item);
|
||||
}
|
||||
});
|
||||
forkJoin(obs).subscribe(res => {
|
||||
if (res?.length) {
|
||||
this.hasPermission = res.every(item => item);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
triggerExportSuccess() {
|
||||
|
@ -294,7 +294,7 @@
|
||||
let-m="index">
|
||||
<hbr-label-piece
|
||||
class="label-piece"
|
||||
*ngIf="m < 1"
|
||||
*ngIf="m < 1 && label"
|
||||
[hasIcon]="false"
|
||||
[label]="
|
||||
getLabel(label)
|
||||
|
@ -639,10 +639,10 @@ export class CreateEditRuleComponent implements OnInit, OnDestroy {
|
||||
|
||||
setFilterAndTrigger(adapter) {
|
||||
this.supportedFilters = adapter.supported_resource_filters;
|
||||
this.filters.clear(); // clear before init
|
||||
this.supportedFilters.forEach(element => {
|
||||
this.filters.push(this.initFilter(element.type));
|
||||
});
|
||||
|
||||
this.supportedTriggers = adapter.supported_triggers;
|
||||
this.ruleForm
|
||||
.get('trigger')
|
||||
|
Loading…
Reference in New Issue
Block a user