mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-01 08:09:59 +01:00
Merge pull request #10021 from AllForNothing/release-1.10.0
Disable scan now button if no default scanner(cherry-pick #10032)
This commit is contained in:
commit
2d21c3f2fa
@ -6,7 +6,7 @@
|
|||||||
<span>{{ updatedTimeStr }} </span>
|
<span>{{ updatedTimeStr }} </span>
|
||||||
</div>
|
</div>
|
||||||
<div class="button-group">
|
<div class="button-group">
|
||||||
<cron-selection [labelCurrent]="getLabelCurrent" [labelEdit]='getLabelCurrent'
|
<cron-selection [disabled]="!hasDefaultScanner" [labelCurrent]="getLabelCurrent" [labelEdit]='getLabelCurrent'
|
||||||
[originCron]='originCron' (inputvalue)="saveSchedule($event)"></cron-selection>
|
[originCron]='originCron' (inputvalue)="saveSchedule($event)"></cron-selection>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
@ -100,6 +100,7 @@ describe('VulnerabilityConfigComponent', () => {
|
|||||||
it('should stop looping manual metrics if manual scanning is finished', () => {
|
it('should stop looping manual metrics if manual scanning is finished', () => {
|
||||||
component.scanningMetrics.isScheduled = false;
|
component.scanningMetrics.isScheduled = false;
|
||||||
component.scanningMetrics.ongoing = false;
|
component.scanningMetrics.ongoing = false;
|
||||||
|
component.hasDefaultScanner = true;
|
||||||
expect(component.scanAvailable).toBeTruthy();
|
expect(component.scanAvailable).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -41,6 +41,7 @@ export class VulnerabilityConfigComponent implements OnInit, OnDestroy {
|
|||||||
private _loopManualInterval;
|
private _loopManualInterval;
|
||||||
updatedTimeStr: string;
|
updatedTimeStr: string;
|
||||||
onGettingUpdatedTimeStr: boolean;
|
onGettingUpdatedTimeStr: boolean;
|
||||||
|
hasDefaultScanner: boolean = false;
|
||||||
constructor(
|
constructor(
|
||||||
private scanningService: ScanAllRepoService,
|
private scanningService: ScanAllRepoService,
|
||||||
private errorHandler: ErrorHandler,
|
private errorHandler: ErrorHandler,
|
||||||
@ -119,6 +120,9 @@ export class VulnerabilityConfigComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (flag) {
|
||||||
|
this.hasDefaultScanner = true;
|
||||||
|
}
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
this.onGettingUpdatedTimeStr = false;
|
this.onGettingUpdatedTimeStr = false;
|
||||||
}
|
}
|
||||||
|
@ -116,14 +116,7 @@ export class TagRetentionComponent implements OnInit {
|
|||||||
level: "project",
|
level: "project",
|
||||||
ref: this.projectId
|
ref: this.projectId
|
||||||
};
|
};
|
||||||
let resolverData = this.route.snapshot.parent.data;
|
this.refreshAfterCreatRetention();
|
||||||
if (resolverData) {
|
|
||||||
let project = <Project>resolverData["projectResolver"];
|
|
||||||
if (project.metadata && project.metadata.retention_id) {
|
|
||||||
this.retentionId = project.metadata.retention_id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.getRetention();
|
|
||||||
this.getMetadata();
|
this.getMetadata();
|
||||||
}
|
}
|
||||||
openConfirm(cron: string) {
|
openConfirm(cron: string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user