feat: to enable optimized slots (#16579)

* feature to enable optimized slots

* type check (was not caught running locally)

* update for typechecks

* update for type checks

* initialize form

* update slots test for showOptimizedSlots

* added some more tests

* handled edge case

* added test for edge case

* generalized condition

* refactored instead of ternary and added comments

* update condition

* Update apps/web/public/static/locales/en/common.json

Co-authored-by: Carina Wollendorfer <[email protected]>

* moved showOptimizedSlots setting to advanced tab

* updated to always move to next 15min if not possible to next interval

* correct after merge

* chore

* fix typecheck after latest merges

* remove workinghours when dateRanges input

* refactor: extract to fn

* chore

* remove unrelated changes

* remove unrealted change

* updated tests

* unrelated format changes no-verify

* unrelated format changes no-verify

* handle current day booking cases, to show roundedoff minutes

* remove unrelated format changes in openapi.json

* add test for new condition

* remove unrelated auto-format changes

* remove unrelated auto-format changes

* update after merge

* For current day bookings, normalizing the seconds to zero to avoid issues with time calculations

* Update packages/platform/atoms/event-types/hooks/useEventTypeForm.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* update for typecheck due to latest changes

* resolve merge conflicts

* Smaller description

* Minor style change to prefer early return

---------

Co-authored-by: Carina Wollendorfer <[email protected]>
Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: Devanshu Sharma <[email protected]>
Co-authored-by: Volnei Munhoz <[email protected]>
Co-authored-by: Keith Williams <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
15 files changed
+548 -4

No files matched your search

@@ -3511,6 +3511,8 @@
"file_upload_instructions": "Accepted types: {{acceptedTypes}}; Max file size: {{maxSize}}",
"license_key_saved": "License key saved successfully",
"timezone_mismatch_tooltip": "You are viewing the report based on your profile timezone ({{userTimezone}}), while your browser is set to timezone ({{browserTimezone}})",
"show_optimized_slots": "Optimized slots",
"show_optimized_slots_description": "Arrange time slots to optimize availability.",
"failed_bookings_by_field": "Failed Bookings By Field",
"failed_bookings": "Failed bookings",
"event_type_no_hosts": "No hosts are assigned to event type",
@@ -121,6 +121,7 @@ describe("handleChildrenEventTypes", () => {
autoTranslateDescriptionEnabled,
includeNoShowInRRCalculation,
instantMeetingScheduleId,
showOptimizedSlots,
...evType
} = mockFindFirstEventType({
id: 123,
@@ -182,6 +183,7 @@ describe("handleChildrenEventTypes", () => {
assignRRMembersUsingSegment,
includeNoShowInRRCalculation,
instantMeetingScheduleId,
showOptimizedSlots,
...evType
} = mockFindFirstEventType({
metadata: { managedEventConfig: {} },
@@ -292,6 +294,7 @@ describe("handleChildrenEventTypes", () => {
includeNoShowInRRCalculation,
instantMeetingScheduleId,
assignRRMembersUsingSegment,
showOptimizedSlots,
...evType
} = mockFindFirstEventType({
id: 123,
@@ -356,6 +359,7 @@ describe("handleChildrenEventTypes", () => {
assignRRMembersUsingSegment,
rrSegmentQueryValue,
useEventLevelSelectedCalendars,
showOptimizedSlots,
...evType
} = mockFindFirstEventType({
metadata: { managedEventConfig: {} },
@@ -421,6 +425,7 @@ describe("handleChildrenEventTypes", () => {
includeNoShowInRRCalculation,
instantMeetingScheduleId,
assignRRMembersUsingSegment,
showOptimizedSlots,
...evType
} = mockFindFirstEventType({
metadata: { managedEventConfig: {} },
@@ -444,6 +449,7 @@ describe("handleChildrenEventTypes", () => {
requiresBookerEmailVerification: false,
lockTimeZoneToggleOnBookingPage: false,
useEventTypeDestinationCalendarEmail: false,
showOptimizedSlots: false,
workflows: [],
parentId: 1,
locations: [],