aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/forms
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-27 18:10:26 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-27 18:10:26 +0100
commitbf57d5eebf8b0fa2361b7973ce9772abd1bb4828 (patch)
tree6f8ba86f2bedf8bb630c5f0cef4fbce88c2abf76 /client/src/app/shared/forms
parent447fde277497dfff73310dc12bf79fb576139b94 (diff)
downloadPeerTube-bf57d5eebf8b0fa2361b7973ce9772abd1bb4828.tar.gz
PeerTube-bf57d5eebf8b0fa2361b7973ce9772abd1bb4828.tar.zst
PeerTube-bf57d5eebf8b0fa2361b7973ce9772abd1bb4828.zip
Client: try to improve ux for the upload form
Diffstat (limited to 'client/src/app/shared/forms')
-rw-r--r--client/src/app/shared/forms/form-reactive.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/client/src/app/shared/forms/form-reactive.ts b/client/src/app/shared/forms/form-reactive.ts
index 1e8a69771..a5732e083 100644
--- a/client/src/app/shared/forms/form-reactive.ts
+++ b/client/src/app/shared/forms/form-reactive.ts
@@ -21,4 +21,20 @@ export abstract class FormReactive {
21 } 21 }
22 } 22 }
23 } 23 }
24
25 // Same as onValueChanged but force checking even if the field is not dirty
26 protected forceCheck() {
27 for (const field in this.formErrors) {
28 // clear previous error message (if any)
29 this.formErrors[field] = '';
30 const control = this.form.get(field);
31
32 if (control && !control.valid) {
33 const messages = this.validationMessages[field];
34 for (const key in control.errors) {
35 this.formErrors[field] += messages[key] + ' ';
36 }
37 }
38 }
39 }
24} 40}