diff options
author | Chocobozzz <me@florianbigard.com> | 2022-06-20 16:42:21 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-06-20 16:42:21 +0200 |
commit | 75084782b767f51f6158ada1984cf339c6302960 (patch) | |
tree | 178904ed08269de95683a063623d17cf87e56fad /client/src/app/shared/shared-forms/dynamic-form-field.component.ts | |
parent | 9bc3622320dc43474ce4b60c222ec25e6e657b97 (diff) | |
download | PeerTube-75084782b767f51f6158ada1984cf339c6302960.tar.gz PeerTube-75084782b767f51f6158ada1984cf339c6302960.tar.zst PeerTube-75084782b767f51f6158ada1984cf339c6302960.zip |
Handle input error in custom input text
Diffstat (limited to 'client/src/app/shared/shared-forms/dynamic-form-field.component.ts')
-rw-r--r-- | client/src/app/shared/shared-forms/dynamic-form-field.component.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/client/src/app/shared/shared-forms/dynamic-form-field.component.ts b/client/src/app/shared/shared-forms/dynamic-form-field.component.ts index b63890797..e1a1f8034 100644 --- a/client/src/app/shared/shared-forms/dynamic-form-field.component.ts +++ b/client/src/app/shared/shared-forms/dynamic-form-field.component.ts | |||
@@ -12,4 +12,15 @@ export class DynamicFormFieldComponent { | |||
12 | @Input() form: FormGroup | 12 | @Input() form: FormGroup |
13 | @Input() formErrors: any | 13 | @Input() formErrors: any |
14 | @Input() setting: RegisterClientFormFieldOptions | 14 | @Input() setting: RegisterClientFormFieldOptions |
15 | |||
16 | hasDedicatedFormError () { | ||
17 | const dedicated = new Set<RegisterClientFormFieldOptions['type']>([ | ||
18 | 'input-checkbox', | ||
19 | 'input', | ||
20 | 'select', | ||
21 | 'input-textarea' | ||
22 | ]) | ||
23 | |||
24 | return dedicated.has(this.setting.type) | ||
25 | } | ||
15 | } | 26 | } |