Merge branch 'master' of bitbucket.org:venbainformationtechnology/appointments_frontend

This commit is contained in:
bitbucket 2023-04-17 15:20:19 +05:30
commit ba7cd1b284
6 changed files with 46 additions and 33 deletions

View File

@ -165,7 +165,7 @@ $tem-color : #217e69;
border: 1px solid #e8edef;
width: 89%;
background-color: #227f6e21;
// box-shadow: 0 2px 0 rgb(0 0 0 / 3%)
box-shadow: 0 2px 0 #00000008
}
.hoverButton{
background: $white;

View File

@ -25,8 +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">
<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', 'pattern')">Invalid Contact No </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="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>
<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 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>

View File

@ -51,26 +51,33 @@ export class AddBusinessComponent implements OnInit {
onSelectFile(event) {
console.log(event)
console.log(event.target.files[0])
if(event.target.files[0].size > 2097152){
this.notifierService.notify('warning', 'Image size is too Larger');
}else {
const file = event.target.files[0];
if(event != null){
this.imageViewStatus = true
}
this.form['value'].logo = [event.target.files[0]]
if (event.target.files && event.target.files[0]) {
var reader = new FileReader();
reader.readAsDataURL(event.target.files[0]);
reader.onload = (event) => {
this.url = event.target.result;
console.log(this.url)
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){
this.notifierService.notify('warning', 'Image size is too Larger');
}else {
const file = event.target.files[0];
if(event != null){
this.imageViewStatus = true
}
this.form['value'].logo = [event.target.files[0]]
if (event.target.files && event.target.files[0]) {
var reader = new FileReader();
reader.readAsDataURL(event.target.files[0]);
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=[];
this.formData.append('image', file, file.name);
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);
}
@ -83,14 +90,14 @@ export class AddBusinessComponent implements OnInit {
admin_checked: new FormControl('',null),
logo: new FormControl('', null),
busName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
address: new FormControl('', [Validators.required, Validators.maxLength(50)]),
city: new FormControl('', [Validators.required, Validators.maxLength(10)]),
state: new FormControl('', [Validators.required, Validators.maxLength(10)]),
busName: new FormControl('', [Validators.required]),
address: new FormControl('', [Validators.required, Validators.maxLength(100)]),
city: new FormControl('', [Validators.required]),
state: new FormControl('', [Validators.required]),
email: new FormControl('', [Validators.required, Validators.email,Validators.pattern(
'[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]),
});
@ -100,7 +107,7 @@ export class AddBusinessComponent implements OnInit {
public myError = (controlName: string, errorName: string) =>{
return this.form.controls[controlName].hasError(errorName);
}
submit(){
let tmp = this.form.value
tmp.id = this.local_data.id

View File

@ -52,7 +52,7 @@
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<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', 'pattern')">Invalid Contact No </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="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>
<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">
<input placeholder="ConfirmPassword" matInput formControlName="confirmPassword">
<mat-error *ngIf="myError('confirmPassword', 'required')">confirmPassword is required</mat-error>

View File

@ -50,8 +50,8 @@ export class AddUserComponent implements OnInit {
let userrole = localStorage.getItem('user_role')
this.form = new FormGroup({
businessselect: new FormControl('',[Validators.required]),
role: new FormControl('', [Validators.required, Validators.maxLength(20)]),
userName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
role: new FormControl('', [Validators.required]),
userName: new FormControl('', [Validators.required]),
// contactNo: new FormControl('', [Validators.required, Validators.maxLength(20)]),
contactNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10), Validators.pattern('^[0-9]{10}$')]),
// lastName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
@ -181,6 +181,8 @@ export class AddUserComponent implements OnInit {
onSelectFile(event) {
console.log(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){
this.notifierService.notify('warning', 'Image size is too Larger');
}else {
@ -200,6 +202,10 @@ export class AddUserComponent implements OnInit {
this.formData.append('image', 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)');
}
}

View File

@ -1,9 +1,10 @@
<ng-scrollbar class="scrollHV">
<mat-toolbar>
<span style="text-align: center;">Appointment</span>
<h3 style="margin-left:35% ;">{{busName}}</h3>
</mat-toolbar>
<ng-scrollbar class="scrollHV">
<div class="container mt-1">
<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">