From 90d2340bff119b7b5bb46a263c68adbd99579969 Mon Sep 17 00:00:00 2001 From: Inbal Date: Mon, 2 Oct 2023 15:55:24 +0300 Subject: [PATCH 1/3] fix cloneWorkOrder listoutofbounds bug --- .../main/default/classes/AppointmentController.cls | 7 ++++--- .../mobileAppointmentBookingSettingsContainer.js | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/RescheduleAppointments/force-app/main/default/classes/AppointmentController.cls b/RescheduleAppointments/force-app/main/default/classes/AppointmentController.cls index 81f067b..307b01a 100644 --- a/RescheduleAppointments/force-app/main/default/classes/AppointmentController.cls +++ b/RescheduleAppointments/force-app/main/default/classes/AppointmentController.cls @@ -545,12 +545,13 @@ public without sharing class AppointmentController { ); if (String.isNotEmpty(newWOId)) { - ServiceAppointment sa = [ + ServiceAppointment sa; + ServiceAppointment saList = [ SELECT Id FROM ServiceAppointment WHERE ParentRecordId = :newWOId - ][0]; - if (sa == null) { + ]; + if (saList == null || saList.size() == 0) { sa = new ServiceAppointment(); sa.ParentRecordId = newWOId; sa.DueDate = dueDate; diff --git a/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingSettingsContainer/mobileAppointmentBookingSettingsContainer.js b/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingSettingsContainer/mobileAppointmentBookingSettingsContainer.js index 63c51b6..2090b40 100644 --- a/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingSettingsContainer/mobileAppointmentBookingSettingsContainer.js +++ b/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingSettingsContainer/mobileAppointmentBookingSettingsContainer.js @@ -15,8 +15,8 @@ export default class MobileAppointmentBookingSettingsContainer extends Lightning recommendedScore = 80; _serviceAppointmentId; - @api operatingHours = "Israel OH"; - @api schedulingPolicy = "rescheduleLWC"; + @api operatingHours = "Gold Appointments Calendar"; + @api schedulingPolicy = "Customer First"; @api schedulingHorizonUnit = "Months"; @api schedulingHorizonValue = "3"; From acf9b5c9e4bcdc44c9ad84a2cf8c6de74ac4ec51 Mon Sep 17 00:00:00 2001 From: Inbal Date: Mon, 2 Oct 2023 18:24:36 +0300 Subject: [PATCH 2/3] fixed confirm reschdule events not propogating properly --- .../mobileAppointmentBookingRescheduleAppointment.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingRescheduleAppointment/mobileAppointmentBookingRescheduleAppointment.js b/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingRescheduleAppointment/mobileAppointmentBookingRescheduleAppointment.js index 32eaf84..b5bc4e0 100644 --- a/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingRescheduleAppointment/mobileAppointmentBookingRescheduleAppointment.js +++ b/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingRescheduleAppointment/mobileAppointmentBookingRescheduleAppointment.js @@ -17,12 +17,14 @@ export default class MobileAppointmentBookingRescheduleAppointment extends Light @api appointmentNumber; @api assignToName; - handleConfirmBtnClose() { + handleConfirmBtnClose(event) { + event.stopPropagation(); const customEvent = new CustomEvent("rescheduleclosewindow"); this.dispatchEvent(customEvent); } - handleConfirm() { + handleConfirm(event) { + event.stopPropagation(); this.showSpinner = true; const customEvent = new CustomEvent("rescheduleconfirmed"); From 1576a25f9503da7692ac1d631e21ce0f46dcb301 Mon Sep 17 00:00:00 2001 From: Inbal Date: Tue, 3 Oct 2023 10:07:11 +0300 Subject: [PATCH 3/3] missing scrolling handling on required resource error handling --- .../mobileAppointmentBookingLanding.js | 2 ++ .../mobileAppointmentBookingRescheduleAppointment.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingLanding/mobileAppointmentBookingLanding.js b/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingLanding/mobileAppointmentBookingLanding.js index ab7313c..b274306 100644 --- a/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingLanding/mobileAppointmentBookingLanding.js +++ b/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingLanding/mobileAppointmentBookingLanding.js @@ -754,6 +754,7 @@ export default class MobileAppointmentBookingLanding extends LightningElement { +error ); this.timeSlotDateWise = []; + this.allowScrolling(); }); } }) @@ -762,6 +763,7 @@ export default class MobileAppointmentBookingLanding extends LightningElement { "Error While assigning current user as required resource: " + error ); + this.allowScrolling(); }); }); } else if (saData.error) { diff --git a/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingRescheduleAppointment/mobileAppointmentBookingRescheduleAppointment.js b/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingRescheduleAppointment/mobileAppointmentBookingRescheduleAppointment.js index b5bc4e0..1174f42 100644 --- a/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingRescheduleAppointment/mobileAppointmentBookingRescheduleAppointment.js +++ b/RescheduleAppointments/force-app/main/default/lwc/mobileAppointmentBookingRescheduleAppointment/mobileAppointmentBookingRescheduleAppointment.js @@ -18,12 +18,14 @@ export default class MobileAppointmentBookingRescheduleAppointment extends Light @api assignToName; handleConfirmBtnClose(event) { + event.preventDefault(); event.stopPropagation(); const customEvent = new CustomEvent("rescheduleclosewindow"); this.dispatchEvent(customEvent); } handleConfirm(event) { + event.preventDefault(); event.stopPropagation(); this.showSpinner = true;