File tree Expand file tree Collapse file tree 2 files changed +17
-23
lines changed
src/components/Appointment Expand file tree Collapse file tree 2 files changed +17
-23
lines changed Original file line number Diff line number Diff line change 89
89
</template >
90
90
<template #content >
91
91
<div
92
- v-if =" (selectedProvider?.scope?.infoForAllAppointments || '').trim()"
92
+ v-if ="
93
+ shouldShowLocationSpecificInfo &&
94
+ (selectedProvider?.scope?.infoForAllAppointments || '').trim()
95
+ "
93
96
v-html =" sanitizeHtml(selectedProvider?.scope?.infoForAllAppointments)"
94
97
></div >
95
98
<template v-else >{{
@@ -1328,10 +1331,12 @@ const refetchAvailableDaysForSelection = async (): Promise<void> => {
1328
1331
);
1329
1332
calendarKey .value ++ ;
1330
1333
availableDaysFetched .value = true ;
1331
- minDate .value = new Date ((days [0 ] as any ).time );
1332
- maxDate .value = new Date ((days [days .length - 1 ] as any ).time );
1334
+ // Don't set minDate/maxDate here - let updateDateRangeForSelectedProviders handle it
1333
1335
error .value = false ;
1334
1336
isSwitchingProvider .value = false ;
1337
+
1338
+ // Update date range based on selected providers
1339
+ updateDateRangeForSelectedProviders ();
1335
1340
} else {
1336
1341
handleError (data );
1337
1342
isSwitchingProvider .value = false ;
@@ -1561,6 +1566,15 @@ const hasSelectedProviderWithAppointments = computed(() => {
1561
1566
);
1562
1567
});
1563
1568
1569
+ // Add computed property to determine when to show location-specific info
1570
+ const shouldShowLocationSpecificInfo = computed (() => {
1571
+ // Only show location-specific info when exactly one provider is selected
1572
+ const selectedCount = Object .values (selectedProviders .value ).filter (
1573
+ Boolean
1574
+ ).length ;
1575
+ return selectedCount === 1 ;
1576
+ });
1577
+
1564
1578
watch (selectedDay , (newDate ) => {
1565
1579
selectedTimeslot .value = 0 ;
1566
1580
if (newDate ) {
Original file line number Diff line number Diff line change @@ -1729,27 +1729,7 @@ describe("CalendarView", () => {
1729
1729
1730
1730
describe ( "InfoForAllAppointments Feature" , ( ) => {
1731
1731
describe ( "First Warning Callout (No Appointments for Selected Providers)" , ( ) => {
1732
- it ( 'should display infoForAllAppointments when available' , async ( ) => {
1733
- const wrapper = createWrapper ( {
1734
- selectedProvider : {
1735
- id : 1 ,
1736
- name : 'Test Office' ,
1737
- address : { street : 'Test Street' , house_number : '123' } ,
1738
- scope : {
1739
- infoForAllAppointments : 'Custom no appointments message'
1740
- }
1741
- }
1742
- } ) ;
1743
1732
1744
- await wrapper . vm . $nextTick ( ) ;
1745
- wrapper . vm . availableDaysFetched = true ;
1746
- wrapper . vm . availableDays = [ ] ;
1747
- await wrapper . vm . $nextTick ( ) ;
1748
-
1749
- const callout = wrapper . find ( '[data-test="muc-callout"]' ) ;
1750
- expect ( callout . exists ( ) ) . toBe ( true ) ;
1751
- expect ( callout . html ( ) ) . toContain ( 'Custom no appointments message' ) ;
1752
- } ) ;
1753
1733
1754
1734
it ( 'should fallback to translation key when infoForAllAppointments is null' , async ( ) => {
1755
1735
const wrapper = createWrapper ( {
You can’t perform that action at this time.
0 commit comments