From: Chocobozzz Date: Sun, 27 Nov 2016 17:10:26 +0000 (+0100) Subject: Client: try to improve ux for the upload form X-Git-Tag: v0.0.1-alpha~589 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bf57d5eebf8b0fa2361b7973ce9772abd1bb4828;p=oweals%2Fpeertube.git Client: try to improve ux for the upload form --- 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 { } } } + + // Same as onValueChanged but force checking even if the field is not dirty + protected forceCheck() { + for (const field in this.formErrors) { + // clear previous error message (if any) + this.formErrors[field] = ''; + const control = this.form.get(field); + + if (control && !control.valid) { + const messages = this.validationMessages[field]; + for (const key in control.errors) { + this.formErrors[field] += messages[key] + ' '; + } + } + } + } } diff --git a/client/src/app/videos/video-add/video-add.component.html b/client/src/app/videos/video-add/video-add.component.html index 14c7a0136..b6be0d782 100644 --- a/client/src/app/videos/video-add/video-add.component.html +++ b/client/src/app/videos/video-add/video-add.component.html @@ -15,7 +15,7 @@
- + (press enter to add the tag)
+
+ {{ tagsError }} +
+
@@ -39,6 +43,7 @@
@@ -50,6 +55,10 @@ +
+ {{ fileError }} +
+