This commit is contained in:
Smart 2023-04-17 12:33:42 +05:30
parent 501442e44e
commit d16ea75801
4 changed files with 32 additions and 3 deletions

View File

@ -7,12 +7,14 @@
<div mat-dialog-content class="my-table">
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Name</mat-label>
<input placeholder=" Name" matInput formControlName="busName">
<mat-error *ngIf="myError('busName', 'required')">Name is required</mat-error>
<mat-error *ngIf="myError('busName', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Email</mat-label>
<input type="email" placeholder=" Email" matInput [(ngModel)]="local_data.email" formControlName="email">
<mat-error *ngIf="!form.get('email')?.errors?.required && (form.get('email')?.errors?.pattern)">
Please enter a valid email address
@ -23,6 +25,7 @@
</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Phone No</mat-label>
<input placeholder="Phone No" matInput [(ngModel)]="local_data.contactNo" formControlName="contactNo">
<mat-error *ngIf="myError('contactNo', 'required')">Contact No is required</mat-error>
<mat-error *ngIf="myError('contactNo', 'pattern')">Invalid Contact No </mat-error>
@ -30,16 +33,19 @@
<mat-error *ngIf="myError('contactNo', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Address</mat-label>
<input placeholder=" Address" matInput [(ngModel)]="local_data.address" formControlName="address">
<mat-error *ngIf="myError('address', 'required')">Address is required</mat-error>
<mat-error *ngIf="myError('address', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>State</mat-label>
<input placeholder=" State" matInput [(ngModel)]="local_data.state" formControlName="state">
<mat-error *ngIf="myError('state', 'required')">State is required</mat-error>
<mat-error *ngIf="myError('state', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>City</mat-label>
<input placeholder=" City" matInput [(ngModel)]="local_data.city" formControlName="city">
<mat-error *ngIf="myError('city', 'required')">City is required</mat-error>
<mat-error *ngIf="myError('city', 'maxlength')">Limit exceed</mat-error>

View File

@ -58,12 +58,24 @@
<mat-error *ngIf="myError('contactNo', 'minlength')"> Contact No must be at least 10 characters</mat-error>
<mat-error *ngIf="myError('contactNo', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<!-- <mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Password</mat-label>
<input placeholder="Password" matInput formControlName="password">
<mat-error *ngIf="myError('password', 'required')">Password is required</mat-error>
<mat-error *ngIf="myError('password', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
</mat-form-field> -->
<mat-form-field appearance="outline" class="mat-pane user-mate">
<mat-label>Password</mat-label>
<input matInput type="password" placeholder="Password" formControlName="password" [type]="hide ? 'password' : 'text'" name="password">
<mat-error *ngIf="!form.get('password')?.errors?.required">
Password length must be greater than or equal to 8 and password must contain one or more uppercase ,
lowercase , numeric and special characters
</mat-error>
<mat-error *ngIf="form.get('password')?.invalid && (form.get('password')?.dirty || form.get('password')?.touched) && form.get('password')?.errors?.required">
Password is required
</mat-error>
</mat-form-field>
<img *ngIf="action == 'Update' && imageViewStatus != true" class="image mb-2" [src]="image_view(local_data.logo)" height="150" width="150"/>
<img *ngIf="imageViewStatus == true" class="image mb-2" [src]="url" height="150" width="150"><br/>

View File

@ -59,4 +59,12 @@ input[type=file]::file-selector-button {
.imgSizeValidation{
color: red;
font-family: ui-serif;
}
.user-mate{
::ng-deep .mat-form-field-subscript-wrapper {
position: inherit!important;
box-sizing: border-box;
width: 100%;
overflow: hidden;
}
}

View File

@ -56,7 +56,10 @@ export class AddUserComponent implements OnInit {
email: new FormControl('', [Validators.required, Validators.email,Validators.pattern(
'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$',
),]),
password: new FormControl('', [Validators.required, Validators.minLength(6)]),
// password: new FormControl('', [Validators.required, Validators.minLength(6)]),
password: new FormControl('', [Validators.required,Validators.pattern(
'^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*_=+-]).{8,12}$'
)]),
logo: new FormControl('', null),
// confirmPassword: new FormControl('', [Validators.required, Validators.minLength(6)]),
createdBy:new FormControl(userrole,null),