business and user image validation
This commit is contained in:
parent
f2eed58e5e
commit
898b45a411
@ -165,7 +165,7 @@ $tem-color : #217e69;
|
|||||||
border: 1px solid #e8edef;
|
border: 1px solid #e8edef;
|
||||||
width: 89%;
|
width: 89%;
|
||||||
background-color: #227f6e21;
|
background-color: #227f6e21;
|
||||||
box-shadow: 0 2px 0 rgb(0 0 0 / 3%)
|
box-shadow: 0 2px 0 #00000008
|
||||||
}
|
}
|
||||||
.hoverButton{
|
.hoverButton{
|
||||||
background: $white;
|
background: $white;
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</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">
|
||||||
<input placeholder="Phone No" matInput [(ngModel)]="local_data.contactNo" formControlName="contactNo">
|
<input type="number" 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', 'required')">Contact No is required</mat-error>
|
||||||
<mat-error *ngIf="myError('contactNo', 'pattern')">Invalid Contact No </mat-error>
|
<mat-error *ngIf="myError('contactNo', 'pattern')">Invalid Contact No </mat-error>
|
||||||
<mat-error *ngIf="myError('contactNo', 'minlength')"> Contact No must be at least 10 characters</mat-error>
|
<mat-error *ngIf="myError('contactNo', 'minlength')"> Contact No must be at least 10 characters</mat-error>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
<img *ngIf="action == 'Update' && imageViewStatus != true" class="image mb-2" [src]="image_view(local_data.logo)" height="150" width="150"/>
|
<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/>
|
<img *ngIf="imageViewStatus == true" class="image mb-2" [src]="url" height="150" width="150"><br/>
|
||||||
<input type='file'accept="image/*" data-max-size="2048" style="width: 50%;" (change)="onSelectFile($event)" formControlName="logo"><br>
|
<input type='file'accept="image/*" data-max-size="2048" style="width: 50%;" (change)="onSelectFile($event)" formControlName="logo"><br>
|
||||||
<span *ngIf="imageViewStatus != true" class="imgSizeValidation">Upload Below 2MB </span>
|
<span *ngIf="imageViewStatus != true" class="imgSizeValidation">Upload Below 2MB <br> Supported File (jpg,jpeg anf png)</span>
|
||||||
</div>
|
</div>
|
||||||
<div fxFlex.xs="30" fxFlex.sm="30" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" fxLayoutAlign="start end">
|
<div fxFlex.xs="30" fxFlex.sm="30" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" fxLayoutAlign="start end">
|
||||||
<mat-checkbox *ngIf="action != 'Update'" class="example-margin mt-2" formControlName="admin_checked" (change)="showOptions($event)">Add Admin</mat-checkbox>
|
<mat-checkbox *ngIf="action != 'Update'" class="example-margin mt-2" formControlName="admin_checked" (change)="showOptions($event)">Add Admin</mat-checkbox>
|
||||||
|
|||||||
@ -51,6 +51,8 @@ export class AddBusinessComponent implements OnInit {
|
|||||||
onSelectFile(event) {
|
onSelectFile(event) {
|
||||||
console.log(event)
|
console.log(event)
|
||||||
console.log(event.target.files[0])
|
console.log(event.target.files[0])
|
||||||
|
let fileType = event.target.files[0]
|
||||||
|
if(fileType.type == 'image/png' || fileType.type == 'image/jpg' || fileType.type == 'image/jpeg'){
|
||||||
if(event.target.files[0].size > 2097152){
|
if(event.target.files[0].size > 2097152){
|
||||||
this.notifierService.notify('warning', 'Image size is too Larger');
|
this.notifierService.notify('warning', 'Image size is too Larger');
|
||||||
}else {
|
}else {
|
||||||
@ -71,6 +73,11 @@ export class AddBusinessComponent implements OnInit {
|
|||||||
this.formData.append('image', file, file.name);
|
this.formData.append('image', file, file.name);
|
||||||
console.log(this.currentFileUpload)
|
console.log(this.currentFileUpload)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.notifierService.notify('warning', 'Invalid File)');
|
||||||
|
this.notifierService.notify('warning', 'Upload Supported File Like (png,jpg and jpeg)');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// this.formData.append('file', file, file.name);
|
// this.formData.append('file', file, file.name);
|
||||||
}
|
}
|
||||||
@ -83,10 +90,10 @@ export class AddBusinessComponent implements OnInit {
|
|||||||
admin_checked: new FormControl('',null),
|
admin_checked: new FormControl('',null),
|
||||||
|
|
||||||
logo: new FormControl('', null),
|
logo: new FormControl('', null),
|
||||||
busName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
busName: new FormControl('', [Validators.required]),
|
||||||
address: new FormControl('', [Validators.required, Validators.maxLength(50)]),
|
address: new FormControl('', [Validators.required, Validators.maxLength(100)]),
|
||||||
city: new FormControl('', [Validators.required, Validators.maxLength(10)]),
|
city: new FormControl('', [Validators.required]),
|
||||||
state: new FormControl('', [Validators.required, Validators.maxLength(10)]),
|
state: new FormControl('', [Validators.required]),
|
||||||
email: new FormControl('', [Validators.required, Validators.email,Validators.pattern(
|
email: new FormControl('', [Validators.required, Validators.email,Validators.pattern(
|
||||||
'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$',
|
'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$',
|
||||||
),]),
|
),]),
|
||||||
|
|||||||
@ -52,7 +52,7 @@
|
|||||||
</mat-form-field>
|
</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>Phone No</mat-label>
|
<mat-label>Phone No</mat-label>
|
||||||
<input matInput placeholder="Enter Phone No" formControlName="contactNo" id="contactNo">
|
<input matInput type="number" placeholder="Enter Phone No" formControlName="contactNo" id="contactNo">
|
||||||
<mat-error *ngIf="myError('contactNo', 'required')">Contact No is required</mat-error>
|
<mat-error *ngIf="myError('contactNo', 'required')">Contact No is required</mat-error>
|
||||||
<mat-error *ngIf="myError('contactNo', 'pattern')">Invalid Contact No </mat-error>
|
<mat-error *ngIf="myError('contactNo', 'pattern')">Invalid Contact No </mat-error>
|
||||||
<mat-error *ngIf="myError('contactNo', 'minlength')"> Contact No must be at least 10 characters</mat-error>
|
<mat-error *ngIf="myError('contactNo', 'minlength')"> Contact No must be at least 10 characters</mat-error>
|
||||||
@ -68,7 +68,7 @@
|
|||||||
<img *ngIf="action == 'Update' && imageViewStatus != true" class="image mb-2" [src]="image_view(local_data.logo)" height="150" width="150"/>
|
<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/>
|
<img *ngIf="imageViewStatus == true" class="image mb-2" [src]="url" height="150" width="150"><br/>
|
||||||
<input type='file'accept="image/*" data-max-size="2048" style="width: 33%;" (change)="onSelectFile($event)" formControlName="logo"><br>
|
<input type='file'accept="image/*" data-max-size="2048" style="width: 33%;" (change)="onSelectFile($event)" formControlName="logo"><br>
|
||||||
<span *ngIf="imageViewStatus != true" class="imgSizeValidation">Upload Below 2MB </span>
|
<span *ngIf="imageViewStatus != true" class="imgSizeValidation">Upload Below 2MB <br> Supported File (jpg,jpeg anf png)</span>
|
||||||
<!-- <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">
|
||||||
<input placeholder="ConfirmPassword" matInput formControlName="confirmPassword">
|
<input placeholder="ConfirmPassword" matInput formControlName="confirmPassword">
|
||||||
<mat-error *ngIf="myError('confirmPassword', 'required')">confirmPassword is required</mat-error>
|
<mat-error *ngIf="myError('confirmPassword', 'required')">confirmPassword is required</mat-error>
|
||||||
|
|||||||
@ -48,8 +48,8 @@ export class AddUserComponent implements OnInit {
|
|||||||
let userrole = localStorage.getItem('user_role')
|
let userrole = localStorage.getItem('user_role')
|
||||||
this.form = new FormGroup({
|
this.form = new FormGroup({
|
||||||
businessselect: new FormControl('',[Validators.required]),
|
businessselect: new FormControl('',[Validators.required]),
|
||||||
role: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
role: new FormControl('', [Validators.required]),
|
||||||
userName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
userName: new FormControl('', [Validators.required]),
|
||||||
// contactNo: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
// contactNo: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
||||||
contactNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10), Validators.pattern('^[0-9]{10}$')]),
|
contactNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10), Validators.pattern('^[0-9]{10}$')]),
|
||||||
// lastName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
// lastName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
||||||
@ -172,6 +172,8 @@ export class AddUserComponent implements OnInit {
|
|||||||
onSelectFile(event) {
|
onSelectFile(event) {
|
||||||
console.log(event.target.files[0])
|
console.log(event.target.files[0])
|
||||||
const file = event.target.files[0];
|
const file = event.target.files[0];
|
||||||
|
let fileType = event.target.files[0]
|
||||||
|
if(fileType.type == 'image/png' || fileType.type == 'image/jpg' || fileType.type == 'image/jpeg'){
|
||||||
if(event.target.files[0].size > 2097152){
|
if(event.target.files[0].size > 2097152){
|
||||||
this.notifierService.notify('warning', 'Image size is too Larger');
|
this.notifierService.notify('warning', 'Image size is too Larger');
|
||||||
}else {
|
}else {
|
||||||
@ -191,6 +193,10 @@ export class AddUserComponent implements OnInit {
|
|||||||
this.formData.append('image', file, file.name);
|
this.formData.append('image', file, file.name);
|
||||||
// this.formData.append('file', file, file.name);
|
// this.formData.append('file', file, file.name);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.notifierService.notify('warning', 'Invalid File)');
|
||||||
|
this.notifierService.notify('warning', 'Upload Supported File Like (png,jpg and jpeg)');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
|
|
||||||
<ng-scrollbar class="scrollHV">
|
|
||||||
<mat-toolbar>
|
<mat-toolbar>
|
||||||
<span style="text-align: center;">Appointment</span>
|
<span style="text-align: center;">Appointment</span>
|
||||||
<h3 style="margin-left:35% ;">{{busName}}</h3>
|
<h3 style="margin-left:35% ;">{{busName}}</h3>
|
||||||
</mat-toolbar>
|
</mat-toolbar>
|
||||||
|
<ng-scrollbar class="scrollHV">
|
||||||
<div class="container mt-1">
|
<div class="container mt-1">
|
||||||
<div fxLayout="row wrap" fxLayoutAlign="center">
|
<div fxLayout="row wrap" fxLayoutAlign="center">
|
||||||
<div class="column mat-width" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
|
<div class="column mat-width" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
|
||||||
|
|||||||
@ -10,7 +10,7 @@ export const environment = {
|
|||||||
// apiEndpoint:'http://192.168.1.20:8080/api/',
|
// apiEndpoint:'http://192.168.1.20:8080/api/',
|
||||||
// apiEndpoint:'https://api.venbait.in/api/',
|
// apiEndpoint:'https://api.venbait.in/api/',
|
||||||
// apiEndpoint:'http://venbainfotech.com:5000/api/',
|
// apiEndpoint:'http://venbainfotech.com:5000/api/',
|
||||||
apiEndpoint:'http://192.168.1.3:8080/api/',
|
apiEndpoint:'http://192.168.1.4:8080/api/',
|
||||||
// apiEndpoint:'https://api.venbait.in/api/',
|
// apiEndpoint:'https://api.venbait.in/api/',
|
||||||
|
|
||||||
//EndUser URL
|
//EndUser URL
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user