From d750ca7d1683b7d2f887371a3dbf1ff644abc312 Mon Sep 17 00:00:00 2001 From: Damien Vitrac Date: Tue, 28 Nov 2023 16:36:51 +0100 Subject: [PATCH] Update task schedule validator Resolves #1974 --- ui/src/app/tasks-jobs/tasks/task-prop.validator.spec.ts | 2 +- ui/src/app/tasks-jobs/tasks/task-prop.validator.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/src/app/tasks-jobs/tasks/task-prop.validator.spec.ts b/ui/src/app/tasks-jobs/tasks/task-prop.validator.spec.ts index c0e10fe19..fce2268e0 100644 --- a/ui/src/app/tasks-jobs/tasks/task-prop.validator.spec.ts +++ b/ui/src/app/tasks-jobs/tasks/task-prop.validator.spec.ts @@ -10,7 +10,7 @@ describe('tasks-jobs/tasks/task-prop.validator.ts', () => { }); }); it('valid', () => { - ['app.foo', 'deployer.foo', 'scheduler.foo'].forEach(mock => { + ['app.foo', 'deployer.foo', 'scheduler.foo', 'version..foo'].forEach(mock => { const control: UntypedFormControl = new UntypedFormControl(mock); expect(TaskPropValidator.key(control)).toBeNull(); }); diff --git a/ui/src/app/tasks-jobs/tasks/task-prop.validator.ts b/ui/src/app/tasks-jobs/tasks/task-prop.validator.ts index dfd7fab73..cfae91dde 100644 --- a/ui/src/app/tasks-jobs/tasks/task-prop.validator.ts +++ b/ui/src/app/tasks-jobs/tasks/task-prop.validator.ts @@ -3,7 +3,13 @@ import {UntypedFormControl} from '@angular/forms'; export class TaskPropValidator { static key(control: UntypedFormControl): any { const value = control.value; - if (value && !value.startsWith('app.') && !value.startsWith('deployer.') && !value.startsWith('scheduler.')) { + if ( + value && + !value.startsWith('app.') && + !value.startsWith('deployer.') && + !value.startsWith('scheduler.') && + !value.startsWith('version.') + ) { return {invalid: true}; } return null;