From 5d0cf0f51097bf5a42ae8260b7e7298cb3115941 Mon Sep 17 00:00:00 2001 From: "surendar.m@watermelon.us" Date: Wed, 12 Apr 2023 10:11:07 +0530 Subject: [PATCH] End User URL --- .../consultant-setting.component.html | 4 +- .../consultant-setting.component.scss | 1 + .../consultant-setting.component.ts | 33 +++-- .../customers-list.component.ts | 118 +++++++++--------- .../customer-info.component.html | 11 +- .../customer-info/customer-info.component.ts | 4 +- ng-seed/src/environments/environment.ts | 27 ++-- 7 files changed, 109 insertions(+), 89 deletions(-) diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html index 3890d01..c5ff521 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html @@ -406,10 +406,10 @@
diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.scss b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.scss index 478464e..f944ad0 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.scss +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.scss @@ -177,6 +177,7 @@ label{ margin-left: 6rem; } .copy-button { + cursor: pointer; background: #625A92; border: 1px solid #625A92; -webkit-border-radius: 2px; diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts index ac58041..7ed0471 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts @@ -35,7 +35,6 @@ export class ConsultantSettingComponent implements OnInit { public servicesList:any = new MatTableDataSource(); practitionerdetails: any; servicesList_array: any = []; - apiUrl:any; serviceCheckedData: number; checkedArray: any[]; servicesList_data: any=[]; @@ -50,6 +49,8 @@ export class ConsultantSettingComponent implements OnInit { exp: any=[]; qualification: any=[]; id: any; + public end_User_Url = environment.endUserUrl; + endUserURL: any; constructor(private notifierService: NotifierService,private formBuilder: FormBuilder, public dialog: MatDialog, public _con:ConsultantService, private fb: FormBuilder, public _api:ConsultantService,private locationStrategy: LocationStrategy) {} @@ -157,7 +158,8 @@ workingDialog(action,obj) { this.workinghours = JSON.parse(this.practitionerdetails.workingHours) // this.workinghours = this.practitionerdetails.workingHours console.log(this.workinghours) - this.apiUrl = 'http://localhost:4200/customer/business/'+this.usersList.randStr + this.endUserURL = this.end_User_Url+this.usersList['BusinessDetails'][0].randStr + console.log(this.endUserURL) } } ); @@ -210,9 +212,7 @@ workingDialog(action,obj) { openDialog(action,obj) { console.log(this.working_customize) - //if(this.working_customize == false){ - - + //if(this.working_customize == false){ // obj.action = action; const dialogRef = this.dialog.open(EditWorkingHoursComponent, { width: '48%', @@ -257,6 +257,7 @@ workingDialog(action,obj) { this._api.createDurationFeesDetails(param).subscribe(res => { if (res.status == 200) { console.log(res) + this.getServicesList(this.usersList.id,this.usersList.busId) // this.checkedList = res.data; } } ); @@ -300,15 +301,17 @@ workingDialog(action,obj) { save(){ this.isEditable = false; + let userid = localStorage.getItem('user_id') let param: any = { "exp": this.exp, - "id": this.id, + // "id": this.id, "qualification": this.qualification, "fees": "800", "languages": this.languages, "dob": this.dob, "designtion": this.qualification, // "gender": this.gender, - "userName": this.userName + "userName": this.userName, + "userId":userid } if(this.usersList['practitionerInfos'].length>0) { param.id = this.id @@ -326,5 +329,19 @@ workingDialog(action,obj) { } - + copyToClipBoard(message) { + console.log(message) + this.notifierService.notify('success', 'Copied...!'); + const selBox = document.createElement('textarea'); + selBox.style.position = 'fixed'; + selBox.style.left = '0'; + selBox.style.top = '0'; + selBox.style.opacity = '0'; + selBox.value = message; + document.body.appendChild(selBox); + selBox.focus(); + selBox.select(); + document.execCommand('copy'); + document.body.removeChild(selBox); + } } diff --git a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts index 3d8b8c0..10c6231 100644 --- a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts +++ b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts @@ -64,15 +64,12 @@ export class CustomersListComponent implements OnInit { ngOnInit(): void { + console.log('in') this.recordStatus=false; this.getCustomersList() } - ngAfterViewInit() { - this.customersListSource.paginator = this.paginator; - console.log(this.customersListSource,this.paginator) - this.customersListSource.sort = this.sort; - } + applyFilter(filterValue: string) { filterValue = filterValue.trim(); // Remove whitespace @@ -81,70 +78,69 @@ export class CustomersListComponent implements OnInit { } getCustomersList() { - //this._pd.getTabStatusPdDetails(this.tabStatus) - let user_role = localStorage.getItem('user_role'); - if(user_role == 'PRACTITIONER'){ - this._app.getAppoinmentsListDetails().subscribe(res => { + console.log('in') + //this._pd.getTabStatusPdDetails(this.tabStatus) + let user_role = localStorage.getItem('user_role'); + if(user_role == 'PRACTITIONER'){ + this._app.getAppoinmentsListDetails().subscribe(res => { if (res.status == 200) { - this.appoinmentsList = res.data; - let id = localStorage.getItem('user_id') - console.log(id) - - console.log(this.appoinmentsList) - - let filter = this.appoinmentsList.filter(arr=>{return arr["ServicesMapDetail.userId"] + this.appoinmentsList = res.data; + let id = localStorage.getItem('user_id') + console.log(id) + console.log(this.appoinmentsList) + let filter = this.appoinmentsList.filter(arr=>{return arr["ServicesMapDetail.userId"] == id}) - console.log(filter) - filter.forEach(element => { + console.log(filter) + filter.forEach(element => { this.appoinmentsIds.push( element.customer[0].id) - - - }); - this._cus.getCustomersListDetails().subscribe(res => { - if (res.status == 200) { - this.isLoading = false - this.customersList = res.data; - console.log(this.customersList) - this.customersListLength = res.data.length; - console.log(this.customersListLength) - this.customersListSource['data'] = this.customersList; - console.log(this.customersListSource) - this.recordStatus=false; - - console.log(this.customersList,this.appoinmentsIds) - let user_role = localStorage.getItem('user_role'); - if(user_role == 'PRACTITIONER'){ - const activeIds = this.appoinmentsIds - const serviceList = this.customersList - console.log(activeIds,serviceList) - - const result = serviceList.filter(({id}) => activeIds.includes(id)); - console.log(result) - this.customersList = result - this.customersListSource['data'] = this.customersList; - - } - - } - else{ - this.customersList=[]; - this.customersListLength= null; - this.recordStatus=true; - } -}, error => this.isLoading = false); - - } - else{ - - } - }) + }); + this.getCustomerDetails() + } + }) + } + this.getCustomerDetails() } - + getCustomerDetails(){ + this._cus.getCustomersListDetails().subscribe(res => { + if (res.status == 200) { + this.isLoading = false + this.customersList = res.data; + console.log(this.customersList) + this.customersListLength = res.data.length; + console.log(this.customersListLength) + this.customersListSource['data'] = this.customersList; + console.log(this.customersListSource) + this.recordStatus=false; + + console.log(this.customersList,this.appoinmentsIds) + let user_role = localStorage.getItem('user_role'); + if(user_role == 'PRACTITIONER'){ + const activeIds = this.appoinmentsIds + const serviceList = this.customersList + console.log(activeIds,serviceList) + + const result = serviceList.filter(({id}) => activeIds.includes(id)); + console.log(result) + this.customersList = result + this.customersListSource['data'] = this.customersList; + } + + } + else{ + this.customersList=[]; + this.customersListLength= null; + this.recordStatus=true; + } + }, error => this.isLoading = false); } - + ngAfterViewInit() { + this.customersListSource.paginator = this.paginator; + console.log(this.customersListSource,this.paginator) + this.customersListSource.sort = this.sort; + } pageChange(e) { console.log(e); } diff --git a/ng-seed/src/app/end-user/customer-info/customer-info.component.html b/ng-seed/src/app/end-user/customer-info/customer-info.component.html index bf8c6c8..cbae3d8 100644 --- a/ng-seed/src/app/end-user/customer-info/customer-info.component.html +++ b/ng-seed/src/app/end-user/customer-info/customer-info.component.html @@ -19,17 +19,20 @@ Please enter a valid email address - - + + email is required + Email is required - +
- Phone No is required + Contact No is required + Invalid Contact No + Contact No must be at least 10 characters Limit exceed
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 bb93c65..ab3d71c 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 @@ -39,16 +39,16 @@ export class CustomerInfoComponent implements OnInit { ngOnInit() { this.form = new FormGroup({ - cusName: new FormControl('', [Validators.required]), + cusName: 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}$', ),]), + phoneNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10), Validators.pattern('^[0-9]{10}$')]), address_1: new FormControl('', [Validators.maxLength(50)]), city: new FormControl('', [Validators.maxLength(10)]), state: new FormControl('', [Validators.maxLength(10)]), otp: new FormControl('', [Validators.maxLength(10)]), pincode: new FormControl('',[Validators.maxLength(6)]), - phoneNo: new FormControl('', [Validators.required, Validators.maxLength(10),Validators.minLength(10)]), }); } diff --git a/ng-seed/src/environments/environment.ts b/ng-seed/src/environments/environment.ts index 7aeef88..7c54ae5 100644 --- a/ng-seed/src/environments/environment.ts +++ b/ng-seed/src/environments/environment.ts @@ -6,18 +6,21 @@ export const environment = { production: false, environmentName: 'Testing Environment',//Localhost Environment. -// apiEndpoint:'http://venbainfotech.com:5000/api/', -apiEndpoint:'http://192.168.1.17:8080/api/', -// apiEndpoint:'https://api.venbait.in/api/', + // apiEndpoint:'http://venbainfotech.com:5000/api/', + apiEndpoint:'http://192.168.1.17:8080/api/', + // apiEndpoint:'https://api.venbait.in/api/', + + //EndUser URL + endUserUrl:'https://venbainfotech.com/appointment/#/customer/business/', - firebase: { - apiKey: "AIzaSyCKbfDJ5Qf0rDP3WKppa94u9xuVaVabaDw", - authDomain: "venba-appointment.firebaseapp.com", - projectId: "venba-appointment", - storageBucket: "venba-appointment.appspot.com", - messagingSenderId: "513912226817", - appId: "1:513912226817:web:eebcec6f7c6407a1dd2c00", - measurementId: "G-48RM8BFRFK" -}, + firebase: { + apiKey: "AIzaSyCKbfDJ5Qf0rDP3WKppa94u9xuVaVabaDw", + authDomain: "venba-appointment.firebaseapp.com", + projectId: "venba-appointment", + storageBucket: "venba-appointment.appspot.com", + messagingSenderId: "513912226817", + appId: "1:513912226817:web:eebcec6f7c6407a1dd2c00", + measurementId: "G-48RM8BFRFK" + }, };