mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 20:26:13 +01:00
Vulnerability scan cancel editing to make UI into orginal status
Signed-off-by: Cheng Fangyuan <fangyuanc@fangyuanc-a01.vmware.com>
This commit is contained in:
parent
5cf6c04ea6
commit
8b6e72e56e
@ -28,7 +28,7 @@
|
||||
<span>{{ (scanningType ? 'SCHEDULE.'+ scanningType.toUpperCase(): "") | translate }}</span>
|
||||
<span [hidden]="scanningType===SCHEDULE_TYPE.NONE">{{'SCHEDULE.AT' | translate}}</span>
|
||||
<span [hidden]="scanningType===SCHEDULE_TYPE.NONE">{{ dailyTime | translate }}</span>
|
||||
<button class="btn btn-outline btn-sm" (click)="editSchedule()">{{'BUTTON.EDIT' | translate}}</button>
|
||||
<button class="btn btn-outline btn-sm" (click)="editSchedule()" id="editSchedule">{{'BUTTON.EDIT' | translate}}</button>
|
||||
</div>
|
||||
<div class="form-group vertical-center" *ngIf="isEditMode">
|
||||
<label for="scanAllPolicy">{{ 'CONFIG.SCANNING.SCAN_ALL' | translate }}</label>
|
||||
|
@ -9,7 +9,7 @@ import {
|
||||
ConfigurationService
|
||||
} from '../../service/index';
|
||||
import { ErrorHandler } from '../../error-handler/index';
|
||||
import { toPromise, isEmptyObject } from '../../utils';
|
||||
import { toPromise, isEmptyObject, clone} from '../../utils';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { ClairDetail } from '../../service/interface';
|
||||
const ONE_HOUR_SECONDS: number = 3600;
|
||||
@ -252,7 +252,7 @@ export class VulnerabilityConfigComponent implements OnInit {
|
||||
getConfigurations(): void {
|
||||
toPromise<Configuration>(this.configService.getConfigurations())
|
||||
.then((config: Configuration) => {
|
||||
this.configCopy = Object.assign({}, config);
|
||||
this.configCopy = clone(config);
|
||||
this.config = config;
|
||||
})
|
||||
.catch(error => {
|
||||
@ -346,7 +346,7 @@ export class VulnerabilityConfigComponent implements OnInit {
|
||||
let getchanges = this.config.scan_all_policy.value;
|
||||
let changes = {"scan_all_policy": getchanges};
|
||||
for (let prop of Object.keys(changes)) {
|
||||
this.config[prop] = Object.assign({}, this.configCopy[prop]);
|
||||
this.config[prop] = clone(this.configCopy[prop]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ Resource ../../resources/Util.robot
|
||||
|
||||
*** Keywords ***
|
||||
Disable Scan Schedule
|
||||
Click Element //vulnerability-config//button[@id="editSchedule"]
|
||||
Click Element //vulnerability-config//select[@id="scanAllPolicy"]
|
||||
Click Element //vulnerability-config//select[@id="scanAllPolicy"]//option[contains(.,'None')]
|
||||
Click Element //button[contains(.,'SAVE')]
|
||||
|
Loading…
Reference in New Issue
Block a user