fix(edgejobs): validate date when saving job in basic configuration (#7048)

pull/7189/head
matias-portainer 2 years ago committed by GitHub
parent 4fb1880ddc
commit 005c48b1ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -59,7 +59,10 @@ export class EdgeJobFormController {
} }
if (this.formValues.cronMethod === 'basic') { if (this.formValues.cronMethod === 'basic') {
if (!this.model.Recurring) { if (!this.model.Recurring && (this.formValues.datetime === undefined || !this.formValues.datetime.isValid())) {
this.state.formValidationError = 'Schedule date must not be empty';
return;
} else if (!this.model.Recurring) {
this.model.CronExpression = datetimeToCron(this.formValues.datetime); this.model.CronExpression = datetimeToCron(this.formValues.datetime);
} else { } else {
this.model.CronExpression = this.formValues.scheduleValue.cron; this.model.CronExpression = this.formValues.scheduleValue.cron;

Loading…
Cancel
Save