Fix unable to save after entering invalid cron and then switching back to other schedules

Signed-off-by: FangyuanCheng <fangyuanc@vmware.com>
This commit is contained in:
FangyuanCheng 2019-05-08 10:48:48 +08:00
parent 2b5c511c76
commit a34f99cae4

View File

@ -73,12 +73,15 @@ export class CronScheduleComponent implements OnChanges {
}
save(): void {
if (this.scheduleType === SCHEDULE_TYPE.CUSTOM && this.cronString === '') {
this.dateInvalid = true;
}
if (this.dateInvalid) {
return;
if (this.scheduleType === SCHEDULE_TYPE.CUSTOM ) {
if (this.cronString === '') {
this.dateInvalid = true;
}
if (this.dateInvalid) {
return;
}
}
let scheduleTerm: string = "";
if (this.scheduleType && this.scheduleType === SCHEDULE_TYPE.NONE) {
scheduleTerm = "";