feat: show routing trace dialog on assignment reason badge click (#27629)
* feat: show routing trace dialog on assignment reason badge click Co-Authored-By: [email protected] <[email protected]> * fix: remove duplicate RoutingTraceSheet rendering - Remove RoutingTraceSheet from BookingListItem.tsx to avoid duplicate rendering - Move RoutingTraceSheet in BookingActionsDropdown.tsx outside of isBookingFromRoutingForm condition - Use booking.assignmentReason.length > 0 condition for RoutingTraceSheet rendering - Remove unused isOpenRoutingTraceSheet getter and RoutingTraceSheet import from BookingListItem.tsx Co-Authored-By: [email protected] <[email protected]> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
3 files changed
+32
-19
No files matched your search
@@ -280,6 +280,9 @@ function BookingListItem(booking: BookingItemProps) {
|
||||
const setIsOpenWrongAssignmentDialog = useBookingActionsStoreContext(
|
||||
(state) => state.setIsOpenWrongAssignmentDialog
|
||||
);
|
||||
const setIsOpenRoutingTraceSheet = useBookingActionsStoreContext(
|
||||
(state) => state.setIsOpenRoutingTraceSheet
|
||||
);
|
||||
const reportAction = getReportAction(actionContext);
|
||||
const reportActionWithHandler = {
|
||||
...reportAction,
|
||||
@@ -549,7 +552,7 @@ function BookingListItem(booking: BookingItemProps) {
|
||||
userTimeZone={userTimeZone}
|
||||
isRescheduled={isRescheduled}
|
||||
onAssignmentReasonClick={
|
||||
isBookingFromRoutingForm ? () => setIsOpenWrongAssignmentDialog(true) : undefined
|
||||
booking.assignmentReason.length > 0 ? () => setIsOpenRoutingTraceSheet(true) : undefined
|
||||
}
|
||||
/>
|
||||
{isBookingFromRoutingForm && (
|
||||
|
||||
@@ -455,23 +455,23 @@ export function BookingActionsDropdown({
|
||||
status={getBookingStatus()}
|
||||
/>
|
||||
{isBookingFromRoutingForm && (
|
||||
<>
|
||||
<WrongAssignmentDialog
|
||||
isOpenDialog={isOpenWrongAssignmentDialog}
|
||||
setIsOpenDialog={setIsOpenWrongAssignmentDialog}
|
||||
bookingUid={booking.uid}
|
||||
routingReason={booking.assignmentReason[0]?.reasonString ?? null}
|
||||
guestEmail={booking.attendees[0]?.email ?? ""}
|
||||
hostEmail={booking.user?.email ?? ""}
|
||||
hostName={booking.user?.name ?? null}
|
||||
teamId={booking.eventType?.team?.id ?? null}
|
||||
/>
|
||||
<RoutingTraceSheet
|
||||
isOpen={isOpenRoutingTraceSheet}
|
||||
setIsOpen={setIsOpenRoutingTraceSheet}
|
||||
bookingUid={booking.uid}
|
||||
/>
|
||||
</>
|
||||
<WrongAssignmentDialog
|
||||
isOpenDialog={isOpenWrongAssignmentDialog}
|
||||
setIsOpenDialog={setIsOpenWrongAssignmentDialog}
|
||||
bookingUid={booking.uid}
|
||||
routingReason={booking.assignmentReason[0]?.reasonString ?? null}
|
||||
guestEmail={booking.attendees[0]?.email ?? ""}
|
||||
hostEmail={booking.user?.email ?? ""}
|
||||
hostName={booking.user?.name ?? null}
|
||||
teamId={booking.eventType?.team?.id ?? null}
|
||||
/>
|
||||
)}
|
||||
{booking.assignmentReason.length > 0 && (
|
||||
<RoutingTraceSheet
|
||||
isOpen={isOpenRoutingTraceSheet}
|
||||
setIsOpen={setIsOpenRoutingTraceSheet}
|
||||
bookingUid={booking.uid}
|
||||
/>
|
||||
)}
|
||||
{booking.paid && booking.payment[0] && (
|
||||
<ChargeCardDialog
|
||||
|
||||
Reference in new issue
Block a user