blob: 97016654a5a602f638cd632e5a1034c6425637f0 [file] [log] [blame]
kumaran.m3b4814a2020-05-01 19:48:54 +05301<!--
2Copyright 2020 TATA ELXSI
3
4Licensed under the Apache License, Version 2.0 (the 'License');
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15
16Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
17-->
SANDHYA.JSa9816552022-04-12 09:07:08 +053018<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"
SANDHYA.JS6c686082024-06-10 21:39:41 +053023 (click)="close()">
SANDHYA.JSa9816552022-04-12 09:07:08 +053024 <i class="fas fa-times-circle text-danger"></i>
25 </button>
kumaran.m3b4814a2020-05-01 19:48:54 +053026 </div>
SANDHYA.JSa9816552022-04-12 09:07:08 +053027 <div class="modal-body">
28 <label class="col-sm-12 col-form-label mandatory-label"
SANDHYA.JS6c686082024-06-10 21:39:41 +053029 [ngClass]="{'text-danger': userForm.invalid === true && submitted === true && isOtp === false,'message': isPassword && userForm.invalid === true && submitted }">{{'MANDATORYCHECK'|
SANDHYA.JSa9816552022-04-12 09:07:08 +053030 translate}}</label>
SANDHYA.JS6c686082024-06-10 21:39:41 +053031 <div class="row form-group mb-3" *ngIf="userType === 'add' || userType === 'editUserName'|| userType === 'forgotPassword'">
kumaran.m3b4814a2020-05-01 19:48:54 +053032 <div class="col-sm-4">
SANDHYA.JSa9816552022-04-12 09:07:08 +053033 <label for="userName">{{'PAGE.USERS.USERNAME' | translate}} *</label>
kumaran.m3b4814a2020-05-01 19:48:54 +053034 </div>
35 <div class="col-sm-8">
SANDHYA.JSa9816552022-04-12 09:07:08 +053036 <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.m3b4814a2020-05-01 19:48:54 +053039 </div>
SANDHYA.JSa9816552022-04-12 09:07:08 +053040 <div *ngIf="submitted && f.userName.errors" class="input-validation-msg">
41 <div *ngIf="f.userName.errors.minlength">
42 {{'PAGE.LOGIN.USERNAMEMINLENGTHVALIDMESSAGE' | translate}} </div>
kumaran.m3b4814a2020-05-01 19:48:54 +053043 </div>
44 </div>
SANDHYA.JS6c686082024-06-10 21:39:41 +053045 <div class="row form-group mb-3"
46 *ngIf="userType === 'add' || userType === 'editmail' || userType === 'forgotPassword'">
47 <div class="col-sm-4">
48 <label *ngIf="userType === 'editmail' || userType === 'add'" for="email">{{'PAGE.USERS.EMAIL' | translate}}</label>
49 <label *ngIf="userType === 'forgotPassword'" for="email">{{'PAGE.USERS.EMAIL' | translate}} *</label>
50 </div>
51 <div class="col-sm-8">
52 <input class="form-control" placeholder="{{'PAGE.USERS.EMAIL' | translate}}" type="text" formControlName="email_id"
53 id="email" [ngClass]="{ 'is-invalid': submitted && f.email_id.errors }" required>
54 </div>
55 </div>
56 <ng-container *ngIf="isOtp">
57 <div class="row form-group mb-3">
58 <div class="col-sm-4">
59 <label for="otp">{{'PAGE.USERS.OTP' | translate}} *</label>
60 </div>
61 <div class="col-sm-8">
62 <input class="form-control" placeholder="{{'PAGE.USERS.OTP' | translate}}" type="text" formControlName="otp" id="otp"
63 [ngClass]="{ 'is-invalid': submitted && f.otp.errors && isOtp === false }" required>
64 </div>
65 </div>
66 </ng-container>
67 <ng-container
68 *ngIf="userType === 'editPassword' || userType === 'add' || userType === 'changePassword' || userType === 'change_password'">
SANDHYA.JSc84f1122024-06-04 21:50:03 +053069 <div class="row form-group mb-3" *ngIf=" userType === 'changePassword'">
SANDHYA.JSa9816552022-04-12 09:07:08 +053070 <div class="col-sm-4">
71 <label for="oldpassword">{{'PAGE.USERS.OLDPASSWORD' | translate}} *</label>
72 </div>
73 <div class="col-sm-8">
74 <input class="form-control" placeholder="{{'PAGE.USERS.OLDPASSWORD' | translate}}" type="password"
75 formControlName="old_password" id="old_password" autocomplete="old-password"
76 [ngClass]="{ 'is-invalid': submitted && f.old_password.errors }" required>
kumaran.m3b4814a2020-05-01 19:48:54 +053077 </div>
78 </div>
SANDHYA.JSc84f1122024-06-04 21:50:03 +053079 <div class="row form-group mb-3" *ngIf="userType === 'add' || userType === 'editPassword'">
SANDHYA.JSa9816552022-04-12 09:07:08 +053080 <div class="col-sm-4">
81 <label for="password">{{'PAGE.USERS.PASSWORD' | translate}} *</label>
82 </div>
83 <div class="col-sm-8">
84 <input class="form-control" placeholder="{{'PAGE.USERS.PASSWORD' | translate}}" minlength="8" maxlength="50"
85 type="password" formControlName="password" id="password" autocomplete="new-password"
86 [ngClass]="{ 'is-invalid': submitted && f.password.errors }" required>
87 </div>
88 <div class="input-validation-msg" [ngClass]="{'message': isPassword}">
89 <div
90 *ngIf="userForm?.controls.password.hasError('minlength') || userForm?.controls.password.errors?.pattern">
91 {{'PAGE.LOGIN.PASSWORDMINLENGTHVALIDMESSAGE' | translate}} </div>
92 </div>
93 </div>
SANDHYA.JS6c686082024-06-10 21:39:41 +053094 <div class="row form-group mb-3" *ngIf="userType === 'changePassword' || userType === 'change_password'">
SANDHYA.JSa9816552022-04-12 09:07:08 +053095 <div class="col-sm-4">
96 <label for="password">{{'PAGE.USERS.NEWPASSWORD' | translate}} *</label>
97 </div>
98 <div class="col-sm-8">
99 <input class="form-control" placeholder="{{'PAGE.USERS.NEWPASSWORD' | translate}}" minlength="8"
100 maxlength="50" type="password" formControlName="password" id="password" autocomplete="new-password"
101 [ngClass]="{ 'is-invalid': submitted && f.password.errors }" required>
102 </div>
103 <div class="input-validation-msg" [ngClass]="{'message': isPassword}">
104 <div
105 *ngIf="userForm?.controls.password.hasError('minlength') || userForm?.controls.password.errors?.pattern">
106 {{'PAGE.LOGIN.PASSWORDMINLENGTHVALIDMESSAGE' | translate}} </div>
107 </div>
108 </div>
SANDHYA.JS6c686082024-06-10 21:39:41 +0530109 <div class="row form-group mb-3" *ngIf= "userType === 'editPassword' || userType === 'add'|| userType === 'change_password'|| userType === 'changePassword'">
SANDHYA.JSa9816552022-04-12 09:07:08 +0530110 <div class="col-sm-4">
111 <label for="password2">{{'PAGE.USERS.CONFPASSWORD' | translate}} *</label>
112 </div>
113 <div class="col-sm-8">
114 <input class="form-control" placeholder="{{'PAGE.USERS.CONFPASSWORD' | translate}}" type="password"
115 formControlName="password2" id="password2" autocomplete="new-password"
116 [ngClass]="{ 'is-invalid': submitted && f.password2.errors }" required>
117 <div class="mr-top-5" *ngIf="userForm?.controls.password.value && userForm?.controls.password2.value">
118 <i class="far"
119 [ngClass]="{'fa-times-circle text-danger':userForm?.controls.password.value !== userForm?.controls.password2.value,
120 'fa-check-circle text-success':userForm?.controls.password.value === userForm?.controls.password2.value}"></i>
121 {{'PAGE.USERS.PASSWORDMATCH' | translate}}
122 </div>
123 </div>
124 </div>
125 </ng-container>
SANDHYA.JSc84f1122024-06-04 21:50:03 +0530126 <div class="form-group row mb-3" *ngIf="userType === 'add'">
SANDHYA.JSa9816552022-04-12 09:07:08 +0530127 <label class="col-sm-4 col-form-label">{{'DOMAIN' | translate}} {{'NAME' | translate}}</label>
128 <div class="col-sm-8">
129 <ng-select [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="domains" bindLabel="title"
130 bindValue="value" formControlName="domain_name" id="domain_name"
131 [ngClass]="{ 'is-invalid': submitted && f.domain_name.errors }"></ng-select>
132 </div>
kumaran.m3b4814a2020-05-01 19:48:54 +0530133 </div>
134 </div>
SANDHYA.JSa9816552022-04-12 09:07:08 +0530135 <div class="modal-footer">
136 <button type="button" class="btn btn-danger" (click)="close()">{{'CANCEL' | translate}}</button>
137 <button *ngIf="userType==='add'" type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button>
138 <button *ngIf="userType!=='add'" type="submit" class="btn btn-primary">{{'APPLY' | translate}}</button>
139 </div>
140 </form>
141</div>
kumaran.m3b4814a2020-05-01 19:48:54 +0530142<app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader>