From 5aa6508f0e003b155f6d952b6b9da61b164db484 Mon Sep 17 00:00:00 2001 From: "surendar.m@watermelon.us" Date: Sat, 15 Apr 2023 17:25:29 +0530 Subject: [PATCH] sorting and doctor profile --- .../appoinments-list.component.html | 2 +- .../appoinments-list.component.ts | 34 +++++-- .../business-list/business-list.component.ts | 3 + .../consultant-setting.component.html | 14 ++- .../consultant-setting.component.ts | 6 +- .../customers-list.component.html | 2 +- .../customers-list.component.ts | 39 +++++--- .../service-list/service-list.component.ts | 3 + .../user/user-list/user-list.component.ts | 3 + .../doctor-profile.component.html | 98 +++---------------- .../doctor-profile.component.ts | 8 +- .../slot-booking-details.component.html | 43 +++++--- .../slot-booking-details.component.scss | 6 +- .../layouts/admin/admin-layout.component.html | 9 +- .../layouts/admin/admin-layout.component.ts | 40 ++++++-- ng-seed/src/environments/environment.ts | 2 +- 16 files changed, 170 insertions(+), 142 deletions(-) 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 38cae88..042e1bc 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 @@ -38,7 +38,7 @@ Date and Time - {{row.appoinmentDate | date:'dd-MMM-YYYY'}}, {{row.appoinmentSlots | date:'shortTime'}} + {{row.appoinmentDate | date:'dd-MMM-YYYY'}}, {{row.appoinmentSlots[0] | date:'shortTime'}} diff --git a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts index 13f7074..f362874 100644 --- a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts +++ b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts @@ -76,30 +76,50 @@ export class AppoinmentsListComponent implements OnInit { } getAppoinmentsList() { + let user_role = localStorage.getItem('user_role'); //this._pd.getTabStatusPdDetails(this.tabStatus) this._app.getAppoinmentsListDetails().subscribe(res => { if (res.status == 200) { this.isLoading = false this.appoinmentsList = res.data; - console.log(this.appoinmentsList) - this.appointmentListLength = res.data.length; - console.log(this.appointmentListLength) - this.appointmentListSource['data'] = this.appoinmentsList; - console.log(this.appointmentListSource) - this.recordStatus=false; + console.log(this.appoinmentsList) - let user_role = localStorage.getItem('user_role'); + this.appoinmentsList.forEach(element => { + console.log(element) + element.appoinmentSlots = JSON.parse(element.appoinmentSlots) + }); + console.log(this.appoinmentsList) + + if(user_role == 'PRACTITIONER'){ + console.log('if ') let id = localStorage.getItem('user_id') console.log(id) + this.appointmentListSource['data'] = this.appoinmentsList; this.appointmentListSource console.log(this.appointmentListSource) let filter = this.appointmentListSource['data'].filter(arr=>{return arr["ServicesMapDetail.userId"] == id}) console.log(filter) + filter.sort((a: any, b: any) => { + return b.id - a.id; + }); this.appointmentListSource['data'] = filter this.appointmentListLength = filter.length; + console.log(this.appointmentListSource) + + } else { + console.log('else') + this.appointmentListLength = res.data.length; + console.log(this.appointmentListLength) + this.appoinmentsList.sort((a: any, b: any) => { + return b.id - a.id; + }); + this.appointmentListSource['data'] = this.appoinmentsList; + console.log(this.appointmentListSource) + } + this.recordStatus=false; } else{ this.appoinmentsList=[]; diff --git a/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts b/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts index f9e7d16..0e6db2a 100644 --- a/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts +++ b/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts @@ -64,6 +64,9 @@ export class BusinessListComponent implements OnInit { console.log(this.businessList) this.businessListLength = res.data.length; console.log(this.businessListLength) + this.businessList.sort((a: any, b: any) => { + return b.id - a.id; + }); this.businessListSource['data'] = this.businessList; console.log(this.businessListSource) this.recordStatus=false; 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 51fa978..fd68ce0 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 @@ -112,10 +112,18 @@ +
+ + {{practitionerdetails.caption}} + + Caption + + +
{{practitionerdetails.description}} - + Description @@ -371,7 +379,7 @@
--> -
+
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 646104a..5296ea8 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 @@ -46,6 +46,7 @@ export class ConsultantSettingComponent implements OnInit { gender: any=[]; description:any=[]; skills:any = []; + caption:any = []; dob: any=[]; languages: any=[]; designtion: any=[]; @@ -162,6 +163,7 @@ unavailability(action,obj) { "gender": null, "description":null, "skills": null, + "caption": null, "isActive": "1", }] @@ -173,7 +175,8 @@ unavailability(action,obj) { this.userName = this.usersList.userName this.gender=this.practitionerdetails.gender this.description=this.practitionerdetails.description - this.skills=this.practitionerdetails.skills + this.skills= JSON.parse(this.practitionerdetails.skills) + this.caption = this.practitionerdetails.caption this.dob=this.practitionerdetails.dob this.exp=this.practitionerdetails.exp this.languages=this.practitionerdetails.languages @@ -337,6 +340,7 @@ unavailability(action,obj) { "gender": this.gender, "description": this.description, "skills": this.skills, + "caption": this.caption, "userName": this.userName, "userId":userid } diff --git a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.html b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.html index 05e9c29..34e9944 100644 --- a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.html +++ b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.html @@ -7,7 +7,7 @@ - + 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 10c6231..7c856ba 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 @@ -98,7 +98,7 @@ export class CustomersListComponent implements OnInit { } }) } - this.getCustomerDetails() + // this.getCustomerDetails() } getCustomerDetails(){ @@ -106,25 +106,32 @@ export class CustomersListComponent implements OnInit { 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) 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 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; - } + const result = serviceList.filter(({id}) => activeIds.includes(id)); + console.log(result) + this.customersList = result + this.customersListLength = this.customersList.length; + this.customersList.sort((a: any, b: any) => { + return b.id - a.id; + }); + this.customersListSource['data'] = this.customersList; + } else{ + this.customersListLength = res.data.length; + console.log(this.customersListLength) + this.customersList.sort((a: any, b: any) => { + return b.id - a.id; + }); + this.customersListSource['data'] = this.customersList; + console.log(this.customersListSource) + this.recordStatus=false; + } } else{ diff --git a/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.ts b/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.ts index 6301518..c585533 100644 --- a/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.ts +++ b/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.ts @@ -66,6 +66,9 @@ export class ServiceListComponent implements OnInit { console.log(this.servicesList) this.servicesListLength = res.data.length; console.log(this.servicesListLength) + this.servicesList.sort((a: any, b: any) => { + return b.serviceId - a.serviceId; + }); this.servicesListSource['data'] = this.servicesList; console.log(this.servicesListSource) this.recordStatus=false; diff --git a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts index 4fb231f..62ccc29 100644 --- a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts +++ b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts @@ -81,6 +81,9 @@ export class UserListComponent implements OnInit { if (res.status == 200) { this.isLoading = false let usersList = res.data + usersList.sort((a: any, b: any) => { + return b.id - a.id; + }); this.usersList['data'] = usersList; this.usersListLength = res.data.length; this.recordStatus=false; diff --git a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.html b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.html index 41cf114..8375d8e 100644 --- a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.html +++ b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.html @@ -71,10 +71,10 @@ Phone : {{bookedAppointment.contactNo}} -
  • +
  • Email: {{bookedAppointment.email}} @@ -92,115 +92,49 @@
  • -
    +
    -

    “I highly appreciate your help for my family in our most difficult time. We owed everyone at @dr.changes a big thank you and our life.”

    +

    “{{profileDetails.caption}}”

    - More than 15 years ago, a small group of families, community activists, and civil servants in New York came together to form an organization called Dr.Changes. They provide services for those struggling to care for a loved one who did not “fit” into traditional health systems: stroke, Parkinson’s, Alzheimer’s disease, traumatic brain injury, debilitating disorders, etc. The diagnoses were different, but the families shared common challenges: few community resources, isolation, lack of information, and drastic changes in family roles. + {{profileDetails.description}}

    -

    SKILLS

    -
    -
    -
      -
    • +

      SKILLS

      +
      +
      beenhere - Assisting with walking from bed to wheelchair -
    • -
    • - - beenhere - - - Bathing, dressing and grooming assistance -
    • -
    • - - beenhere - - Medication reminders -
    • -
    • - - beenhere - - Safety and fall prevention -
    • -
    • - - beenhere - - Status reporting to family -
    • -
    -
    -
    -
      -
    • - - beenhere - - Assisting with walking from bed to wheelchair -
    • -
    • - - beenhere - - - Bathing, dressing and grooming assistance -
    • -
    • - - beenhere - - Medication reminders -
    • -
    • - - beenhere - - Safety and fall prevention -
    • -
    • - - beenhere - - Status reporting to family -
    • -
    -
    -
    + {{skillsList}} +
    +
    -
    +

    LANGUAGE

    -

    English

    -

    French

    +

    {{profileDetails.languages}}

    QUALIFICATIONS

    -

    Master of Science

    -

    University Limerick

    +

    {{profileDetails.qualification}}

    diff --git a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts index f177497..a2d6c93 100644 --- a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts +++ b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts @@ -14,6 +14,8 @@ export class DoctorProfileComponent implements OnInit { private apiUrl = environment.apiEndpoint; dp: any =[]; busName: any=[]; + profileDetails: any; + skillsDetails: any = []; constructor(private router:Router,public end_user:EndUserService,private spinner:NgxSpinnerService) { this.spinner.show() @@ -29,9 +31,13 @@ export class DoctorProfileComponent implements OnInit { console.log('booked', res); if(res.length>0){ - this.bookedAppointment=res[0].user[0] + this.bookedAppointment = res[0].user[0] this.dp = this.apiUrl+'imageViewer?img_name='+ this.bookedAppointment.logo console.log(this.dp) + this.profileDetails = this.bookedAppointment.practitionerInfos[0] + console.log(this.profileDetails) + this.skillsDetails = JSON.parse(this.profileDetails.skills) + console.log(this.skillsDetails) }else{ let URL = this.router.url; diff --git a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html index ebbe0bc..b9ae4e6 100644 --- a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html +++ b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html @@ -51,6 +51,7 @@
    +
    @@ -63,10 +64,6 @@

    Teero would like to schedule an interview with you! Pick a time & date.

    - - -

    AvatarBusiness

    {{busName}}

    Avatar Practitioner

    @@ -74,25 +71,42 @@

    Avatar Service

    {{servicesName.servicesName}} ({{servicesName.duration }} Mins) -

    + +

    AvatarDate :

    + {{date | date:'longDate'}} +

    AvatarTime :

    + {{slotTime | date:'shortTime'}} +

    AvatarAmount :

    + {{user.practitionerInfos[0].days}}
    -
    -
    -
    {{check(days) | date:'longDate'}}
    +
    +
    +
    + {{check(days) | date:'longDate'}} +
    +
    + + + +
    +
    + +
    + +
    -
    -
    - -
    +
    diff --git a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.scss b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.scss index 692a24f..30302e4 100644 --- a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.scss +++ b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.scss @@ -104,6 +104,7 @@ margin-left: -3rem!important; // max-width: 100%; min-width: -webkit-fill-available; padding: 1rem !important; + } @media only screen and (max-width: 600px) { h3{ @@ -162,10 +163,11 @@ margin-left: -3rem!important; color: #7a7a7a; } h4{ - color: #227f6e;; + color: #227f6e; + margin: 0; } .scrollHV { - height: calc(100vh - 105px); + height: calc(100vh - 338px); } .flexxx{ flex-direction: column; diff --git a/ng-seed/src/app/layouts/admin/admin-layout.component.html b/ng-seed/src/app/layouts/admin/admin-layout.component.html index 1f02a65..096b866 100644 --- a/ng-seed/src/app/layouts/admin/admin-layout.component.html +++ b/ng-seed/src/app/layouts/admin/admin-layout.component.html @@ -6,11 +6,11 @@
    -