Improve message visibility on signup
This commit is contained in:
parent
58d515e32f
commit
d8c9996ce2
|
@ -4,6 +4,7 @@
|
||||||
Create an account
|
Create an account
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="info" class="alert alert-info">{{ info }}</div>
|
||||||
<div *ngIf="error" class="alert alert-danger">{{ error }}</div>
|
<div *ngIf="error" class="alert alert-danger">{{ error }}</div>
|
||||||
|
|
||||||
<div class="d-flex justify-content-left flex-wrap">
|
<div class="d-flex justify-content-left flex-wrap">
|
||||||
|
@ -59,7 +60,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="submit" i18n-value value="Signup" [disabled]="!form.valid">
|
<input type="submit" i18n-value value="Signup" [disabled]="!form.valid || signupDone">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -12,7 +12,9 @@ import { FormValidatorService } from '@app/shared/forms/form-validators/form-val
|
||||||
styleUrls: [ './signup.component.scss' ]
|
styleUrls: [ './signup.component.scss' ]
|
||||||
})
|
})
|
||||||
export class SignupComponent extends FormReactive implements OnInit {
|
export class SignupComponent extends FormReactive implements OnInit {
|
||||||
|
info: string = null
|
||||||
error: string = null
|
error: string = null
|
||||||
|
signupDone = false
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
protected formValidatorService: FormValidatorService,
|
protected formValidatorService: FormValidatorService,
|
||||||
|
@ -50,17 +52,17 @@ export class SignupComponent extends FormReactive implements OnInit {
|
||||||
|
|
||||||
this.userService.signup(userCreate).subscribe(
|
this.userService.signup(userCreate).subscribe(
|
||||||
() => {
|
() => {
|
||||||
|
this.signupDone = true
|
||||||
|
|
||||||
if (this.requiresEmailVerification) {
|
if (this.requiresEmailVerification) {
|
||||||
this.notificationsService.alert(
|
this.info = this.i18n('Welcome! Now please check your emails to verify your account and complete signup.')
|
||||||
this.i18n('Welcome'),
|
return
|
||||||
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.notificationsService.success(
|
||||||
|
this.i18n('Success'),
|
||||||
|
this.i18n('Registration for {{username}} complete.', { username: userCreate.username })
|
||||||
|
)
|
||||||
this.redirectService.redirectToHomepage()
|
this.redirectService.redirectToHomepage()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
|
||||||
hide () {
|
hide () {
|
||||||
this.closingModal = true
|
this.closingModal = true
|
||||||
this.openedModal.close()
|
this.openedModal.close()
|
||||||
|
this.form.reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
isReplacingExistingCaption () {
|
isReplacingExistingCaption () {
|
||||||
|
|
Loading…
Reference in New Issue