* fix timezone zone issue for first slot
* fix failed test in getSchedule
* Update apps/web/test/lib/getSchedule.test.ts
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: alannnc <alannnc@gmail.com>
* removed old booker and make new booker as a default
* fixes merge conflict
* fixed tests
* fixed tests for old-booker
* fixed typo in @calcom/lib/defaultEvents.ts
---------
Co-authored-by: René Müller <rene.mueller@clicksports.de>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
## What does this PR do?
Currently, we start the first slot always at the nearest 15 minutes. This is not ideal as for some duration other slot starting time make more sense. So with this PR the starting times are defined as follow:
- Frequency is exact hours (60, 120, 180, ...), slot start time is a full hour
- Frequency is half hours (30, 90, ...), slot start time is half or full hours (8:00, 8:30, ...)
- Same with 20-minute events (20, 40, ...) and 10-minute events
- Everything else will start at the nearest 15 min slot
It also fixes that slot times are shifted when there is a busy slot with a different duration. Here is a before and after of a 30-min event with a 5-minute busy slot at 1:00 pm
Before:
![Screenshot 2023-07-07 at 13 31 45](https://github.com/calcom/cal.com/assets/30310907/b92d4ff4-49f1-48f4-a973-99266f61d919)
After
![Screenshot 2023-07-07 at 13 34 01](https://github.com/calcom/cal.com/assets/30310907/042c7ef7-8c2a-4cd9-b663-183bc07b5864)
#### 30 Minute events, availability starting at 7:15
Before:
![Screenshot 2023-07-06 at 12 40 00](https://github.com/calcom/cal.com/assets/30310907/752ed978-83cf-4ee9-a38d-b5795df6daec)
After:
![Screenshot 2023-07-06 at 12 40 42](https://github.com/calcom/cal.com/assets/30310907/5d51ec15-5be8-4f3b-b374-46dad35216b8)
## Type of change
- Bug fix (non-breaking change which fixes an issue)
## How should this be tested?
- Check if slot times are shown as described
- Test with different intervals/durations
- Test with busy times
- Test with different availabilities
## Mandatory Tasks
- [x] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.
## What does this PR do?
Fix 404 booking pages when org support is enabled locally
## Type of change
<!-- Please delete bullets that are not relevant. -->
- Bug fix (non-breaking change which fixes an issue)
## How should this be tested?
<!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration -->
- Add localhost:3000 to ALLOWED_HOSTNAMES which is the default recommendation for enabling org support locally.
<img width="1035" alt="Screenshot 2023-07-10 at 11 04 35 AM" src="https://github.com/calcom/cal.com/assets/1780212/7272437b-afae-4073-905b-eafc39f9fafc">
- Simply restart the server and visit http://localhost:3000/pro. It will give 404. After this change it would work
## Mandatory Tasks
- [x] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.
* Fix Team Events not working
* Get embed for org events working
* Fix rewrites
* Update next-config.test.ts
Spacing changes
* Update next-config.test.ts
Scan the file through prettier and update
---------
Co-authored-by: alannnc <alannnc@gmail.com>
* Initial commit
* Adding feature flag
* Add schema relation for teams and credentials
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* Create getUserAdminTeams function & tRPC endpoint
* Get user admin teams on app store page
* Create UserAdminTeams type
* Add user query to getUserAdminTeams
* Letting duplicate slugs for teams to support orgs
* Covering null on unique clauses
* Add dropdown to install button on app store
* Supporting having the orgId in the session cookie
* On app page, only show dropdown if there are teams
* Add teamId to OAuth state
* Create team credential for OAuth flow
* Create team credential for GCal
* Add create user or team credential for Stripe
* Create webex credentials for users or teams
* Fix type error on useAddAppMutation
* Hubspot create credential on user or team
* Zoho create create credential for user or team
* Zoom create credentials on user or team
* Salesforce create credential on user or teams
* OAuth create credentials for user or teams
* Revert Outlook changes
* Revert GCal changes
* Default app instal, create credential on user or team
* Add teamId to credential creation
* Disable installing for teams for calendars
* Include teams when querying installed apps
* Render team credentials on installed page
* Uninstall team apps
* Type fix on app card
* Add input to include user in teams query
* Add dropdown to install app page for user or team
* Type fixes on category page
* Install app from eventType page to user or team
* Render user and team apps on event type app page
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* Render user and team apps on event type app page
* Add credentialOwner to eventTypeAppCard types
* Type fixes
* Create hook to check if app is enabled
* Clean up console.logs
* Fix useIsAppEnabled by returning not an array
* Convert event type apps to useIsAppEnabled
* Abstract credential owner type
* Remove console.logs
* On installed app page, show apps if only team credential is installed
* Clean up commented lines
* Handle installing app to just an team event from event type page
* Fix early return when creating team app credential
* Zoom add state to callback
* Get team location credentials and save credential id to location
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Type fix
* Grab team location credentials
* Add isInstalled to eventType apps query
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* Enable payment apps for team credentials
* Fix for team-user apps for event types
* Fix layout and add teamId to app card
* Disable apps on managed event types
* Add managed event type fields to event type apps
* Include organizations in query
* Change createAppCredential to createOAuthAppCredential
* Show app installed on teams
* Making sure we let localhost still work
* UI show installed for which team
* Type fixes
* For team events move use host location to top
* Add around to appStore
* New team event types organizer default conf app
* Fix app card bug
* Clean up
* Search for teamId or userId when deleting credential
* Type fixes
* Type fixes
* Type fixes
* Type fixes
* Address feedback
* Feedback
* Type check fixes
* feat: Organization branding in side menu (#9279)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Making sure we show the set up profile on org only
* Profile username availability rely on org hook
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: Organization support for event types page (#9449)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Processing orgs and children as profile options
* Reverting change not belonging to this PR
* Making sure we show the set up profile on org only
* Removing console.log
* Comparing memberships to choose the highest one
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Type errors
* Refactor and type fixes
* Update orgDomains.ts
* Feedback
* Reverting
* NIT
* Address feedback
* fix issue getting org slug from domain
* Improving orgDomains util
* Host comes with port
* Update useRouterQuery.ts
* Fix app card bug
* Fix schema
* Type fixes
* Revert changes to location apps
* Remove console.log
* Fix app store test
* Handle install app dropdown
* Add CalendarApp to `getCalendar`
* Add PaymentApp type fix
* Payment type fix
* Type fixes
* Match with main
* Change type to account for team
* Fix app count for team events
* Type fixes
* More type fixes
* Type fix?
* Fix the type fix
* Remove UserAdminTeams empty array union
* Type fix
* Type fix
* Type fix
* Uses type predicates
* Use teamId. Fixes installation for teams after user installation
* Fix Team Events not working
* Get embed for org events working
* Fix rewrites
* Address feedback
* Type fix
* Fixes
* Add useAppContextWithSchema in useIsAppEnabled
* Type fix for apps using useIsAppEnabled
* Integrations.handler change credentialIds to userCredentialIds
* Remove apps endpoint
* Add LockedIcon and disabled props to event type app context
* Type fixes
* Type fix
* Type fixes
* Show team installed apps for members
* Type fix
* Reverting findFirst
* Revert findFirst
* Avoid a possible 500
* Fix missing tanslation
* Avoid possible 500
* Undo default app for teams
* Type fix
* Fix test
* Update package.json
* feat: Fix invite bug - added tests (#9945)
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
* chore: Button Component Tidy up (#9888)
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* feat: Make Team Private
## What does this PR do?
Fixes https://github.com/calcom/cal.com/issues/8974
1) When user is admin
<img width="1440" alt="Screenshot 2023-07-03 at 6 45 50 PM" src="https://github.com/calcom/cal.com/assets/53316345/ce15158f-d278-4f1a-ba2e-8b63e4274793">
2) When user is not admin and team is private
<img width="1440" alt="Screenshot 2023-07-03 at 6 47 15 PM" src="https://github.com/calcom/cal.com/assets/53316345/ce23560e-690a-4c42-a76d-49691260aa4d">
3)
<img width="1440" alt="Screenshot 2023-07-03 at 6 51 56 PM" src="https://github.com/calcom/cal.com/assets/53316345/13af38f8-5618-4dae-b359-b24dc91e4eb4">
## Type of change
<!-- Please delete bullets that are not relevant. -->
- New feature (non-breaking change which adds functionality)
## How should this be tested?
1) go to Team members page and turn on switch Make Team Private.
Now after making the team private only admin would be able to see all the members list in the settings. There will not be a button to Book a team member instead on the team page like before.
## Mandatory Tasks
- [ ] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Leo Giovanetti <hello@leog.me>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: Alan <alannnc@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
* Fix RegExp
* Used ORGANIZATIONS_ENABLED to opt-out of orgs behaviour
* Add comments
* Add a new testcase
* Add response headers for easier debugging and Checkly tests in production
* Added unit tests for availability to string
* Testing to see if extra toString() removes unicode
* Replacing unicode space
* Updated to regex
* Reverted files that were not supposed to change
* Reverted schema changes
* Added comment
* Type check
* Change function call structure
---------
Co-authored-by: alannnc <alannnc@gmail.com>
* Add RegExp tests
* Update apps/web/test/lib/next-config.test.ts
* Dont avoid rewrite for /booked event slug
* Add /embed/embed.js test
* Add dynamic group booking link test
* [CAL-1517] fix all Typescript warnings
* solve conflicts
* Update stripeCheckoutSession.handler.ts
Parse is a guard, so even though the variable is unused the parse itself is needed.
* Update ToolbarPlugin.tsx
Don't change dependency tree
---------
Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* Moving to vitest
* Rearranging test
* Fixing prettier linting
* Reverting launch.json
* Adjustments
* Merged with main and regenerated lockfile
* Fixing tests for API
* Yarn updated, docs is gone
---------
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* Enabling workflows for managed events
* Disabling fields for workflow when readonly
* Disabling event type workflows if readonly
* Installing auth app
* Reverting yarn.lock
* Again reverting yarn
* Showing user workflows in managed event type
* Reusing existing code to show all workflows
* Further extending workflow support
* Added unit test
* Fixing workflow assignment
* Fixing locked workflows for children MET
* Update packages/features/ee/workflows/components/EventWorkflowsTab.tsx
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
* Personal workflows fix, matching count numbers
* Fixing menu items for managed event types
* Fixing type checks
* Fixing empty activeOn select
* Fixing unit test
* handling active workflows for MET
* Fixing MET slug nit
* Embed option in action restored for non-MET
* Correcting mobile view when hidden
* More adjustments
* fix sms reminder field for children
* remove console.log
---------
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
* 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>
* fix date override for fixed round robin + time zone in date override
* check if slot is within working hours of fixed hosts
* add test for date override in different time zone
* fix date overrides for not fixed hosts (round robin)
* code clean up
* fix added test
* use the correct timezone of user for date overrides
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
* Reserving slot picked up on cache
* change memory-cache to database table to block slots while reservation completes
* remove memory-cache
* update realeaseAt field when same user change te selected Slot
* Change default time to book
Co-authored-by: alannnc <alannnc@gmail.com>
* remove ip field and renews the session when the user remains in the booking form
* Remove duplicate router
* types fixes
* nit picks
* Update turbo.json
* Revert unrelated change
* Uses constant
* Constant already has a fallback
* Update slots.ts
* Unit test fixes
* slot reservation on user level and support seats
* types fixes and reserve slots on click
* Fix nit var name
---------
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* feat(web): improve session retrieval performance
Switch to using `getServerSession` which avoids a HTTP round trip to retrieve session details.
Additionally, migrate deprecated `app/lib/auth` calls to to `@calcom/lib` package.
* fix: update failing test and lint
* Consolidates auth code in features
* Update yarn.lock
* Update packages/trpc/server/createContext.ts
* Oopsie
---------
Co-authored-by: zomars <zomars@me.com>
* feat(lib): add more tests to lib package
Add more tests to the lib package to make it more robust overall. Additionally, tidy any methods that can be modified without changing behaviour and tighten types where possible.
* fix(lib): update missed imports
* fix: revert stylistic changes
* Update getSchedule.test.ts
---------
Co-authored-by: Omar López <zomars@me.com>
* use the organizer timezone and invitee timezone to show slots
* type fixes
* set start date on selected TZ on booking payload
* add considerations when only the invitee is on DTS
* Apply suggestions from code review
Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: Omar López <zomars@me.com>
* fixes typo
* Apply suggestions from code review
Co-authored-by: alannnc <alannnc@gmail.com>
* cleaning
---------
Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Omar López <zomars@me.com>
Co-authored-by: alannnc <alannnc@gmail.com>
* Updated the busyTimes query to include bookings owned OR hosted by the given user
* Updated getSchedule tests to account for the new where condition
* Ignoring typing within a mocked function
* Further type checks, figured out how to run the command locally
* Maximum call stack size exceeded fix?
# Conflicts:
# packages/prisma/index.ts
* Prisma client extensions is too much for our TS
* Removed unused Icons
* Type fixes
* Refactored buildSlots
* Added typing for computedAvailableSlots
* Adds very simple boundary logic to make sure slots start at the right times
* Logic was cutting off too early
* Woops, should be eventLength, not frequency
* Expect 12:15 slots as availability is till 12:30 for booking
* Deliberately skip test for testing purposes
* slotInterval overrides intervals, but not duration
* Fix calendar mocking
* Another 45m length
* Unskip :(
* Fix test
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Omar López <zomars@me.com>
* Identify owner for a timeslot and check busyness against his schedule only
* Fix TS errors
* Fix flatmap
* Fix xisting unit tests
* Prevent duplicate slots by merging, userId -> userIds (multi)
* Small fix to potential undefined
* Moved duplicate prevention to buildSlots function
* Apply date override on a per user basis
* Prevent -1 being added to computedLocalAvailability
* Removed console.log
* Apply override properly on COLLECTIVE
* Default timeZone to UTC when undefined
* isSame doesn't work when the day shifts, isBetween instead
* Iterate over all slot.userIds schedules to identify the first user schedule that matches
* add round-robin test
Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* Initial incomplete (but mostly functional) push of date override functions
* Fixed date shifting on load
* Bring back minDate (automatically disable all dates before current date)
* Fix type error
* Supply working hours to render available dates
* Converted to SSR
* moving defaultValues to the backend
* Improv. as filter can be achieved within the reduce
Co-authored-by: Omar López <zomars@me.com>
* Double inversion -> single, as it is an early return
* uniq() exit - not needed anymore
* Typefixes
* It's overriding dates :D
* Fixed duplication DateOverrides in list
* Implemented changing the month
* Make dateOverrides an optional param
* Fixed test (which requires dateOverrides due to auto-typing)
* Prevent a full update on set as default from list view
* Added some extra keys to keep ts happy
* Only allow a single date override per date
* Disallow editing excludedDates to the same date
* Bring back duplicate key ?.?
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* Add db relevant stuff
* Basic UI there still buggy
* This UI is hard - some progress
* Fix awful state mangament
* Fix re-ordering
* Working UI logic!
* Partical working minMax function
* Fix min max
* bookingLImits api + tests
* Moved checkBookingLimits to backend only code
* Fix httperror import
* Return busy times
* Remove avaliablity calc
* Working for everything but year
* Remove redundant + fix async forloop
* Add compatible type
* Future proof with evenTypeId filter
* Fix commonjson
* Sorting + validation + tests + passing
* Add empty test
* Move validation check to backend
* Add bookinglimits in trpc
* Add test for undefined
* Apply suggestions from code review
Co-authored-by: Jeroen Reumkens <hello@jeroenreumkens.nl>
* Update apps/web/components/v2/eventtype/EventLimitsTab.tsx
Co-authored-by: Jeroen Reumkens <hello@jeroenreumkens.nl>
* Rename value for eligiability
* Rename keyof type
* status code
* Fix toggle not toggling off
* Update apps/web/pages/v2/event-types/[type]/index.tsx
Co-authored-by: Omar López <zomars@me.com>
* Update apps/web/pages/v2/event-types/[type]/index.tsx
Co-authored-by: Omar López <zomars@me.com>
* Change back to undefined as it is working for sean. See if it fails on testapp
* Fixing test builder
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Jeroen Reumkens <hello@jeroenreumkens.nl>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Omar López <zomars@me.com>
Co-authored-by: Leo Giovanetti <hello@leog.me>
* WIP
* Consolidates jest deps
* Test fixes
* Moves jest to root
* Test fixes
* Update CalendarService.test.ts
* Cleanup
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* WIP
* Fix for team availability with time offsets
* Prevent empty schedule from opening up everything
* When no utcOffset or timeZone's are given, default to 0 utcOffset (UTC)
* timeZone should not be part of getUserAvailability
* Prevents {days:[X],startTime:0,endTime:0} error entry
* Added getAggregateWorkingHours() (#3913)
* Added test for getAggregateWorkingHours
* Timezone isn't used here anymore
* fix: developer docs url (#3914)
* fix: developer docs url added
* chore : remove /
* chore : import url
Co-authored-by: Zach Waterfield <zlwaterfield@gmail.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* Test fixes
* Reinstate prisma (generate only) and few comments
* Test fixes
* Skipping getSchedule again
* Added await to expect() as it involves async logic causing the promise to timeout
* Test cleanup
* Update jest.config.ts
Co-authored-by: Alan <alannnc@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: Zach Waterfield <zlwaterfield@gmail.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* wip commit
* Finished new algorithm for fetching the least recently booked user
* ROUND_ROBIN fix
* Removed redundant import
* Prisma dependency turned getLuckyUser into a server-only function
* DRY avatars
* Properly passThrough
* name can be undefined.
* Remove debug artefact
* -re init dynamic links
* typing fix 001
* added missing div closing tag
* added necessary DB column pull to satisfy Type errors
* further type fixes
* WIP
* removed console logs
* some revert
* WIP
* another approach
* enabled dynamic links availability fetch
* Added users to eventTypeObject for consistency
* WIP: Moving user and changing map item name
* Fix user list call
* Removed explicit User type in map
* modify default user attributes
* adds explicit users to EventTypeObject in teams
* Updated availability page
* Updates Availability
* Futher availability change
* Remove explicit user type from slot router
* more fixes
* more fixes WIP
* cleaning up more errors WIP
* object assign used for typesafety
* added check if dynamic booking is allowed by all users
* cleaned up console logs
* clean up
* Improvement
* resolving suggestions by alex
* changes requested by Omar
* Filter out empty usernames instead of accepting null
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>