| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 1 | <!-- |
| 2 | Copyright 2020 TATA ELXSI |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the 'License'); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in) |
| 17 | --> |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 18 | <div class="wrap-user" [ngClass]="{'change-password': isPassword}"> |
| 19 | <form [formGroup]="userForm" (ngSubmit)="userAction(userType)" autocomplete="off"> |
| 20 | <div class="modal-header"> |
| 21 | <h4 class="modal-title" id="modal-basic-title">{{userTitle}}</h4> |
| 22 | <button *ngIf="!isFirstLogin" class="button-xs" type="button" class="close" aria-label="Close" |
| 23 | (click)="activeModal.close()"> |
| 24 | <i class="fas fa-times-circle text-danger"></i> |
| 25 | </button> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 26 | </div> |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 27 | <div class="modal-body"> |
| 28 | <label class="col-sm-12 col-form-label mandatory-label" |
| 29 | [ngClass]="{'text-danger': userForm.invalid === true && submitted === true,'message': isPassword && userForm.invalid === true && submitted }">{{'MANDATORYCHECK'| |
| 30 | translate}}</label> |
| SANDHYA.JS | c84f112 | 2024-06-04 21:50:03 +0530 | [diff] [blame] | 31 | <div class="row form-group mb-3" *ngIf="userType === 'add' || userType === 'editUserName'"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 32 | <div class="col-sm-4"> |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 33 | <label for="userName">{{'PAGE.USERS.USERNAME' | translate}} *</label> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 34 | </div> |
| 35 | <div class="col-sm-8"> |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 36 | <input class="form-control" placeholder="{{'PAGE.USERS.USERNAME' | translate}}" type="text" |
| 37 | formControlName="userName" id="userName" [ngClass]="{ 'is-invalid': submitted && f.userName.errors }" |
| 38 | required> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 39 | </div> |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 40 | <div *ngIf="submitted && f.userName.errors" class="input-validation-msg"> |
| 41 | <div *ngIf="f.userName.errors.minlength"> |
| 42 | {{'PAGE.LOGIN.USERNAMEMINLENGTHVALIDMESSAGE' | translate}} </div> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 43 | </div> |
| 44 | </div> |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 45 | <ng-container *ngIf="userType === 'add' || userType === 'editPassword' || userType === 'changePassword'"> |
| SANDHYA.JS | c84f112 | 2024-06-04 21:50:03 +0530 | [diff] [blame] | 46 | <div class="row form-group mb-3" *ngIf=" userType === 'changePassword'"> |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 47 | <div class="col-sm-4"> |
| 48 | <label for="oldpassword">{{'PAGE.USERS.OLDPASSWORD' | translate}} *</label> |
| 49 | </div> |
| 50 | <div class="col-sm-8"> |
| 51 | <input class="form-control" placeholder="{{'PAGE.USERS.OLDPASSWORD' | translate}}" type="password" |
| 52 | formControlName="old_password" id="old_password" autocomplete="old-password" |
| 53 | [ngClass]="{ 'is-invalid': submitted && f.old_password.errors }" required> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 54 | </div> |
| 55 | </div> |
| SANDHYA.JS | c84f112 | 2024-06-04 21:50:03 +0530 | [diff] [blame] | 56 | <div class="row form-group mb-3" *ngIf="userType === 'add' || userType === 'editPassword'"> |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 57 | <div class="col-sm-4"> |
| 58 | <label for="password">{{'PAGE.USERS.PASSWORD' | translate}} *</label> |
| 59 | </div> |
| 60 | <div class="col-sm-8"> |
| 61 | <input class="form-control" placeholder="{{'PAGE.USERS.PASSWORD' | translate}}" minlength="8" maxlength="50" |
| 62 | type="password" formControlName="password" id="password" autocomplete="new-password" |
| 63 | [ngClass]="{ 'is-invalid': submitted && f.password.errors }" required> |
| 64 | </div> |
| 65 | <div class="input-validation-msg" [ngClass]="{'message': isPassword}"> |
| 66 | <div |
| 67 | *ngIf="userForm?.controls.password.hasError('minlength') || userForm?.controls.password.errors?.pattern"> |
| 68 | {{'PAGE.LOGIN.PASSWORDMINLENGTHVALIDMESSAGE' | translate}} </div> |
| 69 | </div> |
| 70 | </div> |
| SANDHYA.JS | c84f112 | 2024-06-04 21:50:03 +0530 | [diff] [blame] | 71 | <div class="row form-group mb-3" *ngIf="userType === 'changePassword'"> |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 72 | <div class="col-sm-4"> |
| 73 | <label for="password">{{'PAGE.USERS.NEWPASSWORD' | translate}} *</label> |
| 74 | </div> |
| 75 | <div class="col-sm-8"> |
| 76 | <input class="form-control" placeholder="{{'PAGE.USERS.NEWPASSWORD' | translate}}" minlength="8" |
| 77 | maxlength="50" type="password" formControlName="password" id="password" autocomplete="new-password" |
| 78 | [ngClass]="{ 'is-invalid': submitted && f.password.errors }" required> |
| 79 | </div> |
| 80 | <div class="input-validation-msg" [ngClass]="{'message': isPassword}"> |
| 81 | <div |
| 82 | *ngIf="userForm?.controls.password.hasError('minlength') || userForm?.controls.password.errors?.pattern"> |
| 83 | {{'PAGE.LOGIN.PASSWORDMINLENGTHVALIDMESSAGE' | translate}} </div> |
| 84 | </div> |
| 85 | </div> |
| SANDHYA.JS | c84f112 | 2024-06-04 21:50:03 +0530 | [diff] [blame] | 86 | <div class="row form-group mb-3"> |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 87 | <div class="col-sm-4"> |
| 88 | <label for="password2">{{'PAGE.USERS.CONFPASSWORD' | translate}} *</label> |
| 89 | </div> |
| 90 | <div class="col-sm-8"> |
| 91 | <input class="form-control" placeholder="{{'PAGE.USERS.CONFPASSWORD' | translate}}" type="password" |
| 92 | formControlName="password2" id="password2" autocomplete="new-password" |
| 93 | [ngClass]="{ 'is-invalid': submitted && f.password2.errors }" required> |
| 94 | <div class="mr-top-5" *ngIf="userForm?.controls.password.value && userForm?.controls.password2.value"> |
| 95 | <i class="far" |
| 96 | [ngClass]="{'fa-times-circle text-danger':userForm?.controls.password.value !== userForm?.controls.password2.value, |
| 97 | 'fa-check-circle text-success':userForm?.controls.password.value === userForm?.controls.password2.value}"></i> |
| 98 | {{'PAGE.USERS.PASSWORDMATCH' | translate}} |
| 99 | </div> |
| 100 | </div> |
| 101 | </div> |
| 102 | </ng-container> |
| SANDHYA.JS | c84f112 | 2024-06-04 21:50:03 +0530 | [diff] [blame] | 103 | <div class="form-group row mb-3" *ngIf="userType === 'add'"> |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 104 | <label class="col-sm-4 col-form-label">{{'DOMAIN' | translate}} {{'NAME' | translate}}</label> |
| 105 | <div class="col-sm-8"> |
| 106 | <ng-select [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="domains" bindLabel="title" |
| 107 | bindValue="value" formControlName="domain_name" id="domain_name" |
| 108 | [ngClass]="{ 'is-invalid': submitted && f.domain_name.errors }"></ng-select> |
| 109 | </div> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 110 | </div> |
| 111 | </div> |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 112 | <div class="modal-footer"> |
| 113 | <button type="button" class="btn btn-danger" (click)="close()">{{'CANCEL' | translate}}</button> |
| 114 | <button *ngIf="userType==='add'" type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button> |
| 115 | <button *ngIf="userType!=='add'" type="submit" class="btn btn-primary">{{'APPLY' | translate}}</button> |
| 116 | </div> |
| 117 | </form> |
| 118 | </div> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 119 | <app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader> |