aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/login
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/login')
-rw-r--r--client/src/app/login/login.component.html50
-rw-r--r--client/src/app/login/login.component.ts11
2 files changed, 29 insertions, 32 deletions
diff --git a/client/src/app/login/login.component.html b/client/src/app/login/login.component.html
index 1846fd19e..fac63d44d 100644
--- a/client/src/app/login/login.component.html
+++ b/client/src/app/login/login.component.html
@@ -50,35 +50,29 @@
50 </form> 50 </form>
51</div> 51</div>
52 52
53<div bsModal #forgotPasswordModal="bs-modal" (onShown)="onForgotPasswordModalShown()" class="modal" tabindex="-1"> 53<!--<ng-template #forgotPasswordModal (onShown)="onForgotPasswordModalShown()">-->
54 <div class="modal-dialog"> 54<ng-template #forgotPasswordModal>
55 <div class="modal-content"> 55 <div class="modal-header">
56 56 <h4 i18n class="modal-title">Forgot your password</h4>
57 <div class="modal-header"> 57 <span class="close" aria-hidden="true" (click)="hideForgotPasswordModal()"></span>
58 <span class="close" aria-hidden="true" (click)="hideForgotPasswordModal()"></span> 58 </div>
59 <h4 i18n class="modal-title">Forgot your password</h4>
60 </div>
61 59
62 <div class="modal-body"> 60 <div class="modal-body">
63 <div class="form-group"> 61 <div class="form-group">
64 <label i18n for="forgot-password-email">Email</label> 62 <label i18n for="forgot-password-email">Email</label>
65 <input 63 <input
66 type="email" id="forgot-password-email" i18n-placeholder placeholder="Email address" required 64 type="email" id="forgot-password-email" i18n-placeholder placeholder="Email address" required
67 [(ngModel)]="forgotPasswordEmail" #forgotPasswordEmailInput 65 [(ngModel)]="forgotPasswordEmail" #forgotPasswordEmailInput
68 > 66 >
69 </div> 67 </div>
68 </div>
70 69
71 <div class="form-group inputs"> 70 <div class="modal-footer inputs">
72 <span i18n class="action-button action-button-cancel" (click)="hideForgotPasswordModal()"> 71 <span i18n class="action-button action-button-cancel" (click)="hideForgotPasswordModal()">Cancel</span>
73 Cancel
74 </span>
75 72
76 <input 73 <input
77 type="submit" i18n-value value="Send me an email to reset my password" class="action-button-submit" 74 type="submit" i18n-value value="Send me an email to reset my password" class="action-button-submit"
78 (click)="askResetPassword()" [disabled]="!forgotPasswordEmailInput.validity.valid" 75 (click)="askResetPassword()" [disabled]="!forgotPasswordEmailInput.validity.valid"
79 > 76 >
80 </div>
81 </div>
82 </div>
83 </div> 77 </div>
84</div> 78</ng-template>
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts
index 9a68c12fa..8e8822510 100644
--- a/client/src/app/login/login.component.ts
+++ b/client/src/app/login/login.component.ts
@@ -2,12 +2,12 @@ import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'
2import { RedirectService, ServerService } from '@app/core' 2import { RedirectService, ServerService } from '@app/core'
3import { UserService } from '@app/shared' 3import { UserService } from '@app/shared'
4import { NotificationsService } from 'angular2-notifications' 4import { NotificationsService } from 'angular2-notifications'
5import { ModalDirective } from 'ngx-bootstrap/modal'
6import { AuthService } from '../core' 5import { AuthService } from '../core'
7import { FormReactive } from '../shared' 6import { FormReactive } from '../shared'
8import { I18n } from '@ngx-translate/i18n-polyfill' 7import { I18n } from '@ngx-translate/i18n-polyfill'
9import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 8import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
10import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service' 9import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service'
10import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
11 11
12@Component({ 12@Component({
13 selector: 'my-login', 13 selector: 'my-login',
@@ -16,14 +16,17 @@ import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-
16}) 16})
17 17
18export class LoginComponent extends FormReactive implements OnInit { 18export class LoginComponent extends FormReactive implements OnInit {
19 @ViewChild('forgotPasswordModal') forgotPasswordModal: ModalDirective 19 @ViewChild('forgotPasswordModal') forgotPasswordModal: ElementRef
20 @ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef 20 @ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef
21 21
22 error: string = null 22 error: string = null
23 forgotPasswordEmail = '' 23 forgotPasswordEmail = ''
24 24
25 private openedForgotPasswordModal: NgbModalRef
26
25 constructor ( 27 constructor (
26 protected formValidatorService: FormValidatorService, 28 protected formValidatorService: FormValidatorService,
29 private modalService: NgbModal,
27 private loginValidatorsService: LoginValidatorsService, 30 private loginValidatorsService: LoginValidatorsService,
28 private authService: AuthService, 31 private authService: AuthService,
29 private userService: UserService, 32 private userService: UserService,
@@ -84,10 +87,10 @@ export class LoginComponent extends FormReactive implements OnInit {
84 } 87 }
85 88
86 openForgotPasswordModal () { 89 openForgotPasswordModal () {
87 this.forgotPasswordModal.show() 90 this.openedForgotPasswordModal = this.modalService.open(this.forgotPasswordModal)
88 } 91 }
89 92
90 hideForgotPasswordModal () { 93 hideForgotPasswordModal () {
91 this.forgotPasswordModal.hide() 94 this.openedForgotPasswordModal.close()
92 } 95 }
93} 96}