diff --git a/ng-seed/Appointmnet_Frontend_Build.zip b/ng-seed/Appointmnet_Frontend_Build.zip deleted file mode 100644 index 9c88825..0000000 Binary files a/ng-seed/Appointmnet_Frontend_Build.zip and /dev/null differ diff --git a/ng-seed/package-lock.json b/ng-seed/package-lock.json index 26dd290..0da0018 100644 --- a/ng-seed/package-lock.json +++ b/ng-seed/package-lock.json @@ -9904,6 +9904,21 @@ "tslib": "^2.0.0" } }, + "ngx-mat-select-search": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/ngx-mat-select-search/-/ngx-mat-select-search-3.3.1.tgz", + "integrity": "sha512-U8CnG0ER/Z4WLcvucvzurBHg+WY3Dfr7HCwqSWv3nKG95dXrWCdCG1y34/uCRvv/CPwi7NoS1EoBXA/CNYuCNw==", + "requires": { + "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, "ngx-perfect-scrollbar": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/ngx-perfect-scrollbar/-/ngx-perfect-scrollbar-10.1.0.tgz", diff --git a/ng-seed/package.json b/ng-seed/package.json index 8e3ce61..69de18a 100644 --- a/ng-seed/package.json +++ b/ng-seed/package.json @@ -56,6 +56,7 @@ "ngx-bootstrap": "^10.2.0", "ngx-color-picker": "^11.0.0", "ngx-daterangepicker-material": "^5.0.1", + "ngx-mat-select-search": "^3.3.1", "ngx-perfect-scrollbar": "10.1.0", "ngx-scrollbar": "^7.5.6", "ngx-sortablejs": "^3.1.4", diff --git a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html index 3ff7622..8199617 100644 --- a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html +++ b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html @@ -63,7 +63,7 @@ --> Payment Status - {{row.paymentStatus == 1 ? 'Paid' : 'Not Paid'}} + {{row.paymentStatus == 0 ? 'Paid' : 'Not Paid'}} diff --git a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html index 98fd5da..0d0282b 100644 --- a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html +++ b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html @@ -148,12 +148,12 @@
- Paid - Not Paid + Paid + Not Paid
- + Payment Mode Cash diff --git a/ng-seed/src/app/appoinment/business/add-business/add-business.component.html b/ng-seed/src/app/appoinment/business/add-business/add-business.component.html index 906a667..9320124 100644 --- a/ng-seed/src/app/appoinment/business/add-business/add-business.component.html +++ b/ng-seed/src/app/appoinment/business/add-business/add-business.component.html @@ -49,11 +49,11 @@ + formControlName="country" noEntriesFoundLabel="'no matching country found'" #singleSelect> - - - {{ country.flag }}   {{ country.name }} + + + {{ country.flag }}   {{ country.name }} Invalid option Country is required @@ -64,9 +64,12 @@ - -- Select Your State -- - {{ state.name }} + formControlName="state" #singleSelect> + + + + + {{ state.name }} Invalid option State is required @@ -76,9 +79,11 @@ - -- Select Your City -- - {{ city.name }} + formControlName="city" #singleSelect> + + + + {{ city.name }} Invalid option City is required diff --git a/ng-seed/src/app/appoinment/business/add-business/add-business.component.ts b/ng-seed/src/app/appoinment/business/add-business/add-business.component.ts index f3b26cc..53a0515 100644 --- a/ng-seed/src/app/appoinment/business/add-business/add-business.component.ts +++ b/ng-seed/src/app/appoinment/business/add-business/add-business.component.ts @@ -9,10 +9,26 @@ import { NotifierService } from 'angular-notifier'; import { environment } from 'environments/environment'; import { map } from 'rxjs/internal/operators/map'; import { Country, State, City } from 'country-state-city'; +import { ReplaySubject, Subject } from 'rxjs'; +import { MatSelect } from '@angular/material/select'; +import { take, takeUntil } from 'rxjs/operators'; export interface UsersData { name: string; id: number; } +export interface countriesName { + name: string; + isoCode: string; +} +export interface statesName { + name: string; + stateCode: string; +} +export interface cityName { + name: string; + cityCode: string; +} + @Component({ selector: 'app-add-business', @@ -43,7 +59,15 @@ export class AddBusinessComponent implements OnInit { currentFileUpload: any; countryevent:any=[]; isSubmitting: boolean = false; - private apiUrl = environment.apiEndpoint; + private apiUrl = environment.apiEndpoint; + public countrySearchCtrl: FormControl = new FormControl(); + public filteredCountries: ReplaySubject = new ReplaySubject(1); + public stateSearchCtrl: FormControl = new FormControl(); + public filteredStates: ReplaySubject = new ReplaySubject(1); + public citySearchCtrl: FormControl = new FormControl(); + public filteredCities: ReplaySubject = new ReplaySubject(1); + protected _onDestroy = new Subject(); + @ViewChild('singleSelect') singleSelect: MatSelect; constructor(private http: HttpClient,private notifierService: NotifierService,private router: Router,private formBuilder: FormBuilder, public dialogRef: MatDialogRef, @Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData) { @@ -52,6 +76,9 @@ export class AddBusinessComponent implements OnInit { console.log(this.local_data) this.action = this.local_data.action; this.formData= new FormData(); + + + } get f(){ return this.form.controls; @@ -142,6 +169,22 @@ export class AddBusinessComponent implements OnInit { this.dialogRef.close(); } ngOnInit() { + console.log(this.countries) + // this.filteredCountryList.next(this.countries.slice()); + + this.filteredCountries.next(this.countries.slice()); + + // listen for search field value changes + this.countrySearchCtrl.valueChanges + .pipe(takeUntil(this._onDestroy)) + .subscribe(() => { + this.filterCountries(); + }); + // if(this.countries.length != 0){ + + // } + + let valData; if(this.action == 'Add'){ valData= [this.validateUsernameAvailability.bind(this)] @@ -216,6 +259,7 @@ export class AddBusinessComponent implements OnInit { this.form.patchValue(this.local_data) + // this.filterList() } public myError = (controlName: string, errorName: string) =>{ @@ -289,6 +333,13 @@ export class AddBusinessComponent implements OnInit { this.countryevent = country this.states = State.getStatesOfCountry(country.isoCode); console.log(country) + console.log(this.states) + this.filteredStates.next(this.states.slice()); + this.stateSearchCtrl.valueChanges + .pipe(takeUntil(this._onDestroy)) + .subscribe(() => { + this.filterStates(); + }); this.form.controls['currency'].setValue(country.currency) this.selectedCountry = country; @@ -299,7 +350,13 @@ export class AddBusinessComponent implements OnInit { // console.log($event,$event.value) this.cities = City.getCitiesOfState( this.countryevent.isoCode, state.isoCode) console.log(this.cities) - this.selectedState = state; + this.filteredCities.next(this.cities.slice()); + this.citySearchCtrl.valueChanges + .pipe(takeUntil(this._onDestroy)) + .subscribe(() => { + this.filterCity(); + }); + this.selectedState = state; // this.selectedCity = null; } @@ -308,4 +365,103 @@ export class AddBusinessComponent implements OnInit { this.selectedCity = city } + // filterList() { + // console.log(this.countries) + // this.countrySearchCtrl.valueChanges.pipe().subscribe(()=>{ + // this.applyFilter(this.countrySearchCtrl.value,this.filteredCountryList,this.countries,'name') + // }) + // this.stateSearchCtrl.valueChanges.pipe().subscribe(()=>{ + // this.applyFilter(this.stateSearchCtrl.value,this.filteredStateList,this.states.name,'name') + // }) + // // this.branchFilterCtrl.valueChanges.pipe().subscribe(()=>{ + // // this.applyFilter(this.branchFilterCtrl.value,this.filteredBranchList,this.lenderBranchList,'branch_name') + // // }) + + + // } + + // applyFilter(filtered_text,filter_list,raw_list,obj_name) { + // if (!raw_list) { + // return; + // } + // // get the search keyword + // let search = filtered_text; + // if (!search) { + // filter_list.next(raw_list.slice()); + // return; + // } else { + // search = search.toLowerCase(); + // } + // // filter the banks + // filter_list.next( + // raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1) + // ); + // } + + /** + * Sets the initial value after the filteredCountries are loaded initially + */ + protected setInitialValue() { + this.filteredCountries.pipe(take(1),takeUntil(this._onDestroy)).subscribe(() => { + this.singleSelect.compareWith = (a:countriesName, b: countriesName) => a && b && a.isoCode === b.isoCode; + }); + this.filteredStates.pipe(take(1),takeUntil(this._onDestroy)).subscribe(() => { + this.singleSelect.compareWith = (a:statesName, b: statesName) => a && b && a.stateCode === b.stateCode; + }); + this.filteredCities.pipe(take(1),takeUntil(this._onDestroy)).subscribe(() => { + this.singleSelect.compareWith = (a:cityName, b: cityName) => a && b && a.cityCode === b.cityCode; + }); + } + + protected filterCountries() { + if (!this.countries) { + return; + } + // get the search keyword + let search = this.countrySearchCtrl.value; + if (!search) { + this.filteredCountries.next(this.countries.slice()); + return; + } else { + search = search.toLowerCase(); + } + // filter the banks + this.filteredCountries.next(this.countries.filter(val => val.name.toLowerCase().indexOf(search) > -1) + ); + } + + protected filterStates(){ + if (!this.states) { + return; + } + // get the search keyword + let search = this.stateSearchCtrl.value; + if (!search) { + this.filteredStates.next(this.states.slice()); + return; + } else { + search = search.toLowerCase(); + } + // filter the banks + this.filteredStates.next(this.states.filter(val => val.name.toLowerCase().indexOf(search) > -1) + ); + } + + protected filterCity(){ + if (!this.cities) { + return; + } + // get the search keyword + let search = this.citySearchCtrl.value; + if (!search) { + this.filteredCities.next(this.cities.slice()); + return; + } else { + search = search.toLowerCase(); + } + // filter the banks + this.filteredCities.next(this.cities.filter(val => val.name.toLowerCase().indexOf(search) > -1) + ); + } + } diff --git a/ng-seed/src/app/appoinment/business/business.module.ts b/ng-seed/src/app/appoinment/business/business.module.ts index 6404b91..9f9e569 100644 --- a/ng-seed/src/app/appoinment/business/business.module.ts +++ b/ng-seed/src/app/appoinment/business/business.module.ts @@ -10,6 +10,7 @@ import { DemoMaterialModule } from 'app/shared/demo.module'; 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'; const customNotifierOptions: NotifierOptions = { @@ -68,6 +69,7 @@ const customNotifierOptions: NotifierOptions = { ScrollingModule, NgScrollbarModule, NotifierModule.withConfig(customNotifierOptions), + NgxMatSelectSearchModule ] }) export class BusinessModule { } diff --git a/ng-seed/src/app/end-user/booking-summary/booking-summary.component.ts b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.ts index 7830b7f..b3274b9 100644 --- a/ng-seed/src/app/end-user/booking-summary/booking-summary.component.ts +++ b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.ts @@ -4,6 +4,7 @@ import { Router } from '@angular/router'; import * as html2pdf from 'html2pdf.js' import { environment } from 'environments/environment'; import { format } from 'date-fns'; +import { local } from 'd3'; @@ -28,7 +29,13 @@ export class BookingSummaryComponent implements OnInit { constructor(public end_user:EndUserService,private router:Router,) { this.logo = localStorage.getItem('logo') this.busName = localStorage.getItem('busName') - + let clickSummaryDetails = localStorage.getItem('goToFirstFirst') + if(clickSummaryDetails == '1'){ + this.backRedireact() + } else{ + localStorage.setItem('goToFirstFirst','1') + } + // this.end_user.bookedDetails_observable$.subscribe((res) => { // console.log('booked2', res); @@ -101,15 +108,15 @@ export class BookingSummaryComponent implements OnInit { // console.log(res) // let serviceMap = res['data'][0].id // let time = new Date().toLocaleTimeString() - let param= { - "busId": serviceDetails.busId, - "cusId": appointmentId, - "appoinmentDate": slot_array[0].date, - "userId": serviceDetails.userId, - "appoinmentSlots": JSON.stringify(slot_array[0].slots) - //"servicemap" :this.bookedAppointment_servicemap - } - // let param =paramPay + // let param= { + // "busId": serviceDetails.busId, + // "cusId": appointmentId, + // "appoinmentDate": slot_array[0].date, + // "userId": serviceDetails.userId, + // "appoinmentSlots": JSON.stringify(slot_array[0].slots) + // //"servicemap" :this.bookedAppointment_servicemap + // } + let param =paramPay console.log(param) this.end_user.CheckAppoinmentsDetails(param).subscribe(res => { @@ -227,6 +234,7 @@ export class BookingSummaryComponent implements OnInit { } Summaryhide(){ this.summary = true; + localStorage.setItem('goToFirstFirst','1') } download(){ diff --git a/ng-seed/src/app/end-user/customer-info/customer-info.component.ts b/ng-seed/src/app/end-user/customer-info/customer-info.component.ts index 961e5e7..f590404 100644 --- a/ng-seed/src/app/end-user/customer-info/customer-info.component.ts +++ b/ng-seed/src/app/end-user/customer-info/customer-info.component.ts @@ -68,7 +68,8 @@ export class CustomerInfoComponent implements OnInit { } ngOnInit() { - + localStorage.setItem('goToFirstFirst','0') + console.log(localStorage.getItem('goToFirstFirst')) if (performance.navigation.type === 1) { console.log(0) // This condition checks if the page is refreshed @@ -475,7 +476,7 @@ this.paymentform = payment; onclickfun(){ - + if(this.verifyOTP == 0){ this.getOTP(1) } diff --git a/ng-seed/src/environments/environment.ts b/ng-seed/src/environments/environment.ts index 4f548a3..9c84602 100644 --- a/ng-seed/src/environments/environment.ts +++ b/ng-seed/src/environments/environment.ts @@ -7,11 +7,11 @@ export const environment = { production: false, environmentName: 'Testing Environment',//Localhost Environment. // apiEndpoint:'http://venbainfotech.com:5000/api/', - // apiEndpoint:'http://192.168.1.32:8080/api/', + // apiEndpoint:'http://192.168.1.14:8080/api/', apiEndpoint:'https://dev.venbait.in/appointments/api/', //EndUser URL - endUserUrl: window.location.origin+'/appointment/#/booking/', + endUserUrl: window.location.origin+'/#/booking/', mailUrl:window.location.origin, payment_api_key :'4cb964d4-9ef4-4a25-8f85-a2a13f43cbba', payment_mode:'TEST',