From d8c9996ce2b4de3ef1f2d36f63e461006bab58ed Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Nov 2018 17:02:21 +0100 Subject: [PATCH] Improve message visibility on signup --- client/src/app/signup/signup.component.html | 3 ++- client/src/app/signup/signup.component.ts | 20 ++++++++++--------- .../video-caption-add-modal.component.ts | 1 + 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/client/src/app/signup/signup.component.html b/client/src/app/signup/signup.component.html index 531a97814..0207a166e 100644 --- a/client/src/app/signup/signup.component.html +++ b/client/src/app/signup/signup.component.html @@ -4,6 +4,7 @@ Create an account +
{{ info }}
{{ error }}
@@ -59,7 +60,7 @@
- +
diff --git a/client/src/app/signup/signup.component.ts b/client/src/app/signup/signup.component.ts index cf2657b85..607d64893 100644 --- a/client/src/app/signup/signup.component.ts +++ b/client/src/app/signup/signup.component.ts @@ -12,7 +12,9 @@ import { FormValidatorService } from '@app/shared/forms/form-validators/form-val styleUrls: [ './signup.component.scss' ] }) export class SignupComponent extends FormReactive implements OnInit { + info: string = null error: string = null + signupDone = false constructor ( protected formValidatorService: FormValidatorService, @@ -50,17 +52,17 @@ export class SignupComponent extends FormReactive implements OnInit { this.userService.signup(userCreate).subscribe( () => { + this.signupDone = true + if (this.requiresEmailVerification) { - this.notificationsService.alert( - this.i18n('Welcome'), - this.i18n('Please check your email to verify your account and complete signup.') - ) - } else { - this.notificationsService.success( - this.i18n('Success'), - this.i18n('Registration for {{username}} complete.', { username: userCreate.username }) - ) + this.info = this.i18n('Welcome! Now please check your emails to verify your account and complete signup.') + return } + + this.notificationsService.success( + this.i18n('Success'), + this.i18n('Registration for {{username}} complete.', { username: userCreate.username }) + ) this.redirectService.redirectToHomepage() }, diff --git a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts index 796fbe531..eaf819726 100644 --- a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts @@ -60,6 +60,7 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni hide () { this.closingModal = true this.openedModal.close() + this.form.reset() } isReplacingExistingCaption () { -- 2.25.1