Browse Source
Merge pull request #15145 from mtsymbarov-del/fix/cf-and-alarm-rules-name-validation
Removed pattern validation from name field on CF and Alarm rules
pull/15171/head
Vladyslav Prykhodko
7 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
2 additions and
10 deletions
-
ui-ngx/src/app/core/services/calculated-field-form.service.ts
-
ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rule-dialog.component.html
-
ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rules.component.html
-
ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.html
-
ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.html
|
|
|
@ -38,7 +38,7 @@ export class CalculatedFieldFormService { |
|
|
|
|
|
|
|
buildForm(): FormGroup { |
|
|
|
return this.fb.group({ |
|
|
|
name: ['', [Validators.required, Validators.pattern(oneSpaceInsideRegex), Validators.maxLength(255)]], |
|
|
|
name: ['', [Validators.required, Validators.maxLength(255)]], |
|
|
|
entityId: [null, Validators.required], |
|
|
|
type: [CalculatedFieldType.SIMPLE], |
|
|
|
debugSettings: [], |
|
|
|
@ -48,7 +48,7 @@ export class CalculatedFieldFormService { |
|
|
|
|
|
|
|
buildAlarmRuleForm(): FormGroup { |
|
|
|
return this.fb.group({ |
|
|
|
name: ['', [Validators.required, Validators.pattern(oneSpaceInsideRegex), Validators.maxLength(255)]], |
|
|
|
name: ['', [Validators.required, Validators.maxLength(255)]], |
|
|
|
entityId: [null, Validators.required], |
|
|
|
type: [CalculatedFieldType.ALARM], |
|
|
|
debugSettings: [], |
|
|
|
|
|
|
|
@ -40,8 +40,6 @@ |
|
|
|
<mat-error> |
|
|
|
@if (fieldFormGroup.get('name').hasError('required')) { |
|
|
|
{{ 'alarm-rule.alarm-type-required' | translate }} |
|
|
|
} @else if (fieldFormGroup.get('name').hasError('pattern')) { |
|
|
|
{{ 'alarm-rule.alarm-type-pattern' | translate }} |
|
|
|
} @else if (fieldFormGroup.get('name').hasError('maxlength')) { |
|
|
|
{{ 'alarm-rule.alarm-type-max-length' | translate }} |
|
|
|
} |
|
|
|
|
|
|
|
@ -47,8 +47,6 @@ |
|
|
|
<mat-error> |
|
|
|
@if (entityForm.get('name').hasError('required')) { |
|
|
|
{{ 'common.hint.title-required' | translate }} |
|
|
|
} @else if (entityForm.get('name').hasError('pattern')) { |
|
|
|
{{ 'common.hint.title-pattern' | translate }} |
|
|
|
} @else if (entityForm.get('name').hasError('maxlength')) { |
|
|
|
{{ 'common.hint.title-max-length' | translate }} |
|
|
|
} |
|
|
|
|
|
|
|
@ -47,8 +47,6 @@ |
|
|
|
<mat-error> |
|
|
|
@if (entityForm.get('name').hasError('required')) { |
|
|
|
{{ 'common.hint.title-required' | translate }} |
|
|
|
} @else if (entityForm.get('name').hasError('pattern')) { |
|
|
|
{{ 'common.hint.title-pattern' | translate }} |
|
|
|
} @else if (entityForm.get('name').hasError('maxlength')) { |
|
|
|
{{ 'common.hint.title-max-length' | translate }} |
|
|
|
} |
|
|
|
|
|
|
|
@ -39,8 +39,6 @@ |
|
|
|
<mat-error> |
|
|
|
@if (fieldFormGroup.get('name').hasError('required')) { |
|
|
|
{{ 'common.hint.title-required' | translate }} |
|
|
|
} @else if (fieldFormGroup.get('name').hasError('pattern')) { |
|
|
|
{{ 'common.hint.title-pattern' | translate }} |
|
|
|
} @else if (fieldFormGroup.get('name').hasError('maxlength')) { |
|
|
|
{{ 'common.hint.title-max-length' | translate }} |
|
|
|
} |
|
|
|
|