Merge branch 'master' of bitbucket.org:venbainformationtechnology/appointments_frontend
This commit is contained in:
commit
ba7cd1b284
@ -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;
|
||||||
|
|||||||
@ -25,8 +25,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">
|
||||||
<mat-label>Phone No</mat-label>
|
<input type="number" placeholder="Phone No" matInput [(ngModel)]="local_data.contactNo" formControlName="contactNo">
|
||||||
<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', '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>
|
||||||
@ -60,7 +59,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,26 +51,33 @@ 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])
|
||||||
if(event.target.files[0].size > 2097152){
|
let fileType = event.target.files[0]
|
||||||
this.notifierService.notify('warning', 'Image size is too Larger');
|
if(fileType.type == 'image/png' || fileType.type == 'image/jpg' || fileType.type == 'image/jpeg'){
|
||||||
}else {
|
if(event.target.files[0].size > 2097152){
|
||||||
const file = event.target.files[0];
|
this.notifierService.notify('warning', 'Image size is too Larger');
|
||||||
if(event != null){
|
}else {
|
||||||
this.imageViewStatus = true
|
const file = event.target.files[0];
|
||||||
}
|
if(event != null){
|
||||||
this.form['value'].logo = [event.target.files[0]]
|
this.imageViewStatus = true
|
||||||
if (event.target.files && event.target.files[0]) {
|
}
|
||||||
var reader = new FileReader();
|
this.form['value'].logo = [event.target.files[0]]
|
||||||
reader.readAsDataURL(event.target.files[0]);
|
if (event.target.files && event.target.files[0]) {
|
||||||
reader.onload = (event) => {
|
var reader = new FileReader();
|
||||||
this.url = event.target.result;
|
reader.readAsDataURL(event.target.files[0]);
|
||||||
console.log(this.url)
|
reader.onload = (event) => {
|
||||||
|
this.url = event.target.result;
|
||||||
|
console.log(this.url)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// this.formData=[];
|
||||||
|
this.formData.append('image', file, file.name);
|
||||||
|
console.log(this.currentFileUpload)
|
||||||
}
|
}
|
||||||
// this.formData=[];
|
} else {
|
||||||
this.formData.append('image', file, file.name);
|
this.notifierService.notify('warning', 'Invalid File)');
|
||||||
console.log(this.currentFileUpload)
|
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,14 +90,14 @@ 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}$',
|
||||||
),]),
|
),]),
|
||||||
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}$')]),
|
||||||
createdBy:new FormControl(userrole,[Validators.required]),
|
createdBy:new FormControl(userrole,[Validators.required]),
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -100,7 +107,7 @@ export class AddBusinessComponent implements OnInit {
|
|||||||
public myError = (controlName: string, errorName: string) =>{
|
public myError = (controlName: string, errorName: string) =>{
|
||||||
return this.form.controls[controlName].hasError(errorName);
|
return this.form.controls[controlName].hasError(errorName);
|
||||||
}
|
}
|
||||||
|
|
||||||
submit(){
|
submit(){
|
||||||
let tmp = this.form.value
|
let tmp = this.form.value
|
||||||
tmp.id = this.local_data.id
|
tmp.id = this.local_data.id
|
||||||
|
|||||||
@ -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>
|
||||||
@ -80,7 +80,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>
|
||||||
|
|||||||
@ -50,8 +50,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)]),
|
||||||
@ -181,6 +181,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 {
|
||||||
@ -200,6 +202,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">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user