Merge pull request #7715 from pureshine/cannot-save

Fix unable to save after entering invalid cron and then switching back to other schedules
This commit is contained in:
Mia ZHOU 2019-05-08 13:57:00 +08:00 committed by GitHub
commit 3604765d8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 = "";