User Registration DP UI
This commit is contained in:
parent
6171dcb4f0
commit
6cb431487c
@ -1,7 +1,4 @@
|
||||
|
||||
|
||||
<mat-card>
|
||||
|
||||
<form [formGroup]="regForm" (ngSubmit)="register(regForm.value)">
|
||||
<mat-card-content>
|
||||
<div fxflex="100" fxLayout="row" fxLayoutAlign="start center">
|
||||
@ -17,46 +14,38 @@
|
||||
<mat-card>
|
||||
<mat-card-title>Personal</mat-card-title><hr/>
|
||||
<mat-card-content>
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2" style="display: inline-flex;">
|
||||
<span dividerColor="primary" class="ml-xs mr-xs" *ngIf="profileaccess">
|
||||
<img [src]="profileurl" style="width: 50%;border-radius: 50%;">
|
||||
</span>
|
||||
<span *ngIf="imageaccess">
|
||||
<img [src]="filename" style="width: 50%; border-radius: 50%;">
|
||||
</span>
|
||||
<div style="width:60%">
|
||||
Profile Picture
|
||||
<input type="file" (change)="onFileChange($event)" [formControl]="regForm.controls['userpic']" accept="image/*" />
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
||||
|
||||
|
||||
<!-- <span *ngIf="usersData !=''">
|
||||
{{img}}
|
||||
</span> -->
|
||||
</div>
|
||||
<span dividerColor="primary" class="ml-xs mr-xs" *ngIf="!imageaccess">
|
||||
<img [src]="profileurl || 'https://image.ibb.co/mGjZB9/usernew.png'" style="width: 10%;border-radius: 50%;border:2px solid red">
|
||||
|
||||
</span>
|
||||
<span dividerColor="primary" *ngIf="imageaccess">
|
||||
<img [src]="filename" style="width: 10%; border-radius: 50%;border:2px solid #e00201">
|
||||
</span>
|
||||
|
||||
<label for="fileUpload" ><mat-icon style="color:#e00201">camera_alt</mat-icon></label>
|
||||
|
||||
|
||||
<input type="file" id="fileUpload" (change)="onFileChange($event)" [formControl]="regForm.controls['userpic']" accept="image/*" style="display:none"/>
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
<input matInput placeholder="First Name" [formControl]="regForm.controls['firstName']" required>
|
||||
<mat-error *ngIf="regForm.controls['firstName'].hasError('required') && regForm.controls['firstName'].touched" class="mat-text-warn">First Name Required.</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['firstName'].hasError('minlength') && regForm.controls['firstName'].touched" class="mat-text-warn">Atleast 5 Characters.</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['firstName'].hasError('maxlength') && regForm.controls['firstName'].touched" class="mat-text-warn">Not More Than 10 Characters.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
<input matInput placeholder="Last Name" [formControl]="regForm.controls['lastName']" required>
|
||||
<mat-error *ngIf="regForm.controls['lastName'].hasError('required') && regForm.controls['lastName'].touched" class="mat-text-warn">Last Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- <mat-error *ngIf="regForm.controls['lastName'].hasError('minlength') && regForm.controls['lastName'].touched" class="mat-text-warn">Your first name must be at least 5 characters long.</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['lastName'].hasError('maxlength') && regForm.controls['lastName'].touched" class="mat-text-warn">Your first name cannot exceed 10 characters.</mat-error> -->
|
||||
<mat-form-field style="display: none;">
|
||||
<input matInput placeholder="User Id" [formControl]="regForm.controls['userid']">
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<mat-slide-toggle color="primary" [formControl]="regForm.controls['isactive']">
|
||||
Isactive
|
||||
</mat-slide-toggle>
|
||||
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
@ -72,9 +61,6 @@
|
||||
<mat-error *ngIf="regForm.controls['email'].errors?.email && regForm.controls['email'].touched" class="mat-text-warn">Invalid Email Address.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<!-- <mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
<input matInput placeholder="Alt Email address" [formControl]="regForm.controls['altemail']" type="email">
|
||||
</mat-form-field> -->
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
<input matInput placeholder="Phone Number" [formControl]="regForm.controls['phone']" type="number" required>
|
||||
<mat-error *ngIf="regForm.controls['phone'].hasError('required') && regForm.controls['phone'].touched" class="mat-text-warn">Phone Number Required.</mat-error>
|
||||
@ -106,71 +92,7 @@
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <mat-card-title>Contact Information</mat-card-title><hr/>
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
<input matInput placeholder="Phone number" [formControl]="regForm.controls['phone']" type="text">
|
||||
<mat-error *ngIf="regForm.controls['phone'].hasError('required') && regForm.controls['phone'].touched" class="mat-text-warn">You must include phone number.</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['phone'].errors?.phone && regForm.controls['phone'].touched" class="mat-text-warn">You must include a valid phone number.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
<input matInput placeholder="Alt Phone number" [formControl]="regForm.controls['altphone']" type="text">
|
||||
<mat-error *ngIf="regForm.controls['altphone'].errors?.phone && regForm.controls['phone'].touched" class="mat-text-warn">You must include a valid phone number.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
<!-- <mat-error *ngIf="regForm.controls['phone'].hasError('required') && regForm.controls['phone'].touched" class="mat-text-warn">You must include phone number.</mat-error>
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
|
||||
<input matInput placeholder="Address 1" [formControl]="regForm.controls['address1']">
|
||||
</mat-form-field>
|
||||
</div> -->
|
||||
<!-- <div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
|
||||
<input matInput placeholder="Address 2" [formControl]="regForm.controls['address2']">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
|
||||
<input matInput placeholder="Address 3" [formControl]="regForm.controls['address3']">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
|
||||
<input matInput placeholder="Pincode" [formControl]="regForm.controls['pincode']">
|
||||
</mat-form-field>
|
||||
</div> -->
|
||||
<!-- <div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
||||
<mat-select matInput placeholder="State" [formControl]="regForm.controls['state']" required (selectionChange)="getcity($event)" >
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let s of State" [value]="s" >
|
||||
{{s.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="regForm.controls['state'].hasError('required') && regForm.controls['state'].touched" class="mat-text-warn">State Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
||||
<mat-select matInput placeholder="City" [formControl]="regForm.controls['city']" required>
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let c of City" [value]="c">
|
||||
{{c.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="regForm.controls['city'].hasError('required') && regForm.controls['city'].touched" class="mat-text-warn">city Required.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>-->
|
||||
<div fxFlex.gt-sm="33.33%" fxFlex="50" class="m-gap p-gap">
|
||||
<mat-card>
|
||||
|
||||
<mat-card-title>Role</mat-card-title><hr/>
|
||||
@ -188,8 +110,6 @@
|
||||
<mat-error *ngIf="regForm.controls['type'].errors?.phone && regForm.controls['type'].touched" class="mat-text-warn">Enitity Type Required</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
<!-- <span *ngIf="roleload"> -->
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" *ngIf="typeValue == '2'">
|
||||
<mat-select matInput placeholder="Lender Name" [formControl]="regForm.controls['lenVenName']" required>
|
||||
<mat-option>--</mat-option>
|
||||
@ -212,7 +132,6 @@
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" >
|
||||
<mat-select matInput placeholder="Role" (selectionChange)="toggleAllSelection($event,regForm.controls['type'].value)" [formControl]="regForm.controls['role']" required>
|
||||
<!-- <mat-option #allSelected (click)="toggleAllSelection()" [value]="0">ALL</mat-option> -->
|
||||
<mat-option *ngFor="let role of roles" [value]="role" >
|
||||
{{role.role_name}}
|
||||
</mat-option>
|
||||
@ -232,48 +151,16 @@
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<!-- <div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
||||
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;" *ngIf="roleAccess">
|
||||
<mat-select matInput placeholder="PD Type" [formControl]="regForm.controls['pdtype']" required>
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let PDT of pdType" [value]="PDT">
|
||||
{{PDT.type_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
|
||||
</mat-form-field>
|
||||
</div>-->
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
<!-- <div fxLayout="row" fxLayoutAlign="start center" class="mb-2" *ngIf="roleAccess">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;" >
|
||||
<mat-select matInput placeholder="Select Customer" [formControl]="regForm.controls['customer']" required (selectionChange)="getcity($event)">
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let C of customerSeg" [value]="C" >
|
||||
{{C.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;" *ngIf="roleAccess">
|
||||
<mat-select matInput placeholder="Select Product" [formControl]="regForm.controls['product']" required>
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let P of product" [value]="P">
|
||||
{{P.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
|
||||
</mat-form-field>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
<hr>
|
||||
<!-- <pre>{{regForm.controls['userid'].value | json}}</pre> -->
|
||||
|
||||
|
||||
<mat-card-actions style="text-align:right;">
|
||||
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
|
||||
// .mat-card-title{
|
||||
|
||||
// color: #fff;
|
||||
// margin-left: 13px;
|
||||
// background: rgba(157, 69, 124, 1);
|
||||
// box-shadow: 0 4px 20px 0 rgba(157, 69, 124, 1), 0 7px 10px -5px rgba(157, 69, 124, 1);;
|
||||
// display: inline-block;
|
||||
// border-radius: 6px;
|
||||
// padding: 10px;
|
||||
// margin-top: -52px;
|
||||
|
||||
|
||||
// }
|
||||
|
||||
|
||||
@ -200,7 +200,7 @@ this.loader = true;
|
||||
this.AWS.adminUpdateuser(userData, data.record).subscribe(res => {
|
||||
this.loader =false;
|
||||
console.log(res);
|
||||
Swal('user Created');
|
||||
Swal('User Created');
|
||||
this.router.navigate(['setting/users/userlist']);
|
||||
});
|
||||
}
|
||||
@ -216,7 +216,7 @@ this.loader = true;
|
||||
});}
|
||||
this.users.saveRecords(res,userData).subscribe(res=>{
|
||||
this.loader = false;
|
||||
Swal('Update User');
|
||||
Swal('User Updated');
|
||||
this.router.navigate(['setting/users/userlist']);
|
||||
//this.shared.redirectTo('settings/userListing');
|
||||
delete this.AWS.localUserId;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user