bug list all fix
This commit is contained in:
parent
9d3a83df3f
commit
9571d4c816
@ -7,20 +7,17 @@
|
||||
<mat-form-field appearance="outline" class="card-mat-pane">
|
||||
<mat-label>Name</mat-label>
|
||||
<input placeholder="Name" formControlName="name" matInput>
|
||||
<!-- <mat-error *ngIf="myError('cusName', 'required')">Name is required</mat-error>
|
||||
<mat-error *ngIf="myError('cusName', 'maxlength')">Limit exceed</mat-error> -->
|
||||
<mat-error *ngIf="myError('name', 'required')">Name is required</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" class="card-mat-pane">
|
||||
<mat-label>Email</mat-label>
|
||||
<input type="email" placeholder="Email" formControlName="email" matInput >
|
||||
<!-- <mat-error *ngIf="!form.get('email')?.errors?.required && (form.get('email')?.errors?.pattern)">
|
||||
Please enter a valid email address
|
||||
</mat-error>
|
||||
<mat-error *ngIf="myError('email', 'required')">email is required</mat-error>
|
||||
<mat-error *ngIf="form.get('email')?.invalid && (form.get('email')?.dirty || form.get('email')?.touched) && form.get('email')?.errors?.required">
|
||||
Email is required
|
||||
</mat-error> -->
|
||||
</mat-form-field>
|
||||
<mat-error *ngIf="myError('email', 'required')">Email is required</mat-error>
|
||||
<mat-error *ngIf="myError('email', 'email')">Invalid email format</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" class="card-mat-pane">
|
||||
<mat-label>Phone</mat-label>
|
||||
<input placeholder="Mobile No" type="text" appMobileNumberPattern maxlength="10" minlength="10" matInput formControlName="phoneNo">
|
||||
@ -33,7 +30,7 @@
|
||||
<div class="popup-button">
|
||||
<!-- <span class="buttons cancel" (click)="close()">Cancel</span> -->
|
||||
<button type="button"class="buttons cancel" (click)="close()" >Cancel</button>
|
||||
<button type="submit"class="buttons add">Save</button>
|
||||
<button type="submit"class="buttons add" [disabled]="submitDisabled">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</mat-card>
|
||||
@ -11,15 +11,19 @@ import { CustomersService } from 'app/appoinment/customers/customers-service/cus
|
||||
export class AppointmentAddcustomerComponent implements OnInit {
|
||||
form: FormGroup;
|
||||
@Output() childButtonEvent = new EventEmitter();
|
||||
submitDisabled: boolean = true;
|
||||
constructor(public _app:AppointmentsService,public _cus:CustomersService) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
ngOnInit(): void {
|
||||
|
||||
this.form = new FormGroup({
|
||||
name: new FormControl('', [Validators.required]),
|
||||
email: new FormControl('', [Validators.required]),
|
||||
phoneNo: new FormControl('', [Validators.required,Validators.minLength(10),Validators.maxLength(10)]),
|
||||
|
||||
|
||||
email: new FormControl('', [Validators.required, Validators.email]),
|
||||
phoneNo: new FormControl('', [Validators.required, Validators.minLength(10), Validators.maxLength(10)]),
|
||||
});
|
||||
|
||||
this.form.valueChanges.subscribe(() => {
|
||||
this.submitDisabled = !this.form.valid;
|
||||
});
|
||||
}
|
||||
public myError = (controlName: string, errorName: string) =>{
|
||||
|
||||
@ -147,10 +147,13 @@
|
||||
</mat-form-field>
|
||||
|
||||
<div style="margin-top: 5px;margin-bottom: 15px;">
|
||||
<div><mat-label>Payment Status</mat-label></div>
|
||||
<mat-radio-group aria-label="Select an option" formControlName="paymentStatus" required>
|
||||
<mat-radio-button value="0">Paid</mat-radio-button>
|
||||
<mat-radio-button value="1" style="margin-left: 10px;">Not Paid</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
<mat-error *ngIf="form.get('paymentStatus').hasError('required')">Payment status is required</mat-error>
|
||||
<!-- <mat-error *ngIf="paymentStatus.hasError('invalidValue')">Please choose any other</mat-error> -->
|
||||
</div>
|
||||
|
||||
<mat-form-field appearance="outline" class="mat-pane" *ngIf="form.get('paymentStatus').value == 0">
|
||||
@ -160,7 +163,8 @@
|
||||
<mat-option value="UPI">UPI</mat-option>
|
||||
<mat-option value="Card">Card</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-error *ngIf="form.get('paymentMode').hasError('required')">Payment mode is required</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- <div class="notes">
|
||||
<input type="checkbox" id="scales" name="scales" checked>
|
||||
<label for="scales">Send notifications for customer</label>
|
||||
|
||||
@ -437,19 +437,20 @@ export class DialogBoxComponent implements OnInit {
|
||||
// console.log(this.form.value,this.slotsResult,this.days[this.clicks]);
|
||||
// if(this.slotsResult == undefined){
|
||||
// }
|
||||
if(this.form.value.paymentStatus == 0){
|
||||
// console.log('paymentmode')
|
||||
if(this.form.value.paymentStatus == 1){
|
||||
console.log('paymentmode')
|
||||
this.form.controls['paymentMode'].clearValidators();
|
||||
this.form.controls['paymentMode'].updateValueAndValidity();
|
||||
}
|
||||
if(this.slotsResult.length == 0){
|
||||
// console.log(this.slotsResult.length == 0)
|
||||
console.log(this.slotsResult.length == 0)
|
||||
this.notifierService.notify('warning', 'Please Select Slots');
|
||||
this.form.controls['appoinmentSlots'].clearValidators();
|
||||
this.form.controls['appoinmentSlots'].updateValueAndValidity();
|
||||
}else {
|
||||
if (!this.form.valid) {
|
||||
return;
|
||||
this.notifierService.notify('warning', 'Please Fill all the Fields');
|
||||
return;
|
||||
}
|
||||
|
||||
this.isSubmitting = true;
|
||||
|
||||
@ -51,12 +51,12 @@
|
||||
id="country"
|
||||
formControlName="country" noEntriesFoundLabel="'no matching country found'" #singleSelect>
|
||||
<mat-option>
|
||||
<ngx-mat-select-search [formControl]="countrySearchCtrl" ></ngx-mat-select-search>
|
||||
<ngx-mat-select-search [formControl]="countrySearchCtrl" placeholderLabel="Search Country"></ngx-mat-select-search>
|
||||
</mat-option>
|
||||
<mat-option *ngFor="let country of filteredCountries | async" (click)="countryname(country)" [value]="country.name"> {{ country.flag }} {{ country.name }}</mat-option>
|
||||
<mat-option value="invalid">Invalid option</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="myError('country', 'required')">Country is required</mat-error>
|
||||
<mat-error *ngIf="form.get('country').hasError('required')">Country is required</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field appearance="outline" class="mat-pane" *ngIf="action != 'Delete'; else elseTemplate" >
|
||||
@ -64,29 +64,29 @@
|
||||
<mat-select #state
|
||||
name="state"
|
||||
id="state"
|
||||
formControlName="state" #singleSelect>
|
||||
formControlName="state" #singleSelect required>
|
||||
<mat-option>
|
||||
<ngx-mat-select-search [formControl]="stateSearchCtrl" ></ngx-mat-select-search>
|
||||
<ngx-mat-select-search [formControl]="stateSearchCtrl" placeholderLabel="Search State"></ngx-mat-select-search>
|
||||
</mat-option>
|
||||
<!-- <mat-option [value]="null">-- Select Your State --</mat-option> -->
|
||||
<mat-option *ngFor="let state of filteredStates | async" (click)="statename(state)" [value]="state.name"> {{ state.name }}</mat-option>
|
||||
<mat-option value="invalid">Invalid option</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="myError('state', 'required')">State is required</mat-error>
|
||||
<mat-error *ngIf="form.get('state').hasError('required')">Country is required</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" class="mat-pane" *ngIf="action != 'Delete'; else elseTemplate" >
|
||||
<mat-label>City</mat-label>
|
||||
<mat-select #city
|
||||
name="city"
|
||||
id="city"
|
||||
formControlName="city" #singleSelect>
|
||||
formControlName="city" #singleSelect required>
|
||||
<mat-option>
|
||||
<ngx-mat-select-search [formControl]="citySearchCtrl" ></ngx-mat-select-search>
|
||||
<ngx-mat-select-search [formControl]="citySearchCtrl" placeholderLabel="Search City"></ngx-mat-select-search>
|
||||
</mat-option>
|
||||
<mat-option *ngFor="let city of filteredCities | async" (click)="cityname(city)" [value]="city.name"> {{ city.name }}</mat-option>
|
||||
<mat-option value="invalid">Invalid option</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="myError('city', 'required')">City is required</mat-error>
|
||||
<mat-error *ngIf="form.get('city').hasError('required')">Country is required</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- <mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
|
||||
<mat-label>State</mat-label>
|
||||
@ -102,7 +102,7 @@
|
||||
</mat-form-field> -->
|
||||
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
|
||||
<mat-label>Type Of Currency</mat-label>
|
||||
<input placeholder="Type Of Currency" matInput [(ngModel)]="local_data.currency" formControlName="currency">
|
||||
<input placeholder="Type Of Currency" matInput [(ngModel)]="local_data.currency" formControlName="currency" readonly>
|
||||
<mat-error *ngIf="myError('currency', 'required')">currency is required</mat-error>
|
||||
<!-- <mat-error *ngIf="myError('currency', 'maxlength')">Limit exceed</mat-error> -->
|
||||
</mat-form-field>
|
||||
|
||||
@ -76,6 +76,7 @@ export class AddBusinessComponent implements OnInit {
|
||||
console.log(this.local_data)
|
||||
this.action = this.local_data.action;
|
||||
this.formData= new FormData();
|
||||
console.log(this.action)
|
||||
|
||||
|
||||
|
||||
@ -185,16 +186,17 @@ export class AddBusinessComponent implements OnInit {
|
||||
// }
|
||||
|
||||
|
||||
let valData;
|
||||
if(this.action == 'Add'){
|
||||
valData= [this.validateUsernameAvailability.bind(this)]
|
||||
}else{
|
||||
valData = null
|
||||
}
|
||||
// let valData;
|
||||
// if(this.action == 'Add'){
|
||||
// valData= [this.validateUsernameAvailability.bind(this)]
|
||||
// }else{
|
||||
// valData = null
|
||||
// }
|
||||
let valData = [this.validateUsernameAvailability.bind(this)]
|
||||
let userrole = localStorage.getItem('user_role')
|
||||
this.form = new FormGroup({
|
||||
admin_checked: new FormControl('',null),
|
||||
logo: new FormControl('', null),
|
||||
logo: new FormControl('', [Validators.required]),
|
||||
busName: new FormControl('', [Validators.required]),
|
||||
address: new FormControl('', [Validators.required, Validators.maxLength(100)]),
|
||||
city: new FormControl('', [Validators.required]),
|
||||
@ -270,13 +272,24 @@ export class AddBusinessComponent implements OnInit {
|
||||
return this.http.get<any[]>(this.apiUrl + "businessDetailList")
|
||||
.pipe(
|
||||
map((response:any) => {
|
||||
|
||||
console.log(response)
|
||||
let response1 = response.data
|
||||
let apiList
|
||||
if(this.action == 'Add'){
|
||||
console.log('add')
|
||||
apiList = response.data
|
||||
}else{
|
||||
console.log('edit',this.local_data.busId)
|
||||
let listData = response.data
|
||||
const newArray = listData.filter(item => item.busId !== this.local_data.busId);
|
||||
console.log(newArray)
|
||||
apiList = newArray
|
||||
}
|
||||
|
||||
// console.log(response)
|
||||
let response1 = apiList
|
||||
let tmp=[];
|
||||
if(response1 instanceof Array){
|
||||
|
||||
response.data.forEach(element => {
|
||||
apiList.forEach(element => {
|
||||
tmp.push(element.email)
|
||||
});
|
||||
console.log(tmp,`${control.value}`);
|
||||
@ -293,9 +306,15 @@ export class AddBusinessComponent implements OnInit {
|
||||
let tmp = this.form.value
|
||||
tmp.id = this.local_data.id
|
||||
console.log(tmp,this.form)
|
||||
|
||||
if(this.action == 'Update'){
|
||||
this.form.controls['admin_checked'].clearValidators();
|
||||
this.form.controls['admin_checked'].updateValueAndValidity();
|
||||
|
||||
console.log(this.form.value)
|
||||
}
|
||||
if (!this.form.valid) {
|
||||
console.log("check")
|
||||
this.notifierService.notify('warning', 'Please fill all the fields');
|
||||
return;
|
||||
}
|
||||
this.isSubmitting = true
|
||||
@ -343,6 +362,10 @@ export class AddBusinessComponent implements OnInit {
|
||||
this.form.controls['currency'].setValue(country.currency)
|
||||
|
||||
this.selectedCountry = country;
|
||||
// if(this.action == 'Update'){
|
||||
this.form.controls['state'].setValue('')
|
||||
this.form.controls['city'].setValue('')
|
||||
// }
|
||||
this.cities = this.selectedState = this.selectedCity = null;
|
||||
}
|
||||
|
||||
|
||||
@ -101,10 +101,13 @@
|
||||
</mat-expansion-panel> -->
|
||||
</mat-accordion>
|
||||
|
||||
<mat-card-content *ngIf="recordStatus">
|
||||
<h5 align="center" style="font-weight: bold;
|
||||
color: brown;">No Data Available</h5>
|
||||
</mat-card-content>
|
||||
<!-- Show "No Data Available" or "No matching data found" text -->
|
||||
<mat-card-content *ngIf="recordStatus && businessListSource.filteredData.length === 0">
|
||||
<h5 align="center" style="font-weight: bold; color: brown;">No Data Available</h5>
|
||||
</mat-card-content>
|
||||
<mat-card-content *ngIf="!recordStatus && businessListSource.filteredData.length === 0">
|
||||
<h5 align="center" style="font-weight: bold; color: brown;">No matching data found</h5>
|
||||
</mat-card-content>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -54,6 +54,11 @@ export class BusinessListComponent implements OnInit {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.businessListSource.filter = filterValue;
|
||||
this.checkRecordStatus();
|
||||
}
|
||||
|
||||
checkRecordStatus() {
|
||||
this.recordStatus = this.businessListSource.filteredData.length === 0;
|
||||
}
|
||||
|
||||
isactive(value: any) {
|
||||
@ -127,6 +132,7 @@ export class BusinessListComponent implements OnInit {
|
||||
}
|
||||
console.log(this.businessListSource)
|
||||
// this.recordStatus=false;
|
||||
this.checkRecordStatus();
|
||||
}
|
||||
else{
|
||||
this.isLoading = false
|
||||
@ -134,6 +140,7 @@ export class BusinessListComponent implements OnInit {
|
||||
this.businessList=[];
|
||||
this.businessListLength= null;
|
||||
this.recordStatus=true;
|
||||
this.checkRecordStatus();
|
||||
}
|
||||
}, error => this.isLoading = false);
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import { NgScrollbarModule } from 'ngx-scrollbar';
|
||||
import { AddBusinessComponent } from './add-business/add-business.component';
|
||||
import { NotifierModule, NotifierOptions } from 'angular-notifier';
|
||||
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
|
||||
const customNotifierOptions: NotifierOptions = {
|
||||
@ -61,6 +62,7 @@ const customNotifierOptions: NotifierOptions = {
|
||||
|
||||
],
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
DemoMaterialModule,
|
||||
CommonModule,
|
||||
BusinessRoutingModule,
|
||||
|
||||
@ -149,10 +149,12 @@
|
||||
</mat-expansion-panel> -->
|
||||
</mat-accordion>
|
||||
|
||||
<mat-card-content *ngIf="recordStatus">
|
||||
<h5 align="center" style="font-weight: bold;
|
||||
color: brown;">No Data Available</h5>
|
||||
</mat-card-content>
|
||||
<mat-card-content *ngIf="recordStatus && usersList.filteredData.length === 0">
|
||||
<h5 align="center" style="font-weight: bold; color: brown;">No Data Available</h5>
|
||||
</mat-card-content>
|
||||
<mat-card-content *ngIf="!recordStatus && usersList.filteredData.length === 0">
|
||||
<h5 align="center" style="font-weight: bold; color: brown;">No matching data found</h5>
|
||||
</mat-card-content>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -97,7 +97,12 @@ export class UserListComponent implements OnInit {
|
||||
this.usersList.filter = filterValue;
|
||||
console.log(this.usersList)
|
||||
|
||||
}
|
||||
this.checkRecordStatus();
|
||||
}
|
||||
|
||||
checkRecordStatus() {
|
||||
this.recordStatus = this.usersList.filteredData.length === 0;
|
||||
}
|
||||
|
||||
isactive(value: any) {
|
||||
console.log(value)
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- <button class="mt-2 mb-1" [disabled]="!loginForm.valid" mat-raised-button color="primary" mat-button>Sign In</button> -->
|
||||
<button class="mt-2 mb-1" mat-raised-button color="primary" mat-button>Sign In</button>
|
||||
<button class="mt-2 mb-1" mat-raised-button color="primary" [disabled]="!loginForm.valid || isFormEmpty()" mat-button>Sign In</button>
|
||||
<a class="mat-text-warn mb-0" (click)="openForgot()">Forgot password?</a>
|
||||
<!-- <p class="mb-0">Don't have an account? <a [routerLink]="['/authentication/register']" class="mat-text-primary">Register Here</a></p> -->
|
||||
</div>
|
||||
|
||||
@ -145,6 +145,12 @@ export class LoginComponent {
|
||||
this.router.navigate(['authentication/forgot-password'])
|
||||
// this.router.navigate(['/home'])
|
||||
}
|
||||
|
||||
isFormEmpty(): boolean {
|
||||
const email = this.loginForm.get('email').value;
|
||||
const password = this.loginForm.get('password').value;
|
||||
return !email && !password;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -7,8 +7,8 @@ export const environment = {
|
||||
production: false,
|
||||
environmentName: 'Testing Environment',//Localhost Environment.
|
||||
// apiEndpoint:'http://venbainfotech.com:5000/api/',
|
||||
apiEndpoint:'http://192.168.1.29:8080/api/',
|
||||
// apiEndpoint:'https://dev.venbait.in/appointments/api/',
|
||||
// apiEndpoint:'http://192.168.1.29:8080/api/',
|
||||
apiEndpoint:'https://dev.venbait.in/appointments/api/',
|
||||
|
||||
//EndUser URL
|
||||
endUserUrl: window.location.origin+'/#/booking/',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user