cal.pub0.org/packages/features/bookings/components/AvailableTimes.tsx

128 lines
4.8 KiB
TypeScript
Raw Normal View History

Feat/weekly booking view (#8484) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Large View Header * BookFormModal * Modal * Fix modal * Select first day when switching months in booker * SetSelected Date on large layouts * Fix re-renders * Fix yarn.lock * Set selected date when switching layout * Add empty state * Lint * sticky button on modal * paramater layout & empty state * fix: 7040 fix - team profile description (#8469) * New Crowdin translations by Github Action * Not center * Fix positionion * Removed unused dependnecy in effect * Update apps/web/public/static/locales/en/common.json Co-authored-by: Alex van Andel <me@alexvanandel.com> * Fix padding overflow --------- Co-authored-by: Jeroen Reumkens <hello@jeroenreumkens.nl> Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-04-25 12:01:45 +00:00
import { CalendarX2 } from "lucide-react";
import { shallow } from "zustand/shallow";
New Booker Component (preparations for booker atom) (#6792) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Select first day when switching months in booker --------- Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-04-24 14:32:30 +00:00
import type { Dayjs } from "@calcom/dayjs";
import dayjs from "@calcom/dayjs";
import type { Slots } from "@calcom/features/schedules";
import { classNames } from "@calcom/lib";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { nameOfDay } from "@calcom/lib/weekday";
feat: event settings booker layout toggle (#9082) * WIP for adding booker layout toggle in event settings pages * Prevent form error from getting form stuck in loading state * Fixed types for bookerlayouts settings and preselect correct layout in booker * Added defaultlayout settings to profile too, and use that in booker plus as default for events. * Made layout settings responsive * Added feature toggle for new layout settings * Fixed user builder for tests by adding defaultlyotu * Show toggles on booker for layout switch based on selected layouts. Also added a small fix for the settings toggles to preselect the correct toggle for defaultlayout when user profile settings are used. * Used zod parse to fix type errors. * Fix unit test * Set selected date to today in datepicker when week or column view is default layout. It uses that date to show in the title bar. * Moved booker layout settings to event and user meta data instead of new db column. * Converted booker layout strings into an enum. * Renamed booker layouts feature flag and deleted unused v2 booker feature flag. * Update packages/trpc/server/routers/viewer/eventTypes/update.handler.ts Co-authored-by: Omar López <zomars@me.com> * Fix import * Fix lint warnings in EventTypeSingleLayout * Fixed bug where when selected date was passed via query param page booking form wouldn't automatically show up. It would still serve you the date selection. This should fix e2e tests. * Fixed layout header. * Enabled booking layout toggle feature flag. --------- Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: Omar López <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com>
2023-06-06 15:31:43 +00:00
import { BookerLayouts } from "@calcom/prisma/zod-utils";
New Booker Component (preparations for booker atom) (#6792) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Select first day when switching months in booker --------- Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-04-24 14:32:30 +00:00
import { Button, SkeletonText } from "@calcom/ui";
Feat/weekly booking view (#8484) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Large View Header * BookFormModal * Modal * Fix modal * Select first day when switching months in booker * SetSelected Date on large layouts * Fix re-renders * Fix yarn.lock * Set selected date when switching layout * Add empty state * Lint * sticky button on modal * paramater layout & empty state * fix: 7040 fix - team profile description (#8469) * New Crowdin translations by Github Action * Not center * Fix positionion * Removed unused dependnecy in effect * Update apps/web/public/static/locales/en/common.json Co-authored-by: Alex van Andel <me@alexvanandel.com> * Fix padding overflow --------- Co-authored-by: Jeroen Reumkens <hello@jeroenreumkens.nl> Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-04-25 12:01:45 +00:00
import { useBookerStore } from "../Booker/store";
New Booker Component (preparations for booker atom) (#6792) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Select first day when switching months in booker --------- Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-04-24 14:32:30 +00:00
import { useTimePreferences } from "../lib";
import { TimeFormatToggle } from "./TimeFormatToggle";
type AvailableTimesProps = {
date: Dayjs;
slots: Slots[string];
onTimeSelect: (time: string) => void;
seatsPerTimeslot?: number | null;
showTimeformatToggle?: boolean;
className?: string;
};
export const AvailableTimes = ({
date,
slots,
onTimeSelect,
seatsPerTimeslot,
showTimeformatToggle = true,
className,
}: AvailableTimesProps) => {
const { t, i18n } = useLocale();
const [timeFormat, timezone] = useTimePreferences((state) => [state.timeFormat, state.timezone]);
const hasTimeSlots = !!seatsPerTimeslot;
Feat/weekly booking view (#8484) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Large View Header * BookFormModal * Modal * Fix modal * Select first day when switching months in booker * SetSelected Date on large layouts * Fix re-renders * Fix yarn.lock * Set selected date when switching layout * Add empty state * Lint * sticky button on modal * paramater layout & empty state * fix: 7040 fix - team profile description (#8469) * New Crowdin translations by Github Action * Not center * Fix positionion * Removed unused dependnecy in effect * Update apps/web/public/static/locales/en/common.json Co-authored-by: Alex van Andel <me@alexvanandel.com> * Fix padding overflow --------- Co-authored-by: Jeroen Reumkens <hello@jeroenreumkens.nl> Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-04-25 12:01:45 +00:00
const [layout] = useBookerStore((state) => [state.layout], shallow);
feat: event settings booker layout toggle (#9082) * WIP for adding booker layout toggle in event settings pages * Prevent form error from getting form stuck in loading state * Fixed types for bookerlayouts settings and preselect correct layout in booker * Added defaultlayout settings to profile too, and use that in booker plus as default for events. * Made layout settings responsive * Added feature toggle for new layout settings * Fixed user builder for tests by adding defaultlyotu * Show toggles on booker for layout switch based on selected layouts. Also added a small fix for the settings toggles to preselect the correct toggle for defaultlayout when user profile settings are used. * Used zod parse to fix type errors. * Fix unit test * Set selected date to today in datepicker when week or column view is default layout. It uses that date to show in the title bar. * Moved booker layout settings to event and user meta data instead of new db column. * Converted booker layout strings into an enum. * Renamed booker layouts feature flag and deleted unused v2 booker feature flag. * Update packages/trpc/server/routers/viewer/eventTypes/update.handler.ts Co-authored-by: Omar López <zomars@me.com> * Fix import * Fix lint warnings in EventTypeSingleLayout * Fixed bug where when selected date was passed via query param page booking form wouldn't automatically show up. It would still serve you the date selection. This should fix e2e tests. * Fixed layout header. * Enabled booking layout toggle feature flag. --------- Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: Omar López <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com>
2023-06-06 15:31:43 +00:00
const isColumnView = layout === BookerLayouts.COLUMN_VIEW;
const isMonthView = layout === BookerLayouts.MONTH_VIEW;
Feat/weekly booking view (#8484) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Large View Header * BookFormModal * Modal * Fix modal * Select first day when switching months in booker * SetSelected Date on large layouts * Fix re-renders * Fix yarn.lock * Set selected date when switching layout * Add empty state * Lint * sticky button on modal * paramater layout & empty state * fix: 7040 fix - team profile description (#8469) * New Crowdin translations by Github Action * Not center * Fix positionion * Removed unused dependnecy in effect * Update apps/web/public/static/locales/en/common.json Co-authored-by: Alex van Andel <me@alexvanandel.com> * Fix padding overflow --------- Co-authored-by: Jeroen Reumkens <hello@jeroenreumkens.nl> Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-04-25 12:01:45 +00:00
const isToday = dayjs().isSame(date, "day");
New Booker Component (preparations for booker atom) (#6792) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Select first day when switching months in booker --------- Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-04-24 14:32:30 +00:00
return (
<div className={classNames("text-default flex flex-col", className)}>
<header className="bg-default before:bg-default dark:bg-muted dark:before:bg-muted mb-3 flex w-full flex-row items-center font-medium">
<span
className={classNames(
isColumnView && "w-full text-center",
isColumnView ? "text-subtle text-xs uppercase" : "text-emphasis font-semibold"
)}>
<span className={classNames(isToday && "!text-default")}>
Feat/weekly booking view (#8484) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Large View Header * BookFormModal * Modal * Fix modal * Select first day when switching months in booker * SetSelected Date on large layouts * Fix re-renders * Fix yarn.lock * Set selected date when switching layout * Add empty state * Lint * sticky button on modal * paramater layout & empty state * fix: 7040 fix - team profile description (#8469) * New Crowdin translations by Github Action * Not center * Fix positionion * Removed unused dependnecy in effect * Update apps/web/public/static/locales/en/common.json Co-authored-by: Alex van Andel <me@alexvanandel.com> * Fix padding overflow --------- Co-authored-by: Jeroen Reumkens <hello@jeroenreumkens.nl> Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-04-25 12:01:45 +00:00
{nameOfDay(i18n.language, Number(date.format("d")), "short")}
New Booker Component (preparations for booker atom) (#6792) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Select first day when switching months in booker --------- Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-04-24 14:32:30 +00:00
</span>
Feat/weekly booking view (#8484) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Large View Header * BookFormModal * Modal * Fix modal * Select first day when switching months in booker * SetSelected Date on large layouts * Fix re-renders * Fix yarn.lock * Set selected date when switching layout * Add empty state * Lint * sticky button on modal * paramater layout & empty state * fix: 7040 fix - team profile description (#8469) * New Crowdin translations by Github Action * Not center * Fix positionion * Removed unused dependnecy in effect * Update apps/web/public/static/locales/en/common.json Co-authored-by: Alex van Andel <me@alexvanandel.com> * Fix padding overflow --------- Co-authored-by: Jeroen Reumkens <hello@jeroenreumkens.nl> Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-04-25 12:01:45 +00:00
<span
className={classNames(
isColumnView && isToday && "bg-brand-default text-brand ml-2",
"inline-flex items-center justify-center rounded-3xl px-1 pt-0.5 font-medium",
isMonthView ? "text-default text-sm" : "text-xs"
Feat/weekly booking view (#8484) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Large View Header * BookFormModal * Modal * Fix modal * Select first day when switching months in booker * SetSelected Date on large layouts * Fix re-renders * Fix yarn.lock * Set selected date when switching layout * Add empty state * Lint * sticky button on modal * paramater layout & empty state * fix: 7040 fix - team profile description (#8469) * New Crowdin translations by Github Action * Not center * Fix positionion * Removed unused dependnecy in effect * Update apps/web/public/static/locales/en/common.json Co-authored-by: Alex van Andel <me@alexvanandel.com> * Fix padding overflow --------- Co-authored-by: Jeroen Reumkens <hello@jeroenreumkens.nl> Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-04-25 12:01:45 +00:00
)}>
{date.format("DD")}
New Booker Component (preparations for booker atom) (#6792) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Select first day when switching months in booker --------- Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-04-24 14:32:30 +00:00
</span>
</span>
{showTimeformatToggle && (
<div className="ml-auto">
New Booker Component (preparations for booker atom) (#6792) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Select first day when switching months in booker --------- Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-04-24 14:32:30 +00:00
<TimeFormatToggle />
</div>
)}
</header>
Feat/weekly booking view (#8484) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Large View Header * BookFormModal * Modal * Fix modal * Select first day when switching months in booker * SetSelected Date on large layouts * Fix re-renders * Fix yarn.lock * Set selected date when switching layout * Add empty state * Lint * sticky button on modal * paramater layout & empty state * fix: 7040 fix - team profile description (#8469) * New Crowdin translations by Github Action * Not center * Fix positionion * Removed unused dependnecy in effect * Update apps/web/public/static/locales/en/common.json Co-authored-by: Alex van Andel <me@alexvanandel.com> * Fix padding overflow --------- Co-authored-by: Jeroen Reumkens <hello@jeroenreumkens.nl> Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-04-25 12:01:45 +00:00
<div className="h-full pb-4">
New Booker Component (preparations for booker atom) (#6792) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Select first day when switching months in booker --------- Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-04-24 14:32:30 +00:00
{!slots.length && (
<div className="bg-subtle border-subtle flex h-full flex-col items-center rounded-md border p-6 dark:bg-transparent">
Feat/weekly booking view (#8484) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Large View Header * BookFormModal * Modal * Fix modal * Select first day when switching months in booker * SetSelected Date on large layouts * Fix re-renders * Fix yarn.lock * Set selected date when switching layout * Add empty state * Lint * sticky button on modal * paramater layout & empty state * fix: 7040 fix - team profile description (#8469) * New Crowdin translations by Github Action * Not center * Fix positionion * Removed unused dependnecy in effect * Update apps/web/public/static/locales/en/common.json Co-authored-by: Alex van Andel <me@alexvanandel.com> * Fix padding overflow --------- Co-authored-by: Jeroen Reumkens <hello@jeroenreumkens.nl> Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-04-25 12:01:45 +00:00
<CalendarX2 className="text-muted mb-2 h-4 w-4" />
<p className={classNames("text-muted", showTimeformatToggle ? "-mt-1 text-lg" : "text-sm")}>
{t("all_booked_today")}
</p>
</div>
New Booker Component (preparations for booker atom) (#6792) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Select first day when switching months in booker --------- Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-04-24 14:32:30 +00:00
)}
{slots.map((slot) => {
const bookingFull = !!(hasTimeSlots && slot.attendees && slot.attendees >= seatsPerTimeslot);
return (
<Button
key={slot.time}
disabled={bookingFull}
data-testid="time"
data-disabled={bookingFull}
New Booker Component (preparations for booker atom) (#6792) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Select first day when switching months in booker --------- Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-04-24 14:32:30 +00:00
data-time={slot.time}
onClick={() => onTimeSelect(slot.time)}
className="min-h-9 mb-2 flex h-auto w-full flex-col justify-center py-2"
New Booker Component (preparations for booker atom) (#6792) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Select first day when switching months in booker --------- Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-04-24 14:32:30 +00:00
color="secondary">
{dayjs.utc(slot.time).tz(timezone).format(timeFormat)}
{bookingFull && <p className="text-sm">{t("booking_full")}</p>}
{hasTimeSlots && !bookingFull && (
<p className="flex items-center text-sm lowercase">
<span
className={classNames(
slot.attendees && slot.attendees / seatsPerTimeslot >= 0.8
? "bg-rose-600"
: slot.attendees && slot.attendees / seatsPerTimeslot >= 0.33
? "bg-yellow-500"
: "bg-emerald-400",
"mr-1 inline-block h-2 w-2 rounded-full"
)}
aria-hidden
/>
{slot.attendees ? seatsPerTimeslot - slot.attendees : seatsPerTimeslot}{" "}
{t("seats_available", {
count: slot.attendees ? seatsPerTimeslot - slot.attendees : seatsPerTimeslot,
})}
New Booker Component (preparations for booker atom) (#6792) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Select first day when switching months in booker --------- Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-04-24 14:32:30 +00:00
</p>
)}
</Button>
);
})}
</div>
</div>
);
};
export const AvailableTimesSkeleton = () => (
<div className="mt-8 flex w-[20%] flex-col only:w-full">
{/* Random number of elements between 1 and 6. */}
{Array.from({ length: Math.floor(Math.random() * 6) + 1 }).map((_, i) => (
New Booker Component (preparations for booker atom) (#6792) * Wip on booker atom * Wip on booker atom * Added correct icon imports * Fixed build * Responsive improvements * Removed package lock * Responsive tweaks * Animation improvements and cleanup * Animation improvements and event meta layout improvements. * Tweaked margins. * Added more event meta blocks * Layout tweaks * Converted booker layout to css grid and implemented multiple layout options * cleanup * Fixed build * Fixed build * Added temporary api route to enable/disable new booker * Added sticky behavior * Reverted yarn.lock and reinstalled new packages to see if this fixes build on vercel. * Ensure divider lines always have 100% height. * Improved animation config + initial load * Ensure to pass eventid to getschedule, otherwise custom availability schedule wont work and wont return any availability * Fixed divider line heights in booker * Fixed timezone select positioning * Added ability to view multiple days of timeslots * Added icons to booker toggle * Always show timeslots in timeslots view, also if no date is selected yet. In that case we show upcoming 5 days. * Fixed timeslots in small calendar view * Show selected day in calendar * Fixed booker timeslots view * Wip in making booking form work * Moved most of the booker atom stuff to features, since it belongs there. Atom should be a rather small wrapper. * Added create event functionality to booker form. * Added guests toggle to booker form and styled input addons in dark mode. * Added dynamic weekstart to booker * Added seats limit feature to timeslots. * Removed todo * Added correct event avatars * Added correct event name and icons * Added correct translation for minutes text in multi duration * Add rescheduling functionality to new booker. * Added selected booking time to booking meta in sidebar. * Abstracted away timeformat to custom hook * Added correct key props to all components in booker. * Fix build * Create some new custom hooks to have a lot less repitition in code. * Moved bookerform component inside booker directory since it is tied to it. * Added error messages to booker form, plus fixed bug in recurring events. * Added some comments <3 * Fixed todos in booker form. * Added loading state for timeslot selector, and added prefetching of next month, in case of multi day view showing 2 months at the same time. * Fixed import paths * Added away view * Validate uniqueness of event attendees. * Tweaked comment * #5798 added correct date format and style for selected date in booker. * UI improvements * Enable possibility to add booking values via query params. * Added functionality to update query params when user selects date/duration etc in booker * First steps in adding e2e test. * Fixes after merge with main, and added new form builder. * Implemented new form types and validation to booker, confirming new form builder. Validation still throwing wrong error keys though. * Added search to timezone dropdown * Added e2e test for booker (copy of current booker tests, only enabling cookie), plus fixed reschedule view. * Updated yarn.lock * Added new booker for team pages. * Fixed input addon (hover) styles. * Added dynamic booking. * Hide timeformat select for multi day view for now. * Cleanup and ui tweaks * removed log * Mobile improvements * Cleanup * Small design tweaks after talking to ciaran. * Text color and weight tweaks in booker * Added rainbow gates to new booker. * Added in default values which fixes form vallidation (???). * Added empty defaults for name and email * Added metadata * Reset yarn.lock * Fixed booker zod validation after change in main. * Icon tweak * Fixed timezone select styles after new classnames have been merged. * Updated seat availability styles. * Update yarn.lock * Added explanation for alchemy key to .env.example * Added tooltip to booker month/week/multiday toggle * Fixed timezoneselect styles in booker after select updates. * Updates bookingfields component by taking changes from current booker component * Removed remaining booker todos * Fix bookeventform * Fix for recurring event meta * Type fixes * Typefixes * Team event fixes * Avoid hydration errors by only rendering date picker client side. Remove web3 gates since we dont offer them anymore. Prevent timeslot select from staying open when switching to a different month. * Don't show calendar on mobile booker during booking. * Always align booker buttons to bottom * Don't show backend messages in error, rather show a helpful text like the current booker does as well. * Do invisible next rewrite based on cookie from next.config.js (#7949) * Do invisible next rewrite based on cookie from next.config.js * Name embed link instead of bookerPath * Rewrites only dynamic user pages --------- Co-authored-by: zomars <zomars@me.com> * Don't allow change of timezone when bookerform is visible * Don't add duration to query param if the event is not a multi duration event. * Update next.config.js * Added correct timezone formatting to event meta when timeslot is selected. * removed .env variable that isn't needed anymore. * Update Gates.tsx * Type fixes * Allows to run all tests with the new booker * Fixed timezone select styles after merge. * Don't throw error when event doesn't have hosts, rather return no users, which will result in no availability in UI. * Make booker errors of severity info instead of warning. * Ensure team avatars are shown, as well as filter on uniqueness of avatars. * Added all booked today message to timeslots. * Added cal.com logo to booker. * Fixed fragment classname error, minor mobile animation tweaks plus make all booked today text smaller for multi day layout. * Improved timezone select styles, and updated arguments of getbooking function after updates in main. * Prevent infinite loop in rewriting new booker. * Prevent infinite loop in rewriting new booker. * Moved new-booker pages to their own directory to prevent regexes confusing next and thus nut running getserversideprops after rewrite. Also adding clearing of old date in booker store, that could stick around when user immediately navigates back to the same page after booking. * Fixed cal logo color in darkmode for new booker. * Implemented new color tokens and theme variables. Also small design tweaks after merge with main. * Minor style tweaks * Show multiple locations in tooltip on booker #8222 * Radio button style tweaks * Fixed build * Updated calendar imports to new lucide names * Removed resetting of selected times logic, because otherwise url params wouldnt be taken into account which is actually what we want. So old values sticking around when navigating back is actually the desired behavior. * Updated tests to instead of always run the new booker in tests, have a utility to run both the new and old booker for specified tests. * Added comment and eslint disable for if statement in booker test. * Update packages/features/bookings/components/event-meta/Details.tsx Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Fix badge types * Lazy loaded timezone select to save 85kb in bundle size. * Upgraded framer to latest. Als moved framer and react sticky deps to features instead of atoms. * Added new pagewrapper logic * Simplified rescheduling ssr fetches, this now also supports multi seat rescheduling. * Unset selected time when user is rescheduling directly after a new booking, otherwise it would show the form instead of new time selection. * Updated form builder logic as per form builder in current booker. * Updated form builder prefill logic as per logic in current booker. * Updated getbooking function to fetch correct details when a reschedule uid is used * Fixed booking questions test by NOT waiting for /book page because the new booker doesnt have this. * Added former meeting time to reschedule view. * Fixed types * Undo playwright config update by mistake. * Fixed event types test by only waiting for /book page in old booker * Set new booker cookie to one year in the future instead of 2050 * added reset mockdate to test * Temporary disabled test to see if this solves the out of memory error. * Deleted test to see if that fixes the memory error * Select first day when switching months in booker --------- Co-authored-by: zomars <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-04-24 14:32:30 +00:00
<SkeletonText className="mb-4 h-6 w-full" key={i} />
))}
</div>
);