| 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 | --> |
| 18 | <form [formGroup]="userForm" (ngSubmit)="userAction(userType)" autocomplete="off"> |
| 19 | <div class="modal-header"> |
| 20 | <h4 class="modal-title" id="modal-basic-title">{{userTitle}}</h4> |
| 21 | <button class="button-xs" type="button" class="close" aria-label="Close" (click)="activeModal.close()"> |
| 22 | <i class="fas fa-times-circle text-danger"></i> |
| 23 | </button> |
| 24 | </div> |
| 25 | <div class="modal-body"> |
| 26 | <label class="col-sm-12 col-form-label mandatory-label" |
| 27 | [ngClass]="{'text-danger': userForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' | translate}}</label> |
| 28 | <div class="row form-group" *ngIf="userType === 'add' || userType === 'editUserName'"> |
| 29 | <div class="col-sm-4"> |
| 30 | <label for="userName">{{'PAGE.USERS.USERNAME' | translate}} *</label> |
| 31 | </div> |
| 32 | <div class="col-sm-8"> |
| 33 | <input class="form-control" placeholder="{{'PAGE.USERS.USERNAME' | translate}}" type="text" |
| 34 | formControlName="userName" id="userName" [ngClass]="{ 'is-invalid': submitted && f.userName.errors }" |
| 35 | required> |
| 36 | </div> |
| 37 | <div *ngIf="submitted && f.userName.errors" class="input-validation-msg"> |
| 38 | <div *ngIf="f.userName.errors.minlength"> |
| 39 | {{'PAGE.LOGIN.USERNAMEMINLENGTHVALIDMESSAGE' | translate}} </div> |
| 40 | </div> |
| 41 | </div> |
| 42 | <ng-container *ngIf="userType === 'add' || userType === 'editPassword'"> |
| 43 | <div class="row form-group"> |
| 44 | <div class="col-sm-4"> |
| 45 | <label for="password">{{'PAGE.USERS.PASSWORD' | translate}} *</label> |
| 46 | </div> |
| 47 | <div class="col-sm-8"> |
| 48 | <input class="form-control" placeholder="{{'PAGE.USERS.PASSWORD' | translate}}" minlength="8" maxlength="50" |
| 49 | type="password" formControlName="password" id="password" autocomplete="new-password" |
| 50 | [ngClass]="{ 'is-invalid': submitted && f.password.errors }" required> |
| 51 | </div> |
| 52 | <div class="input-validation-msg"> |
| 53 | <div *ngIf="userForm?.controls.password.hasError('minlength') || userForm?.controls.password.errors?.pattern"> |
| 54 | {{'PAGE.LOGIN.PASSWORDMINLENGTHVALIDMESSAGE' | translate}} </div> |
| 55 | </div> |
| 56 | </div> |
| 57 | <div class="row form-group"> |
| 58 | <div class="col-sm-4"> |
| 59 | <label for="password2">{{'PAGE.USERS.CONFPASSWORD' | translate}} *</label> |
| 60 | </div> |
| 61 | <div class="col-sm-8"> |
| 62 | <input class="form-control" placeholder="{{'PAGE.USERS.CONFPASSWORD' | translate}}" type="password" |
| 63 | formControlName="password2" id="password2" autocomplete="new-password" |
| 64 | [ngClass]="{ 'is-invalid': submitted && f.password2.errors }" required> |
| 65 | <div class="mr-top-5" *ngIf="userForm?.controls.password.value && userForm?.controls.password2.value"> |
| 66 | <i class="far" |
| 67 | [ngClass]="{'fa-times-circle text-danger':userForm?.controls.password.value !== userForm?.controls.password2.value, |
| 68 | 'fa-check-circle text-success':userForm?.controls.password.value === userForm?.controls.password2.value}"></i> |
| 69 | {{'PAGE.USERS.PASSWORDMATCH' | translate}} |
| 70 | </div> |
| 71 | </div> |
| 72 | </div> |
| 73 | </ng-container> |
| 74 | <div class="form-group row" *ngIf="userType === 'add'"> |
| 75 | <label class="col-sm-4 col-form-label">{{'DOMAIN' | translate}} {{'NAME' | translate}}</label> |
| 76 | <div class="col-sm-8"> |
| Barath Kumar R | 76e55f4 | 2021-02-08 18:19:35 +0530 | [diff] [blame^] | 77 | <ng-select [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="domains" bindLabel="title" |
| 78 | bindValue="value" formControlName="domain_name" id="domain_name" |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 79 | [ngClass]="{ 'is-invalid': submitted && f.domain_name.errors }"></ng-select> |
| 80 | </div> |
| 81 | </div> |
| 82 | </div> |
| 83 | <div class="modal-footer"> |
| 84 | <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button> |
| 85 | <button *ngIf="userType==='add'" type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button> |
| 86 | <button *ngIf="userType!=='add'" type="submit" class="btn btn-primary">{{'APPLY' | translate}}</button> |
| 87 | </div> |
| 88 | </form> |
| 89 | <app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader> |