Feature 11034: Forgot Password in OSM
- Added support for forgot password from UI
- Added forgot password button in login page
Change-Id: I058a09356c4e2ff5d5b0e883e74f0041d1aaffea
Signed-off-by: SANDHYA.JS <sandhya.j@tataelxsi.co.in>
diff --git a/src/app/users/add-user/AddEditUserComponent.html b/src/app/users/add-user/AddEditUserComponent.html
index 6ae0f32..9701665 100644
--- a/src/app/users/add-user/AddEditUserComponent.html
+++ b/src/app/users/add-user/AddEditUserComponent.html
@@ -20,15 +20,15 @@
<div class="modal-header">
<h4 class="modal-title" id="modal-basic-title">{{userTitle}}</h4>
<button *ngIf="!isFirstLogin" class="button-xs" type="button" class="close" aria-label="Close"
- (click)="activeModal.close()">
+ (click)="close()">
<i class="fas fa-times-circle text-danger"></i>
</button>
</div>
<div class="modal-body">
<label class="col-sm-12 col-form-label mandatory-label"
- [ngClass]="{'text-danger': userForm.invalid === true && submitted === true,'message': isPassword && userForm.invalid === true && submitted }">{{'MANDATORYCHECK'|
+ [ngClass]="{'text-danger': userForm.invalid === true && submitted === true && isOtp === false,'message': isPassword && userForm.invalid === true && submitted }">{{'MANDATORYCHECK'|
translate}}</label>
- <div class="row form-group mb-3" *ngIf="userType === 'add' || userType === 'editUserName'">
+ <div class="row form-group mb-3" *ngIf="userType === 'add' || userType === 'editUserName'|| userType === 'forgotPassword'">
<div class="col-sm-4">
<label for="userName">{{'PAGE.USERS.USERNAME' | translate}} *</label>
</div>
@@ -42,7 +42,30 @@
{{'PAGE.LOGIN.USERNAMEMINLENGTHVALIDMESSAGE' | translate}} </div>
</div>
</div>
- <ng-container *ngIf="userType === 'add' || userType === 'editPassword' || userType === 'changePassword'">
+ <div class="row form-group mb-3"
+ *ngIf="userType === 'add' || userType === 'editmail' || userType === 'forgotPassword'">
+ <div class="col-sm-4">
+ <label *ngIf="userType === 'editmail' || userType === 'add'" for="email">{{'PAGE.USERS.EMAIL' | translate}}</label>
+ <label *ngIf="userType === 'forgotPassword'" for="email">{{'PAGE.USERS.EMAIL' | translate}} *</label>
+ </div>
+ <div class="col-sm-8">
+ <input class="form-control" placeholder="{{'PAGE.USERS.EMAIL' | translate}}" type="text" formControlName="email_id"
+ id="email" [ngClass]="{ 'is-invalid': submitted && f.email_id.errors }" required>
+ </div>
+ </div>
+ <ng-container *ngIf="isOtp">
+ <div class="row form-group mb-3">
+ <div class="col-sm-4">
+ <label for="otp">{{'PAGE.USERS.OTP' | translate}} *</label>
+ </div>
+ <div class="col-sm-8">
+ <input class="form-control" placeholder="{{'PAGE.USERS.OTP' | translate}}" type="text" formControlName="otp" id="otp"
+ [ngClass]="{ 'is-invalid': submitted && f.otp.errors && isOtp === false }" required>
+ </div>
+ </div>
+ </ng-container>
+ <ng-container
+ *ngIf="userType === 'editPassword' || userType === 'add' || userType === 'changePassword' || userType === 'change_password'">
<div class="row form-group mb-3" *ngIf=" userType === 'changePassword'">
<div class="col-sm-4">
<label for="oldpassword">{{'PAGE.USERS.OLDPASSWORD' | translate}} *</label>
@@ -68,7 +91,7 @@
{{'PAGE.LOGIN.PASSWORDMINLENGTHVALIDMESSAGE' | translate}} </div>
</div>
</div>
- <div class="row form-group mb-3" *ngIf="userType === 'changePassword'">
+ <div class="row form-group mb-3" *ngIf="userType === 'changePassword' || userType === 'change_password'">
<div class="col-sm-4">
<label for="password">{{'PAGE.USERS.NEWPASSWORD' | translate}} *</label>
</div>
@@ -83,7 +106,7 @@
{{'PAGE.LOGIN.PASSWORDMINLENGTHVALIDMESSAGE' | translate}} </div>
</div>
</div>
- <div class="row form-group mb-3">
+ <div class="row form-group mb-3" *ngIf= "userType === 'editPassword' || userType === 'add'|| userType === 'change_password'|| userType === 'changePassword'">
<div class="col-sm-4">
<label for="password2">{{'PAGE.USERS.CONFPASSWORD' | translate}} *</label>
</div>