Compare commits

...
196 Commits
Author SHA1 Message Date
Alex van Andel 8a2da017ff v2.6.8
release.yml / release (push) Canceled after 0s
2023-03-08 13:04:44 +00:00
Nafees Nazik 2f8280a6ee fix: routing form delete button not rendered (#7424) 2023-03-08 12:39:58 +00:00
4e1e2577eb fix: create a trpc route for fetching country (#7555)
* fix: create a trpc route for fetching country

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* fix: type error

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

---------

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
2023-03-08 12:33:42 +00:00
Udit TakkarandPeer Richelsen 84da528d4d feat: add partstat, rsvp, role (#6940)
* feat: add partstat, rsvp, role

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* fix: type error

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

---------

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-03-08 11:58:09 +00:00
Nafees NazikandPeer Richelsen 29ceaee8d2 feat: Add fresh chat to list of support integration (#7448)
* chore: add fresh chat configs to env.example

* feat: add fresh chat menu item and render

* refactor: remove some event listeners

* chore: make popover closed after the click

* refactor the code and fix some bugs

* feat: auto open chat

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-03-08 11:30:24 +00:00
Nafees NazikandPeer Richelsen d28c914d3c Fix modal z index issue in settings (#7578)
* feat: add z-index to modal

* feat: reduce z-index

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-03-08 10:59:06 +00:00
github-actions[bot]andCrowdin Bot 34d3bdf868 New Crowdin translations by Github Action (#7579)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-03-08 11:36:32 +01:00
github-actions[bot]andCrowdin Bot 58836eefbf New Crowdin translations by Github Action (#7577)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-03-08 10:51:07 +01:00
github-actions[bot] 4ab6c2b3da New Crowdin translations by Github Action (#7569) 2023-03-08 08:50:57 +01:00
Efraín Rochínandzomars e1601960df Generate getSchedule response using the invitee timeZone (#7574)
* Generate getSchedule response using the invitee timeZone

* Prevents too much diffing

* Adds follow up to TODO to issue

---------

Co-authored-by: zomars <zomars@me.com>
2023-03-07 19:24:36 -07:00
zomars c97fecf436 Syncs react-hook-form in console/website 2023-03-07 19:08:00 -07:00
Carina WollendorferandCarinaWolli 804ba04983 make eventpage optional (#7573)
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
2023-03-07 23:50:34 +00:00
Joe Au-Yeung 163444a0f9 Bug - teams being double created without slugs (#7571) 2023-03-07 23:02:05 +00:00
b0da827483 fix: event location not translated in booking page (#7528)
* fix: event location not translated

* fix: translate

* chore: lowercase trans keys

* fix: label

* feat: snake case labels

* fix: show the link if the user has one

* fix: add translatable keys

* fix:

* chore: fix type error

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
2023-03-07 22:37:56 +00:00
Alex van Andel 1b468b9ae7 Fixed test (#7572) 2023-03-07 15:15:11 -07:00
2fa83bd512 Add Idp-Initiated SSO (#6781)
* wip idp enabled login

* add route to handle callback from IdP

* update the new provider

* cleanup

* fix the type

* add suggested changes

* make the suggested changes

* use client secret verifier

* Make [...nextauth] a little easier to read

---------

Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Omar López <zomars@me.com>
2023-03-07 14:31:39 -07:00
zomars 7eecc311e0 Syncs yarn.lock with submodules 2023-03-07 12:55:44 -07:00
github-actions[bot]andCrowdin Bot 6c8b428577 New Crowdin translations by Github Action (#7566)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-03-07 20:04:35 +01:00
github-actions[bot]andCrowdin Bot 699c55da18 New Crowdin translations by Github Action (#7562)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-03-07 19:48:20 +01:00
Kiran KandPeer Richelsen 74a30a180e URL to initiate SAML authentication flow (#6813)
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-03-07 18:33:16 +00:00
Hariom BalharaandPeer Richelsen ce8e1d52da Fix "User Added Question" Label in Email and Calendar Invite (#7559)
* Show label in email and calendar invite and send label as well as name in webhook

* Make common code reusable

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-03-07 17:50:54 +00:00
Hariom Balhara 6f8ea490d0 "Manage Booking Questions" - Add a comprehensive test (#7465)
* Add first test

* Add test for team event as well
2023-03-07 17:40:47 +00:00
github-actions[bot]andCrowdin Bot a2fd5ba2a2 New Crowdin translations by Github Action (#7561)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-03-07 18:28:10 +01:00
Udit Takkar 48c8b749ce fix: remove alert and disable toggle (#7542) 2023-03-07 17:05:01 +00:00
Syed Ali Shahbaz faaf935724 Fix for bad primary calendar check (#7557) 2023-03-07 15:47:10 +00:00
github-actions[bot]andCrowdin Bot 0c94b0a30a New Crowdin translations by Github Action (#7546)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-03-07 12:25:32 +01:00
Nafees Nazik a25195cf20 fix: overflow issue in event type form builder and booking page (#7553) 2023-03-07 13:25:06 +05:30
Alex van Andel 56a2b66190 v2.6.7
release.yml / release (push) Canceled after 0s
2023-03-06 23:53:04 +00:00
Carina WollendorferandCarinaWolli a0f55707e2 make "text" the default value (#7543)
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
2023-03-06 23:27:29 +00:00
Alex van Andel b247075a19 Revert "Update CODEOWNERS"
This reverts commit 25ec5313fb.
2023-03-06 23:18:45 +00:00
Alex van Andel 25ec5313fb Update CODEOWNERS
Add kodiakhq as reviewer for translations.
2023-03-06 23:16:17 +00:00
Efraín Rochín 33f35e77fd Fix/incorrect timezone on booking success (#7544)
* set the selected timezone to formatToLocalizedTimezone function

* remove console.logs
2023-03-06 23:12:43 +00:00
Benjamin BabicandPeer Richelsen 69808bb9a4 1172 booking uid design update (#7537)
* booking/[uid] additional fields design update

* add host badge to the who field

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-03-06 22:45:40 +00:00
GitStart-Cal.comandgitstart-calcom 18b6a93476 Fix: Filter Timezones by cities (#7540)
Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
2023-03-06 17:52:20 +00:00
Peer Richelsen e627cc51fd max-height for description + scroll bar, removing description icon (#7535)
* max-height for description, scroll

* added nicer scrollbar

* removing info icon for more description space
2023-03-06 16:44:31 +00:00
Peer Richelsen b349def58b Update README.md 2023-03-06 15:49:22 +01:00
github-actions[bot]andCrowdin Bot 6a6faf30ff New Crowdin translations by Github Action (#7534)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-03-06 14:50:58 +01:00
Alex van AndelandPeer Richelsen 5616dba4db Minor typo fixups :pray (#7530)
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-03-06 13:46:21 +00:00
bca1a1b86c New Crowdin translations by Github Action (#7522)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-03-06 14:20:14 +01:00
Julius MarmingeandAlex van Andel ddf7a234ab use inner context type (#7449)
Co-authored-by: Alex van Andel <me@alexvanandel.com>
2023-03-06 13:17:16 +00:00
Nafees NazikandAlex van Andel fa7260d72a feat: use next transpile packages feature (#7527)
* feat: use next transpile packages feature

* Also remove next-transpile-modules from storybook (+ remove experimental)

---------

Co-authored-by: Alex van Andel <me@alexvanandel.com>
2023-03-06 13:10:39 +00:00
Joe Au-YeungandAlex van Andel 5f9f6ef025 Only show Google Meet dependency when GCal is not set as destination calendar (#7442)
* Query for destination calendar

* Only display Meet warning when destination calendar is not GCal

* Add conditional

---------

Co-authored-by: Alex van Andel <me@alexvanandel.com>
2023-03-06 12:37:18 +00:00
3d41c64d81 feat: error message for invalid variables in custom event name (#7426)
* feat: add custom validate name util

* refactor: separate custom event type modal into a
different component

* feat: add validation to zod

* chore: add i18n key

* feat: add dynamic imports

* fix: padding

* Omit cache-hit exit 1, assuming it'll fail regardless

---------

Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
2023-03-06 12:14:54 +00:00
sean-brydonandAlex van Andel 8a9b985760 Bulk edit locations when default conferencing app is set (#7520)
* Bulk edit default locations

* Update [category]

* Open modal on none link events

---------

Co-authored-by: Alex van Andel <me@alexvanandel.com>
2023-03-06 10:53:35 +00:00
Udit Takkar c8956680ad fix: use slug in options (#7523)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
2023-03-06 10:47:57 +00:00
Udit Takkar c2668acd33 fix: use recordingId to check loading (#7524)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
2023-03-06 10:39:54 +00:00
Peer Richelsen 89bf8321ba Update CONTRIBUTING.md 2023-03-05 23:00:57 +01:00
github-actions[bot]andCrowdin Bot da625f1527 New Crowdin translations by Github Action (#7516)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-03-05 17:57:16 +01:00
Udit TakkarandAlex van Andel 2dddd4ce77 feat: create trpc route to fetch download link (#7495)
* feat: create trpc route to fetch download link

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* fix: removing file, adding isdownloadable logix

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* chore

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* fix: type error

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* Some performance enhancements and better error logging

* Add error message here too

---------

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
2023-03-05 12:59:07 +00:00
Leo Giovanetti cc1d606ba8 Implementing CAL-1173 (#7509)
* Implementation

* Added check when no pass is provided

* Refactoring login url to function
2023-03-05 02:09:45 +00:00
Alex van Andel 262c8cf37c Removed @next/font (#7514) 2023-03-04 20:07:50 +00:00
Alex van Andel 4366405b21 Updates to yarn.lock / removed outdated deps from downstream 2023-03-04 16:23:15 +00:00
Hariom BalharaandAlex van Andel 07399974ce Small Embed Fixes (#7513)
* Fix bg beyond rounded border in embed

* Consider margin as well for mainElement height

* Fix loader positioning

* Give better name to embed artifacts

---------

Co-authored-by: Alex van Andel <me@alexvanandel.com>
2023-03-04 16:11:04 +00:00
Alex van Andel 9d7cd73c7f Fixed lockfile, bumped nextjs to v13.2.3 2023-03-04 15:10:13 +00:00
1551a293c5 Made Skeleton Loader for Availibilty Page look more like actual content of the page (#7415)
Co-authored-by: Raunak Singh Jolly <raunak.singh@oriserve.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
2023-03-03 18:08:10 -07:00
47e948fbbc Fixes formatting issues with lists in event type description and bio (#7505)
* fix ul and ol in editor

* fix imports

* disable list for team about section

* fix event type description in list

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-03-04 00:20:13 +01:00
Omar López c8b01f6992 Revert "fix: use only slug (#7504)" (#7506)
This reverts commit f3143d99ee.
2023-03-03 15:44:14 -07:00
Udit Takkar f3143d99ee fix: use only slug (#7504)
* fix: use only slug

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* chore

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* fix: create slug key

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

---------

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
2023-03-03 15:43:26 -07:00
github-actions[bot] 61a5c3a3b5 New Crowdin translations by Github Action (#7467) 2023-03-03 17:41:00 +01:00
Carina WollendorferandCarinaWolli 056edd8ec2 fix event type options (#7473)
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
2023-03-03 09:36:23 -07:00
Hariom Balhara d8387835a8 Well, you can have 0 attendees in a booking (#7494) 2023-03-03 09:35:58 -07:00
Nafees Nazik 26ea249481 Fix: email encoding bug (#7490)
* fix: existing decode Uri

* feat: unescape characters in base email

* fix: encoding in booking page
2023-03-03 09:35:11 -07:00
2d26d73eb3 Fix/DST issues (#7462)
* 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>
2023-03-03 09:33:16 -07:00
Hariom Balhara b8b24c04dc We dont support button html (#7500) 2023-03-03 09:30:44 -07:00
Alex van Andel 62dcd6612c Removed some of the UTC logic which shouldn't be there (#7425)
* Removed some of the UTC logic which shouldn't be there

* Upgrade rhf, remove SSR on [schedule] page

* Fix potential bug with date

* Amend schedule trpc call & don't show edit availability if id is undefined

* type fix

* Order date overrides in list by date

* Changed logic to check for unavailable

* Fix bug report spotted by @CarinaWolli

I can save date overrides for march 1st and 2nd (my date/time when saving was march 1st at 11PM GMT-5). It is saved successfully in the database however the date overrides don't show up in the list.

That's why:

- new Date() is utc so it is already march 2nd
- override.date has always timestamp 00:00 so it is also smaller than the utc time which was in my case 2023-03-02T04:00

* Actual fix, gotta remember it's the schedule tz
2023-03-03 14:02:02 +01:00
zomars 295748adca Update yarn.lock 2023-03-02 14:00:21 -07:00
Omar López 6e93224c9b Tree shake icons (#7051)
* Attempt to tree shake icons

* Tree shaking icons
2023-03-02 13:56:10 -07:00
4d8198d113 Filter Timezones by cities (#7118)
* Filter Timezones by cities

* Update yarn.lock

* Removes large endpoint from batching

* Adds caching for large response

* Updates test snapshots

---------

Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
2023-03-02 13:42:41 -07:00
Nafees Nazik 5fe0ca7913 fix: escape markdown in users OG image (#7474)
* fix: escape markdown in bio

* chore: add remark and strip-markdown package

* feat: strip markdown

* fix: remove first commit
2023-03-02 12:55:57 -07:00
cfb625e934 Editor for event type description (#7450)
* add editor for event type description

* enable same things for markdownIt

* show links in blue

* fix placeholder design

* format description for event list

* limit event descript ot 4 lines in list

* shorten event-type description whenever needed

* add editor to create event type dialog

* fix link title in event type list

* Fix overwriting users column when saving event types (#7445)

* Only overwrite user column when present

* Clean up

* Merge branch 'main' into feat/editor-event-type-description

* Merge branch 'main' into feat/editor-event-type-description

# Conflicts:
#	apps/web/pages/settings/my-account/profile.tsx

* Linting

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
2023-03-02 12:55:25 -07:00
Hariom Balhara e12b21a73c Check app-store types on CI (#7190)
* Check app-store types on CI

* Fix ESLINt error
2023-03-02 11:58:31 -07:00
Warrenandzomars 841346c5f2 Install DeploySentinel Playwright reporter (#7405)
* install reporter

* Update e2e-app-store.yml

---------

Co-authored-by: zomars <zomars@me.com>
2023-03-02 11:25:30 -07:00
zomars 1270742078 Linting 2023-03-02 11:23:41 -07:00
517cfde5b8 Feature/ Manage Booking Questions (#6560)
* WIP

* Create Booking Questions builder

* Renaming things

* wip

* wip

* Implement Add Guests and other fixes

* Fixes after testing

* Fix wrong status code 404

* Fixes

* Lint fixes

* Self review comments addressed

* More self review comments addressed

* Feedback from zomars

* BugFixes after testing

* More fixes discovered during review

* Update packages/lib/hooks/useHasPaidPlan.ts

Co-authored-by: Omar López <zomars@me.com>

* More fixes discovered during review

* Update packages/ui/components/form/inputs/Input.tsx

Co-authored-by: Omar López <zomars@me.com>

* More fixes discovered during review

* Update packages/features/bookings/lib/getBookingFields.ts

Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>

* More PR review fixes

* Hide label using labelSrOnly

* Fix Carinas feedback and implement 2 workflows thingy

* Misc fixes

* Fixes from Loom comments and PR

* Fix a lint errr

* Fix cancellation reason

* Fix regression in edit due to name conflict check

* Update packages/features/form-builder/FormBuilder.tsx

Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>

* Fix options not set when default value is used

* Restoring reqBody to avoid uneeded conflicts with main

* Type fix

* Update apps/web/components/booking/pages/BookingPage.tsx

Co-authored-by: Omar López <zomars@me.com>

* Update packages/features/form-builder/FormBuilder.tsx

Co-authored-by: Omar López <zomars@me.com>

* Update apps/web/components/booking/pages/BookingPage.tsx

Co-authored-by: Omar López <zomars@me.com>

* Apply suggestions from code review

Co-authored-by: Omar López <zomars@me.com>

* Show fields but mark them disabled

* Apply suggestions from code review

Co-authored-by: Omar López <zomars@me.com>

* More comments

* Fix booking success page crash when a booking doesnt have newly added required fields response

* Dark theme asterisk not visible

* Make location required in zodSchema as was there in production

* Linting

* Remove _metadata.ts files for apps that have config.json

* Revert "Remove _metadata.ts files for apps that have config.json"

This reverts commit d79bdd336cf312a30a8943af94c059947bd91ccd.

* Fix lint error

* Fix missing condition for samlSPConfig

* Delete unexpectedly added file

* yarn.lock change not required

* fix types

* Make checkboxes rounded

* Fix defaultLabel being stored as label due to SSR rendering

* Shaved 16kb from booking page

* Explicit types for profile

* Show payment value only if price is greater than 0

* Fix type error

* Add back inferred types as they are failing

* Fix duplicate label on number

---------

Co-authored-by: zomars <zomars@me.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
2023-03-02 11:15:28 -07:00
Hariom BalharaandAlex van Andel 51bf613621 Add hariom as codeowner for Routing Forms (#7469)
* Add hariom as codeowner for Routing Forms

* Update CODEOWNERS

---------

Co-authored-by: Alex van Andel <me@alexvanandel.com>
2023-03-02 16:22:09 +00:00
sean-brydonandAlex van Andel f4c3ab6431 Availability uiux improvements (#7466)
* Delete modal + button on [schedule]

* Update to V2 component

* Default Icon

---------

Co-authored-by: Alex van Andel <me@alexvanandel.com>
2023-03-02 16:20:02 +00:00
Alex van Andel e8acc3e500 Apparently we must use paths-ignore instead of paths 2023-03-02 14:51:24 +00:00
Alex van Andel a6ba0f5b57 Exclude **.md/CODEOWNERS files from triggering pr.yml wf 2023-03-02 14:36:33 +00:00
Alex van Andel b82d924f03 Update CODEOWNERS
Add @calcom/core to all single person claims
2023-03-02 14:16:25 +00:00
Hariom Balhara 1cdb51f424 Fix tests flakiness in embed (#7468) 2023-03-02 13:58:46 +00:00
Joe Au-YeungandHariom Balhara aca0dc1b01 Fix webhook e2e test (#7455)
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
2023-03-02 12:13:55 +00:00
zomars e5e8c33c34 Adds missing cleanups to e2e tests 2023-03-01 16:35:28 -07:00
github-actions[bot]andCrowdin Bot c76847a8f1 New Crowdin translations by Github Action (#7453)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-03-01 22:58:06 +01:00
Joe Au-Yeung 7b1ced914b Fix overwriting users column when saving event types (#7445)
* Only overwrite user column when present

* Clean up
2023-03-01 10:16:04 -07:00
zomars a6cd173910 Update playwright.config.ts 2023-02-28 16:43:44 -07:00
zomars dcd39c3f04 Update pr.yml 2023-02-28 16:42:13 -07:00
Efraín Rochínandzomars aa0a1fcc95 upgrade nextjs to 13.2 version and replace @next/font for in built ne… (#7440)
* upgrade nextjs to 13.2 version and replace @next/font for in built next/font

* Sync packages

* Update yarn.lock

* Updates edge configs

---------

Co-authored-by: zomars <zomars@me.com>
2023-02-28 16:38:46 -07:00
Udit Takkar 76cf352bce fix: set organiser email to external id (#7406)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
2023-02-28 14:53:20 -07:00
github-actions[bot]andCrowdin Bot 86ab19be30 New Crowdin translations by Github Action (#7409)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-02-28 14:52:08 -07:00
Julius Marmingeandzomars e4b766b9d6 refactor: cleanup use of rawInput and pipe mdwr in trpc router (#7422)
* cleanup use of rawInput and pipe mdwr

* Update ssg.ts

* Update ssg.ts

* Update viewer.tsx

---------

Co-authored-by: zomars <zomars@me.com>
2023-02-28 14:40:19 -07:00
Efraín Rochínandzomars 2529f71770 Upgrade prisma to 4.11.0 version (#7438)
* Upgrade prisma to 4.11.0 version

* Update yarn.lock

* Syncs packages

* Update yarn.lock

* Removes deprecations

---------

Co-authored-by: zomars <zomars@me.com>
2023-02-28 14:15:50 -07:00
zomars 9ea0f02c93 Update production-build.yml 2023-02-28 14:14:24 -07:00
zomars fb1828c8f9 GH actions improvements
commit 3ea36a4b9626c99bf343caf8bacb756a09699990
Author: zomars <zomars@me.com>
Date:   Tue Feb 28 13:26:58 2023 -0700

    Revert "One more time"

    This reverts commit fd8b559a135820567f40dbb47a4b4dfc2ef44755.

commit fd8b559a135820567f40dbb47a4b4dfc2ef44755
Author: zomars <zomars@me.com>
Date:   Tue Feb 28 13:00:49 2023 -0700

    One more time

commit e8fe71d795a74c00eb59139389df454a2ff8d807
Author: zomars <zomars@me.com>
Date:   Tue Feb 28 12:40:28 2023 -0700

    Fix?

commit 84517e6ddbca2248b72d6cd912c2c32f9efb743c
Author: zomars <zomars@me.com>
Date:   Tue Feb 28 12:38:20 2023 -0700

    Revert "Consolitades setup step"

    This reverts commit 5e8d1983cc5ac309fa6875a2fee77aa6287b7151.

commit 5e8d1983cc5ac309fa6875a2fee77aa6287b7151
Author: zomars <zomars@me.com>
Date:   Tue Feb 28 12:34:52 2023 -0700

    Consolitades setup step

commit 8e732c4cf9662daf84ab8c3acf702292fb6dd4e5
Merge: 00485a9d3 12f2c1f43
Author: zomars <zomars@me.com>
Date:   Tue Feb 28 12:25:18 2023 -0700

    Merge remote-tracking branch 'upstream/main'

commit 00485a9d3313d415906141493febdbf56dff649d
Author: zomars <zomars@me.com>
Date:   Tue Feb 28 12:08:29 2023 -0700

    Update action.yml

commit 95c30af12f91b4cc310f0a61b5d584591bebc3ee
Author: zomars <zomars@me.com>
Date:   Tue Feb 28 12:05:42 2023 -0700

    Update action.yml

commit e56d8a73e25c664afb0066aedc792250abc3b86a
Author: zomars <zomars@me.com>
Date:   Tue Feb 28 11:09:21 2023 -0700

    Removed setup

commit ff83d88ac6cd7338204ce93a84c285189bd6d352
Author: zomars <zomars@me.com>
Date:   Tue Feb 28 10:54:30 2023 -0700

    Is this redundant?

commit b40b65e8da1238abe097913a3422f24be342c27e
Merge: 774ba24ae 29e9bd0ee
Author: zomars <zomars@me.com>
Date:   Tue Feb 28 10:53:25 2023 -0700

    Merge remote-tracking branch 'upstream/main'

commit 774ba24aeb1d0fde55963fe6aecdf3fddddfa497
Merge: 450812044 9c794bac1
Author: zomars <zomars@me.com>
Date:   Tue Feb 28 10:18:53 2023 -0700

    Merge remote-tracking branch 'upstream/main'

commit 450812044137b665eb90422daf58e8e042cf1492
Author: Omar López <zomars@me.com>
Date:   Tue Feb 28 07:35:02 2023 -0700

    Update action.yml

commit c1d6937f4c22039138284985a4da723ac4ea7803
Author: Omar López <zomars@me.com>
Date:   Tue Feb 28 07:19:52 2023 -0700

    Update action.yml

commit de3ec8b5d8a94ae3cf9aa1e7f3accdf5a8101159
Author: Omar López <zomars@me.com>
Date:   Tue Feb 28 07:05:39 2023 -0700

    Update action.yml

commit b6f6382f1554394ea743acc92824fd7e222ee97d
Author: Omar López <zomars@me.com>
Date:   Tue Feb 28 06:30:55 2023 -0700

    Update action.yml

commit e79c03c7a31930dd99ccd9f5cdc156b808c869a5
Author: Omar López <zomars@me.com>
Date:   Tue Feb 28 06:06:51 2023 -0700

    Update action.yml

commit 55cc76f526aefa83a8275b06ad3f55b6d201e8a6
Author: zomars <zomars@me.com>
Date:   Mon Feb 27 21:09:05 2023 -0700

    Update pr.yml

commit ffc5d245613f1364e302a4c91e32490d8621b987
Merge: 2c41c16af 4eecd4220
Author: zomars <zomars@me.com>
Date:   Mon Feb 27 21:03:22 2023 -0700

    Merge branch 'up-main'

commit 2c41c16afc2f1c4c0ad77f1064b7e1369146ac48
Author: zomars <zomars@me.com>
Date:   Mon Feb 27 20:23:13 2023 -0700

    Updates webhook response

commit cc5ef15b431226d97d3128e8460e9b6f505cba44
Author: zomars <zomars@me.com>
Date:   Mon Feb 27 20:11:35 2023 -0700

    Typefix

commit 50be9255cb8f839c2e8914e03a963c63b7dd5948
Author: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Date:   Mon Feb 27 15:45:40 2023 -0500

    Fix - add team members to emails (#7207)

    * On booking add team members & translation

    * Add team members to round robin create

    * Only update calendars on reschedule if there is a calendar reference

    * Send email on reschedules

    * Send team email on cancelled event

    * Add team members to calendar event description

    * Clean up

    * Convert other emails to organizer & teams

    * Type check fixes

    * More type fixes

    * Change organizer scheduled input to an object

    * early return updateCalendarEvent

    * Introduce team member type

    * Fix type errors

    * Put team members before attendees

    * Remove lodash cloneDeep

    * Update packages/core/EventManager.ts

    Co-authored-by: Omar López <zomars@me.com>

    * Remove booking select object

    * Revert "Remove booking select object"

    This reverts commit 9f121ff4ebbaec9a0643111f96c5337b930ddd5b.

    * Refactor email manager (#7270)

    Co-authored-by: zomars <zomars@me.com>

    * Type change

    * Remove conditional check for updateAllCalendarEvents

    ---------

    Co-authored-by: zomars <zomars@me.com>

commit c7d22a851c584600952e62f8a383a52bee1ad87e
Author: Omar López <zomars@me.com>
Date:   Mon Feb 27 12:39:26 2023 -0700

    Update viewer.tsx (#7428)

commit db5b802a157e4e4abdf5cb55149eb9a4d4e19a12
Author: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Date:   Mon Feb 27 13:47:21 2023 -0500

    Add destination calendar name to DestinationCalendarSelector (#6701)

    * Add destination calendar name

    * Type fix

    * Search through calendars only for destination calendar credential

    * Refactor get connected calendars

    * Clean up

    ---------

    Co-authored-by: zomars <zomars@me.com>

commit 27512b16d2e189826a7719cbf7cec1fd55ad419a
Author: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
Date:   Mon Feb 27 02:24:43 2023 -0500

    Team Workflows (#7038)

    Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
    Co-authored-by: CarinaWolli <wollencarina@gmail.com>
    Co-authored-by: zomars <zomars@me.com>
    Co-authored-by: Peer Richelsen <peeroke@gmail.com>

commit 7b47956a34b9e474c9667ce0f1dbc9a45991a991
Author: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Date:   Sun Feb 26 00:45:05 2023 +0530

    feat: get country code from ip geolocation (#6880)

    * feat: get coutnry code from ip geolocation

    Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

    * fix: create new api route for fetching code

    Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

    * chore: replace city with country

    Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

    * refactor: create hook for country

    Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

    ---------

    Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

commit 658ccc651743c81ab08b4a8a5fecdfd3149ef518
Author: Esaú Morais <55207584+esau-morais@users.noreply.github.com>
Date:   Sat Feb 25 16:07:41 2023 -0300

    Update settings back button redirect link (#7403)

    * fix(schedule): close on click #7143

    * fix(EventSetupTab): validLocations length will always match validLocations length #7138

    * fix(SettingsLayout): go back to right route #7379

commit b5849ca30fde97a986cb697220b47712c24834e3
Author: Omar López <zomars@me.com>
Date:   Fri Feb 24 20:57:49 2023 -0700

    Zomars/cal 884 paid events not sending the link (#7318)

    * WIP

    * Sends correct emails for paid bookings

    * Update PaymentService.ts

    * Update webhook.ts

    * Update webhook.ts

commit a57369d521b3e0c278e72a4002842a2267a72636
Author: zomars <zomars@me.com>
Date:   Mon Feb 27 17:56:55 2023 -0700

    Whitespace!!

commit 4d74fa89bf3967696ffd72191b387ad48cb29240
Author: zomars <zomars@me.com>
Date:   Mon Feb 27 16:36:08 2023 -0700

    fix

commit fe1724accc81a46b12c1f6a3cdf1669908a4df42
Author: zomars <zomars@me.com>
Date:   Mon Feb 27 16:23:24 2023 -0700

    Build fix

commit 0ce2c654cefb505bc0772cbd424c2d1887e009c1
Author: zomars <zomars@me.com>
Date:   Mon Feb 27 16:17:48 2023 -0700

    LFG

commit d8be3316799ed7b032f9539e2c98d938872e7483
Author: zomars <zomars@me.com>
Date:   Mon Feb 27 15:59:52 2023 -0700

    Please

commit d27f36f8896269f1b4083d4e5fb5443bfb86e49a
Author: zomars <zomars@me.com>
Date:   Mon Feb 27 15:41:33 2023 -0700

    Pls

commit eb4d01eff2210a087bd69b0756784c2ad9b0647b
Author: zomars <zomars@me.com>
Date:   Mon Feb 27 15:28:01 2023 -0700

    Test

commit c3fd449cfda8ba3c8a43718591f44a36fa95e4ae
Author: zomars <zomars@me.com>
Date:   Mon Feb 27 14:07:52 2023 -0700

    a

commit 21cc8834157c9cca6c6c49ea54f1b227a29264db
Author: zomars <zomars@me.com>
Date:   Sat Feb 25 09:35:42 2023 -0700

    Fingers crossed

commit f674d7f99b752b9a5cf6c167d10b744d2b7401af
Author: zomars <zomars@me.com>
Date:   Sat Feb 25 09:31:44 2023 -0700

    cache-build not skipping

commit 3cbbead2f2707488c53ac9f982aa8e704ff93e33
Author: zomars <zomars@me.com>
Date:   Sat Feb 25 09:16:16 2023 -0700

    One more time

commit 20672bfbc8f039ae5e699465bf7cab27dde8ba1b
Author: zomars <zomars@me.com>
Date:   Sat Feb 25 09:00:51 2023 -0700

    Caching is hard

commit a6ff8974a4571da10fac48f2555ed1f92f9b0b9d
Author: zomars <zomars@me.com>
Date:   Sat Feb 25 08:45:09 2023 -0700

    Running out of ideas

commit d7577926add336d806509231c35f41f5bf826f22
Author: zomars <zomars@me.com>
Date:   Sat Feb 25 08:31:54 2023 -0700

    Possible caching conflicts

commit 1cc8e6e8977f255f0095c0f03b5ad11195220a35
Author: zomars <zomars@me.com>
Date:   Sat Feb 25 08:05:35 2023 -0700

    e2e

commit 4636609be2efe6a028d1faae180f992376021862
Author: zomars <zomars@me.com>
Date:   Sat Feb 25 08:03:08 2023 -0700

    Cache fixes

commit 6db3b1afbe3d2b1ccecce6d83f5410f1ffa4453f
Author: zomars <zomars@me.com>
Date:   Sat Feb 25 07:49:50 2023 -0700

    Test

commit 8d2587bc3a72daaba4e74b2ee7878199451b3577
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 21:20:27 2023 -0700

    db-cache fixes

commit 0991c54f36a47d05b0baab036ab3ed1039c59154
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 21:07:13 2023 -0700

    Adds skipping steps

commit e8e437ba0178c5cab54613e1c1f1cac1cd0d73ad
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 21:04:38 2023 -0700

    Fixes

commit d5912767bd3a5b57c9150e0b851f51b2d9f6750b
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 20:48:15 2023 -0700

    Cache fixes

commit 88aa6d560ecb9e8f4603344454fabd68bc3fa990
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 20:17:23 2023 -0700

    Fix

commit 594d8b5efe0f320de13862dba552e8fffb9d2cde
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 20:17:23 2023 -0700

    Fix

commit 0b29558a6c248dce961cb462a46f5047ef917545
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 20:12:45 2023 -0700

    Fix

commit f80259232c6b6f58556d2f39212329d87c3468ca
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 20:09:53 2023 -0700

    Fix

commit 73b02c2c920e2f0f9996d1cf6580fb4195ec69e4
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 20:04:07 2023 -0700

    Fix

commit 4c375c89523651779b47f0fc53e0effb78300a08
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 19:59:15 2023 -0700

    FFS

commit fbe8eb969f4a22840b8a518ee87892b488964638
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 19:56:59 2023 -0700

    Fixes

commit 619b26de0205c4094966fe36b40ca37def743309
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 19:53:39 2023 -0700

    Fix

commit 737a29b80a53b0fdda953fa9c9068da60b018fcb
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 19:51:38 2023 -0700

    Fix

commit a9cf1fd3830306c246283debfb8654f011053688
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 19:49:20 2023 -0700

    Another fix

commit 0770c5b8141dc819bdfb065ba41793edfb9660d2
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 19:45:41 2023 -0700

    Fix

commit efb9d0ccd48446ddf66eb84bd45dedb36132e025
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 19:43:42 2023 -0700

     Fix env setter

commit 5cda52f1f95cbfcaf34f8b196101834e6adcda1a
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 19:23:11 2023 -0700

    Add env-cache

commit ad8e36891e3adb9621202a054e188727f9a2beac
Author: zomars <zomars@me.com>
Date:   Fri Feb 24 18:56:27 2023 -0700

    Create env file workflow
2023-02-28 13:52:50 -07:00
Alex van Andel 12f2c1f431 Negate node_modules to decrease the file count 2023-02-28 19:06:12 +00:00
zomars 29e9bd0ee7 Run cached installs
Should still be faster. Ensures prisma client is up to date.
2023-02-28 10:33:01 -07:00
zomars 9c794bac1a Only match exact key 2023-02-28 10:12:55 -07:00
zomars feca7c23fb Removes partial matching for DB 2023-02-28 10:03:13 -07:00
Omar López 31599cdd26 Fixes prod build hashing
https://github.com/actions/cache/issues/1125#issuecomment-1447688501
2023-02-28 07:38:28 -07:00
Alex van Andel e018eb9ebe Omit cache-hit exit 1, assuming it'll fail regardless 2023-02-28 11:40:12 +00:00
Alex van Andel a3f3f1f263 Match env file exactly without restore-keys 2023-02-28 11:30:54 +00:00
d19eaae5b6 Solves Github actions caching issues (#7431)
* Create env file workflow

* Add env-cache

* Fix env setter

* Fix

* Another fix

* Fix

* Fix

* Fixes

* FFS

* Fix

* Fix

* Fix

* Fix

* Fix

* Cache fixes

* Fixes

* Adds skipping steps

* db-cache fixes

* Test

* Cache fixes

* e2e

* Possible caching conflicts

* Running out of ideas

* Caching is hard

* One more time

* cache-build not skipping

* Fingers crossed

* a

* Test

* Pls

* Please

* LFG

* Build fix

* fix

* Whitespace!!

* Zomars/cal 884 paid events not sending the link (#7318)

* WIP

* Sends correct emails for paid bookings

* Update PaymentService.ts

* Update webhook.ts

* Update webhook.ts

* Update settings back button redirect link (#7403)

* fix(schedule): close on click #7143

* fix(EventSetupTab): validLocations length will always match validLocations length #7138

* fix(SettingsLayout): go back to right route #7379

* feat: get country code from ip geolocation (#6880)

* feat: get coutnry code from ip geolocation

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* fix: create new api route for fetching code

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* chore: replace city with country

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* refactor: create hook for country

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

---------

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* Team Workflows (#7038)

Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>

* Add destination calendar name to DestinationCalendarSelector (#6701)

* Add destination calendar name

* Type fix

* Search through calendars only for destination calendar credential

* Refactor get connected calendars

* Clean up

---------

Co-authored-by: zomars <zomars@me.com>

* Update viewer.tsx (#7428)

* Fix - add team members to emails (#7207)

* On booking add team members & translation

* Add team members to round robin create

* Only update calendars on reschedule if there is a calendar reference

* Send email on reschedules

* Send team email on cancelled event

* Add team members to calendar event description

* Clean up

* Convert other emails to organizer & teams

* Type check fixes

* More type fixes

* Change organizer scheduled input to an object

* early return updateCalendarEvent

* Introduce team member type

* Fix type errors

* Put team members before attendees

* Remove lodash cloneDeep

* Update packages/core/EventManager.ts

Co-authored-by: Omar López <zomars@me.com>

* Remove booking select object

* Revert "Remove booking select object"

This reverts commit 9f121ff4ebbaec9a0643111f96c5337b930ddd5b.

* Refactor email manager (#7270)

Co-authored-by: zomars <zomars@me.com>

* Type change

* Remove conditional check for updateAllCalendarEvents

---------

Co-authored-by: zomars <zomars@me.com>

* Typefix

* Updates webhook response

* Update pr.yml

---------

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Esaú Morais <55207584+esau-morais@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
2023-02-28 10:41:55 +00:00
zomars 4eecd42204 Updates webhook response 2023-02-27 20:23:13 -07:00
zomars b9f90144c5 Typefix 2023-02-27 20:12:02 -07:00
Joe Au-YeungandOmar López 8b07b839e9 Fix - add team members to emails (#7207)
* On booking add team members & translation

* Add team members to round robin create

* Only update calendars on reschedule if there is a calendar reference

* Send email on reschedules

* Send team email on cancelled event

* Add team members to calendar event description

* Clean up

* Convert other emails to organizer & teams

* Type check fixes

* More type fixes

* Change organizer scheduled input to an object

* early return updateCalendarEvent

* Introduce team member type

* Fix type errors

* Put team members before attendees

* Remove lodash cloneDeep

* Update packages/core/EventManager.ts

Co-authored-by: Omar López <zomars@me.com>

* Remove booking select object

* Revert "Remove booking select object"

This reverts commit 9f121ff4ebbaec9a0643111f96c5337b930ddd5b.

* Refactor email manager (#7270)

Co-authored-by: zomars <zomars@me.com>

* Type change

* Remove conditional check for updateAllCalendarEvents

---------

Co-authored-by: zomars <zomars@me.com>
2023-02-27 13:45:40 -07:00
Omar López 2a98ca4b91 Update viewer.tsx (#7428) 2023-02-27 12:39:26 -07:00
Joe Au-Yeungandzomars b9064b1f72 Add destination calendar name to DestinationCalendarSelector (#6701)
* Add destination calendar name

* Type fix

* Search through calendars only for destination calendar credential

* Refactor get connected calendars

* Clean up

---------

Co-authored-by: zomars <zomars@me.com>
2023-02-27 11:47:21 -07:00
0ec71e52ef Team Workflows (#7038)
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-02-27 12:54:43 +05:30
Udit Takkar c20835a4c8 feat: get country code from ip geolocation (#6880)
* feat: get coutnry code from ip geolocation

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* fix: create new api route for fetching code

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* chore: replace city with country

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* refactor: create hook for country

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

---------

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
2023-02-25 12:15:05 -07:00
Esaú Morais 8c63b42cec Update settings back button redirect link (#7403)
* fix(schedule): close on click #7143

* fix(EventSetupTab): validLocations length will always match validLocations length #7138

* fix(SettingsLayout): go back to right route #7379
2023-02-25 12:07:41 -07:00
Omar López ddb752102f Zomars/cal 884 paid events not sending the link (#7318)
* WIP

* Sends correct emails for paid bookings

* Update PaymentService.ts

* Update webhook.ts

* Update webhook.ts
2023-02-24 20:57:49 -07:00
zomars ef0a7950cf Update action.yml 2023-02-24 17:10:39 -07:00
Ben HybertandOmar López 641301afab fix text-align on team (#7372)
* fix text-align on team

* more fixes to the length

* use truncate for long text

* Update packages/features/settings/layouts/SettingsLayout.tsx

---------

Co-authored-by: Omar López <zomars@me.com>
2023-02-24 16:59:24 -07:00
Peer Richelsenandzomars 7d1bc5f0c5 removed todo to issue workflow (#7401)
* removed todo to issue workflow

* Revert "removed todo to issue workflow"

This reverts commit 915c18fe2b94d981433a10f26f912d2c4e8b28d3.

* Make todo only when code reaches main

---------

Co-authored-by: zomars <zomars@me.com>
2023-02-24 15:51:14 -07:00
github-actions[bot]andCrowdin Bot aaccfa49ce New Crowdin translations by Github Action (#7365)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-02-24 15:32:23 -07:00
zomars 1b1f3ddfd9 Update action.yml 2023-02-24 15:31:37 -07:00
zomars f7eda5aa3a Moved cache-db to yarn-build 2023-02-24 13:16:26 -07:00
Omar López b2b846647d Update [type].tsx (#7387) 2023-02-24 13:06:57 -07:00
alannnc 4edc973876 fix for showAttendees default value (#7389) 2023-02-24 12:52:25 -07:00
zomars 3b0126ff35 Typo 🤦‍♂️ 2023-02-24 12:51:34 -07:00
zomars cc4192817b Caching is hard 2023-02-24 12:45:49 -07:00
Alex van Andel a8a10c0f35 v2.6.6
release.yml / release (push) Canceled after 0s
2023-02-24 18:52:04 +00:00
Alex van Andel 5f7d904349 Fixed href's to go to the right place (#7377) 2023-02-24 11:39:09 -07:00
Alex van Andel abce20824f v2.6.5
release.yml / release (push) Canceled after 0s
2023-02-24 14:24:12 +00:00
Peer Richelsen 76a8c89d33 session with ciaran (#7366) 2023-02-24 15:21:31 +01:00
github-actions[bot]andCrowdin Bot fc9360d99a New Crowdin translations by Github Action (#7356)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-02-24 12:56:50 +01:00
Nafees Nazik a5c21d5e3e fix: primary button loading indicator color (#7364) 2023-02-24 12:55:46 +01:00
github-actions[bot]andCrowdin Bot 3960c8a954 New Crowdin translations by Github Action (#7355)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-02-24 11:51:21 +01:00
github-actions[bot]andCrowdin Bot 0cbcda7430 New Crowdin translations by Github Action (#7352)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-02-24 11:46:10 +01:00
Peer Richelsen ff12e35748 Update SettingsLayout.tsx 2023-02-24 11:43:45 +01:00
Nafees Nazik 15d967b1d2 fix: mobile drawer z-index issue (#7353) 2023-02-24 11:41:25 +01:00
github-actions[bot]andCrowdin Bot b309be1d94 New Crowdin translations by Github Action (#7316)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-02-24 11:20:02 +01:00
alannncandAlex van Andel 94dc2643f2 fix/payment-status-message-on-booking-cancelled (#7260)
Co-authored-by: Alex van Andel <me@alexvanandel.com>
2023-02-24 10:28:14 +05:30
Miguel Nieto 6440d3da6a Fix command to create new app for the app store (#7322) 2023-02-24 09:55:00 +05:30
9e08cf88f4 removed SSR trpc calls instead SPA for logged in pages (#6936)
* removed SSR trpc

* Re added debug endpoint

* Update me.ts

* Fixes unused imports

* Rollback unrelated changes

---------

Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
2023-02-23 18:41:57 -07:00
zomars 8b3eb986df Fix shared DB cache 2023-02-23 18:24:07 -07:00
Alex van Andel 8a6a7524cc Prioritise organizer to be the fixed, not lucky (round robin) user (#7317) 2023-02-23 18:22:18 -07:00
Hariom Balhara 1dbdb8a4d4 Remove _metadata.ts files for apps that have config.json (#7188) 2023-02-23 18:21:48 -07:00
Levent DenizandLevent Deniz 4fb0852505 [CAL-1125] Fix app detail page heading size (#7257)
* [CAL-1125] Fix app detail page heading size

* [CAL-1125] Fix margin on back button in shell

* [CAL-1125] Fix shell-margin for mobile

---------

Co-authored-by: Levent Deniz <levent.deniz@check24.de>
2023-02-23 17:19:52 -07:00
Nafees Nazik 0815ab715b fix: slot picker scroll position not consistent (#7282)
* fix: remove old scroll to method

* feat: add scroll into view
2023-02-23 17:19:23 -07:00
Joe Au-Yeung 944ff68463 Fix Outlook & Zoom creating events in UTC (#7283)
* Apply utc offset to time strings

* Zoom, create events in proper time zone
2023-02-23 17:18:49 -07:00
GitStart-Cal.comandgitstart-calcom 676254e96b [CAL-1103] mobile /event-type edit - Move the "Hide from profile" toggle into the dropdown (#7297)
Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
2023-02-23 15:09:10 -07:00
Ben Hybert 207bcb9a97 fix non-admin team preview button (#7301) 2023-02-23 15:03:33 -07:00
github-actions[bot]andCrowdin Bot 4d825672db New Crowdin translations by Github Action (#7303)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-02-23 15:02:12 -07:00
Carina WollendorferandCarinaWolli ba86e7f540 Fixes SMS actions and cal.com branding for premium plan (#7306)
* enable sms actions with premium user name

* allow hide branding when user has premium user name

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
2023-02-23 15:01:51 -07:00
Udit Takkar 3206e4ea12 fix: remove scroll (#7312)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
2023-02-23 15:01:09 -07:00
zomars dbcebec31b Update lint.yml 2023-02-23 14:27:43 -07:00
zomars f427c09e88 Update pr.yml 2023-02-23 14:21:15 -07:00
zomars ded838881f Update pr.yml 2023-02-23 14:13:24 -07:00
zomars 08da9d805a Create cache-clean.yml 2023-02-23 14:06:34 -07:00
zomars 7cd0d5c3c3 Squashed commit of the following:
commit db31f2fdf442a7e68b8cdee4990318d30a5a3210
Author: zomars <zomars@me.com>
Date:   Thu Feb 23 11:41:46 2023 -0700

    Update pr.yml

commit 7afa9839e3a3842f2277f54bff703b1eb5740905
Author: zomars <zomars@me.com>
Date:   Thu Feb 23 11:36:49 2023 -0700

    Update nextjs-bundle-analysis.yml

commit 3b68ed19d774ce9540b0729e0b109cccbde65ea4
Author: zomars <zomars@me.com>
Date:   Thu Feb 23 11:28:30 2023 -0700

    Update pr.yml

commit 7c7e5ab65b03f97760481610a71c796611080719
Author: zomars <zomars@me.com>
Date:   Thu Feb 23 10:56:14 2023 -0700

    Update pr.yml

commit d1854cedd2aa19a7c260426ce3b309a40a16315a
Merge: 26568ba69 b018ee34a
Author: zomars <zomars@me.com>
Date:   Thu Feb 23 10:50:32 2023 -0700

    Merge remote-tracking branch 'upstream/main'

commit 26568ba693a2dd456bcd962598b4dddb8d117d1f
Merge: 2c72ac6f0 f5318c6be
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 17:10:10 2023 -0700

    Merge remote-tracking branch 'upstream/main'

commit 2c72ac6f0c0edbedc305eb7366742d31534ea1c2
Author: Peer Richelsen <peeroke@gmail.com>
Date:   Tue Feb 21 23:25:43 2023 +0100

    improved brand colors on booking page (#7269)

commit 65c0d3ffe8a7bd197c99bac3715356ab08669fbd
Author: Alex van Andel <me@alexvanandel.com>
Date:   Tue Feb 21 20:03:52 2023 +0000

    Define CODEOWNERS file (#7245)

    * Start defining CODEOWNERS file

    * Update CODEOWNERS

    ---------

    Co-authored-by: Omar López <zomars@me.com>

commit 29fb81434864634af584228e3bf3ddea1d630ecd
Author: Omar López <zomars@me.com>
Date:   Tue Feb 21 17:06:44 2023 -0700

    Update .github/actions/cache-db/action.yml

commit 92672fe3aa5539a083cbb10f82f87441b9e899d3
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 16:09:20 2023 -0700

    Revert "Revert "Re-enables buildjet""

    This reverts commit a1d78e7c12618d14b23bd50540ee005c6a550e7b.

commit 530e9748d7f2d4826ccffaa40dea2f137f8f17a9
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 15:13:22 2023 -0700

    Fixes build env

commit a1d78e7c12618d14b23bd50540ee005c6a550e7b
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 14:39:09 2023 -0700

    Revert "Re-enables buildjet"

    This reverts commit badd655e1edf8c2942582439f9fd48c00f892c38.

commit 8f67711e5d387ae0cd97d495766ccd06c4a61b0c
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 14:38:41 2023 -0700

    Adds missing build cache to e2e

commit badd655e1edf8c2942582439f9fd48c00f892c38
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 14:27:11 2023 -0700

    Re-enables buildjet

commit c7bdb52e0abfde27dd42494477ffff39cc3e4e19
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 14:10:34 2023 -0700

    Inherit secrets

commit 86b9b48e86e1c3d6e89b931ae8c8ce515c07b866
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 13:58:35 2023 -0700

    Fixes?

commit ebc304b39e815a0ff5c9e760550e4fee8283a567
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 13:42:33 2023 -0700

    Update nextjs-bundle-analysis.yml

commit 7da00d9566d4a56d77e7feb0d1504efa86148cbe
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 13:32:08 2023 -0700

    Update nextjs-bundle-analysis.yml

commit 224cc38fac42434e3a621c81a993798bb4abc773
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 13:21:38 2023 -0700

    Update nextjs-bundle-analysis.yml

commit 8fdd71ae36362290f80b55e8a2996d413d988c05
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 12:50:45 2023 -0700

    Build fixes

commit 6790be6f8fbba98658730266fb3927001066671f
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 12:46:17 2023 -0700

    Upgrades actions/checkout@v3

commit cc85218e0bdbf1f857296836c0026e09c8466ce9
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 12:29:33 2023 -0700

    Update action.yml

commit 380b1c2be4da15bc40113c7651e1595b5613b8b8
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 12:09:00 2023 -0700

    Update action.yml

commit 39b05a4e9bcba2e00b7efe342f7d456b5fba059a
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 11:55:50 2023 -0700

    Update action.yml

commit f4260393da8716c5246a6148d125d12b51993902
Merge: a82e9925f 4adfcb4b6
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 11:48:32 2023 -0700

    Merge remote-tracking branch 'upstream/main'

commit a82e9925f55c4967bad3dbb47566979734608bbc
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 11:46:07 2023 -0700

    Update lint.yml

commit 747ad8513f20767d6f66021cc548a308e18b6326
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 11:27:22 2023 -0700

    Caches DB

commit f5e96ba3f116eeb62f8ac47ca0d08e17f1fb2fdc
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 10:49:05 2023 -0700

    Comments out buildjet

commit aad26223b16c5444b947191c780416f4c8e61a94
Author: zomars <zomars@me.com>
Date:   Tue Feb 21 10:36:59 2023 -0700

    Update pr.yml

commit 7ce463f38cd1296f47cc5bb5cf8f863a6dfef9a7
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 22:07:31 2023 -0700

    Update action.yml

commit f5f57d963280d743cae0d04b6d80a7f49971f9e0
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 22:06:23 2023 -0700

    Adjustments

commit 2f048acbe6374ff6e8d9d750808c8b3e7bf7b333
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 21:47:01 2023 -0700

    WIP

commit dd1d86beb2bae0bd12b14a636398a2e2ce80555d
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 21:44:14 2023 -0700

    Removed required checks

commit 0db2b50ca8d125e1f7b115ae24cd2346fde92ab9
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 21:11:27 2023 -0700

    Fixes

commit bdc46bd5eef5dbb3c3b8dc2e68468bbff6c20aec
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 21:05:01 2023 -0700

    Update pr.yml

commit f6c58252a8e1b8971e70d3cb644b492d2fbad40d
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 21:02:39 2023 -0700

    Fixes

commit 04369405f38f200fece773ab7f9717fd62145fcf
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 20:35:39 2023 -0700

    Fixes

commit 4a60555b2bd2012c18fae8e338b7ef4bb39dc725
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 20:32:37 2023 -0700

    Update yarn-install.yml

commit 3d7749cef00cbbc843316e75d29e60ee68fe818d
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 20:31:53 2023 -0700

    Update yarn-install.yml

commit 374dc68848ee8be331e703fb0ef0cd08483694e5
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 20:28:14 2023 -0700

    Update yarn-install.yml

commit ae13d06ec2ffc759b1f8d9aea29b419e081e7693
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 20:27:31 2023 -0700

    Update check-types.yml

commit 93ad2cc92319bff6783f8633fc5bc1b8347376c4
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 20:26:38 2023 -0700

    Cleanup

commit 26730f7bbcaa07c323692ed76a17fa471f8e4f2e
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 20:05:54 2023 -0700

    Test

commit 76373a91c19fb1e67b050b0f36bb9b562d9024cd
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 19:51:28 2023 -0700

    Update yarn-e2e.yml

commit 0b3d98a4bc0cc3718b8fdb6f0537e824a6ef4204
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 19:51:14 2023 -0700

    Update package.json

commit 978d848b3989755e728353542714915782fc12c0
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 19:37:19 2023 -0700

    Cleanup

commit f2ccee16a73751f9e0bb26619da0ddfddc094907
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 19:18:42 2023 -0700

    Update action.yml

commit cf9cbbc5f08f29c2ba5a4c390129ff46bf8a3cf5
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 18:59:35 2023 -0700

    Update pr.yml

commit e8d39a91a5909674bfe9d4775ca09d814372529d
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 18:57:53 2023 -0700

    Update action.yml

commit eaa1210d1386b2eadd0bb1990ded444f7c307e60
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 18:43:59 2023 -0700

    Anotha one

commit 2958c17ebb28b3a231982a60fc3f3255a0d013e9
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 16:36:39 2023 -0700

    Tests

commit 922c9077b66b061e9f644eedf0022907ac6df161
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 16:02:05 2023 -0700

    Update pr.yml

commit 663b3bf48aa83a19f735badeb126e2968ee73733
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 16:00:49 2023 -0700

    Adds type check

commit 99746ee6e8662e39862ce25b5d9804372adf9fa4
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 15:53:57 2023 -0700

    Update yarn-e2e.yml

commit f82833cfdb17fa4a3da588a92925d3ebd8579357
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 15:53:04 2023 -0700

    Abstract playwright cache

commit e92ad12b54563219708b1e4423e502e1ac1f2197
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 15:41:07 2023 -0700

    Update action.yml

commit 271fe44bf087b19a7d0b1484261eff1cae8cb8b9
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 15:34:38 2023 -0700

    Update action.yml

commit 9a690de1ffd43270973c969c816e7b76a1d50a38
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 15:26:51 2023 -0700

    WIP

commit 5322fc7134bfa9c1061c45033573503023ba05db
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 15:04:03 2023 -0700

    Fixes

commit 3721dae0b45e4bd309f6a7c92db393956e543880
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 14:59:12 2023 -0700

    Update action.yml

commit 1027f058fd1bcbaa680b4297b081dd838f6ea886
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 14:56:51 2023 -0700

    Update action.yml

commit 9d74f9ed7bddf3e5563420c88476b73230c619df
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 14:53:43 2023 -0700

    Fixes

commit 4bfd63afef3b4139bb797ca6e5a9895138092417
Author: zomars <zomars@me.com>
Date:   Mon Feb 20 14:51:46 2023 -0700

    DRY

commit ea6114835dda65b5d6b31a96ad2781938cc8c121
Author: Omar López <zomars@me.com>
Date:   Sat Feb 18 16:38:00 2023 -0700

    Update production-build.yml

commit 8ec2b2c2c505c74b40a8e50a43e41f3d444730dc
Author: Omar López <zomars@me.com>
Date:   Sat Feb 18 16:36:44 2023 -0700

    Update production-build.yml

commit b0a7ccaa753f2fcf1ec571f3af1df9eea228f8b3
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 15:59:25 2023 -0700

    TEST

commit 0d639fdeb95deaa588fd29e63c275ea8b10a25d8
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 15:36:00 2023 -0700

    Revert

commit 5a597644a0a90cd212ff826aa3dda3214ab05334
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 15:32:16 2023 -0700

    Test

commit 7aafa78f1463f5a22576f814fa70db73db1ff89e
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 12:09:58 2023 -0700

    test

commit 81287f963bfcecbb1fd45670043b4e14690f8a6e
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 11:12:56 2023 -0700

    Update pr.yml

commit ef596f53d4614335ce36e084eae4b79efeed057c
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 10:59:08 2023 -0700

    Update pr.yml

commit 7dbaf1d08deec73c6f4bb53659d4af56282a2c68
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 10:58:22 2023 -0700

    Update pr.yml

commit 25489edac712e5b343c8f31123415a3cc804d254
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 10:39:55 2023 -0700

    Update pr.yml

commit 29ae0845b5b179c1493a35c18925f3f3e619d997
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 10:32:17 2023 -0700

    Update production-build.yml

commit 791492ac9e98046acd9fd5c100d0a3afa54fbbe3
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 10:28:37 2023 -0700

    Update pr.yml

commit 92597d8d7e4139b8129cd499545c37d1a518c0d0
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 10:24:15 2023 -0700

    Update pr.yml

commit 9bc85570c758f86079712270a1cc96e5983368a4
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 10:23:25 2023 -0700

    Update pr.yml

commit ba20dbbb96c95272118ecf5b6eead4ee0e816782
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 10:15:53 2023 -0700

    Update nextjs-bundle-analysis.yml

commit 35b7cd52d819409516f76d2b0e5849a136f55dc2
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 10:11:02 2023 -0700

    Update pr.yml

commit 8fe421e8d5c227d1cb5e31fe73398776d3b05dbf
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 09:55:49 2023 -0700

    Update pr.yml

commit f96af3f70810555d75ae9f3ba6f16e7e464e1926
Author: zomars <zomars@me.com>
Date:   Sat Feb 18 09:33:34 2023 -0700

    Update production-build.yml

commit 29134a3245e00b94a4b0edc2889ea6e81adf3e9b
Author: zomars <zomars@me.com>
Date:   Fri Feb 17 20:53:06 2023 -0700

    Tests

commit 4aa8917687ccb28c1c9abfc30441c96db1bc1663
Author: zomars <zomars@me.com>
Date:   Fri Feb 17 20:38:17 2023 -0700

    Update production-build.yml

commit 7c0884d0b7a45f9e8722547288d3879ee3e82add
Author: zomars <zomars@me.com>
Date:   Fri Feb 17 20:16:59 2023 -0700

    Update pr.yml

commit b68ccd5ee1502de4f9afed2841cf2ab61309cf0e
Author: zomars <zomars@me.com>
Date:   Fri Feb 17 20:16:27 2023 -0700

    Update pr.yml

commit 0c15086a7c02513e73821828a9392cdf45af6227
Author: zomars <zomars@me.com>
Date:   Fri Feb 17 20:13:29 2023 -0700

    Update pr.yml

commit da277ce83bcebd62afc7e2074e82b9e4c64f4c27
Author: zomars <zomars@me.com>
Date:   Fri Feb 17 20:12:50 2023 -0700

    Update pr.yml

commit fdb170086b70ded1f7109e35e85cce60a2ef7eaf
Author: zomars <zomars@me.com>
Date:   Fri Feb 17 20:12:19 2023 -0700

    Update pr.yml

commit 1676d9070b2a07bbbf03297aa6c331dd68b7df4f
Author: zomars <zomars@me.com>
Date:   Fri Feb 17 20:12:06 2023 -0700

    Update pr.yml

commit e834b42e87cad2401219b6fae765871f4b5eb7e8
Author: zomars <zomars@me.com>
Date:   Fri Feb 17 19:59:53 2023 -0700

    Update pr.yml

commit e414378d243f3f43f3639127dee2f4bc4ac75633
Author: zomars <zomars@me.com>
Date:   Fri Feb 17 19:57:07 2023 -0700

    Update pr.yml

commit 6904553b627a4896dab6adb8ac909f6e8604e893
Author: zomars <zomars@me.com>
Date:   Fri Feb 17 19:55:47 2023 -0700

    Update pr.yml

commit 4722f0b44ac33f62ac019a4e707005bc7ff22b07
Author: zomars <zomars@me.com>
Date:   Fri Feb 17 19:54:50 2023 -0700

    Update pr.yml

commit 2a9afdc4ac7a90c76f0aa7edbb2f3af0fbd0e7f1
Author: zomars <zomars@me.com>
Date:   Fri Feb 17 19:13:25 2023 -0700

    Testing
2023-02-23 13:44:38 -07:00
Nafees Nazik b018ee34a7 fix: placeholder in custom event name (#7247)
* fix: replace placeholder

* refactor: replace placeholder into a separate function
2023-02-23 15:46:36 +00:00
Peer Richelsen 17345f9326 added danish (#7302) 2023-02-23 16:40:17 +01:00
a1d7b30d51 New Crowdin translations by Github Action (#7273)Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* New Crowdin translations by Github Action

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

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

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-02-23 16:38:37 +01:00
Hariom Balhara 87dbfba5df Hotfix/ Fix failing build due to terser missing (#7294)
* No need to use terser

* v1.1.3

* v1.0.5

* v1.0.10
2023-02-23 13:55:02 +01:00
Esaú Morais e5d44d029a Allow user to add as many locations as they want (#7279) 2023-02-23 16:49:28 +05:30
Peer Richelsen 4803817055 2.6.4
release.yml / release (push) Canceled after 0s
2023-02-23 11:43:24 +01:00
Nafees Nazik dac6bff5b1 feat: add line clamp class (#7291) 2023-02-23 09:25:31 +01:00
Alex van Andel a3c10d0beb Amend logic to figure out the months between dates (#7289) 2023-02-22 14:36:30 -07:00
zomars d2b45e52ff Update nextjs-bundle-analysis.yml 2023-02-22 14:36:14 -07:00
zomars 0da6878188 Update pr.yml 2023-02-22 14:34:05 -07:00
zomars 572b54b7f0 Update forgot-password.e2e.ts 2023-02-22 14:34:05 -07:00
Carina WollendorferandCarinaWolli d9bf89beab fix variable for name (#7288)
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
2023-02-22 14:06:05 -07:00
Nafees NazikandHariom Balhara 0d1f484c92 test: multiple organizer address test (#7179)
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
2023-02-22 10:52:49 +05:30
github-actions[bot]andCrowdin Bot 51d02c9873 New Crowdin translations by Github Action (#7271)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2023-02-21 17:49:47 -07:00
Peer Richelsen 6226baa244 added cal video to Tips.tsx (#7268)
* Update Tips.tsx

* Update packages/features/tips/Tips.tsx
2023-02-21 17:48:52 -07:00
zomars 81d842ade7 Update nextjs-bundle-analysis.yml 2023-02-21 17:22:46 -07:00
d26732c9dc Refactors Github Workflows (#7267)
* Testing

* Update pr.yml

* Update pr.yml

* Update pr.yml

* Update pr.yml

* Update pr.yml

* Update pr.yml

* Update pr.yml

* Update pr.yml

* Update pr.yml

* Update pr.yml

* Update production-build.yml

* Tests

* Update production-build.yml

* Update pr.yml

* Update pr.yml

* Update nextjs-bundle-analysis.yml

* Update pr.yml

* Update pr.yml

* Update pr.yml

* Update production-build.yml

* Update pr.yml

* Update pr.yml

* Update pr.yml

* Update pr.yml

* test

* Test

* Revert

* TEST

* Update production-build.yml

* Update production-build.yml

* DRY

* Fixes

* Update action.yml

* Update action.yml

* Fixes

* WIP

* Update action.yml

* Update action.yml

* Abstract playwright cache

* Update yarn-e2e.yml

* Adds type check

* Update pr.yml

* Tests

* Anotha one

* Update action.yml

* Update pr.yml

* Update action.yml

* Cleanup

* Update package.json

* Update yarn-e2e.yml

* Test

* Cleanup

* Update check-types.yml

* Update yarn-install.yml

* Update yarn-install.yml

* Update yarn-install.yml

* Fixes

* Fixes

* Update pr.yml

* Fixes

* Removed required checks

* WIP

* Adjustments

* Update action.yml

* Update pr.yml

* Comments out buildjet

* Caches DB

* Update lint.yml

* Update action.yml

* Update action.yml

* Update action.yml

* Upgrades actions/checkout@v3

* Build fixes

* Update nextjs-bundle-analysis.yml

* Update nextjs-bundle-analysis.yml

* Update nextjs-bundle-analysis.yml

* Fixes?

* Inherit secrets

* Re-enables buildjet

* Adds missing build cache to e2e

* Revert "Re-enables buildjet"

This reverts commit badd655e1edf8c2942582439f9fd48c00f892c38.

* Fixes build env

* Revert "Revert "Re-enables buildjet""

This reverts commit a1d78e7c12618d14b23bd50540ee005c6a550e7b.

* Update .github/actions/cache-db/action.yml

* Define CODEOWNERS file (#7245)

* Start defining CODEOWNERS file

* Update CODEOWNERS

---------

Co-authored-by: Omar López <zomars@me.com>

* improved brand colors on booking page (#7269)

---------

Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-02-21 17:10:39 -07:00
Peer Richelsen f5318c6be3 improved brand colors on booking page (#7269) 2023-02-21 15:25:43 -07:00
Alex van AndelandOmar López dafbebe6f3 Define CODEOWNERS file (#7245)
* Start defining CODEOWNERS file

* Update CODEOWNERS

---------

Co-authored-by: Omar López <zomars@me.com>
2023-02-21 13:03:52 -07:00
Peer Richelsen 4adfcb4b6b Update README.md 2023-02-21 18:31:31 +01:00
Nafees Nazik 3ac6a8aa39 fix: allow admin role to degrade as a member (#7258) 2023-02-21 18:19:52 +01:00
sean-brydon c8019edb57 User email as impersonation if username is null (#7250) 2023-02-21 17:12:26 +00:00
Alex van Andel bfc81b770a Change API error handling - download works on local (#7256) 2023-02-21 17:03:10 +00:00
Hariom Balhara 4a5404bf21 Simplify turbo pipelone (#7252) 2023-02-21 16:48:01 +00:00
Hariom Balhara 7a9b40f218 Add sentry and WEBAPP_URL to whitelist (#7248) 2023-02-21 16:46:27 +00:00
Alex van Andel dca1d35cb4 v2.6.3
release.yml / release (push) Canceled after 0s
2023-02-21 13:26:11 +00:00
Esaú Morais af970c049a Do not show location when booking has been cancelled (#7244)
* fix(schedule): close on click #7143

* fix(booking): do not show location when booking has been cancelled
2023-02-21 09:25:57 +00:00
Esaú Morais 6fc3840ca3 Remove duplicated border in Calendar category (#7235)
* fix(schedule): close on click #7143

* fix(CalendarListContainer): remove duplicated border #7222

* fix: set right border to all installed apps
2023-02-21 09:19:29 +00:00
Udit TakkarandHariom Balhara c51150350a chore: check IS_SELF_HOSTED in download (#7214)
* chore: check IS_SELF_HOSTED in download

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* Update apps/web/pages/api/download-cal-video-recording.ts

Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>

* Update apps/web/pages/api/download-cal-video-recording.ts

* Linting fix

---------

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
2023-02-21 09:00:08 +00:00
Alex van Andel 51664bf733 Fixed invalid busy times query logic (#7243)
* Fixed invalid busy times query logic

* Adjusted collective test
2023-02-21 02:45:10 +00:00
Alex van Andel 831506447a Assign userIds to all schedules, including common eventType schedules (#7241) 2023-02-20 23:48:15 +00:00
zomars ee54e670cb FIXME 2023-02-20 14:32:56 -07:00
Carina WollendorferandCarinaWolli 99cd6fe7da add all location links to metadata (#7236)
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
2023-02-20 18:52:07 +00:00
Hariom Balhara 75c7e03efe Upgrade vite (#7197) 2023-02-20 17:50:40 +00:00
Carina WollendorferandCarinaWolli 2ebfcf448c Fixes that workflow reminders of cancelled and rescheduled bookings are still sent (#7232)
* small UI fix

* fix cancelling scheduled emails

* improve comments

* delete reminders for rescheduled bookings

* add migration file

* cancel rescheduled bookings immediately

* remove immediate delete for request reschedule

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
2023-02-20 12:40:08 -05:00
Oscar DominguezandHariom Balhara 235ec0e906 improve typing by removing as html element (#7212)
* refactor(embeds): use generic HTMLIFrameElement instead of 'as HTMLIFrameElement'

* refactor(embeds): improve types for floatingButton logic

* Fix floating button popup not working

---------

Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
2023-02-20 17:37:03 +00:00
Nafees Nazik ea73870ce9 fix: overflow issue in Custom event name modal (#7224) 2023-02-20 21:46:31 +05:30
Peer Richelsen d1440bb5d2 added pwa: extension for standalone, lots of mobile improvements (#7218) 2023-02-20 15:11:51 +01:00
Hariom Balhara a000030040 Check embed in a better way (#7221) 2023-02-20 11:31:56 +00:00
Joe Au-Yeung 44864a801d Admin apps console - revert back to swtiches (#7219) 2023-02-20 15:38:16 +05:30
Sai Deepesh b9fd0b4c78 chore: add i18n in routing form pages (#7193)
* chore: add i18n in routing form pages

* use existing string

* add strings to en/common.json file

* address comments
2023-02-20 10:07:58 +00:00
Harsh SinghandGuest 0e7276370f Fix: mounting state use theme (#7203)
Co-authored-by: Guest <guest@pop-os.localdomain>
2023-02-20 15:17:33 +05:30
Hariom Balhara 4d2cf28c7e Fix metadata not being retrieved (#7208) 2023-02-20 07:30:23 +05:30
sean-brydon 55ee939cf9 Dont default empty state (#7217) 2023-02-19 20:16:19 +00:00
Udit Takkar 2fe54ded15 fix: use getVideoData function (#7205) 2023-02-19 13:13:36 +05:30
Udit Takkar 8e3fa4be29 Fix/email responsive bug (#6901)
* fix: prevent overflow of url

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* fix: manage link responsive in emails

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

---------

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
2023-02-18 22:26:55 +00:00
437 changed files with 16360 additions and 6809 deletions
+6
View File
@@ -39,6 +39,8 @@ SAML_DATABASE_URL=
SAML_ADMINS=
# NEXT_PUBLIC_HOSTED_CAL_FEATURES=1
NEXT_PUBLIC_HOSTED_CAL_FEATURES=
# For additional security set to a random secret and use that value as the client_secret during the OAuth 2.0 flow.
SAML_CLIENT_SECRET_VERIFIER=
# If you use Heroku to deploy Postgres (or use self-signed certs for Postgres) then uncomment the follow line.
# @see https://devcenter.heroku.com/articles/connecting-heroku-postgres#connecting-in-node-js
@@ -76,6 +78,10 @@ NEXT_PUBLIC_ZENDESK_KEY=
# Help Scout Config
NEXT_PUBLIC_HELPSCOUT_KEY=
# Fresh Chat Config
NEXT_PUBLIC_FRESHCHAT_TOKEN=
NEXT_PUBLIC_FRESHCHAT_HOST=
# Inbox to send user feedback
SEND_FEEDBACK_EMAIL=
+33
View File
@@ -0,0 +1,33 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @calcom/reviewers
.github/ @calcom/core
.husky/ @calcom/core
.vcode/ @calcom/core
.snaplet/ @calcom/core
deploy/ @calcom/core
scripts/ @calcom/core
apps/docs @calcom/docs
apps/swagger @calcom/docs
packages/app-store-cli @hariombalhara @calcom/core
packages/dayjs @zomars @calcom/core
packages/emails @zomars @calcom/core
packages/embeds @hariombalhara @calcom/core
packages/eslint-plugin @zomars @calcom/core
packages/features @zomars @calcom/core
packages/features/kbar @alishaz-polymath @calcom/core
packages/features/ee/impersonation @sean-brydon @calcom/core
packages/features/ee/payments @alannnc @calcom/core
packages/features/ee/workflows @CarinaWolli @calcom/core
packages/features/tips @PeerRich @calcom/core
packages/ui @calcom/ui
packages/config @calcom/core
packages/app-store/ee/routing-forms @hariombalhara @calcom/core
+28
View File
@@ -0,0 +1,28 @@
name: Cache production build binaries
description: "Cache or restore if necessary"
inputs:
node_version:
required: false
default: v16.x
runs:
using: "composite"
steps:
- name: Cache production build
uses: actions/cache@v3
id: cache-build
env:
cache-name: prod-build
key-1: ${{ inputs.node_version }}-${{ hashFiles('yarn.lock') }}
key-2: ${{ hashFiles('apps/**/**.[jt]s', 'apps/**/**.[jt]sx', 'packages/**/**.[jt]s', 'packages/**/**.[jt]sx', '!**/node_modules') }}
key-3: ${{ github.event.pull_request.number || github.ref }}
# Ensures production-build.yml will always be fresh
key-4: ${{ github.sha }}
with:
path: |
${{ github.workspace }}/apps/web/.next
**/.turbo/**
**/dist/**
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-${{ env.key-4 }}
- run: yarn build
if: steps.cache-build.outputs.cache-hit != 'true'
shell: bash
+38
View File
@@ -0,0 +1,38 @@
name: Cache database between jobs
description: "Cache or restore if necessary"
inputs:
DATABASE_URL:
required: false
default: "postgresql://postgres:@localhost:5432/calendso"
path:
required: false
default: "backups/backup.sql"
runs:
using: "composite"
steps:
- name: Cache database
id: cache-db
uses: actions/cache@v3
env:
cache-name: cache-db
key-1: ${{ hashFiles('packages/prisma/schema.prisma', 'packages/prisma/migrations/**/**.sql', 'packages/prisma/*.ts') }}
key-2: ${{ github.event.pull_request.number || github.ref }}
with:
path: ${{ inputs.path }}
key: ${{ runner.os }}-${{ env.cache-name }}-${{ inputs.path }}-${{ env.key-1 }}-${{ env.key-2 }}
- run: yarn db-seed
if: steps.cache-db.outputs.cache-hit != 'true'
shell: bash
- name: Postgres Dump Backup
if: steps.cache-db.outputs.cache-hit != 'true'
uses: tj-actions/pg-dump@v2.3
with:
database_url: ${{ inputs.DATABASE_URL }}
path: ${{ inputs.path }}
options: "-O"
- name: Postgres Backup Restore
if: steps.cache-db.outputs.cache-hit == 'true'
uses: tj-actions/pg-restore@v4.5
with:
database_url: ${{ inputs.DATABASE_URL }}
backup_file: ${{ inputs.path }}
@@ -0,0 +1,10 @@
name: Dangerous git Checkout
description: "Git Checkout from PR code so we can run checks from forks"
runs:
using: "composite"
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2
+16
View File
@@ -0,0 +1,16 @@
name: "Set environment variables"
description: "Configures environment variables for a workflow"
runs:
using: "composite"
steps:
- name: Create env file
uses: actions/cache@v3
id: env-cache
with:
path: gh.env
key: env-cache-${{ hashFiles('gh.env') }}
restore-keys: env-cache-
- name: Set Environment Variables
uses: tw3lveparsecs/github-actions-setvars@latest
with:
envFilePath: gh.env
+19
View File
@@ -0,0 +1,19 @@
name: Yarn install
description: "Install all NPM dependencies, caches them and restores if necessary"
inputs:
node_version:
required: false
default: v16.x
runs:
using: "composite"
steps:
- name: Use Node ${{ inputs.node_version }}
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node_version }}
cache: "yarn"
- name: Yarn install
shell: bash
run: |
yarn install --prefer-offline --frozen-lockfile
yarn prisma generate
@@ -0,0 +1,19 @@
name: Install playwright binaries
description: "Install playwright, cache and restore if necessary"
runs:
using: "composite"
steps:
- name: Cache playwright binaries
id: playwright-cache
uses: actions/cache@v2
with:
path: |
~/Library/Caches/ms-playwright
~/.cache/ms-playwright
${{ github.workspace }}/node_modules/playwright
key: cache-playwright-${{ hashFiles('**/yarn.lock') }}
restore-keys: cache-playwright-
- name: Yarn playwright install
shell: bash
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install
+33
View File
@@ -0,0 +1,33 @@
name: cleanup caches by a branch
on:
pull_request:
types:
- closed
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }} # So we can test on forks
fetch-depth: 0
+5 -22
View File
@@ -1,34 +1,17 @@
name: Check types
on:
pull_request_target:
branches:
- main
paths:
- "**.tsx?"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
workflow_call:
env:
NODE_OPTIONS: "--max-old-space-size=8192"
jobs:
check-types:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2
- uses: actions/checkout@v3
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- name: Use Node 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "yarn"
- name: Show info
run: node -e "console.log(require('v8').getHeapStatistics())"
- run: yarn --frozen-lockfile
- run: yarn type-check
+1 -3
View File
@@ -9,14 +9,12 @@ concurrency:
cancel-in-progress: true
jobs:
required-checks:
uses: calcom/cal.com/.github/workflows/required-checks.yml@main
synchronize-with-crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: crowdin action
uses: crowdin/github-action@1.4.9
+1 -1
View File
@@ -7,7 +7,7 @@ jobs:
db-staging-snapshot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Snaplet CLI
run: curl -sL https://app.snaplet.dev/get-cli/ | bash
- name: Restore Snapshot
+13 -78
View File
@@ -1,60 +1,12 @@
name: E2E App-Store Apps
on:
push:
branches: [fixes/e2e-consolidation] # TODO: Remove this after merged in main
pull_request_target: # So we can test on forks
branches:
- main
paths-ignore:
- apps/api/**
- apps/console/**
- apps/docs/**
- apps/swagger/**
- apps/website/**
- apps/web/public/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
workflow_call:
jobs:
test:
e2e-app-store:
timeout-minutes: 20
name: E2E App-Store Apps
strategy:
matrix:
node: ["16.x"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
NEXT_PUBLIC_WEBSITE_URL: http://localhost:3000
NEXTAUTH_SECRET: secret
GOOGLE_API_CREDENTIALS: ${{ secrets.CI_GOOGLE_API_CREDENTIALS }}
GOOGLE_LOGIN_ENABLED: true
# CRON_API_KEY: xxx
CALENDSO_ENCRYPTION_KEY: ${{ secrets.CI_CALENDSO_ENCRYPTION_KEY }}
NEXT_PUBLIC_STRIPE_PUBLIC_KEY: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PUBLIC_KEY }}
STRIPE_PRIVATE_KEY: ${{ secrets.CI_STRIPE_PRIVATE_KEY }}
STRIPE_CLIENT_ID: ${{ secrets.CI_STRIPE_CLIENT_ID }}
STRIPE_WEBHOOK_SECRET: ${{ secrets.CI_STRIPE_WEBHOOK_SECRET }}
PAYMENT_FEE_PERCENTAGE: 0.005
PAYMENT_FEE_FIXED: 10
SAML_DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
SAML_ADMINS: pro@example.com
NEXTAUTH_URL: http://localhost:3000/api/auth
NEXT_PUBLIC_IS_E2E: 1
# EMAIL_FROM: e2e@cal.com
# EMAIL_SERVER_HOST: ${{ secrets.CI_EMAIL_SERVER_HOST }}
# EMAIL_SERVER_PORT: ${{ secrets.CI_EMAIL_SERVER_PORT }}
# EMAIL_SERVER_USER: ${{ secrets.CI_EMAIL_SERVER_USER }}
# EMAIL_SERVER_PASSWORD: ${{ secrets.CI_EMAIL_SERVER_PASSWORD }}
# MS_GRAPH_CLIENT_ID: xxx
# MS_GRAPH_CLIENT_SECRET: xxx
# ZOOM_CLIENT_ID: xxx
# ZOOM_CLIENT_SECRET: xxx
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12.1
@@ -65,35 +17,18 @@ jobs:
- 5432:5432
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }} # So we can test on forks
fetch-depth: 2
- uses: actions/checkout@v3
- uses: ./.github/actions/dangerous-git-checkout
- run: echo 'NODE_OPTIONS="--max_old_space_size=4096"' >> $GITHUB_ENV
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "yarn"
- name: Cache playwright binaries
uses: actions/cache@v2
id: playwright-cache
with:
path: |
~/Library/Caches/ms-playwright
~/.cache/ms-playwright
${{ github.workspace }}/node_modules/playwright
key: cache-playwright-${{ hashFiles('**/yarn.lock') }}
restore-keys: cache-playwright-
- run: yarn --frozen-lockfile
- name: Install playwright deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/yarn-playwright-install
- uses: ./.github/actions/env-read-file
- uses: ./.github/actions/cache-db
- uses: ./.github/actions/cache-build
- name: Run Tests
run: yarn test-e2e:app-store
env:
DEPLOYSENTINEL_API_KEY: ${{ secrets.DEPLOYSENTINEL_API_KEY }}
- name: Upload Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v2
+12 -74
View File
@@ -1,56 +1,11 @@
name: E2E Embed tests and booking flow(for non-embed as well)
on:
pull_request_target: # So we can test on forks
branches:
- main
# Embed e2e - tests verify booking flow which is applicable to non-embed case also. So, don't ignore apps/web changes.
paths:
- apps/web/**
- packages/embeds/**
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
e2e-embed:
timeout-minutes: 20
runs-on: ubuntu-latest
env:
DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
NEXT_PUBLIC_WEBSITE_URL: http://localhost:3000
NEXTAUTH_SECRET: secret
GOOGLE_API_CREDENTIALS: ${{ secrets.CI_GOOGLE_API_CREDENTIALS }}
GOOGLE_LOGIN_ENABLED: true
# CRON_API_KEY: xxx
CALENDSO_ENCRYPTION_KEY: ${{ secrets.CI_CALENDSO_ENCRYPTION_KEY }}
NEXT_PUBLIC_STRIPE_PUBLIC_KEY: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PUBLIC_KEY }}
NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE }}
NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE }}
NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE }}
NEXT_PUBLIC_STRIPE_PREMIUM_NEW_PLAN_PRICE: ${{ secrets.NEXT_PUBLIC_STRIPE_PREMIUM_NEW_PLAN_PRICE }}
NEXT_PUBLIC_IS_PREMIUM_NEW_PLAN: 1
STRIPE_PRIVATE_KEY: ${{ secrets.CI_STRIPE_PRIVATE_KEY }}
STRIPE_CLIENT_ID: ${{ secrets.CI_STRIPE_CLIENT_ID }}
STRIPE_WEBHOOK_SECRET: ${{ secrets.CI_STRIPE_WEBHOOK_SECRET }}
PAYMENT_FEE_PERCENTAGE: 0.005
PAYMENT_FEE_FIXED: 10
SAML_DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
SAML_ADMINS: pro@example.com
NEXTAUTH_URL: http://localhost:3000/api/auth
NEXT_PUBLIC_IS_E2E: 1
# EMAIL_FROM: e2e@cal.com
# EMAIL_SERVER_HOST: ${{ secrets.CI_EMAIL_SERVER_HOST }}
# EMAIL_SERVER_PORT: ${{ secrets.CI_EMAIL_SERVER_PORT }}
# EMAIL_SERVER_USER: ${{ secrets.CI_EMAIL_SERVER_USER }}
# EMAIL_SERVER_PASSWORD: ${{ secrets.CI_EMAIL_SERVER_PASSWORD }}
# MS_GRAPH_CLIENT_ID: xxx
# MS_GRAPH_CLIENT_SECRET: xxx
# ZOOM_CLIENT_ID: xxx
# ZOOM_CLIENT_SECRET: xxx
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
services:
postgres:
image: postgres:12.1
@@ -61,45 +16,28 @@ jobs:
- 5432:5432
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }} # So we can test on forks
fetch-depth: 2
- uses: actions/checkout@v3
- uses: ./.github/actions/dangerous-git-checkout
- run: echo 'NODE_OPTIONS="--max_old_space_size=4096"' >> $GITHUB_ENV
- name: Use Node 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "yarn"
- name: Cache playwright binaries
uses: actions/cache@v2
id: playwright-cache
with:
path: |
~/Library/Caches/ms-playwright
~/.cache/ms-playwright
${{ github.workspace }}/node_modules/playwright
key: cache-playwright-${{ hashFiles('**/yarn.lock') }}
restore-keys: cache-playwright-
- run: yarn --frozen-lockfile
- name: Install playwright deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/yarn-playwright-install
- uses: ./.github/actions/env-read-file
- uses: ./.github/actions/cache-db
- uses: ./.github/actions/cache-build
- name: Run Tests
run: yarn turbo run embed-tests-update-snapshots:ci --scope=@calcom/embed-react --concurrency=1
env:
DEPLOYSENTINEL_API_KEY: ${{ secrets.DEPLOYSENTINEL_API_KEY }}
- name: Upload embed-core results
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-results-core
name: test-results-embed-core
path: packages/embeds/embed-core/playwright/results
- name: Upload embed-react results
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-results-react
name: test-results-embed-react
path: packages/embeds/embed-react/playwright/results
+14 -79
View File
@@ -1,59 +1,11 @@
name: E2E test
on:
pull_request_target: # So we can test on forks
branches:
- main
paths:
- apps/web/**
- packages/**
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
e2e:
timeout-minutes: 20
runs-on: buildjet-4vcpu-ubuntu-2204
env:
DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
NEXT_PUBLIC_WEBSITE_URL: http://localhost:3000
NEXTAUTH_SECRET: secret
GOOGLE_API_CREDENTIALS: ${{ secrets.CI_GOOGLE_API_CREDENTIALS }}
GOOGLE_LOGIN_ENABLED: true
# CRON_API_KEY: xxx
CALENDSO_ENCRYPTION_KEY: ${{ secrets.CI_CALENDSO_ENCRYPTION_KEY }}
DAILY_API_KEY: ${{ secrets.CI_DAILY_API_KEY }}
NEXT_PUBLIC_STRIPE_PUBLIC_KEY: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PUBLIC_KEY }}
NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE }}
NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE }}
NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE }}
NEXT_PUBLIC_STRIPE_PREMIUM_NEW_PLAN_PRICE: ${{ secrets.NEXT_PUBLIC_STRIPE_PREMIUM_NEW_PLAN_PRICE }}
NEXT_PUBLIC_IS_PREMIUM_NEW_PLAN: 1
STRIPE_PRIVATE_KEY: ${{ secrets.CI_STRIPE_PRIVATE_KEY }}
STRIPE_CLIENT_ID: ${{ secrets.CI_STRIPE_CLIENT_ID }}
STRIPE_WEBHOOK_SECRET: ${{ secrets.CI_STRIPE_WEBHOOK_SECRET }}
STRIPE_PRO_PLAN_PRODUCT_ID: ${{ secrets.CI_STRIPE_PRO_PLAN_PRODUCT_ID }}
STRIPE_PREMIUM_PLAN_PRODUCT_ID: ${{ secrets.CI_STRIPE_PREMIUM_PLAN_PRODUCT_ID }}
STRIPE_FREE_PLAN_PRODUCT_ID: ${{ secrets.CI_STRIPE_FREE_PLAN_PRODUCT_ID }}
PAYMENT_FEE_PERCENTAGE: 0.005
PAYMENT_FEE_FIXED: 10
SAML_DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
SAML_ADMINS: pro@example.com
NEXTAUTH_URL: http://localhost:3000/api/auth
NEXT_PUBLIC_IS_E2E: 1
# EMAIL_FROM: e2e@cal.com
# EMAIL_SERVER_HOST: ${{ secrets.CI_EMAIL_SERVER_HOST }}
# EMAIL_SERVER_PORT: ${{ secrets.CI_EMAIL_SERVER_PORT }}
# EMAIL_SERVER_USER: ${{ secrets.CI_EMAIL_SERVER_USER }}
# EMAIL_SERVER_PASSWORD: ${{ secrets.CI_EMAIL_SERVER_PASSWORD }}
# MS_GRAPH_CLIENT_ID: xxx
# MS_GRAPH_CLIENT_SECRET: xxx
# ZOOM_CLIENT_ID: xxx
# ZOOM_CLIENT_SECRET: xxx
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
name: E2E tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12.1
@@ -62,37 +14,20 @@ jobs:
POSTGRES_DB: calendso
ports:
- 5432:5432
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }} # So we can test on forks
fetch-depth: 2
- uses: actions/checkout@v3
- uses: ./.github/actions/dangerous-git-checkout
- run: echo 'NODE_OPTIONS="--max_old_space_size=4096"' >> $GITHUB_ENV
- name: Use Node 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "yarn"
- name: Cache playwright binaries
uses: actions/cache@v2
id: playwright-cache
with:
path: |
~/Library/Caches/ms-playwright
~/.cache/ms-playwright
${{ github.workspace }}/node_modules/playwright
key: cache-playwright-${{ hashFiles('**/yarn.lock') }}
restore-keys: cache-playwright-
- run: yarn --frozen-lockfile
- name: Install playwright deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps
- run: yarn test-e2e
- name: Upload test results
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/yarn-playwright-install
- uses: ./.github/actions/env-read-file
- uses: ./.github/actions/cache-db
- uses: ./.github/actions/cache-build
- name: Run Tests
run: yarn test-e2e
env:
DEPLOYSENTINEL_API_KEY: ${{ secrets.DEPLOYSENTINEL_API_KEY }}
- name: Upload Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
+49
View File
@@ -0,0 +1,49 @@
name: Create .env file
on:
workflow_call:
env:
INPUT_ENV_DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
INPUT_ENV_NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
INPUT_ENV_NEXT_PUBLIC_WEBSITE_URL: http://localhost:3000
INPUT_ENV_NEXTAUTH_SECRET: secret
INPUT_ENV_GOOGLE_API_CREDENTIALS: ${{ secrets.CI_GOOGLE_API_CREDENTIALS }}
INPUT_ENV_GOOGLE_LOGIN_ENABLED: true
# INPUT_ENV_CRON_API_KEY: xxx
INPUT_ENV_CALENDSO_ENCRYPTION_KEY: ${{ secrets.CI_CALENDSO_ENCRYPTION_KEY }}
INPUT_ENV_NEXT_PUBLIC_STRIPE_PUBLIC_KEY: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PUBLIC_KEY }}
INPUT_ENV_STRIPE_PRIVATE_KEY: ${{ secrets.CI_STRIPE_PRIVATE_KEY }}
INPUT_ENV_STRIPE_CLIENT_ID: ${{ secrets.CI_STRIPE_CLIENT_ID }}
INPUT_ENV_STRIPE_WEBHOOK_SECRET: ${{ secrets.CI_STRIPE_WEBHOOK_SECRET }}
INPUT_ENV_PAYMENT_FEE_PERCENTAGE: 0.005
INPUT_ENV_PAYMENT_FEE_FIXED: 10
INPUT_ENV_SAML_DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
INPUT_ENV_SAML_ADMINS: pro@example.com
INPUT_ENV_NEXTAUTH_URL: http://localhost:3000/api/auth
INPUT_ENV_NEXT_PUBLIC_IS_E2E: 1
# INPUT_ENV_EMAIL_FROM: e2e@cal.com
# INPUT_ENV_EMAIL_SERVER_HOST: ${{ secrets.CI_EMAIL_SERVER_HOST }}
# INPUT_ENV_EMAIL_SERVER_PORT: ${{ secrets.CI_EMAIL_SERVER_PORT }}
# INPUT_ENV_EMAIL_SERVER_USER: ${{ secrets.CI_EMAIL_SERVER_USER }}
# INPUT_ENV_EMAIL_SERVER_PASSWORD: ${{ secrets.CI_EMAIL_SERVER_PASSWORD }}
# INPUT_ENV_MS_GRAPH_CLIENT_ID: xxx
# INPUT_ENV_MS_GRAPH_CLIENT_SECRET: xxx
# INPUT_ENV_ZOOM_CLIENT_ID: xxx
# INPUT_ENV_ZOOM_CLIENT_SECRET: xxx
INPUT_ENV_TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
INPUT_ENV_TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
jobs:
create_env_file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ozaytsev86/create-env-file@v1
with:
file-name: ${{ github.workspace }}/gh.env
- uses: actions/cache@v3
id: env-cache
with:
path: gh.env
key: env-cache-${{ hashFiles('gh.env') }}
+5 -29
View File
@@ -1,38 +1,14 @@
name: Lint
on:
pull_request_target:
branches:
- main
paths:
- "**.tsx?"
- "**.jsx?"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
workflow_call:
jobs:
lint:
runs-on: buildjet-4vcpu-ubuntu-2204
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2
- name: Use Node 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "yarn"
- name: Install deps
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile
- name: Test Code Linting
run: yarn lint
- uses: actions/checkout@v3
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- name: Save Code Linting Reports
run: yarn lint:report
continue-on-error: true
+18 -76
View File
@@ -1,91 +1,30 @@
name: "Next.js Bundle Analysis"
on:
pull_request:
workflow_call:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
# change this if your nextjs app does not live at the root of the repo
working-directory: ./apps/web/
jobs:
build:
name: Production build
if: ${{ github.event_name == 'push' }}
uses: ./.github/workflows/production-build.yml
secrets: inherit
analyze:
env:
DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
NEXT_PUBLIC_WEBSITE_URL: http://localhost:3000
NEXTAUTH_SECRET: secret
GOOGLE_API_CREDENTIALS: ${{ secrets.CI_GOOGLE_API_CREDENTIALS }}
GOOGLE_LOGIN_ENABLED: true
CALENDSO_ENCRYPTION_KEY: ${{ secrets.CI_CALENDSO_ENCRYPTION_KEY }}
DAILY_API_KEY: ${{ secrets.CI_DAILY_API_KEY }}
NEXT_PUBLIC_STRIPE_PUBLIC_KEY: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PUBLIC_KEY }}
NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE }}
NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE }}
NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE }}
NEXT_PUBLIC_STRIPE_PREMIUM_NEW_PLAN_PRICE: ${{ secrets.NEXT_PUBLIC_STRIPE_PREMIUM_NEW_PLAN_PRICE }}
NEXT_PUBLIC_IS_PREMIUM_NEW_PLAN: 1
STRIPE_PRIVATE_KEY: ${{ secrets.CI_STRIPE_PRIVATE_KEY }}
STRIPE_CLIENT_ID: ${{ secrets.CI_STRIPE_CLIENT_ID }}
STRIPE_WEBHOOK_SECRET: ${{ secrets.CI_STRIPE_WEBHOOK_SECRET }}
STRIPE_PRO_PLAN_PRODUCT_ID: ${{ secrets.CI_STRIPE_PRO_PLAN_PRODUCT_ID }}
STRIPE_PREMIUM_PLAN_PRODUCT_ID: ${{ secrets.CI_STRIPE_PREMIUM_PLAN_PRODUCT_ID }}
STRIPE_FREE_PLAN_PRODUCT_ID: ${{ secrets.CI_STRIPE_FREE_PLAN_PRODUCT_ID }}
PAYMENT_FEE_PERCENTAGE: 0.005
PAYMENT_FEE_FIXED: 10
SAML_DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
SAML_ADMINS: pro@example.com
NEXTAUTH_URL: http://localhost:3000/api/auth
NEXT_PUBLIC_IS_E2E: 1
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
services:
postgres:
image: postgres:12.1
env:
POSTGRES_USER: postgres
POSTGRES_DB: calendso
ports:
- 5432:5432
needs: build
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "yarn"
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Restore next build
uses: actions/cache@v2
id: restore-build-cache
env:
cache-name: cache-next-build
with:
path: apps/web/.next/cache
# change this if you prefer a more strict cache
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Build next.js app
# change this if your site requires a custom build command
run: cd ../.. && yarn db-seed && yarn build
# Here's the first place where next-bundle-analysis' own script is used
# This step pulls the raw bundle stats for the current bundle
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/cache-build
- name: Analyze bundle
run: npx -p nextjs-bundle-analysis report
run: |
cd apps/web
npx -p nextjs-bundle-analysis report
- name: Upload bundle
uses: actions/upload-artifact@v2
@@ -116,12 +55,15 @@ jobs:
# entry in your package.json file.
- name: Compare with base branch bundle
if: success() && github.event.number
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
run: |
cd apps/web
ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
- name: Get comment body
id: get-comment-body
if: success() && github.event.number
run: |
cd apps/web
body=$(cat .next/analyze/__bundle_analysis_comment.txt)
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
+96
View File
@@ -0,0 +1,96 @@
name: PR Update
on:
pull_request_target:
branches:
- main
paths-ignore:
- "**.md"
- ".github/CODEOWNERS"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
app-store: ${{ steps.filter.outputs.app-store }}
embed: ${{ steps.filter.outputs.embed }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/dangerous-git-checkout
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
app-store:
- 'apps/web/**'
- 'packages/app-store/**'
embed:
- 'apps/web/**'
- 'packages/embeds/**'
env:
name: Create env file
uses: ./.github/workflows/env-create-file.yml
secrets: inherit
type-check:
name: Type check
uses: ./.github/workflows/check-types.yml
secrets: inherit
test:
name: Unit tests
uses: ./.github/workflows/test.yml
secrets: inherit
lint:
name: Linters
uses: ./.github/workflows/lint.yml
secrets: inherit
build:
name: Production build
needs: env
uses: ./.github/workflows/production-build.yml
secrets: inherit
e2e:
name: E2E tests
needs: [changes, lint, build]
uses: ./.github/workflows/e2e.yml
secrets: inherit
e2e-app-store:
name: E2E App Store tests
if: ${{ needs.changes.outputs.app-store == 'true' }}
needs: [changes, lint, build]
uses: ./.github/workflows/e2e-app-store.yml
secrets: inherit
e2e-embed:
name: E2E embeds tests
if: ${{ needs.changes.outputs.embed == 'true' }}
needs: [changes, lint, build]
uses: ./.github/workflows/e2e-embed.yml
secrets: inherit
analyze:
needs: build
uses: ./.github/workflows/nextjs-bundle-analysis.yml
secrets: inherit
required:
needs: [lint, type-check, test, build, e2e]
if: always()
runs-on: ubuntu-latest
steps:
- name: fail if conditional jobs failed
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')
run: exit 1
+25
View File
@@ -0,0 +1,25 @@
name: Production Build
on:
workflow_call:
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:12.1
env:
POSTGRES_USER: postgres
POSTGRES_DB: calendso
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/env-read-file
- uses: ./.github/actions/cache-db
- uses: ./.github/actions/cache-build
-44
View File
@@ -1,44 +0,0 @@
name: "Meta Workflow: Require Conditional Status Checks"
on:
pull_request:
branches:
- main
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
required-checks:
runs-on: ubuntu-latest
steps:
- name: Ensure All Conditional Checks Have Passed
uses: blend/require-conditional-status-checks@2022.02.04
with:
timeout: 15m
github-token: ${{ github.token }}
interval: 20s
# Question marks aren't working
# @see https://github.com/blend/require-conditional-status-checks/pull/11
checks-yaml: |
- job: lint
paths:
- /**/*.jsx
- /**/*.js
- /**/*.tsx
- /**/*.ts
- job: check-types
paths:
- /**/*.tsx
- /**/*.ts
- job: e2e
paths:
- /apps/web/**
- /packages/**
- job: e2e-embed
paths:
- /apps/web/**
- /packages/embeds/**
- job: test
paths:
- /apps/web/**
- /packages/**
+1 -1
View File
@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.GH_ACCESS_TOKEN }}
+5 -21
View File
@@ -1,33 +1,17 @@
name: Unit tests
on:
pull_request_target: # So we can test on forks
branches:
- main
paths:
- apps/web/**
- packages/**
workflow_call:
workflow_run:
workflows: [Crowdin Action]
types: [completed]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }} # So we can test on forks
fetch-depth: 2
# Should be an 8GB machine as per https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
- uses: actions/checkout@v3
- uses: ./.github/actions/dangerous-git-checkout
- run: echo 'NODE_OPTIONS="--max_old_space_size=6144"' >> $GITHUB_ENV
- name: Use Node 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "yarn"
- run: yarn --frozen-lockfile
- uses: ./.github/actions/yarn-install
# Should be an 8GB machine as per https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
- run: yarn test
+3 -7
View File
@@ -1,6 +1,6 @@
name: TODO to Issue
on:
pull_request_target: # So we can test on forks
push:
branches:
- main
workflow_dispatch:
@@ -12,17 +12,13 @@ on:
description: "By default, the commit entered above is compared to the one directly before it; to go back further, enter an earlier SHA here"
required: false
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
todos:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2
- uses: actions/checkout@v3
- name: "Add TODOs to issues"
uses: "alstr/todo-to-issue-action@v4"
env:
+14
View File
@@ -0,0 +1,14 @@
name: Yarn install
on:
workflow_call:
jobs:
setup:
name: Yarn install & cache
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
+12 -30
View File
@@ -2,38 +2,20 @@
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: Server",
"type": "node-terminal",
"type": "node",
"request": "launch",
"command": "npm run dev",
"skipFiles": ["<node_internals>/**"],
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
],
"sourceMaps": true,
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!**/node_modules/**"
]
},
{
"name": "Next.js: Client",
"type": "pwa-chrome",
"request": "launch",
"url": "http://localhost:3000"
},
{
"name": "Next.js: Full Stack",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"name": "Next.js Node Debug",
"runtimeExecutable": "${workspaceFolder}/node_modules/next/dist/bin/next",
"env": {
"NODE_OPTIONS": "--inspect"
},
"cwd": "${workspaceFolder}/apps/web",
"console": "integratedTerminal",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
"sourceMapPathOverrides": {
"meteor://💻app/*": "${workspaceFolder}/*",
"webpack:///./~/*": "${workspaceFolder}/node_modules/*",
"webpack://?:*/*": "${workspaceFolder}/*"
}
}
]
}
}
+1 -1
View File
@@ -128,6 +128,6 @@ If you get errors, be sure to fix them before committing.
## Making a Pull Request
- Be sure to [check the "Allow edits from maintainers" option](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) while creating you PR.
- If your PR refers to or fixes an issue, be sure to add `refs #XXX` or `fixes #XXX` to the PR description. Replacing `XXX` with the respective issue number. Se more about [Linking a pull request to an issue
- If your PR refers to or fixes an issue, be sure to add `refs #XXX` or `fixes #XXX` to the PR description. Replacing `XXX` with the respective issue number. See more about [Linking a pull request to an issue
](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).
- Be sure to fill the PR Template accordingly.
+10 -1
View File
@@ -25,7 +25,7 @@
<p align="center">
<a href="https://cal.com/slack"><img src="https://img.shields.io/badge/Slack-calendso.slack.com-%234A154B" alt="Join Cal.com Slack"></a>
<a href="https://www.producthunt.com/posts/calendso"><img src="https://img.shields.io/badge/Product%20Hunt-%231%20Product%20of%20the%20Month-%23DA552E" alt="Product Hunt"></a>
<a href="https://status.cal.com"><img src="https://betteruptime.com/status-badges/v1/monitor/a9kf.svg" alt="Uptime"></a>
<a href="https://status.cal.com"><img height="20px" src="https://betteruptime.com/status-badges/v1/monitor/a9kf.svg" alt="Uptime"></a>
<a href="https://github.com/calcom/cal.com/stargazers"><img src="https://img.shields.io/github/stars/calcom/cal.com" alt="Github Stars"></a>
<a href="https://news.ycombinator.com/item?id=34507672"><img src="https://img.shields.io/badge/Hacker%20News-%231-%23FF6600" alt="Hacker News"></a>
<a href="https://github.com/calcom/cal.com/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-AGPLv3-purple" alt="License"></a>
@@ -350,8 +350,17 @@ We have a list of [help wanted](https://github.com/calcom/cal.com/issues?q=is:is
<img alt="Bounties of cal" src="https://console.algora.io/api/og/cal/bounties.png?p=0&status=open&theme=light">
</picture>
</a>
<!-- CONTRIBUTORS -->
### Contributors
<a href="https://github.com/calcom/cal.com/graphs/contributors">
<img src="https://contrib.rocks/image?repo=calcom/cal.com" />
</a>
<!-- TRANSLATIONS -->
### Translations
+1 -1
View File
@@ -17,7 +17,7 @@
"license": "MIT",
"dependencies": {
"iframe-resizer-react": "^1.1.0",
"next": "^13.1.1",
"next": "^13.2.1",
"nextra": "^1.1.0",
"nextra-theme-docs": "^1.2.2",
"react": "^18.2.0",
+13 -16
View File
@@ -1,21 +1,7 @@
const withBundleAnalyzer = require("@next/bundle-analyzer");
const withTM = require("next-transpile-modules")([
"@calcom/app-store",
"@calcom/dayjs",
"@calcom/emails",
"@calcom/trpc",
"@calcom/embed-core",
"@calcom/embed-react",
"@calcom/features",
"@calcom/lib",
"@calcom/prisma",
"@calcom/ui",
]);
const glob = require("glob");
const plugins = [];
plugins.push(withTM, withBundleAnalyzer({ enabled: process.env.ANALYZE === "true" }));
plugins.push(withBundleAnalyzer({ enabled: process.env.ANALYZE === "true" }));
/** @type {import("next").NextConfig} */
const nextConfig = {
@@ -27,7 +13,18 @@ const nextConfig = {
typescript: {
ignoreBuildErrors: true,
},
experimental: { images: { allowFutureImage: true } },
transpilePackages: [
"@calcom/app-store",
"@calcom/dayjs",
"@calcom/emails",
"@calcom/trpc",
"@calcom/embed-core",
"@calcom/embed-react",
"@calcom/features",
"@calcom/lib",
"@calcom/prisma",
"@calcom/ui",
],
eslint: {
ignoreDuringBuilds: true,
},
+1 -1
View File
@@ -20,7 +20,7 @@
"@radix-ui/react-slider": "^1.0.0",
"@radix-ui/react-switch": "^1.0.0",
"@radix-ui/react-tooltip": "^1.0.0",
"next": "^13.1.1",
"next": "^13.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"storybook-addon-rtl-direction": "^0.0.19"
+1 -1
View File
@@ -14,7 +14,7 @@
"dependencies": {
"highlight.js": "^11.6.0",
"isarray": "2.0.5",
"next": "^13.1.1",
"next": "^13.2.1",
"openapi-snippet": "^0.13.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
+1 -1
View File
@@ -10,7 +10,7 @@ import NavTabs from "./NavTabs";
const tabs = [
{
name: "profile",
href: "/settings/profile",
href: "/settings/my-account/profile",
icon: FiUser,
},
{
+6 -3
View File
@@ -303,6 +303,11 @@ const Component = ({
);
};
const ShellHeading = () => {
const { t } = useLocale();
return <span className="block py-2">{t("app_store")}</span>;
};
export default function App(props: {
name: string;
description: AppType["description"];
@@ -328,10 +333,8 @@ export default function App(props: {
images?: string[];
isTemplate?: boolean;
}) {
const { t } = useLocale();
return (
<Shell smallHeading isPublic heading={t("app_store")} backPath="/apps" withoutSeo>
<Shell smallHeading isPublic heading={<ShellHeading />} backPath="/apps" withoutSeo>
<HeadSeo
title={props.name}
description={props.description}
@@ -1,6 +1,7 @@
import React from "react";
import { SkeletonText } from "@calcom/ui";
import { Button, SkeletonText } from "@calcom/ui";
import { FiMoreHorizontal } from "@calcom/ui/components/icon";
import classNames from "@lib/classNames";
@@ -18,17 +19,21 @@ export default SkeletonLoader;
function SkeletonItem() {
return (
<li className="group flex w-full items-center justify-between px-2 py-[23px] sm:px-6">
<div className="flex-grow truncate text-sm">
<div className="flex flex-col space-y-2">
<SkeletonText className="h-4 w-32" />
<SkeletonText className="h-2 w-32" />
</div>
</div>
<div className="mt-4 hidden flex-shrink-0 sm:mt-0 sm:ml-5 lg:flex">
<div className="flex justify-between space-x-2 rtl:space-x-reverse">
<SkeletonText className="h-6 w-12" />
<li>
<div className="flex items-center justify-between py-5 hover:bg-neutral-50 ltr:pl-4 rtl:pr-4 sm:ltr:pl-0 sm:rtl:pr-0">
<div className="items-between flex w-full flex-col justify-center hover:bg-neutral-50 sm:px-6">
<SkeletonText className="my-1 h-4 w-32" />
<SkeletonText className="my-1 h-2 w-24" />
<SkeletonText className="my-1 h-2 w-40" />
</div>
<Button
className="mx-5"
type="button"
variant="icon"
color="secondary"
StartIcon={FiMoreHorizontal}
disabled
/>
</div>
</li>
);
@@ -1,3 +1,5 @@
import { z } from "zod";
import { getEventLocationType, locationKeyToString } from "@calcom/app-store/locations";
import { classNames } from "@calcom/lib";
import { useLocale } from "@calcom/lib/hooks/useLocale";
@@ -17,6 +19,23 @@ export function AvailableEventLocations({ locations }: { locations: Props["event
// It's possible that the location app got uninstalled
return null;
}
const translateAbleKeys = [
"attendee_in_person",
"in_person",
"attendee_phone_number",
"link_meeting",
"organizer_phone_number",
];
const locationKey = z.string().default("").parse(locationKeyToString(location));
const translatedLocation = location.type.startsWith("integrations:")
? eventLocationType.label
: translateAbleKeys.includes(locationKey)
? t(locationKey)
: locationKey;
return (
<div key={`${location.type}-${index}`} className="flex flex-row items-center text-sm font-medium">
{eventLocationType.iconUrl === "/link.svg" ? (
@@ -31,14 +50,12 @@ export function AvailableEventLocations({ locations }: { locations: Props["event
alt={`${eventLocationType.label} icon`}
/>
)}
<Tooltip content={t(locationKeyToString(location) ?? "")}>
<p className="truncate">{t(locationKeyToString(location) ?? "")}</p>
<Tooltip content={translatedLocation}>
<p className="line-clamp-1">{translatedLocation}</p>
</Tooltip>
</div>
);
})}
</div>
) : (
<></>
);
) : null;
}
+15 -5
View File
@@ -2,11 +2,12 @@ import { useAutoAnimate } from "@formkit/auto-animate/react";
import Link from "next/link";
import { useRouter } from "next/router";
import type { FC } from "react";
import { useEffect, useState } from "react";
import { useEffect, useState, useCallback } from "react";
import type { Dayjs } from "@calcom/dayjs";
import dayjs from "@calcom/dayjs";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import useMediaQuery from "@calcom/lib/hooks/useMediaQuery";
import { TimeFormat } from "@calcom/lib/timeFormat";
import { nameOfDay } from "@calcom/lib/weekday";
import type { Slot } from "@calcom/trpc/server/routers/viewer/slots";
@@ -50,6 +51,15 @@ const AvailableTimes: FC<AvailableTimesProps> = ({
useEffect(() => {
setBrand(getComputedStyle(document.documentElement).getPropertyValue("--brand-color").trim());
}, []);
const isMobile = useMediaQuery("(max-width: 768px)");
const ref = useCallback(
(node: HTMLDivElement) => {
if (isMobile) {
node?.scrollIntoView({ behavior: "smooth" });
}
},
[isMobile]
);
return (
<div ref={slotPickerRef}>
@@ -75,7 +85,7 @@ const AvailableTimes: FC<AvailableTimesProps> = ({
/>
</div>
</div>
<div className="flex-grow overflow-y-auto sm:block md:h-[364px]">
<div ref={ref} className="flex-grow overflow-y-auto sm:block md:h-[364px]">
{slots.length > 0 &&
slots.map((slot) => {
type BookingURL = {
@@ -111,7 +121,7 @@ const AvailableTimes: FC<AvailableTimesProps> = ({
{seatsPerTimeSlot && slot.attendees && slot.attendees >= seatsPerTimeSlot ? (
<div
className={classNames(
"text-primary-500 dark:bg-darkgray-200 dark:text-darkgray-900 mb-2 block rounded-sm border bg-white py-2 font-medium opacity-25 dark:border-transparent ",
"text-primary-500 dark:bg-darkgray-200 dark:text-darkgray-900 mb-2 block rounded-sm border bg-white py-2 font-medium opacity-25 dark:border-transparent ",
brand === "#fff" || brand === "#ffffff" ? "" : ""
)}>
{dayjs(slot.time).tz(timeZone()).format(timeFormat)}
@@ -122,8 +132,8 @@ const AvailableTimes: FC<AvailableTimesProps> = ({
href={bookingUrl}
prefetch={false}
className={classNames(
"text-primary-500 hover:border-gray-900 hover:bg-gray-50",
"dark:bg-darkgray-200 dark:hover:bg-darkgray-300 dark:hover:border-darkmodebrand dark:text-darkgray-800 mb-2 block rounded-md border bg-white py-2 text-sm font-medium dark:border-transparent",
"hover:bg-brand hover:border-brand hover:text-brandcontrast dark:hover:text-darkmodebrandcontrast",
"dark:bg-darkgray-200 dark:hover:bg-darkmodebrand dark:hover:border-darkmodebrand dark:text-darkgray-800 mb-2 block rounded-md border bg-white py-2 text-sm font-medium dark:border-transparent",
brand === "#fff" || brand === "#ffffff" ? "" : ""
)}
data-testid="time">
@@ -6,7 +6,7 @@ import dayjs from "@calcom/dayjs";
import classNames from "@calcom/lib/classNames";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Badge } from "@calcom/ui";
import { FiCheckSquare, FiClock, FiInfo } from "@calcom/ui/components/icon";
import { FiCheckSquare, FiClock } from "@calcom/ui/components/icon";
import useRouterQuery from "@lib/hooks/useRouterQuery";
@@ -94,15 +94,7 @@ const BookingDescription: FC<Props> = (props) => {
"flex",
isBookingPage && "dark:text-darkgray-600 text-sm font-medium text-gray-600"
)}>
<div>
<FiInfo
className={classNames(
"ml-[2px] inline-block h-4 w-4 ltr:mr-[10px] rtl:ml-[10px]",
isBookingPage && "dark:text-darkgray-600 -mt-1 text-gray-500"
)}
/>
</div>
<div className="max-w-[calc(100%_-_2rem)] flex-shrink break-words">
<div className="scroll-bar scrollbar-track-w-20 max-h-[200px] max-w-full flex-shrink break-words [&_a]:text-blue-500 [&_a]:underline [&_a]:hover:text-blue-600">
<EventTypeDescriptionSafeHTML eventType={eventType} />
</div>
</div>
@@ -0,0 +1,24 @@
import { FormattedNumber, IntlProvider } from "react-intl";
import getPaymentAppData from "@calcom/lib/getPaymentAppData";
import { FiCreditCard } from "@calcom/ui/components/icon";
const BookingDescriptionPayment = (props: { eventType: Parameters<typeof getPaymentAppData>[0] }) => {
const paymentAppData = getPaymentAppData(props.eventType);
if (!paymentAppData || paymentAppData.price <= 0) return null;
return (
<p className="text-bookinglight -ml-2 px-2 text-sm ">
<FiCreditCard className="ml-[2px] -mt-1 inline-block h-4 w-4 ltr:mr-[10px] rtl:ml-[10px]" />
<IntlProvider locale="en">
<FormattedNumber
value={paymentAppData.price / 100.0}
style="currency"
currency={paymentAppData.currency?.toUpperCase()}
/>
</IntlProvider>
</p>
);
};
export default BookingDescriptionPayment;
@@ -223,6 +223,8 @@ function BookingListItem(booking: BookingItemProps) {
};
const showRecordingsButtons =
(booking.location === "integrations:daily" || booking?.location?.trim() === "") && isPast && isConfirmed;
const title = decodeURIComponent(booking.title);
return (
<>
<RescheduleDialog
@@ -355,12 +357,12 @@ function BookingListItem(booking: BookingItemProps) {
<div className="cursor-pointer py-4">
<div
title={booking.title}
title={title}
className={classNames(
"max-w-10/12 sm:max-w-56 text-sm font-medium leading-6 text-gray-900 md:max-w-full",
isCancelled ? "line-through" : ""
)}>
{booking.title}
{title}
<span> </span>
{!!booking?.eventType?.price && !booking.paid && (
@@ -17,7 +17,7 @@ export function TimezoneDropdown({
return (
<>
<div className="dark:focus-within:bg-darkgray-200 dark:bg-darkgray-100 dark:hover:bg-darkgray-200 -mx-[2px] !mt-3 flex w-fit items-center rounded-[4px] px-1 py-[2px] text-sm font-medium focus-within:bg-gray-200 hover:bg-gray-100 [&_svg]:focus-within:text-gray-900 dark:[&_svg]:focus-within:text-white [&_p]:focus-within:text-gray-900 dark:[&_p]:focus-within:text-white">
<div className="dark:focus-within:bg-darkgray-200 dark:bg-darkgray-100 dark:hover:bg-darkgray-200 -mx-[2px] !mt-3 flex w-fit max-w-[20rem] items-center rounded-[4px] px-1 py-[2px] text-sm font-medium focus-within:bg-gray-200 hover:bg-gray-100 lg:max-w-[12rem] [&_svg]:focus-within:text-gray-900 dark:[&_svg]:focus-within:text-white [&_p]:focus-within:text-gray-900 dark:[&_p]:focus-within:text-white">
<FiGlobe className="dark:text-darkgray-600 flex h-4 w-4 text-gray-600 ltr:mr-[2px] rtl:ml-[2px]" />
<TimeOptions onSelectTimeZone={handleSelectTimeZone} />
</div>
File diff suppressed because it is too large Load Diff
@@ -4,7 +4,7 @@ import { isValidPhoneNumber } from "libphonenumber-js";
import { Trans } from "next-i18next";
import Link from "next/link";
import { useEffect } from "react";
import { Controller, useForm, useWatch } from "react-hook-form";
import { Controller, useForm, useWatch, useFormContext } from "react-hook-form";
import { z } from "zod";
import type { EventLocationType, LocationObject } from "@calcom/app-store/locations";
@@ -49,16 +49,19 @@ const LocationInput = (props: {
defaultValue?: string;
}): JSX.Element | null => {
const { eventLocationType, locationFormMethods, ...remainingProps } = props;
const { control } = useFormContext() as typeof locationFormMethods;
if (eventLocationType?.organizerInputType === "text") {
return (
<input {...locationFormMethods.register(eventLocationType.variable)} type="text" {...remainingProps} />
);
} else if (eventLocationType?.organizerInputType === "phone") {
return (
<PhoneInput
<Controller
name={eventLocationType.variable}
control={locationFormMethods.control}
{...remainingProps}
control={control}
render={({ field: { onChange, value } }) => {
return <PhoneInput onChange={onChange} value={value} {...remainingProps} />;
}}
/>
);
}
@@ -188,6 +191,7 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
control={locationFormMethods.control}
render={() => (
<CheckboxField
data-testid="display-location"
defaultChecked={defaultLocation?.displayLocationPublicly}
description={t("display_location_label")}
onChange={(e) =>
@@ -284,16 +288,13 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
}}>
<QueryCell
query={locationsQuery}
success={({ data: locationOptions }) => {
if (!locationOptions.length) return null;
success={({ data }) => {
if (!data.length) return null;
const locationOptions = [...data];
if (booking) {
locationOptions.forEach((location) => {
if (location.label === "phone") {
location.options.filter((l) => l.value !== "phone");
} else if (location.label === "in person") {
location.options.filter((l) => l.value !== "attendeeInPerson");
}
});
locationOptions.map((location) =>
location.options.filter((l) => !["phone", "attendeeInPerson"].includes(l.value))
);
}
return (
<Controller
@@ -345,7 +346,9 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
{t("cancel")}
</Button>
<Button type="submit">{t("update")}</Button>
<Button data-testid="update-location" type="submit">
{t("update")}
</Button>
</div>
</DialogFooter>
</Form>
@@ -113,7 +113,7 @@ const EventTypeScheduleDetails = () => {
);
const filterDays = (dayNum: number) =>
schedule?.schedule.availability.filter((item) => item.days.includes((dayNum + 1) % 7)) || [];
schedule?.schedule.filter((item) => item.days.includes((dayNum + 1) % 7)) || [];
return (
<div className="space-y-4 rounded border px-6 pb-4">
@@ -156,15 +156,17 @@ const EventTypeScheduleDetails = () => {
<FiGlobe className="ltr:mr-2 rtl:ml-2" />
{schedule?.timeZone || <SkeletonText className="block h-5 w-32" />}
</span>
<Button
href={`/availability/${schedule?.schedule.id}`}
disabled={isLoading}
color="minimal"
EndIcon={FiExternalLink}
target="_blank"
rel="noopener noreferrer">
{t("edit_availability")}
</Button>
{!!schedule?.id && (
<Button
href={`/availability/${schedule.id}`}
disabled={isLoading}
color="minimal"
EndIcon={FiExternalLink}
target="_blank"
rel="noopener noreferrer">
{t("edit_availability")}
</Button>
)}
</div>
</div>
);
@@ -0,0 +1,144 @@
import type { FC } from "react";
import type { SubmitHandler } from "react-hook-form";
import { FormProvider } from "react-hook-form";
import { useForm, useFormContext } from "react-hook-form";
import type { EventNameObjectType } from "@calcom/core/event";
import { getEventName } from "@calcom/core/event";
import { validateCustomEventName } from "@calcom/core/event";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Button, Dialog, DialogClose, DialogFooter, DialogContent, TextField } from "@calcom/ui";
interface FormValues {
customEventName: string;
}
interface CustomEventTypeModalFormProps {
placeHolder: string;
close: () => void;
setValue: (value: string) => void;
event: EventNameObjectType;
defaultValue: string;
}
const CustomEventTypeModalForm: FC<CustomEventTypeModalFormProps> = (props) => {
const { t } = useLocale();
const { placeHolder, close, setValue, event } = props;
const { register, handleSubmit, watch, getValues } = useFormContext<FormValues>();
const onSubmit: SubmitHandler<FormValues> = (data) => {
setValue(data.customEventName);
close();
};
// const customEventName = watch("customEventName");
const previewText = getEventName({ ...event, eventName: watch("customEventName") });
const placeHolder_ = watch("customEventName") === "" ? previewText : placeHolder;
return (
<form
id="custom-event-name"
onSubmit={(e) => {
e.preventDefault();
e.stopPropagation();
const isEmpty = getValues("customEventName") === "";
if (isEmpty) {
setValue("");
}
handleSubmit(onSubmit)(e);
}}>
<TextField
label={t("event_name_in_calendar")}
type="text"
placeholder={placeHolder_}
{...register("customEventName", {
validate: (value) => validateCustomEventName(value, t("invalid_event_name_variables")),
})}
className="mb-0"
/>
<div className="pt-6 text-sm">
<div className="mb-6 rounded-md bg-gray-100 p-2">
<h1 className="mb-2 ml-1 font-medium text-gray-900">{t("available_variables")}</h1>
<div className="mb-2.5 flex font-normal">
<p className="ml-1 mr-5 w-28 text-gray-400">{`{Event type title}`}</p>
<p className="text-gray-900">{t("event_name_info")}</p>
</div>
<div className="mb-2.5 flex font-normal">
<p className="ml-1 mr-5 w-28 text-gray-400">{`{Organiser}`}</p>
<p className="text-gray-900">{t("your_full_name")}</p>
</div>
<div className="mb-2.5 flex font-normal">
<p className="ml-1 mr-5 w-28 text-gray-400">{`{Scheduler}`}</p>
<p className="text-gray-900">{t("scheduler_full_name")}</p>
</div>
<div className="mb-1 flex font-normal">
<p className="ml-1 mr-5 w-28 text-gray-400">{`{Location}`}</p>
<p className="text-gray-900">{t("location_info")}</p>
</div>
</div>
<h1 className="mb-2 text-[14px] font-medium leading-4">{t("preview")}</h1>
<div
className="flex h-[212px] w-full rounded-md border-y bg-cover bg-center"
style={{
backgroundImage: "url(/calendar-preview.svg)",
}}>
<div className="m-auto flex items-center justify-center self-stretch">
<div className="mt-3 ml-11 box-border h-[110px] w-[120px] flex-col items-start gap-1 rounded-md border border-solid border-black bg-gray-100 text-[12px] leading-3">
<p className="overflow-hidden text-ellipsis p-1.5 font-medium text-gray-900">{previewText}</p>
<p className="ml-1.5 text-[10px] font-normal text-gray-600">8 - 10 AM</p>
</div>
</div>
</div>
</div>
</form>
);
};
interface CustomEventTypeModalProps {
placeHolder: string;
defaultValue: string;
close: () => void;
setValue: (value: string) => void;
event: EventNameObjectType;
}
const CustomEventTypeModal: FC<CustomEventTypeModalProps> = (props) => {
const { t } = useLocale();
const { defaultValue, placeHolder, close, setValue, event } = props;
const methods = useForm<FormValues>({
defaultValues: {
customEventName: defaultValue,
},
});
return (
<Dialog open={true} onOpenChange={close}>
<DialogContent
title={t("custom_event_name")}
description={t("custom_event_name_description")}
type="creation"
enableOverflow>
<FormProvider {...methods}>
<CustomEventTypeModalForm
event={event}
close={close}
setValue={setValue}
placeHolder={placeHolder}
defaultValue={defaultValue}
/>
</FormProvider>
<DialogFooter>
<DialogClose>{t("cancel")}</DialogClose>
<Button form="custom-event-name" type="submit" color="primary">
{t("create")}
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
);
};
export default CustomEventTypeModal;
@@ -1,214 +0,0 @@
import { useAutoAnimate } from "@formkit/auto-animate/react";
import { EventTypeCustomInputType } from "@prisma/client";
import type { CustomInputParsed } from "pages/event-types/[type]";
import type { FC } from "react";
import type { Control, UseFormRegister } from "react-hook-form";
import { Controller, useFieldArray, useForm, useWatch } from "react-hook-form";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Button, Label, Select, TextField } from "@calcom/ui";
import { FiPlus, FiX } from "@calcom/ui/components/icon";
interface OptionTypeBase {
label: string;
value: EventTypeCustomInputType;
options?: { label: string; type: string }[];
}
interface Props {
onSubmit: (output: CustomInputParsed) => void;
onCancel: () => void;
selectedCustomInput?: CustomInputParsed;
}
type IFormInput = CustomInputParsed;
/**
* Getting a random ID gives us the option to know WHICH field is changed
* when the user edits a custom field.
* This UUID is only used to check for changes in the UI and not the ID we use in the DB
* There is very very very slim chance that this will cause a collision
* */
const randomId = () => Math.floor(Math.random() * 1000000 + new Date().getTime());
const CustomInputTypeForm: FC<Props> = (props) => {
const { t } = useLocale();
const inputOptions: OptionTypeBase[] = [
{ value: EventTypeCustomInputType.TEXT, label: t("text") },
{ value: EventTypeCustomInputType.TEXTLONG, label: t("multiline_text") },
{ value: EventTypeCustomInputType.NUMBER, label: t("number") },
{ value: EventTypeCustomInputType.BOOL, label: t("checkbox") },
{
value: EventTypeCustomInputType.RADIO,
label: t("radio"),
},
{ value: EventTypeCustomInputType.PHONE, label: t("phone_number") },
];
const { selectedCustomInput } = props;
const defaultValues = selectedCustomInput
? { ...selectedCustomInput, id: selectedCustomInput?.id || randomId() }
: {
id: randomId(),
type: EventTypeCustomInputType.TEXT,
};
const { register, control, getValues } = useForm<IFormInput>({
defaultValues,
});
const selectedInputType = useWatch({ name: "type", control });
const selectedInputOption = inputOptions.find((e) => selectedInputType === e.value);
const onCancel = () => {
props.onCancel();
};
return (
<div className="flex flex-col space-y-4">
<div>
<label htmlFor="type" className="block text-sm font-medium text-gray-700">
{t("input_type")}
</label>
<Controller
name="type"
control={control}
render={({ field }) => (
<Select
id="type"
defaultValue={selectedInputOption}
options={inputOptions}
isSearchable={false}
className="mt-1 mb-2 block w-full min-w-0 flex-1 text-sm"
onChange={(option) => option && field.onChange(option.value)}
value={selectedInputOption}
onBlur={field.onBlur}
name={field.name}
/>
)}
/>
</div>
<TextField
label={t("label")}
type="text"
id="label"
required
className="block w-full rounded-sm border-gray-300 text-sm"
defaultValue={selectedCustomInput?.label}
{...register("label", { required: true })}
/>
{(selectedInputType === EventTypeCustomInputType.TEXT ||
selectedInputType === EventTypeCustomInputType.TEXTLONG) && (
<TextField
label={t("placeholder")}
type="text"
id="placeholder"
className="block w-full rounded-sm border-gray-300 text-sm"
defaultValue={selectedCustomInput?.placeholder}
{...register("placeholder")}
/>
)}
{selectedInputType === EventTypeCustomInputType.RADIO && (
<RadioInputHandler control={control} register={register} />
)}
<div className="flex h-5 items-center">
<input
id="required"
type="checkbox"
className="text-primary-600 focus:ring-primary-500 h-4 w-4 rounded border-gray-300 ltr:mr-2 rtl:ml-2"
defaultChecked={selectedCustomInput?.required ?? true}
{...register("required")}
/>
<label htmlFor="required" className="block text-sm font-medium text-gray-700">
{t("is_required")}
</label>
</div>
<input
type="hidden"
id="eventTypeId"
value={selectedCustomInput?.eventTypeId || -1}
{...register("eventTypeId", { valueAsNumber: true })}
/>
<input
type="hidden"
id="id"
value={selectedCustomInput?.id || -1}
{...register("id", { valueAsNumber: true })}
/>
<div className="mt-5 flex justify-end space-x-2 rtl:space-x-reverse sm:mt-4">
<Button onClick={onCancel} type="button" color="secondary" className="ltr:mr-2 rtl:ml-2">
{t("cancel")}
</Button>
<Button
type="button"
onClick={() => {
props.onSubmit(getValues());
}}>
{t("save")}
</Button>
</div>
</div>
);
};
function RadioInputHandler({
register,
control,
}: {
register: UseFormRegister<IFormInput>;
control: Control<IFormInput>;
}) {
const { t } = useLocale();
const { fields, append, remove } = useFieldArray<IFormInput>({
control,
name: "options",
shouldUnregister: true,
});
const [animateRef] = useAutoAnimate<HTMLUListElement>();
return (
<div className="flex flex-col ">
<Label htmlFor="radio_options">{t("options")}</Label>
<ul
className="flex max-h-80 w-full flex-col space-y-1 overflow-y-scroll rounded-md bg-gray-50 p-4"
ref={animateRef}>
<>
{fields.map((option, index) => (
<li key={`${option.id}`}>
<TextField
id={option.id}
placeholder={t("enter_option", { index: index + 1 })}
addOnFilled={false}
label={t("option", { index: index + 1 })}
labelSrOnly
{...register(`options.${index}.label` as const, { required: true })}
addOnSuffix={
<Button
variant="icon"
color="minimal"
StartIcon={FiX}
onClick={() => {
remove(index);
}}
/>
}
/>
</li>
))}
<Button
color="minimal"
StartIcon={FiPlus}
className="!text-sm !font-medium"
onClick={() => {
append({ label: "", type: "text" });
}}>
{t("add_an_option")}
</Button>
</>
</ul>
</div>
);
}
export default CustomInputTypeForm;
@@ -1,5 +1,6 @@
import dynamic from "next/dynamic";
import Link from "next/link";
import type { CustomInputParsed, EventTypeSetupProps, FormValues } from "pages/event-types/[type]";
import type { EventTypeSetupProps, FormValues } from "pages/event-types/[type]";
import { useEffect, useState } from "react";
import { Controller, useFormContext } from "react-hook-form";
import short from "short-uuid";
@@ -8,30 +9,17 @@ import { v5 as uuidv5 } from "uuid";
import type { EventNameObjectType } from "@calcom/core/event";
import { getEventName } from "@calcom/core/event";
import DestinationCalendarSelector from "@calcom/features/calendars/DestinationCalendarSelector";
import CustomInputItem from "@calcom/features/eventtypes/components/CustomInputItem";
import { FormBuilder } from "@calcom/features/form-builder/FormBuilder";
import { APP_NAME, CAL_URL, IS_SELF_HOSTED } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import {
Badge,
Button,
Checkbox,
Dialog,
DialogClose,
DialogContent,
DialogFooter,
Label,
SettingsToggle,
showToast,
TextField,
Tooltip,
} from "@calcom/ui";
import { FiEdit, FiCopy, FiPlus } from "@calcom/ui/components/icon";
import CustomInputTypeForm from "@components/eventtype/CustomInputTypeForm";
import { Badge, Button, Checkbox, Label, SettingsToggle, showToast, TextField, Tooltip } from "@calcom/ui";
import { FiEdit, FiCopy } from "@calcom/ui/components/icon";
import RequiresConfirmationController from "./RequiresConfirmationController";
const CustomEventTypeModal = dynamic(() => import("@components/eventtype/CustomEventTypeModal"));
const generateHashedLink = (id: number) => {
const translator = short();
const seed = `${id}:${new Date().getTime()}`;
@@ -39,22 +27,11 @@ const generateHashedLink = (id: number) => {
return uid;
};
const getRandomId = (length = 8) => {
return (
-1 *
parseInt(
Math.ceil(Math.random() * Date.now())
.toPrecision(length)
.toString()
.replace(".", "")
)
);
};
export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps, "eventType" | "team">) => {
const connectedCalendarsQuery = trpc.viewer.connectedCalendars.useQuery();
const formMethods = useFormContext<FormValues>();
const { t } = useLocale();
const [showEventNameTip, setShowEventNameTip] = useState(false);
const [hashedLinkVisible, setHashedLinkVisible] = useState(!!eventType.hashedLink);
const [redirectUrlVisible, setRedirectUrlVisible] = useState(!!eventType.successRedirectUrl);
@@ -66,41 +43,39 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
host: eventType.users[0]?.name || "Nameless",
t,
};
const [previewText, setPreviewText] = useState(getEventName(eventNameObject));
const [customInputs, setCustomInputs] = useState<CustomInputParsed[]>(
eventType.customInputs.sort((a, b) => a.id - b.id) || []
);
const [selectedCustomInput, setSelectedCustomInput] = useState<CustomInputParsed | undefined>(undefined);
const [selectedCustomInputModalOpen, setSelectedCustomInputModalOpen] = useState(false);
const [requiresConfirmation, setRequiresConfirmation] = useState(eventType.requiresConfirmation);
const placeholderHashedLink = `${CAL_URL}/d/${hashedUrl}/${eventType.slug}`;
const seatsEnabled = formMethods.watch("seatsPerTimeSlotEnabled");
const removeCustom = (index: number) => {
formMethods.getValues("customInputs").splice(index, 1);
customInputs.splice(index, 1);
setCustomInputs([...customInputs]);
};
const changePreviewText = (eventNameObject: EventNameObjectType, previewEventName: string) => {
setPreviewText(
previewEventName
.replace("{Event type title}", eventNameObject.eventType)
.replace("{Scheduler}", eventNameObject.attendeeName)
.replace("{Organiser}", eventNameObject.host)
);
};
useEffect(() => {
!hashedUrl && setHashedUrl(generateHashedLink(eventType.users[0]?.id ?? team?.id));
}, [eventType.users, hashedUrl, team?.id]);
useEffect(() => {
if (eventType.customInputs) {
setCustomInputs(eventType.customInputs.sort((a, b) => a.id - b.id));
}
}, [eventType.customInputs]);
const toggleGuests = (enabled: boolean) => {
const bookingFields = formMethods.getValues("bookingFields");
formMethods.setValue(
"bookingFields",
bookingFields.map((field) => {
if (field.name === "guests") {
return {
...field,
hidden: !enabled,
};
}
return field;
})
);
};
const eventNamePlaceholder = getEventName({
...eventNameObject,
eventName: formMethods.watch("eventName"),
});
const closeEventNameTip = () => setShowEventNameTip(false);
const setEventName = (value: string) => formMethods.setValue("eventName", value);
return (
<div className="flex flex-col space-y-8">
{/**
@@ -141,16 +116,9 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
<TextField
label={t("event_name_in_calendar")}
type="text"
placeholder={t("meeting_with_user")}
placeholder={eventNamePlaceholder}
defaultValue={eventType.eventName || ""}
{...formMethods.register("eventName", {
onChange: (e) => {
if (!e.target.value || !formMethods.getValues("eventName")) {
return setPreviewText(getEventName(eventNameObject));
}
changePreviewText(eventNameObject, e.target.value);
},
})}
{...formMethods.register("eventName")}
addOnSuffix={
<Button
type="button"
@@ -159,53 +127,18 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
color="minimal"
className="hover:stroke-3 min-w-fit px-0 hover:bg-transparent hover:text-black"
onClick={() => setShowEventNameTip((old) => !old)}
aria-label="edit custom name"
/>
}
/>
</div>
<hr />
<div className="">
<SettingsToggle
title={t("additional_inputs")}
description={t("additional_input_description")}
checked={customInputs.length > 0}
onCheckedChange={(e) => {
if (e && customInputs.length === 0) {
// Push a placeholders
setSelectedCustomInputModalOpen(true);
} else if (!e) {
formMethods.setValue("customInputs", []);
}
}}>
<ul className="my-4 rounded-md border">
{customInputs.map((customInput, idx) => (
<CustomInputItem
key={idx}
question={customInput.label}
type={customInput.type}
required={customInput.required}
editOnClick={() => {
setSelectedCustomInput(customInput);
setSelectedCustomInputModalOpen(true);
}}
deleteOnClick={() => removeCustom(idx)}
/>
))}
</ul>
{customInputs.length > 0 && (
<Button
StartIcon={FiPlus}
color="minimal"
type="button"
onClick={() => {
setSelectedCustomInput(undefined);
setSelectedCustomInputModalOpen(true);
}}>
{t("add_input")}
</Button>
)}
</SettingsToggle>
</div>
<FormBuilder
title={t("booking_questions_title")}
description={t("booking_questions_description")}
addFieldLabel={t("add_a_booking_question")}
formProp="bookingFields"
/>
<hr />
<RequiresConfirmationController
seatsEnabled={seatsEnabled}
@@ -213,22 +146,6 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
requiresConfirmation={requiresConfirmation}
onRequiresConfirmation={setRequiresConfirmation}
/>
<hr />
<Controller
name="disableGuests"
control={formMethods.control}
defaultValue={eventType.disableGuests}
render={({ field: { value, onChange } }) => (
<SettingsToggle
title={t("disable_guests")}
description={t("disable_guests_description")}
checked={value}
onCheckedChange={(e) => onChange(e)}
disabled={seatsEnabled}
/>
)}
/>
<hr />
<Controller
name="hideCalendarNotes"
@@ -244,22 +161,6 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
)}
/>
<hr />
<Controller
name="metadata.additionalNotesRequired"
control={formMethods.control}
defaultValue={!!eventType.metadata.additionalNotesRequired}
render={({ field: { value, onChange } }) => (
<div className="flex space-x-3 ">
<SettingsToggle
title={t("require_additional_notes")}
description={t("require_additional_notes_description")}
checked={!!value}
onCheckedChange={(e) => onChange(e)}
/>
</div>
)}
/>
<hr />
<Controller
name="successRedirectUrl"
control={formMethods.control}
@@ -360,13 +261,13 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
onCheckedChange={(e) => {
// Enabling seats will disable guests and requiring confirmation until fully supported
if (e) {
formMethods.setValue("disableGuests", true);
toggleGuests(false);
formMethods.setValue("requiresConfirmation", false);
setRequiresConfirmation(false);
formMethods.setValue("seatsPerTimeSlot", 2);
} else {
formMethods.setValue("seatsPerTimeSlot", null);
formMethods.setValue("disableGuests", false);
toggleGuests(true);
}
onChange(e);
}}>
@@ -404,129 +305,14 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
/>
{showEventNameTip && (
<Dialog open={showEventNameTip} onOpenChange={setShowEventNameTip}>
<DialogContent
title={t("custom_event_name")}
description={t("custom_event_name_description")}
type="creation">
<TextField
label={t("event_name_in_calendar")}
type="text"
placeholder={t("meeting_with_user")}
defaultValue={eventType.eventName || ""}
{...formMethods.register("eventName", {
onChange: (e) => {
if (!e.target.value || !formMethods.getValues("eventName")) {
return setPreviewText(getEventName(eventNameObject));
}
changePreviewText(eventNameObject, e.target.value);
},
})}
className="mb-0"
/>
<div className="text-sm">
<div className="mb-6 rounded-md bg-gray-100 p-2">
<h1 className="mb-2 ml-1 font-medium text-gray-900">{t("available_variables")}</h1>
<div className="mb-2.5 flex font-normal">
<p className="ml-1 mr-5 w-28 text-gray-400">{`{Event type title}`}</p>
<p className="text-gray-900">{t("event_name_info")}</p>
</div>
<div className="mb-2.5 flex font-normal">
<p className="ml-1 mr-5 w-28 text-gray-400">{`{Organiser}`}</p>
<p className="text-gray-900">{t("your_full_name")}</p>
</div>
<div className="mb-2.5 flex font-normal">
<p className="ml-1 mr-5 w-28 text-gray-400">{`{Scheduler}`}</p>
<p className="text-gray-900">{t("scheduler_full_name")}</p>
</div>
<div className="mb-1 flex font-normal">
<p className="ml-1 mr-5 w-28 text-gray-400">{`{Location}`}</p>
<p className="text-gray-900">{t("location_info")}</p>
</div>
</div>
<h1 className="mb-2 text-[14px] font-medium leading-4">{t("preview")}</h1>
<div
className="flex h-[212px] w-full rounded-md border-y bg-cover bg-center"
style={{
backgroundImage: "url(/calendar-preview.svg)",
}}>
<div className="m-auto flex items-center justify-center self-stretch">
<div className="mt-3 ml-11 box-border h-[110px] w-[120px] flex-col items-start gap-1 rounded-md border border-solid border-black bg-gray-100 text-[12px] leading-3">
<p className="overflow-hidden text-ellipsis p-1.5 font-medium text-gray-900">
{previewText}
</p>
<p className="ml-1.5 text-[10px] font-normal text-gray-600">8 - 10 AM</p>
</div>
</div>
</div>
</div>
<DialogFooter>
<DialogClose onClick={() => formMethods.setValue("eventName", eventType.eventName ?? "")}>
{t("cancel")}
</DialogClose>
<Button color="primary" onClick={() => setShowEventNameTip(false)}>
{t("create")}
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
<CustomEventTypeModal
close={closeEventNameTip}
setValue={setEventName}
defaultValue={eventType.eventName || ""}
placeHolder={eventNamePlaceholder}
event={eventNameObject}
/>
)}
<Controller
name="customInputs"
control={formMethods.control}
defaultValue={customInputs}
render={() => (
<Dialog open={selectedCustomInputModalOpen} onOpenChange={setSelectedCustomInputModalOpen}>
<DialogContent
type="creation"
Icon={FiPlus}
title={t("add_new_custom_input_field")}
description={t("this_input_will_shown_booking_this_event")}>
<CustomInputTypeForm
selectedCustomInput={selectedCustomInput}
onSubmit={(values) => {
const customInput: CustomInputParsed = {
id: getRandomId(),
eventTypeId: -1,
label: values.label,
placeholder: values.placeholder,
required: values.required,
type: values.type,
options: values.options,
hasToBeCreated: true,
};
if (selectedCustomInput) {
selectedCustomInput.label = customInput.label;
selectedCustomInput.placeholder = customInput.placeholder;
selectedCustomInput.required = customInput.required;
selectedCustomInput.type = customInput.type;
selectedCustomInput.options = customInput.options || undefined;
selectedCustomInput.hasToBeCreated = false;
// Update by id
const inputIndex = customInputs.findIndex((input) => input.id === values.id);
customInputs[inputIndex] = selectedCustomInput;
setCustomInputs(customInputs);
formMethods.setValue("customInputs", customInputs);
} else {
const concatted = customInputs.concat({
...customInput,
options: customInput.options,
});
console.log(concatted);
setCustomInputs(concatted);
formMethods.setValue("customInputs", concatted);
}
setSelectedCustomInputModalOpen(false);
}}
onCancel={() => {
setSelectedCustomInputModalOpen(false);
}}
/>
</DialogContent>
</Dialog>
)}
/>
</div>
);
};
+32 -23
View File
@@ -13,8 +13,10 @@ import type { EventLocationType } from "@calcom/app-store/locations";
import { getEventLocationType, MeetLocationType, LocationType } from "@calcom/app-store/locations";
import { CAL_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { md } from "@calcom/lib/markdownIt";
import { slugify } from "@calcom/lib/slugify";
import { Button, Label, Select, SettingsToggle, Skeleton, TextField } from "@calcom/ui";
import turndown from "@calcom/lib/turndownService";
import { Button, Editor, Label, Select, SettingsToggle, Skeleton, TextField } from "@calcom/ui";
import { FiEdit2, FiCheck, FiX, FiPlus } from "@calcom/ui/components/icon";
import { EditLocationDialog } from "@components/dialog/EditLocationDialog";
@@ -44,11 +46,14 @@ const getDefaultLocationValue = (options: EventTypeSetupProps["locationOptions"]
};
export const EventSetupTab = (
props: Pick<EventTypeSetupProps, "eventType" | "locationOptions" | "team" | "teamMembers">
props: Pick<
EventTypeSetupProps,
"eventType" | "locationOptions" | "team" | "teamMembers" | "destinationCalendar"
>
) => {
const { t } = useLocale();
const formMethods = useFormContext<FormValues>();
const { eventType, locationOptions, team } = props;
const { eventType, locationOptions, team, destinationCalendar } = props;
const [showLocationModal, setShowLocationModal] = useState(false);
const [editingLocationType, setEditingLocationType] = useState<string>("");
const [selectedLocation, setSelectedLocation] = useState<LocationOption | undefined>(undefined);
@@ -152,14 +157,11 @@ export const EventSetupTab = (
return true;
});
const defaultValue = getDefaultLocationValue(locationOptions, "integrations:daily");
return (
<div className="w-full">
{validLocations.length === 0 && (
<div className="flex">
<LocationSelect
defaultValue={defaultValue}
placeholder={t("select")}
options={locationOptions}
isSearchable={false}
@@ -190,24 +192,22 @@ export const EventSetupTab = (
if (!eventLocationType) {
return null;
}
// We dont want to translate the string link - it doesnt exist in common.json and it gets prefixed/suffixed with __ or //
const eventLabel =
eventLocationType.defaultValueVariable === "link"
? eventLocationType.label
: t(location[eventLocationType.defaultValueVariable] || eventLocationType.label);
location[eventLocationType.defaultValueVariable] || t(eventLocationType.label);
return (
<li
key={`${location.type}${index}`}
className="mb-2 rounded-md border border-gray-300 py-1.5 px-2">
<div className="flex max-w-full justify-between">
<div key={index} className="flex flex-grow items-center">
<div className="flex items-center justify-between">
<div className="flex items-center">
<img
src={eventLocationType.iconUrl}
className="h-4 w-4"
alt={`${eventLocationType.label} logo`}
/>
<span className="truncate text-sm ltr:ml-1 rtl:mr-1">{eventLabel}</span>
<span className="line-clamp-1 text-sm ltr:ml-1 rtl:mr-1">{eventLabel}</span>
</div>
<div className="flex">
<button
@@ -232,7 +232,10 @@ export const EventSetupTab = (
</li>
);
})}
{validLocations.some((location) => location.type === MeetLocationType) && (
{validLocations.some(
(location) =>
location.type === MeetLocationType && destinationCalendar?.integration !== "google_calendar"
) && (
<div className="flex text-sm text-gray-600">
<FiCheck className="mt-0.5 mr-1.5 h-2 w-2.5" />
<Trans i18nKey="event_type_requres_google_cal">
@@ -244,14 +247,17 @@ export const EventSetupTab = (
className="underline">
here.
</Link>{" "}
We will fall back to Cal video if you do not change it.
</p>
</Trans>
</div>
)}
{validLocations.length > 0 && validLocations.length !== locationOptions.length && (
{validLocations.length > 0 && (
<li>
<Button StartIcon={FiPlus} color="minimal" onClick={() => setShowLocationModal(true)}>
<Button
data-testid="add-location"
StartIcon={FiPlus}
color="minimal"
onClick={() => setShowLocationModal(true)}>
{t("add_location")}
</Button>
</li>
@@ -271,12 +277,15 @@ export const EventSetupTab = (
defaultValue={eventType.title}
{...formMethods.register("title")}
/>
<TextField
label={t("description")}
placeholder={t("quick_video_meeting")}
defaultValue={eventType.description ?? ""}
{...formMethods.register("description")}
/>
<div>
<Label>{t("description")}</Label>
<Editor
getText={() => md.render(formMethods.getValues("description") || eventType.description || "")}
setText={(value: string) => formMethods.setValue("description", turndown(value))}
excludedToolbarItems={["blockType"]}
placeholder={t("quick_video_meeting")}
/>
</div>
<TextField
required
label={t("URL")}
@@ -197,7 +197,7 @@ function EventTypeSingleLayout({
heading={eventType.title}
CTA={
<div className="flex items-center justify-end">
<div className="hidden items-center rounded-md px-2 sm:flex sm:hover:bg-gray-100">
<div className="hidden items-center rounded-md px-2 sm:hover:bg-gray-100 lg:flex">
<Skeleton
as={Label}
htmlFor="hiddenSwitch"
@@ -206,7 +206,7 @@ function EventTypeSingleLayout({
</Skeleton>
<Switch
id="hiddenSwitch"
defaultChecked={formMethods.getValues("hidden")}
checked={formMethods.watch("hidden")}
onCheckedChange={(e) => {
formMethods.setValue("hidden", e);
}}
@@ -220,6 +220,7 @@ function EventTypeSingleLayout({
<Tooltip content={t("preview")}>
<Button
color="secondary"
data-testid="preview-button"
target="_blank"
variant="icon"
href={permalink}
@@ -261,7 +262,7 @@ function EventTypeSingleLayout({
<DropdownMenuTrigger asChild>
<Button className="lg:hidden" StartIcon={FiMoreHorizontal} variant="icon" color="secondary" />
</DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuContent style={{ minWidth: "200px" }}>
<DropdownMenuItem className="focus:ring-gray-100">
<DropdownItem
target="_blank"
@@ -293,17 +294,17 @@ function EventTypeSingleLayout({
{t("delete")}
</DropdownItem>
</DropdownMenuItem>
<DropdownMenuSeparator className="block sm:hidden" />
<div className="flex items-center rounded-md py-1.5 px-4 sm:hidden sm:hover:bg-gray-100">
<DropdownMenuSeparator />
<div className="flex h-9 flex-row items-center justify-between py-2 px-4 sm:hover:bg-gray-100">
<Skeleton
as={Label}
htmlFor="hiddenSwitch"
className="mt-2 inline cursor-pointer self-center pr-2 sm:hidden">
className="mt-2 inline cursor-pointer self-center pr-2 ">
{t("hide_from_profile")}
</Skeleton>
<Switch
id="hiddenSwitch"
defaultChecked={formMethods.getValues("hidden")}
checked={formMethods.watch("hidden")}
onCheckedChange={(e) => {
formMethods.setValue("hidden", e);
}}
@@ -9,7 +9,7 @@ import type z from "zod";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import type { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { Alert, Input, Label, SettingsToggle } from "@calcom/ui";
import { Input, Label, SettingsToggle } from "@calcom/ui";
type RequiresConfirmationControllerProps = {
metadata: z.infer<typeof EventTypeMetaDataSchema>;
@@ -39,118 +39,116 @@ export default function RequiresConfirmationController({
return (
<div className="block items-start sm:flex">
<div className={!seatsEnabled ? "w-full" : ""}>
{seatsEnabled ? (
<Alert severity="warning" title="Seats option doesn't support confirmation requirement" />
) : (
<Controller
name="requiresConfirmation"
control={formMethods.control}
render={() => (
<SettingsToggle
title={t("requires_confirmation")}
description={t("requires_confirmation_description")}
checked={requiresConfirmation}
onCheckedChange={(val) => {
formMethods.setValue("requiresConfirmation", val);
onRequiresConfirmation(val);
}}>
<RadioGroup.Root
defaultValue={
requiresConfirmation
? requiresConfirmationSetup === undefined
? "always"
: "notice"
: undefined
<div className="w-full">
<Controller
name="requiresConfirmation"
control={formMethods.control}
render={() => (
<SettingsToggle
title={t("requires_confirmation")}
disabled={seatsEnabled}
tooltip={seatsEnabled ? t("seat_options_doesnt_support_confirmation") : undefined}
description={t("requires_confirmation_description")}
checked={requiresConfirmation}
onCheckedChange={(val) => {
formMethods.setValue("requiresConfirmation", val);
onRequiresConfirmation(val);
}}>
<RadioGroup.Root
defaultValue={
requiresConfirmation
? requiresConfirmationSetup === undefined
? "always"
: "notice"
: undefined
}
onValueChange={(val) => {
if (val === "always") {
formMethods.setValue("requiresConfirmation", true);
onRequiresConfirmation(true);
formMethods.setValue("metadata.requiresConfirmationThreshold", undefined);
setRequiresConfirmationSetup(undefined);
} else if (val === "notice") {
formMethods.setValue("requiresConfirmation", true);
onRequiresConfirmation(true);
formMethods.setValue(
"metadata.requiresConfirmationThreshold",
requiresConfirmationSetup || defaultRequiresConfirmationSetup
);
}
onValueChange={(val) => {
if (val === "always") {
formMethods.setValue("requiresConfirmation", true);
onRequiresConfirmation(true);
formMethods.setValue("metadata.requiresConfirmationThreshold", undefined);
setRequiresConfirmationSetup(undefined);
} else if (val === "notice") {
formMethods.setValue("requiresConfirmation", true);
onRequiresConfirmation(true);
formMethods.setValue(
"metadata.requiresConfirmationThreshold",
requiresConfirmationSetup || defaultRequiresConfirmationSetup
);
}
}}>
<div className="-ml-2 flex flex-col flex-wrap justify-start gap-y-2 space-y-2">
<div className="flex items-center">
<RadioGroup.Item
id="always"
value="always"
className="min-w-4 flex h-4 w-4 cursor-pointer items-center rounded-full border border-black bg-white focus:border-2 focus:outline-none ltr:mr-2 rtl:ml-2">
<RadioGroup.Indicator className="relative flex h-4 w-4 items-center justify-center after:block after:h-2 after:w-2 after:rounded-full after:bg-black" />
</RadioGroup.Item>
<Label htmlFor="always" className="!m-0 flex items-center">
{t("always_requires_confirmation")}
</Label>
</div>
<div className="flex items-center">
<RadioGroup.Item
id="notice"
value="notice"
className="min-w-4 flex h-4 w-4 cursor-pointer items-center rounded-full border border-black bg-white focus:border-2 focus:outline-none ltr:mr-2 rtl:ml-2">
<RadioGroup.Indicator className="relative flex h-4 w-4 items-center justify-center after:block after:h-2 after:w-2 after:rounded-full after:bg-black" />
</RadioGroup.Item>
<Label htmlFor="notice" className="!m-0 flex items-center">
<Trans
i18nKey="when_booked_with_less_than_notice"
defaults="When booked with less than <time></time> notice"
components={{
time: (
<div className="mx-2 flex">
<Input
type="number"
min={1}
onChange={(evt) => {
const val = Number(evt.target?.value);
setRequiresConfirmationSetup({
unit:
requiresConfirmationSetup?.unit ??
defaultRequiresConfirmationSetup.unit,
time: val,
});
formMethods.setValue("metadata.requiresConfirmationThreshold.time", val);
}}
className="!m-0 block w-16 rounded-md border-gray-300 text-sm [appearance:textfield]"
defaultValue={metadata?.requiresConfirmationThreshold?.time || 30}
/>
<select
onChange={(evt) => {
const val = evt.target.value as UnitTypeLongPlural;
setRequiresConfirmationSetup({
time:
requiresConfirmationSetup?.time ??
defaultRequiresConfirmationSetup.time,
unit: val,
});
formMethods.setValue("metadata.requiresConfirmationThreshold.unit", val);
}}
className="ml-2 block h-9 rounded-md border-gray-300 py-2 pl-3 pr-10 text-sm focus:outline-none"
defaultValue={
metadata?.requiresConfirmationThreshold?.unit ||
defaultRequiresConfirmationSetup.unit
}>
<option value="minutes">{t("minute_timeUnit")}</option>
<option value="hours">{t("hour_timeUnit")}</option>
</select>
</div>
),
}}
/>
</Label>
</div>
}}>
<div className="-ml-2 flex flex-col flex-wrap justify-start gap-y-2 space-y-2">
<div className="flex items-center">
<RadioGroup.Item
id="always"
value="always"
className="min-w-4 flex h-4 w-4 cursor-pointer items-center rounded-full border border-black bg-white focus:border-2 focus:outline-none ltr:mr-2 rtl:ml-2">
<RadioGroup.Indicator className="relative flex h-4 w-4 items-center justify-center after:block after:h-2 after:w-2 after:rounded-full after:bg-black" />
</RadioGroup.Item>
<Label htmlFor="always" className="!m-0 flex items-center">
{t("always_requires_confirmation")}
</Label>
</div>
</RadioGroup.Root>
</SettingsToggle>
)}
/>
)}
<div className="flex items-center">
<RadioGroup.Item
id="notice"
value="notice"
className="min-w-4 flex h-4 w-4 cursor-pointer items-center rounded-full border border-black bg-white focus:border-2 focus:outline-none ltr:mr-2 rtl:ml-2">
<RadioGroup.Indicator className="relative flex h-4 w-4 items-center justify-center after:block after:h-2 after:w-2 after:rounded-full after:bg-black" />
</RadioGroup.Item>
<Label htmlFor="notice" className="!m-0 flex items-center">
<Trans
i18nKey="when_booked_with_less_than_notice"
defaults="When booked with less than <time></time> notice"
components={{
time: (
<div className="mx-2 flex">
<Input
type="number"
min={1}
onChange={(evt) => {
const val = Number(evt.target?.value);
setRequiresConfirmationSetup({
unit:
requiresConfirmationSetup?.unit ??
defaultRequiresConfirmationSetup.unit,
time: val,
});
formMethods.setValue("metadata.requiresConfirmationThreshold.time", val);
}}
className="!m-0 block w-16 rounded-md border-gray-300 text-sm [appearance:textfield]"
defaultValue={metadata?.requiresConfirmationThreshold?.time || 30}
/>
<select
onChange={(evt) => {
const val = evt.target.value as UnitTypeLongPlural;
setRequiresConfirmationSetup({
time:
requiresConfirmationSetup?.time ??
defaultRequiresConfirmationSetup.time,
unit: val,
});
formMethods.setValue("metadata.requiresConfirmationThreshold.unit", val);
}}
className="ml-2 block h-9 rounded-md border-gray-300 py-2 pl-3 pr-10 text-sm focus:outline-none"
defaultValue={
metadata?.requiresConfirmationThreshold?.unit ||
defaultRequiresConfirmationSetup.unit
}>
<option value="minutes">{t("minute_timeUnit")}</option>
<option value="hours">{t("hour_timeUnit")}</option>
</select>
</div>
),
}}
/>
</Label>
</div>
</div>
</RadioGroup.Root>
</SettingsToggle>
)}
/>
</div>
</div>
);
@@ -1,11 +1,11 @@
import { ArrowRightIcon } from "@heroicons/react/solid";
import MarkdownIt from "markdown-it";
import { useRouter } from "next/router";
import type { FormEvent } from "react";
import { useRef, useState } from "react";
import { useForm } from "react-hook-form";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { md } from "@calcom/lib/markdownIt";
import { telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry";
import turndown from "@calcom/lib/turndownService";
import { trpc } from "@calcom/trpc/react";
@@ -14,8 +14,6 @@ import { Avatar } from "@calcom/ui";
import type { IOnboardingPageProps } from "../../../pages/getting-started/[[...step]]";
const md = new MarkdownIt("default", { html: true, breaks: true });
type FormData = {
bio: string;
};
@@ -1,10 +1,10 @@
import { ShieldCheckIcon } from "@calcom/ui/components/icon";
import { FiShield } from "@calcom/ui/components/icon";
const TwoFactorModalHeader = ({ title, description }: { title: string; description: string }) => {
return (
<div className="mb-4 sm:flex sm:items-start">
<div className="bg-brand text-brandcontrast dark:bg-darkmodebrand dark:text-darkmodebrandcontrast mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-opacity-5 sm:mx-0 sm:h-10 sm:w-10">
<ShieldCheckIcon className="h-6 w-6 text-white" />
<FiShield className="h-6 w-6 text-white" />
</div>
<div className="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
<h3 className="font-cal text-lg font-medium leading-6 text-gray-900" id="modal-title">
+2 -4
View File
@@ -1,13 +1,11 @@
import MarkdownIt from "markdown-it";
import Link from "next/link";
import type { TeamPageProps } from "pages/team/[slug]";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { md } from "@calcom/lib/markdownIt";
import { Avatar } from "@calcom/ui";
const md = new MarkdownIt("default", { html: true, breaks: true, linkify: true });
type TeamType = TeamPageProps["team"];
type MembersType = TeamType["members"];
type MemberType = MembersType[number];
@@ -19,7 +17,7 @@ const Member = ({ member, teamName }: { member: MemberType; teamName: string | n
return (
<Link key={member.id} href={`/${member.username}`}>
<div className="sm:min-w-80 sm:max-w-80 dark:bg-darkgray-200 dark:hover:bg-darkgray-300 group flex min-h-full flex-col space-y-2 rounded-md bg-white p-4 hover:cursor-pointer hover:bg-gray-50 ">
<div className="sm:min-w-80 sm:max-w-80 dark:bg-darkgray-200 dark:hover:bg-darkgray-300 group flex min-h-full flex-col space-y-2 rounded-md bg-white p-4 hover:cursor-pointer hover:bg-gray-50 ">
<Avatar
size="md"
alt={member.name || ""}
@@ -1,3 +1,4 @@
import { StarIcon as StarIconSolid } from "@heroicons/react/solid";
import classNames from "classnames";
import { debounce, noop } from "lodash";
import { useRouter } from "next/router";
@@ -14,7 +15,7 @@ import type { RouterOutputs } from "@calcom/trpc/react";
import { trpc } from "@calcom/trpc/react";
import type { AppRouter } from "@calcom/trpc/server/routers/_app";
import { Button, Dialog, DialogClose, DialogContent, DialogHeader, Input, Label } from "@calcom/ui";
import { FiCheck, FiEdit2, FiExternalLink, StarIconSolid } from "@calcom/ui/components/icon";
import { FiCheck, FiEdit2, FiExternalLink } from "@calcom/ui/components/icon";
export enum UsernameChangeStatusEnum {
UPGRADE = "UPGRADE",
@@ -40,6 +40,7 @@ export default function LocationSelect(props: Props<LocationOption, false, Group
return (
<Select<LocationOption>
name="location"
id="location-select"
components={{
Option: (props) => (
<components.Option {...props}>
+10 -4
View File
@@ -29,7 +29,8 @@ function Select<
IsMulti extends boolean = false,
Group extends GroupBase<Option> = GroupBase<Option>
>({ className, ...props }: SelectProps<Option, IsMulti, Group>) {
const { resolvedTheme, forcedTheme /*isReady*/ } = useTheme();
const [mounted, setMounted] = useState<boolean>(false);
const { resolvedTheme, forcedTheme } = useTheme();
const hasDarkTheme = !forcedTheme && resolvedTheme === "dark";
const darkThemeColors = {
/** Dark Theme starts */
@@ -73,10 +74,15 @@ function Select<
/** Dark Theme ends */
};
useEffect(() => {
setMounted(true);
}, []);
// Till we know in JS the theme is ready, we can't render react-select as it would render with light theme instead
// if (!isReady) {
// return <input type="text" className={className} />;
// }
if (!mounted) {
return <input type="text" className={className} />;
}
return (
<ReactSelect
theme={(theme) => ({
@@ -6,7 +6,7 @@ import type {
User,
VerificationToken,
} from "@prisma/client";
import { PrismaClientKnownRequestError } from "@prisma/client/runtime";
import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library";
import { identityProviderNameMap } from "@lib/auth";
+8 -1
View File
@@ -3,6 +3,7 @@ import type { IncomingMessage, OutgoingMessage } from "http";
import { z } from "zod";
import { IS_PRODUCTION } from "@calcom/lib/constants";
import { WEBAPP_URL } from "@calcom/lib/constants";
function getCspPolicy(nonce: string) {
//TODO: Do we need to explicitly define it in turbo.json
@@ -12,7 +13,12 @@ function getCspPolicy(nonce: string) {
// We can remove 'unsafe-inline' from style-src when we add nonces to all style tags
// Maybe see how @next-safe/middleware does it if it's supported.
const useNonStrictPolicy = CSP_POLICY === "non-strict";
const SENTRY_ENDPOINT = process.env.NEXT_PUBLIC_SENTRY_DSN
? new URL(process.env.NEXT_PUBLIC_SENTRY_DSN, "http://base_url").origin
: "";
// We add WEBAPP_URL to img-src because of booking pages, which end up loading images from app.cal.com on cal.com
// FIXME: Write a layer to extract out EventType Analytics tracking endpoints and add them to img-src or connect-src as needed. e.g. fathom, Google Analytics and others
return `
default-src 'self' ${IS_PRODUCTION ? "" : "data:"};
script-src ${
@@ -29,7 +35,8 @@ function getCspPolicy(nonce: string) {
IS_PRODUCTION ? (useNonStrictPolicy ? "'unsafe-inline'" : "") : "'unsafe-inline'"
} app.cal.com;
font-src 'self';
img-src 'self' https://www.gravatar.com https://img.youtube.com https://eu.ui-avatars.com/api/ data:
img-src 'self' ${WEBAPP_URL} https://www.gravatar.com https://img.youtube.com https://eu.ui-avatars.com/api/ data:;
connect-src 'self' ${SENTRY_ENDPOINT}
`;
}
+79 -2
View File
@@ -1,7 +1,56 @@
import type { Prisma, PrismaClient } from "@prisma/client";
import type { z } from "zod";
async function getBooking(prisma: PrismaClient, uid: string) {
const booking = await prisma.booking.findFirst({
import { getBookingResponsesPartialSchema } from "@calcom/features/bookings/lib/getBookingResponsesSchema";
import slugify from "@calcom/lib/slugify";
import type { eventTypeBookingFields } from "@calcom/prisma/zod-utils";
type BookingSelect = {
description: true;
customInputs: true;
attendees: {
select: {
email: true;
name: true;
};
};
location: true;
smsReminderNumber: true;
};
// Backward Compatibility for booking created before we had managed booking questions
function getResponsesFromOldBooking(
rawBooking: Prisma.BookingGetPayload<{
select: BookingSelect;
}>
) {
const customInputs = rawBooking.customInputs || {};
const responses = Object.keys(customInputs).reduce((acc, label) => {
acc[slugify(label) as keyof typeof acc] = customInputs[label as keyof typeof customInputs];
return acc;
}, {});
return {
// It is possible to have no attendees in a booking when the booking is cancelled.
name: rawBooking.attendees[0]?.name || "Nameless",
email: rawBooking.attendees[0]?.email || "",
guests: rawBooking.attendees.slice(1).map((attendee) => {
return attendee.email;
}),
notes: rawBooking.description || "",
location: {
value: rawBooking.location || "",
optionValue: rawBooking.location || "",
},
...responses,
};
}
async function getBooking(
prisma: PrismaClient,
uid: string,
bookingFields: z.infer<typeof eventTypeBookingFields> & z.BRAND<"HAS_SYSTEM_FIELDS">
) {
const rawBooking = await prisma.booking.findFirst({
where: {
uid,
},
@@ -9,6 +58,7 @@ async function getBooking(prisma: PrismaClient, uid: string) {
startTime: true,
description: true,
customInputs: true,
responses: true,
smsReminderNumber: true,
location: true,
attendees: {
@@ -20,6 +70,14 @@ async function getBooking(prisma: PrismaClient, uid: string) {
},
});
if (!rawBooking) {
return rawBooking;
}
const booking = getBookingWithResponses(rawBooking, {
bookingFields,
});
if (booking) {
// @NOTE: had to do this because Server side cant return [Object objects]
// probably fixable with json.stringify -> json.parse
@@ -31,4 +89,23 @@ async function getBooking(prisma: PrismaClient, uid: string) {
export type GetBookingType = Prisma.PromiseReturnType<typeof getBooking>;
export const getBookingWithResponses = <
T extends Prisma.BookingGetPayload<{
select: BookingSelect & {
responses: true;
};
}>
>(
booking: T,
eventType: {
bookingFields: z.infer<typeof eventTypeBookingFields> & z.BRAND<"HAS_SYSTEM_FIELDS">;
}
) => {
return {
...booking,
responses: getBookingResponsesPartialSchema({
bookingFields: eventType.bookingFields,
}).parse(booking.responses || getResponsesFromOldBooking(booking)),
};
};
export default getBooking;
+2 -2
View File
@@ -1,3 +1,3 @@
export function isBrandingHidden(hideBrandingSetting: boolean, belongsToActiveTeam: boolean) {
return belongsToActiveTeam && hideBrandingSetting;
export function isBrandingHidden(hideBrandingSetting: boolean, hasPaidPlan: boolean) {
return hasPaidPlan && hideBrandingSetting;
}
@@ -1,8 +1,11 @@
import * as fetch from "@lib/core/http/fetch-wrapper";
import type { BookingCreateBody, BookingResponse } from "@lib/types/booking";
import type { BookingCreateBody } from "@calcom/prisma/zod-utils";
const createBooking = async (data: BookingCreateBody) => {
const response = await fetch.post<BookingCreateBody, BookingResponse>("/api/book/event", data);
import * as fetch from "@lib/core/http/fetch-wrapper";
import type { BookingResponse } from "@lib/types/booking";
type BookingCreateBodyForMutation = Omit<BookingCreateBody, "location">;
const createBooking = async (data: BookingCreateBodyForMutation) => {
const response = await fetch.post<BookingCreateBodyForMutation, BookingResponse>("/api/book/event", data);
return response;
};
@@ -1,7 +1,8 @@
import type { BookingCreateBody } from "@calcom/prisma/zod-utils";
import type { AppsStatus } from "@calcom/types/Calendar";
import * as fetch from "@lib/core/http/fetch-wrapper";
import type { BookingCreateBody, BookingResponse } from "@lib/types/booking";
import type { BookingResponse } from "@lib/types/booking";
type ExtendedBookingCreateBody = BookingCreateBody & {
noEmail?: boolean;
-30
View File
@@ -2,36 +2,6 @@ import type { Attendee, Booking } from "@prisma/client";
import type { AppsStatus } from "@calcom/types/Calendar";
export type BookingCreateBody = {
email: string;
end: string;
web3Details?: {
userWallet: string;
userSignature: unknown;
};
eventTypeId: number;
eventTypeSlug: string;
guests?: string[];
location: string;
name: string;
notes?: string;
rescheduleUid?: string;
recurringEventId?: string;
start: string;
timeZone: string;
user?: string | string[];
language: string;
bookingUid?: string;
customInputs: { label: string; value: string | boolean }[];
metadata: {
[key: string]: string;
};
hasHashedBookingLink: boolean;
hashedLink?: string | null;
smsReminderNumber?: string;
ethSignature?: string;
};
export type BookingResponse = Booking & {
paymentUid?: string;
attendees: Attendee[];
+25 -21
View File
@@ -2,20 +2,6 @@ require("dotenv").config({ path: "../../.env" });
const CopyWebpackPlugin = require("copy-webpack-plugin");
const { withSentryConfig } = require("@sentry/nextjs");
const os = require("os");
const withTM = require("next-transpile-modules")([
"@calcom/app-store",
"@calcom/core",
"@calcom/dayjs",
"@calcom/emails",
"@calcom/embed-core",
"@calcom/embed-react",
"@calcom/embed-snippet",
"@calcom/features",
"@calcom/lib",
"@calcom/prisma",
"@calcom/trpc",
"@calcom/ui",
]);
const { withAxiom } = require("next-axiom");
const { i18n } = require("./next-i18next.config");
@@ -80,7 +66,6 @@ if (process.env.ANALYZE === "true") {
plugins.push(withBundleAnalyzer);
}
plugins.push(withTM);
plugins.push(withAxiom);
/** @type {import("next").NextConfig} */
const nextConfig = {
@@ -94,12 +79,31 @@ const nextConfig = {
eslint: {
ignoreDuringBuilds: !!process.env.CI,
},
// TODO: We need to have all components in `@calcom/ui/components` in order to use this
// modularizeImports: {
// "@calcom/ui": {
// transform: "@calcom/ui/components/{{member}}",
// },
// },
transpilePackages: [
"@calcom/app-store",
"@calcom/core",
"@calcom/dayjs",
"@calcom/emails",
"@calcom/embed-core",
"@calcom/embed-react",
"@calcom/embed-snippet",
"@calcom/features",
"@calcom/lib",
"@calcom/prisma",
"@calcom/trpc",
"@calcom/ui",
],
modularizeImports: {
"@calcom/ui/components/icon": {
transform: "@react-icons/all-files/fi/{{member}}",
skipDefaultConversion: true,
preventFullImport: true,
},
// TODO: We need to have all components in `@calcom/ui/components` in order to use this
// "@calcom/ui": {
// transform: "@calcom/ui/components/{{member}}",
// },
},
images: {
unoptimized: true,
},
+7 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@calcom/web",
"version": "2.6.0",
"version": "2.6.8",
"private": true,
"scripts": {
"analyze": "ANALYZE=true next build",
@@ -45,7 +45,6 @@
"@hookform/resolvers": "^2.9.7",
"@next-auth/prisma-adapter": "^1.0.4",
"@next/bundle-analyzer": "^13.1.6",
"@next/font": "^13.1.1",
"@radix-ui/react-avatar": "^1.0.0",
"@radix-ui/react-collapsible": "^1.0.0",
"@radix-ui/react-dialog": "^1.0.0",
@@ -70,12 +69,13 @@
"bcryptjs": "^2.4.3",
"classnames": "^2.3.1",
"dotenv-cli": "^6.0.0",
"eslint-config-next": "^13.1.6",
"eslint-config-next": "^13.2.1",
"googleapis": "^84.0.0",
"gray-matter": "^4.0.3",
"handlebars": "^4.7.7",
"ical.js": "^1.4.0",
"ics": "^2.37.0",
"jose": "^4.13.1",
"kbar": "^0.1.0-beta.36",
"libphonenumber-js": "^1.10.12",
"lodash": "^4.17.21",
@@ -85,14 +85,13 @@
"memory-cache": "^0.2.0",
"micro": "^10.0.1",
"mime-types": "^2.1.35",
"next": "^13.1.1",
"next": "^13.2.1",
"next-auth": "^4.18.8",
"next-axiom": "^0.16.0",
"next-collect": "^0.2.1",
"next-i18next": "^11.3.0",
"next-seo": "^4.26.0",
"next-themes": "^0.2.0",
"next-transpile-modules": "^10.0.0",
"nodemailer": "^6.7.8",
"otplib": "^12.0.1",
"qrcode": "^1.5.1",
@@ -104,7 +103,7 @@
"react-dom": "^18.2.0",
"react-easy-crop": "^3.5.2",
"react-feather": "^2.0.10",
"react-hook-form": "^7.34.2",
"react-hook-form": "^7.43.3",
"react-hot-toast": "^2.3.0",
"react-intl": "^5.25.1",
"react-live-chat-loader": "^2.7.3",
@@ -116,9 +115,11 @@
"react-use-intercom": "1.5.1",
"react-virtualized-auto-sizer": "^1.0.6",
"react-window": "^1.8.7",
"remark": "^14.0.2",
"rrule": "^2.7.1",
"schema-dts": "^1.1.0",
"short-uuid": "^4.2.0",
"strip-markdown": "^5.0.0",
"stripe": "^9.16.0",
"superjson": "1.9.1",
"tailwindcss-radix": "^2.6.0",
+5 -6
View File
@@ -1,5 +1,5 @@
import { BadgeCheckIcon } from "@heroicons/react/solid";
import classNames from "classnames";
import MarkdownIt from "markdown-it";
import type { GetServerSidePropsContext } from "next";
import Link from "next/link";
import { useRouter } from "next/router";
@@ -23,20 +23,19 @@ import defaultEvents, {
} from "@calcom/lib/defaultEvents";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import useTheme from "@calcom/lib/hooks/useTheme";
import { md } from "@calcom/lib/markdownIt";
import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry";
import prisma from "@calcom/prisma";
import { baseEventTypeSelect } from "@calcom/prisma/selects";
import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { HeadSeo, AvatarGroup, Avatar } from "@calcom/ui";
import { BadgeCheckIcon, FiArrowRight } from "@calcom/ui/components/icon";
import { Avatar, AvatarGroup, HeadSeo } from "@calcom/ui";
import { FiArrowRight } from "@calcom/ui/components/icon";
import type { inferSSRProps } from "@lib/types/inferSSRProps";
import type { EmbedProps } from "@lib/withEmbedSsr";
import { ssrInit } from "@server/lib/ssr";
const md = new MarkdownIt("default", { html: true, breaks: true, linkify: true });
export default function User(props: inferSSRProps<typeof getServerSideProps> & EmbedProps) {
const { users, profile, eventTypes, isDynamicGroup, dynamicNames, dynamicUsernames, isSingleUser } = props;
const [user] = users; //To be used when we only have a single user, not dynamic group
@@ -146,7 +145,7 @@ export default function User(props: inferSSRProps<typeof getServerSideProps> & E
{!isBioEmpty && (
<>
<div
className="dark:text-darkgray-600 text-sm text-gray-500 [&_a]:text-blue-500 [&_a]:underline [&_a]:hover:text-blue-600"
className=" dark:text-darkgray-600 text-sm text-gray-500 [&_a]:text-blue-500 [&_a]:underline [&_a]:hover:text-blue-600"
dangerouslySetInnerHTML={{ __html: md.render(user.bio || "") }}
/>
</>
+11 -11
View File
@@ -3,7 +3,9 @@ import { z } from "zod";
import type { LocationObject } from "@calcom/app-store/locations";
import { IS_TEAM_BILLING_ENABLED, WEBAPP_URL } from "@calcom/lib/constants";
import hasKeyInMetadata from "@calcom/lib/hasKeyInMetadata";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { addListFormatting } from "@calcom/lib/markdownIt";
import type { User } from "@calcom/prisma/client";
import { isBrandingHidden } from "@lib/isBrandingHidden";
@@ -69,7 +71,8 @@ async function getUserPageProps(context: GetStaticPropsContext) {
const user = await prisma.user.findUnique({
where: {
username,
/** TODO: We should standarize this */
username: username.toLowerCase().replace(/( |%20)/g, "+"),
},
select: {
id: true,
@@ -82,6 +85,7 @@ async function getUserPageProps(context: GetStaticPropsContext) {
weekStart: true,
brandColor: true,
darkBrandColor: true,
metadata: true,
eventTypes: {
where: {
// Many-to-many relationship causes inclusion of the team events - cool -
@@ -121,13 +125,7 @@ async function getUserPageProps(context: GetStaticPropsContext) {
},
});
const md = new MarkdownIt("zero").enable([
//
"emphasis",
"list",
"newline",
"strikethrough",
]);
const md = new MarkdownIt("default", { html: true, breaks: true, linkify: true });
if (!user || !user.eventTypes.length) return { notFound: true };
@@ -155,9 +153,9 @@ async function getUserPageProps(context: GetStaticPropsContext) {
metadata: EventTypeMetaDataSchema.parse(eventType.metadata || {}),
recurringEvent: parseRecurringEvent(eventType.recurringEvent),
locations: privacyFilteredLocations(locations),
descriptionAsSafeHTML: eventType.description ? md.render(eventType.description) : null,
descriptionAsSafeHTML: eventType.description ? addListFormatting(md.render(eventType.description)) : null,
});
// Check if the user you are logging into has any active teams
// Check if the user you are logging into has any active teams or premium user name
const hasActiveTeam =
user.teams.filter((m) => {
if (!IS_TEAM_BILLING_ENABLED) return true;
@@ -166,6 +164,8 @@ async function getUserPageProps(context: GetStaticPropsContext) {
return false;
}).length > 0;
const hasPremiumUserName = hasKeyInMetadata(user, "isPremium");
return {
props: {
eventType: eventTypeObject,
@@ -182,7 +182,7 @@ async function getUserPageProps(context: GetStaticPropsContext) {
away: user?.away,
isDynamic: false,
trpcState: ssg.dehydrate(),
isBrandingHidden: isBrandingHidden(user.hideBranding, hasActiveTeam),
isBrandingHidden: isBrandingHidden(user.hideBranding, hasActiveTeam || hasPremiumUserName),
},
revalidate: 10, // seconds
};
+4 -2
View File
@@ -3,6 +3,7 @@ import type { GetServerSidePropsContext } from "next";
import type { LocationObject } from "@calcom/app-store/locations";
import { privacyFilteredLocations } from "@calcom/app-store/locations";
import { getAppFromSlug } from "@calcom/app-store/utils";
import { getBookingFieldsWithSystemFields } from "@calcom/features/bookings/lib/getBookingFields";
import { parseRecurringEvent } from "@calcom/lib";
import {
getDefaultEvent,
@@ -118,10 +119,10 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
});
if (!eventTypeRaw) return { notFound: true };
const eventType = {
...eventTypeRaw,
metadata: EventTypeMetaDataSchema.parse(eventTypeRaw.metadata || {}),
bookingFields: getBookingFieldsWithSystemFields(eventTypeRaw),
recurringEvent: parseRecurringEvent(eventTypeRaw.recurringEvent),
};
@@ -183,7 +184,8 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
prisma,
context.query.rescheduleUid
? (context.query.rescheduleUid as string)
: (context.query.bookingUid as string)
: (context.query.bookingUid as string),
eventTypeObject.bookingFields
);
}
@@ -30,7 +30,7 @@ export const getStaticProps: GetStaticProps<
},
});
const startDate = (
dayjs(month, "YYYY-MM").isSame(dayjs(), "month") ? dayjs() : dayjs(month, "YYYY-MM")
dayjs(month, "YYYY-MM").isSame(dayjs(), "month") ? dayjs.utc() : dayjs.utc(month, "YYYY-MM")
).startOf("day");
const endDate = startDate.endOf("month");
try {
+2 -2
View File
@@ -1,6 +1,6 @@
import { Inter } from "@next/font/google";
import localFont from "@next/font/local";
import { DefaultSeo } from "next-seo";
import { Inter } from "next/font/google";
import localFont from "next/font/local";
import Head from "next/head";
import Script from "next/script";
+4 -1
View File
@@ -18,7 +18,10 @@ class MyDocument extends Document<Props> {
// If x-csp not set by gSSP, then it's initialPropsOnly
ctx.res?.setHeader("x-csp", "initialPropsOnly");
}
const isEmbed = ctx.asPath?.includes("/embed") || ctx.asPath?.includes("embedType=");
const asPath = ctx.asPath || "";
// Use a dummy URL as default so that URL parsing works for relative URLs as well. We care about searchParams and pathname only
const parsedUrl = new URL(asPath, "https://dummyurl");
const isEmbed = parsedUrl.pathname.endsWith("/embed") || parsedUrl.searchParams.get("embedType") !== null;
const initialProps = await Document.getInitialProps(ctx);
return { isEmbed, nonce, ...initialProps };
}
+141 -32
View File
@@ -2,6 +2,7 @@ import type { UserPermissionRole } from "@prisma/client";
import { IdentityProvider } from "@prisma/client";
import { readFileSync } from "fs";
import Handlebars from "handlebars";
import { SignJWT } from "jose";
import type { Session } from "next-auth";
import NextAuth from "next-auth";
import { encode } from "next-auth/jwt";
@@ -16,9 +17,10 @@ import path from "path";
import checkLicense from "@calcom/features/ee/common/server/checkLicense";
import ImpersonationProvider from "@calcom/features/ee/impersonation/lib/ImpersonationProvider";
import { hostedCal, isSAMLLoginEnabled } from "@calcom/features/ee/sso/lib/saml";
import jackson from "@calcom/features/ee/sso/lib/jackson";
import { hostedCal, isSAMLLoginEnabled, clientSecretVerifier } from "@calcom/features/ee/sso/lib/saml";
import { ErrorCode, isPasswordValid, verifyPassword } from "@calcom/lib/auth";
import { APP_NAME, IS_TEAM_BILLING_ENABLED, WEBAPP_URL } from "@calcom/lib/constants";
import { APP_NAME, IS_TEAM_BILLING_ENABLED, WEBAPP_URL, WEBSITE_URL } from "@calcom/lib/constants";
import { symmetricDecrypt } from "@calcom/lib/crypto";
import { defaultCookies } from "@calcom/lib/default-cookies";
import { randomString } from "@calcom/lib/random";
@@ -38,6 +40,21 @@ const transporter = nodemailer.createTransport<TransportOptions>({
const usernameSlug = (username: string) => slugify(username) + "-" + randomString(6).toLowerCase();
const signJwt = async (payload: { email: string }) => {
const secret = new TextEncoder().encode(process.env.CALENDSO_ENCRYPTION_KEY);
return new SignJWT(payload)
.setProtectedHeader({ alg: "HS256" })
.setSubject(payload.email)
.setIssuedAt()
.setIssuer(WEBSITE_URL)
.setAudience(`${WEBSITE_URL}/auth/login`)
.setExpirationTime("2m")
.sign(secret);
};
const loginWithTotp = async (user: { email: string }) =>
`/auth/login?totp=${await signJwt({ email: user.email })}`;
const providers: Provider[] = [
CredentialsProvider({
id: "credentials",
@@ -82,17 +99,19 @@ const providers: Provider[] = [
throw new Error(ErrorCode.IncorrectUsernamePassword);
}
if (user.identityProvider !== IdentityProvider.CAL) {
if (user.identityProvider !== IdentityProvider.CAL && !credentials.totpCode) {
throw new Error(ErrorCode.ThirdPartyIdentityProviderEnabled);
}
if (!user.password) {
if (!user.password && user.identityProvider !== IdentityProvider.CAL && !credentials.totpCode) {
throw new Error(ErrorCode.IncorrectUsernamePassword);
}
const isCorrectPassword = await verifyPassword(credentials.password, user.password);
if (!isCorrectPassword) {
throw new Error(ErrorCode.IncorrectUsernamePassword);
if (user.password) {
const isCorrectPassword = await verifyPassword(credentials.password, user.password);
if (!isCorrectPassword) {
throw new Error(ErrorCode.IncorrectUsernamePassword);
}
}
if (user.twoFactorEnabled) {
@@ -130,7 +149,7 @@ const providers: Provider[] = [
await limiter.check(10, user.email); // 10 requests per minute
// Check if the user you are logging into has any active teams
const hasActiveTeams =
user.teams.filter((m) => {
user.teams.filter((m: { team: { metadata: unknown } }) => {
if (!IS_TEAM_BILLING_ENABLED) return true;
const metadata = teamMetadataSchema.safeParse(m.team.metadata);
if (metadata.success && metadata.data?.subscriptionId) return true;
@@ -204,10 +223,65 @@ if (isSAMLLoginEnabled) {
},
options: {
clientId: "dummy",
clientSecret: "dummy",
clientSecret: clientSecretVerifier,
},
allowDangerousEmailAccountLinking: true,
});
// Idp initiated login
providers.push(
CredentialsProvider({
id: "saml-idp",
name: "IdP Login",
credentials: {
code: {},
},
async authorize(credentials) {
if (!credentials) {
return null;
}
const { code } = credentials;
if (!code) {
return null;
}
const { oauthController } = await jackson();
// Fetch access token
const { access_token } = await oauthController.token({
code,
grant_type: "authorization_code",
redirect_uri: `${process.env.NEXTAUTH_URL}`,
client_id: "dummy",
client_secret: clientSecretVerifier,
});
if (!access_token) {
return null;
}
// Fetch user info
const userInfo = await oauthController.userInfo(access_token);
if (!userInfo) {
return null;
}
const { id, firstName, lastName, email } = userInfo;
return {
id: id as unknown as number,
firstName,
lastName,
email,
name: `${firstName} ${lastName}`.trim(),
email_verified: true,
};
},
})
);
}
if (true) {
@@ -308,12 +382,18 @@ export default NextAuth({
...token,
};
};
if (!user) {
return await autoMergeIdentities();
}
if (account && account.type === "credentials") {
if (!account) {
return token;
}
if (account.type === "credentials") {
// return token if credentials,saml-idp
if (account.provider === "saml-idp") {
return token;
}
// any other credentials, add user info
return {
...token,
id: user.id,
@@ -328,11 +408,12 @@ export default NextAuth({
// The arguments above are from the provider so we need to look up the
// user based on those values in order to construct a JWT.
if (account && account.type === "oauth" && account.provider && account.providerAccountId) {
let idP: IdentityProvider = IdentityProvider.GOOGLE;
if (account.provider === "saml") {
idP = IdentityProvider.SAML;
if (account.type === "oauth") {
if (!account.provider || !account.providerAccountId) {
return token;
}
const idP = account.provider === "saml" ? IdentityProvider.SAML : IdentityProvider.GOOGLE;
const existingUser = await prisma.user.findFirst({
where: {
AND: [
@@ -387,14 +468,18 @@ export default NextAuth({
if (account?.provider === "email") {
return true;
}
// In this case we've already verified the credentials in the authorize
// callback so we can sign the user in.
if (account?.type === "credentials") {
return true;
}
// Only if provider is not saml-idp
if (account?.provider !== "saml-idp") {
if (account?.type === "credentials") {
return true;
}
if (account?.type !== "oauth") {
return false;
if (account?.type !== "oauth") {
return false;
}
}
if (!user.email) {
@@ -407,7 +492,7 @@ export default NextAuth({
if (account?.provider) {
let idP: IdentityProvider = IdentityProvider.GOOGLE;
if (account.provider === "saml") {
if (account.provider === "saml" || account.provider === "saml-idp") {
idP = IdentityProvider.SAML;
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -417,19 +502,18 @@ export default NextAuth({
if (!user.email_verified) {
return "/auth/error?error=unverified-email";
}
// Only google oauth on this path
const provider = account.provider.toUpperCase() as IdentityProvider;
// Only google oauth on this path
const existingUser = await prisma.user.findFirst({
include: {
accounts: {
where: {
provider: account.provider,
provider: idP,
},
},
},
where: {
identityProvider: provider,
identityProvider: idP as IdentityProvider,
identityProviderId: account.providerAccountId,
},
});
@@ -449,7 +533,11 @@ export default NextAuth({
console.error("Error while linking account of already existing user");
}
}
return true;
if (existingUser.twoFactorEnabled) {
return loginWithTotp(existingUser);
} else {
return true;
}
}
// If the email address doesn't match, check if an account already exists
@@ -461,7 +549,11 @@ export default NextAuth({
if (!userWithNewEmail) {
await prisma.user.update({ where: { id: existingUser.id }, data: { email: user.email } });
return true;
if (existingUser.twoFactorEnabled) {
return loginWithTotp(existingUser);
} else {
return true;
}
} else {
return "/auth/error?error=new-email-conflict";
}
@@ -477,7 +569,11 @@ export default NextAuth({
if (existingUserWithEmail) {
// if self-hosted then we can allow auto-merge of identity providers if email is verified
if (!hostedCal && existingUserWithEmail.emailVerified) {
return true;
if (existingUserWithEmail.twoFactorEnabled) {
return loginWithTotp(existingUserWithEmail);
} else {
return true;
}
}
// check if user was invited
@@ -499,7 +595,11 @@ export default NextAuth({
},
});
return true;
if (existingUserWithEmail.twoFactorEnabled) {
return loginWithTotp(existingUserWithEmail);
} else {
return true;
}
}
// User signs up with email/password and then tries to login with Google/SAML using the same email
@@ -511,7 +611,11 @@ export default NextAuth({
where: { email: existingUserWithEmail.email },
data: { password: null },
});
return true;
if (existingUserWithEmail.twoFactorEnabled) {
return loginWithTotp(existingUserWithEmail);
} else {
return true;
}
} else if (existingUserWithEmail.identityProvider === IdentityProvider.CAL) {
return "/auth/error?error=use-password-login";
}
@@ -531,10 +635,15 @@ export default NextAuth({
identityProviderId: String(user.id),
},
});
const linkAccountNewUserData = { ...account, userId: newUser.id };
await calcomAdapter.linkAccount(linkAccountNewUserData);
return true;
if (account.twoFactorEnabled) {
return loginWithTotp(newUser);
} else {
return true;
}
}
return false;
+5 -1
View File
@@ -5,8 +5,12 @@ import { defaultHandler, defaultResponder } from "@calcom/lib/server";
async function postHandler(req: NextApiRequest, res: NextApiResponse) {
const { oauthController } = await jackson();
const { redirect_url } = await oauthController.samlResponse(req.body);
if (redirect_url) return res.redirect(302, redirect_url);
if (redirect_url) {
res.redirect(302, redirect_url);
}
}
export default defaultHandler({
+1 -1
View File
@@ -83,7 +83,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
// get user's credentials + their connected integrations
const calendarCredentials = getCalendarCredentials(user.credentials);
// get all the connected integrations' calendars (from third party)
const connectedCalendars = await getConnectedCalendars(calendarCredentials, user.selectedCalendars);
const { connectedCalendars } = await getConnectedCalendars(calendarCredentials, user.selectedCalendars);
const calendars = connectedCalendars.flatMap((c) => c.calendars).filter(notEmpty);
const selectableCalendars = calendars.map((cal) => {
return { selected: selectedCalendarIds.findIndex((s) => s.externalId === cal.externalId) > -1, ...cal };
+3 -1
View File
@@ -8,7 +8,9 @@ async function handler(req: NextApiRequest & { userId?: number }) {
const session = await getSession({ req });
/* To mimic API behavior and comply with types */
req.userId = session?.user?.id || -1;
const booking = await handleNewBooking(req);
const booking = await handleNewBooking(req, {
isNotAnApiCall: true,
});
return booking;
}
@@ -1,46 +0,0 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { z } from "zod";
import { fetcher } from "@calcom/app-store/dailyvideo/lib/VideoApiAdapter";
import { getSession } from "@calcom/lib/auth";
import { defaultHandler, defaultResponder } from "@calcom/lib/server";
const getAccessLinkSchema = z.union([
z.object({
download_link: z.string(),
expires: z.number(),
}),
z.object({}),
]);
const requestQuery = z.object({
recordingId: z.string(),
});
async function handler(
req: NextApiRequest,
res: NextApiResponse<z.infer<typeof getAccessLinkSchema> | void>
) {
const { recordingId } = requestQuery.parse(req.query);
const session = await getSession({ req });
// Check if user belong to active team
if (!session?.user?.belongsToActiveTeam) {
return res.status(403);
}
try {
const response = await fetcher(`/recordings/${recordingId}/access-link`).then(getAccessLinkSchema.parse);
if ("download_link" in response && response.download_link) {
return res.status(200).json(response);
}
return res.status(400);
} catch (err) {
res.status(500);
}
}
export default defaultHandler({
GET: Promise.resolve({ default: defaultResponder(handler) }),
});
+5 -3
View File
@@ -1,6 +1,8 @@
import { ImageResponse } from "@vercel/og";
import type { NextApiRequest } from "next";
import { remark } from "remark";
import type { SatoriOptions } from "satori";
import strip from "strip-markdown";
import { z } from "zod";
import { Meeting, App, Generic } from "@calcom/lib/OgImages";
@@ -18,7 +20,7 @@ const interFontMedium = fetch(new URL("../../../../public/fonts/Inter-Medium.ttf
);
export const config = {
runtime: "experimental-edge",
runtime: "edge",
};
const meetingSchema = z.object({
@@ -106,8 +108,8 @@ export default async function handler(req: NextApiRequest) {
description: searchParams.get("description"),
imageType,
});
const img = new ImageResponse(<Generic title={title} description={description} />, ogConfig) as {
const description_ = await (await remark().use(strip).process(description)).toString();
const img = new ImageResponse(<Generic title={title} description={description_} />, ogConfig) as {
body: Buffer;
};
+1
View File
@@ -65,6 +65,7 @@ export default trpcNext.createNextApiHandler({
"viewer.public.i18n": `no-cache`,
// Revalidation time here should be 1 second, per https://github.com/calcom/cal.com/pull/6823#issuecomment-1423215321
"viewer.public.slots.getSchedule": `no-cache`, // FIXME
"viewer.public.cityTimezones": `max-age=${ONE_DAY_IN_SECONDS}, stale-while-revalidate`,
} as const;
// Find which element above is an exact match for this group of paths
+2 -2
View File
@@ -57,8 +57,8 @@ export default function Apps({ categories, appStore }: inferSSRProps<typeof getS
heading={t("app_store")}
subtitle={t("app_store_description")}
actions={(className) => (
<div className="flex w-full flex-col md:flex-row md:justify-between lg:w-auto">
<div className="lg:hidden">
<div className="flex w-full flex-col pt-4 md:flex-row md:justify-between md:pt-0 lg:w-auto">
<div className="ltr:mr-2 rtl:ml-2 lg:hidden">
<HorizontalTabs tabs={tabs} />
</div>
<div>
+29 -19
View File
@@ -1,5 +1,5 @@
import { useRouter } from "next/router";
import { useReducer, useState } from "react";
import { useCallback, useReducer, useState } from "react";
import z from "zod";
import { AppSettings } from "@calcom/app-store/_components/AppSettings";
@@ -7,8 +7,9 @@ import { InstallAppButton } from "@calcom/app-store/components";
import type { EventLocationType } from "@calcom/app-store/locations";
import { getEventLocationTypeFromApp } from "@calcom/app-store/locations";
import { InstalledAppVariants } from "@calcom/app-store/utils";
import { AppSetDefaultLinkDailog } from "@calcom/features/apps/components/AppSetDefaultLinkDialog";
import { AppSetDefaultLinkDialog } from "@calcom/features/apps/components/AppSetDefaultLinkDialog";
import DisconnectIntegrationModal from "@calcom/features/apps/components/DisconnectIntegrationModal";
import { BulkEditDefaultConferencingModal } from "@calcom/features/eventtypes/components/BulkEditDefaultConferencingModal";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import type { RouterOutputs } from "@calcom/trpc/react";
import { trpc } from "@calcom/trpc/react";
@@ -113,11 +114,16 @@ interface IntegrationsListProps {
const IntegrationsList = ({ data, handleDisconnect, variant }: IntegrationsListProps) => {
const { data: defaultConferencingApp } = trpc.viewer.getUsersDefaultConferencingApp.useQuery();
const utils = trpc.useContext();
const [bulkUpdateModal, setBulkUpdateModal] = useState(false);
const [locationType, setLocationType] = useState<(EventLocationType & { slug: string }) | undefined>(
undefined
);
const onSuccessCallback = useCallback(() => {
setBulkUpdateModal(true);
showToast("Default app updated successfully", "success");
}, []);
const updateDefaultAppMutation = trpc.viewer.updateUserDefaultConferencingApp.useMutation({
onSuccess: () => {
showToast("Default app updated successfully", "success");
@@ -172,6 +178,7 @@ const IntegrationsList = ({ data, handleDisconnect, variant }: IntegrationsListP
updateDefaultAppMutation.mutate({
appSlug,
});
setBulkUpdateModal(true);
}
}}>
{t("change_default_conferencing_app")}
@@ -196,11 +203,16 @@ const IntegrationsList = ({ data, handleDisconnect, variant }: IntegrationsListP
})}
</List>
{locationType && (
<AppSetDefaultLinkDailog
<AppSetDefaultLinkDialog
locationType={locationType}
setLocationType={() => setLocationType(undefined)}
onSuccess={onSuccessCallback}
/>
)}
{bulkUpdateModal && (
<BulkEditDefaultConferencingModal open={bulkUpdateModal} setOpen={setBulkUpdateModal} />
)}
</>
);
};
@@ -247,7 +259,7 @@ const IntegrationsContainer = ({
);
}
return (
<>
<div className="rounded-md border border-gray-200 p-7">
<ShellSubHeading
title={t(variant || "other")}
subtitle={t(`installed_app_${variant || "other"}_description`)}
@@ -264,7 +276,7 @@ const IntegrationsContainer = ({
}
/>
<IntegrationsList handleDisconnect={handleDisconnect} data={data} variant={variant} />
</>
</div>
);
}}
/>
@@ -313,19 +325,17 @@ export default function InstalledApps() {
return (
<>
<InstalledAppsLayout heading={t("installed_apps")} subtitle={t("manage_your_connected_apps")}>
<div className="rounded-md border border-gray-200 p-7">
{categoryList.includes(category) && (
<IntegrationsContainer handleDisconnect={handleDisconnect} variant={category} />
)}
{category === "calendar" && <CalendarListContainer />}
{category === "other" && (
<IntegrationsContainer
handleDisconnect={handleDisconnect}
variant={category}
exclude={[...categoryList, "calendar"]}
/>
)}
</div>
{categoryList.includes(category) && (
<IntegrationsContainer handleDisconnect={handleDisconnect} variant={category} />
)}
{category === "calendar" && <CalendarListContainer />}
{category === "other" && (
<IntegrationsContainer
handleDisconnect={handleDisconnect}
variant={category}
exclude={[...categoryList, "calendar"]}
/>
)}
</InstalledAppsLayout>
<DisconnectIntegrationModal
handleModelClose={handleModelClose}
+53 -5
View File
@@ -1,4 +1,5 @@
import classNames from "classnames";
import { jwtVerify } from "jose";
import type { GetServerSidePropsContext } from "next";
import { getCsrfToken, signIn } from "next-auth/react";
import Link from "next/link";
@@ -42,14 +43,14 @@ export default function Login({
isSAMLLoginEnabled,
samlTenantID,
samlProductID,
totpEmail,
}: inferSSRProps<typeof _getServerSideProps> & WithNonceProps) {
const { t } = useLocale();
const router = useRouter();
const methods = useForm<LoginValues>();
const { register, formState } = methods;
const [twoFactorRequired, setTwoFactorRequired] = useState(false);
const [twoFactorRequired, setTwoFactorRequired] = useState(!!totpEmail || false);
const [errorMessage, setErrorMessage] = useState<string | null>(null);
const errorMessages: { [key: string]: string } = {
@@ -94,6 +95,16 @@ export default function Login({
</Button>
);
const ExternalTotpFooter = (
<Button
onClick={() => {
window.location.replace("/");
}}
color="minimal">
{t("cancel")}
</Button>
);
const onSubmit = async (values: LoginValues) => {
setErrorMessage(null);
telemetry.event(telemetryEventTypes.login, collectPageParameters());
@@ -120,7 +131,9 @@ export default function Login({
heading={twoFactorRequired ? t("2fa_code") : t("welcome_back")}
footerText={
twoFactorRequired
? TwoFactorFooter
? !totpEmail
? TwoFactorFooter
: ExternalTotpFooter
: process.env.NEXT_PUBLIC_DISABLE_SIGNUP !== "true"
? LoginFooter
: null
@@ -135,7 +148,7 @@ export default function Login({
<EmailField
id="email"
label={t("email_address")}
defaultValue={router.query.email as string}
defaultValue={totpEmail || (router.query.email as string)}
placeholder="john.doe@example.com"
required
{...register("email")}
@@ -152,7 +165,7 @@ export default function Login({
<PasswordField
id="password"
autoComplete="off"
required
required={!totpEmail}
className="mb-0"
{...register("password")}
/>
@@ -211,6 +224,40 @@ const _getServerSideProps = async function getServerSideProps(context: GetServer
const session = await getSession({ req });
const ssr = await ssrInit(context);
const verifyJwt = (jwt: string) => {
const secret = new TextEncoder().encode(process.env.CALENDSO_ENCRYPTION_KEY);
return jwtVerify(jwt, secret, {
issuer: WEBSITE_URL,
audience: `${WEBSITE_URL}/auth/login`,
algorithms: ["HS256"],
});
};
let totpEmail = null;
if (context.query.totp) {
try {
const decryptedJwt = await verifyJwt(context.query.totp as string);
if (decryptedJwt.payload) {
totpEmail = decryptedJwt.payload.email as string;
} else {
return {
redirect: {
destination: "/auth/error?error=JWT%20Invalid%20Payload",
permanent: false,
},
};
}
} catch (e) {
return {
redirect: {
destination: "/auth/error?error=Invalid%20JWT%3A%20Please%20try%20again",
permanent: false,
},
};
}
}
if (session) {
return {
redirect: {
@@ -238,6 +285,7 @@ const _getServerSideProps = async function getServerSideProps(context: GetServer
isSAMLLoginEnabled,
samlTenantID,
samlProductID,
totpEmail,
},
};
};
+23
View File
@@ -0,0 +1,23 @@
import { signIn } from "next-auth/react";
import { useRouter } from "next/router";
import { useEffect } from "react";
// To handle the IdP initiated login flow callback
export default function Page() {
const router = useRouter();
useEffect(() => {
if (!router.isReady) {
return;
}
const { code } = router.query;
signIn("saml-idp", {
callbackUrl: "/",
code,
});
}, []);
return null;
}
+38
View File
@@ -0,0 +1,38 @@
import { signIn } from "next-auth/react";
import { useRouter } from "next/router";
import { samlProductID, samlTenantID } from "@calcom/features/ee/sso/lib/saml";
import { HOSTED_CAL_FEATURES } from "@calcom/lib/constants";
import type { inferSSRProps } from "@lib/types/inferSSRProps";
// This page is used to initiate the SAML authentication flow by redirecting to the SAML provider.
// Accessible only on self-hosted Cal.com instances.
export default function Page({ samlTenantID, samlProductID }: inferSSRProps<typeof getServerSideProps>) {
const router = useRouter();
if (HOSTED_CAL_FEATURES) {
router.push("/auth/login");
return;
}
// Initiate SAML authentication flow
signIn(
"saml",
{
callbackUrl: "/",
},
{ tenant: samlTenantID, product: samlProductID }
);
return null;
}
export async function getServerSideProps() {
return {
props: {
samlTenantID,
samlProductID,
},
};
}
+72 -39
View File
@@ -1,4 +1,4 @@
import type { GetServerSidePropsContext } from "next";
import { useRouter } from "next/router";
import { Controller, useFieldArray, useForm } from "react-hook-form";
import { z } from "zod";
@@ -8,7 +8,7 @@ import Shell from "@calcom/features/shell/Shell";
import { availabilityAsString } from "@calcom/lib/availability";
import { yyyymmdd } from "@calcom/lib/date-fns";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { stringOrNumber } from "@calcom/prisma/zod-utils";
import { useTypedQuery } from "@calcom/lib/hooks/useTypedQuery";
import { trpc } from "@calcom/trpc/react";
import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery";
import type { Schedule as ScheduleType, TimeRange, WorkingHours } from "@calcom/types/schedule";
@@ -22,19 +22,20 @@ import {
Switch,
TimezoneSelect,
Tooltip,
Dialog,
DialogTrigger,
ConfirmationDialogContent,
VerticalDivider,
} from "@calcom/ui";
import { FiInfo, FiPlus } from "@calcom/ui/components/icon";
import { FiInfo, FiPlus, FiTrash } from "@calcom/ui/components/icon";
import { HttpError } from "@lib/core/http/error";
import { SelectSkeletonLoader } from "@components/availability/SkeletonLoader";
import EditableHeading from "@components/ui/EditableHeading";
import { ssrInit } from "@server/lib/ssr";
const querySchema = z.object({
schedule: stringOrNumber,
schedule: z.coerce.number().positive().optional(),
});
type AvailabilityFormValues = {
@@ -84,15 +85,29 @@ const DateOverride = ({ workingHours }: { workingHours: WorkingHours[] }) => {
);
};
export default function Availability({ schedule }: { schedule: number }) {
export default function Availability() {
const { t, i18n } = useLocale();
const router = useRouter();
const utils = trpc.useContext();
const me = useMeQuery();
const {
data: { schedule: scheduleId },
} = useTypedQuery(querySchema);
const { timeFormat } = me.data || { timeFormat: null };
const { data, isLoading } = trpc.viewer.availability.schedule.get.useQuery({ scheduleId: schedule });
const { data: defaultValues } = trpc.viewer.availability.defaultValues.useQuery({ scheduleId: schedule });
const form = useForm<AvailabilityFormValues>({ defaultValues });
const { control } = form;
const { data: schedule, isLoading } = trpc.viewer.availability.schedule.get.useQuery(
{ scheduleId },
{
enabled: !!scheduleId,
}
);
const form = useForm<AvailabilityFormValues>({
values: schedule && {
...schedule,
schedule: schedule?.availability || [],
},
});
const updateMutation = trpc.viewer.availability.schedule.update.useMutation({
onSuccess: async ({ prevDefaultId, currentDefaultId, ...data }) => {
if (prevDefaultId && currentDefaultId) {
@@ -120,10 +135,26 @@ export default function Availability({ schedule }: { schedule: number }) {
},
});
const deleteMutation = trpc.viewer.availability.schedule.delete.useMutation({
onError: (err) => {
if (err instanceof HttpError) {
const message = `${err.statusCode}: ${err.message}`;
showToast(message, "error");
}
},
onSettled: () => {
utils.viewer.availability.list.invalidate();
},
onSuccess: () => {
showToast(t("schedule_deleted_successfully"), "success");
router.push("/availability");
},
});
return (
<Shell
backPath="/availability"
title={data?.schedule.name ? data.schedule.name + " | " + t("availability") : t("availability")}
title={schedule?.name ? schedule.name + " | " + t("availability") : t("availability")}
heading={
<Controller
control={form.control}
@@ -134,8 +165,8 @@ export default function Availability({ schedule }: { schedule: number }) {
/>
}
subtitle={
data ? (
data.schedule.availability
schedule ? (
schedule.schedule
.filter((availability) => !!availability.days.length)
.map((availability) => (
<span key={availability.id}>
@@ -158,7 +189,7 @@ export default function Availability({ schedule }: { schedule: number }) {
</Skeleton>
<Switch
id="hiddenSwitch"
disabled={isLoading || data?.isDefault}
disabled={isLoading || schedule?.isDefault}
checked={form.watch("isDefault")}
onCheckedChange={(e) => {
form.setValue("isDefault", e);
@@ -166,6 +197,24 @@ export default function Availability({ schedule }: { schedule: number }) {
/>
</div>
<VerticalDivider />
<Dialog>
<DialogTrigger asChild>
<Button StartIcon={FiTrash} variant="icon" color="destructive" aria-label={t("delete")} />
</DialogTrigger>
<ConfirmationDialogContent
isLoading={deleteMutation.isLoading}
variety="danger"
title={t("delete_schedule")}
confirmBtnText={t("delete")}
loadingText={t("delete")}
onConfirm={() => {
scheduleId && deleteMutation.mutate({ scheduleId });
}}>
{t("delete_schedule_description")}
</ConfirmationDialogContent>
</Dialog>
<VerticalDivider />
<div className="border-l-2 border-gray-300" />
@@ -179,11 +228,12 @@ export default function Availability({ schedule }: { schedule: number }) {
form={form}
id="availability-form"
handleSubmit={async ({ dateOverrides, ...values }) => {
updateMutation.mutate({
scheduleId: schedule,
dateOverrides: dateOverrides.flatMap((override) => override.ranges),
...values,
});
scheduleId &&
updateMutation.mutate({
scheduleId,
dateOverrides: dateOverrides.flatMap((override) => override.ranges),
...values,
});
}}
className="flex flex-col sm:mx-0 xl:flex-row xl:space-x-6">
<div className="flex-1 flex-row xl:mr-0">
@@ -191,7 +241,7 @@ export default function Availability({ schedule }: { schedule: number }) {
<div>
{typeof me.data?.weekStart === "string" && (
<Schedule
control={control}
control={form.control}
name="schedule"
weekStart={
["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"].indexOf(
@@ -203,7 +253,7 @@ export default function Availability({ schedule }: { schedule: number }) {
</div>
</div>
<div className="my-6 rounded-md border">
{data?.workingHours && <DateOverride workingHours={data.workingHours} />}
{schedule?.workingHours && <DateOverride workingHours={schedule.workingHours} />}
</div>
</div>
<div className="min-w-40 col-span-3 space-y-2 lg:col-span-1">
@@ -243,20 +293,3 @@ export default function Availability({ schedule }: { schedule: number }) {
</Shell>
);
}
export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
const params = querySchema.safeParse(ctx.params);
const ssr = await ssrInit(ctx);
if (!params.success) return { notFound: true };
const scheduleId = params.data.schedule;
await ssr.viewer.availability.schedule.get.fetch({ scheduleId });
await ssr.viewer.availability.defaultValues.fetch({ scheduleId });
return {
props: {
schedule: scheduleId,
trpcState: ssr.dehydrate(),
},
};
};
-13
View File
@@ -1,5 +1,4 @@
import { useAutoAnimate } from "@formkit/auto-animate/react";
import type { GetServerSidePropsContext } from "next";
import { NewScheduleButton, ScheduleListItem } from "@calcom/features/schedules";
import Shell from "@calcom/features/shell/Shell";
@@ -14,8 +13,6 @@ import { HttpError } from "@lib/core/http/error";
import SkeletonLoader from "@components/availability/SkeletonLoader";
import { ssrInit } from "@server/lib/ssr";
export function AvailabilityList({ schedules }: RouterOutputs["viewer"]["availability"]["list"]) {
const { t } = useLocale();
const utils = trpc.useContext();
@@ -118,13 +115,3 @@ export default function AvailabilityPage() {
</div>
);
}
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const ssr = await ssrInit(context);
return {
props: {
trpcState: ssr.dehydrate(),
},
};
};
+75 -95
View File
@@ -1,4 +1,4 @@
import { BookingStatus, WorkflowActions } from "@prisma/client";
import { BookingStatus } from "@prisma/client";
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@radix-ui/react-collapsible";
import classNames from "classnames";
import { createEvent } from "ics";
@@ -23,6 +23,10 @@ import {
useIsBackgroundTransparent,
useIsEmbed,
} from "@calcom/embed-core/embed-iframe";
import {
SystemField,
getBookingFieldsWithSystemFields,
} from "@calcom/features/bookings/lib/getBookingFields";
import { parseRecurringEvent } from "@calcom/lib";
import CustomBranding from "@calcom/lib/CustomBranding";
import { APP_NAME } from "@calcom/lib/constants";
@@ -42,10 +46,11 @@ import prisma from "@calcom/prisma";
import type { Prisma } from "@calcom/prisma/client";
import { bookingMetadataSchema } from "@calcom/prisma/zod-utils";
import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { Button, EmailInput, HeadSeo } from "@calcom/ui";
import { Badge, Button, EmailInput, HeadSeo } from "@calcom/ui";
import { FiX, FiExternalLink, FiChevronLeft, FiCheck, FiCalendar } from "@calcom/ui/components/icon";
import { timeZone } from "@lib/clock";
import { getBookingWithResponses } from "@lib/getBooking";
import type { inferSSRProps } from "@lib/types/inferSSRProps";
import CancelBooking from "@components/booking/CancelBooking";
@@ -195,10 +200,7 @@ export default function Success(props: SuccessProps) {
window.scrollTo(0, document.body.scrollHeight);
}
const location: ReturnType<typeof getEventLocationValue> = props.bookingInfo.location
? props.bookingInfo.location
: // If there is no location set then we default to Cal Video
"integrations:daily";
const location = props.bookingInfo.location as ReturnType<typeof getEventLocationValue>;
const locationVideoCallUrl: string | undefined = bookingMetadataSchema.parse(
props?.bookingInfo?.metadata || {}
@@ -335,12 +337,12 @@ export default function Success(props: SuccessProps) {
}
return t("emailed_you_and_attendees" + titleSuffix);
}
const userIsOwner = !!(session?.user?.id && eventType.owner?.id === session.user.id);
useTheme(isSuccessBookingPage ? props.profile.theme : "light");
const title = t(
`booking_${needsConfirmation ? "submitted" : "confirmed"}${props.recurringBookings ? "_recurring" : ""}`
);
const customInputs = bookingInfo?.customInputs;
const locationToDisplay = getSuccessPageLocationMessage(
locationVideoCallUrl ? locationVideoCallUrl : location,
@@ -348,10 +350,6 @@ export default function Success(props: SuccessProps) {
bookingInfo.status
);
const hasSMSAttendeeAction =
eventType.workflows.find((workflowEventType) =>
workflowEventType.workflow.steps.find((step) => step.action === WorkflowActions.SMS_ATTENDEE)
) !== undefined;
const providerName = guessEventLocationType(location)?.label;
return (
@@ -442,17 +440,19 @@ export default function Success(props: SuccessProps) {
<div className="mt-3">
<p className="text-gray-600 dark:text-gray-300">{getTitle()}</p>
</div>
{props.paymentStatus && (
<h4>
{!props.paymentStatus.success &&
!props.paymentStatus.refunded &&
t("booking_with_payment_cancelled")}
{props.paymentStatus.success &&
!props.paymentStatus.refunded &&
t("booking_with_payment_cancelled_already_paid")}
{props.paymentStatus.refunded && t("booking_with_payment_cancelled_refunded")}
</h4>
)}
{props.paymentStatus &&
(bookingInfo.status === BookingStatus.CANCELLED ||
bookingInfo.status === BookingStatus.REJECTED) && (
<h4>
{!props.paymentStatus.success &&
!props.paymentStatus.refunded &&
t("booking_with_payment_cancelled")}
{props.paymentStatus.success &&
!props.paymentStatus.refunded &&
t("booking_with_payment_cancelled_already_paid")}
{props.paymentStatus.refunded && t("booking_with_payment_cancelled_refunded")}
</h4>
)}
<div className="border-bookinglightest text-bookingdark dark:border-darkgray-200 mt-8 grid grid-cols-3 border-t pt-8 text-left dark:text-gray-300">
{(isCancelled || reschedule) && cancellationReason && (
@@ -497,7 +497,12 @@ export default function Success(props: SuccessProps) {
<>
{bookingInfo?.user && (
<div className="mb-3">
<p>{bookingInfo.user.name}</p>
<p>
<span className="mr-2">{bookingInfo.user.name}</span>
<Badge variant="blue" bold>
{t("Host")}
</Badge>
</p>
<p className="text-bookinglight">{bookingInfo.user.email}</p>
</div>
)}
@@ -511,7 +516,7 @@ export default function Success(props: SuccessProps) {
</div>
</>
)}
{locationToDisplay && (
{locationToDisplay && !isCancelled && (
<>
<div className="mt-3 font-medium">{t("where")}</div>
<div className="col-span-2 mt-3">
@@ -539,63 +544,33 @@ export default function Success(props: SuccessProps) {
</div>
</>
)}
{customInputs &&
Object.keys(customInputs).map((key) => {
// This breaks if you have two label that are the same.
// TODO: Fix this in another PR
const customInput = customInputs[key as keyof typeof customInputs];
const eventTypeCustomFound = eventType.customInputs?.find((ci) => ci.label === key);
return (
<>
{eventTypeCustomFound?.type === "RADIO" && (
<>
<div className="border-bookinglightest dark:border-darkgray-300 col-span-3 mt-8 border-t pt-8 pr-3 font-medium">
{eventTypeCustomFound.label}
</div>
<div className="col-span-3 mt-1 mb-2">
{eventTypeCustomFound.options &&
eventTypeCustomFound.options.map((option) => {
const selected = option.label == customInput;
return (
<div
key={option.label}
className={classNames(
"flex space-x-1",
!selected && "text-gray-500"
)}>
<p>{option.label}</p>
<span>{option.label === customInput && "✅"}</span>
</div>
);
})}
</div>
</>
)}
{eventTypeCustomFound?.type !== "RADIO" && customInput !== "" && (
<>
<div className="border-bookinglightest dark:border-darkgray-300 col-span-3 mt-8 border-t pt-8 pr-3 font-medium">
{key}
</div>
<div className="col-span-3 mt-2 mb-2">
{typeof customInput === "boolean" ? (
<p>{customInput ? "true" : "false"}</p>
) : (
<p>{customInput}</p>
)}
</div>
</>
)}
</>
);
})}
{bookingInfo?.smsReminderNumber && hasSMSAttendeeAction && (
<>
<div className="mt-9 font-medium">{t("number_sms_notifications")}</div>
<div className="col-span-2 mb-2 mt-9">
<p>{bookingInfo.smsReminderNumber}</p>
</div>
</>
)}
{Object.entries(bookingInfo.responses).map(([name, response]) => {
const field = eventType.bookingFields.find((field) => field.name === name);
// We show location in the "where" section
// We show Booker Name, Emails and guests in Who section
// We show notes in additional notes section
// We show rescheduleReason at the top
if (!field) return null;
const isSystemField = SystemField.safeParse(field.name);
if (isSystemField.success) return null;
const label = field.label || t(field.defaultLabel || "");
return (
<>
<div className="mt-9 font-medium">{label}</div>
<div className="col-span-2 mb-2 mt-9">
<p
className="break-words"
data-testid="field-response"
data-fob-field={field.name}>
{response.toString()}
</p>
</div>
</>
);
})}
</div>
</div>
{(!needsConfirmation || !userIsOwner) &&
@@ -826,7 +801,6 @@ export function RecurringBookings({
t,
i18n: { language },
} = useLocale();
const recurringBookingsSorted = recurringBookings
? recurringBookings.sort((a: ConfigType, b: ConfigType) => (dayjs(a).isAfter(dayjs(b)) ? 1 : -1))
: null;
@@ -853,7 +827,7 @@ export function RecurringBookings({
{formatToLocalizedTime(dayjs(dateStr), language, undefined, !is24h)} -{" "}
{formatToLocalizedTime(dayjs(dateStr).add(duration, "m"), language, undefined, !is24h)}{" "}
<span className="text-bookinglight">
({formatToLocalizedTimezone(dayjs(dateStr), language)})
({formatToLocalizedTimezone(dayjs(dateStr), language, timeZone())})
</span>
</div>
))}
@@ -873,7 +847,7 @@ export function RecurringBookings({
{formatToLocalizedTime(date, language, undefined, !is24h)} -{" "}
{formatToLocalizedTime(dayjs(date).add(duration, "m"), language, undefined, !is24h)}{" "}
<span className="text-bookinglight">
({formatToLocalizedTimezone(dayjs(dateStr), language)})
({formatToLocalizedTimezone(dayjs(dateStr), language, timeZone())})
</span>
</div>
))}
@@ -890,7 +864,7 @@ export function RecurringBookings({
<br />
{formatToLocalizedTime(date, language, undefined, !is24h)} -{" "}
{formatToLocalizedTime(dayjs(date).add(duration, "m"), language, undefined, !is24h)}{" "}
<span className="text-bookinglight">({formatToLocalizedTimezone(date, language)})</span>
<span className="text-bookinglight">({formatToLocalizedTimezone(date, language, timeZone())})</span>
</div>
);
}
@@ -925,6 +899,8 @@ const getEventTypesFromDB = async (id: number) => {
locations: true,
price: true,
currency: true,
bookingFields: true,
disableGuests: true,
owner: {
select: userSelect,
},
@@ -949,6 +925,7 @@ const getEventTypesFromDB = async (id: number) => {
select: {
workflow: {
select: {
id: true,
steps: true,
},
},
@@ -971,6 +948,7 @@ const getEventTypesFromDB = async (id: number) => {
return {
isDynamic: false,
...eventType,
bookingFields: getBookingFieldsWithSystemFields(eventType),
metadata,
};
};
@@ -1015,7 +993,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (!parsedQuery.success) return { notFound: true };
const { uid, email, eventTypeSlug, cancel } = parsedQuery.data;
const bookingInfo = await prisma.booking.findFirst({
const bookingInfoRaw = await prisma.booking.findFirst({
where: {
uid,
},
@@ -1033,6 +1011,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
status: true,
metadata: true,
cancellationReason: true,
responses: true,
rejectionReason: true,
user: {
select: {
@@ -1057,27 +1036,28 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
},
},
});
if (!bookingInfo) {
if (!bookingInfoRaw) {
return {
notFound: true,
};
}
// @NOTE: had to do this because Server side cant return [Object objects]
// probably fixable with json.stringify -> json.parse
bookingInfo["startTime"] = (bookingInfo?.startTime as Date)?.toISOString() as unknown as Date;
bookingInfo["endTime"] = (bookingInfo?.endTime as Date)?.toISOString() as unknown as Date;
const eventTypeRaw = !bookingInfo.eventTypeId
const eventTypeRaw = !bookingInfoRaw.eventTypeId
? getDefaultEvent(eventTypeSlug || "")
: await getEventTypesFromDB(bookingInfo.eventTypeId);
: await getEventTypesFromDB(bookingInfoRaw.eventTypeId);
if (!eventTypeRaw) {
return {
notFound: true,
};
}
const bookingInfo = getBookingWithResponses(bookingInfoRaw, eventTypeRaw);
// @NOTE: had to do this because Server side cant return [Object objects]
// probably fixable with json.stringify -> json.parse
bookingInfo["startTime"] = (bookingInfo?.startTime as Date)?.toISOString() as unknown as Date;
bookingInfo["endTime"] = (bookingInfo?.endTime as Date)?.toISOString() as unknown as Date;
eventTypeRaw.users = !!eventTypeRaw.hosts?.length
? eventTypeRaw.hosts.map((host) => host.user)
: eventTypeRaw.users;
+2 -1
View File
@@ -3,7 +3,7 @@ import type { GetServerSidePropsContext } from "next";
import { parseRecurringEvent } from "@calcom/lib";
import prisma from "@calcom/prisma";
import { bookEventTypeSelect } from "@calcom/prisma/selects";
import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { customInputSchema, eventTypeBookingFields, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { asStringOrNull, asStringOrThrow } from "@lib/asStringOrNull";
import type { inferSSRProps } from "@lib/types/inferSSRProps";
@@ -71,6 +71,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
...eventTypeRaw,
metadata: EventTypeMetaDataSchema.parse(eventTypeRaw.metadata || {}),
recurringEvent: parseRecurringEvent(eventTypeRaw.recurringEvent),
bookingFields: eventTypeBookingFields.parse(eventTypeRaw.bookingFields || []),
};
const eventTypeObject = [eventType].map((e) => {
+54 -41
View File
@@ -4,10 +4,11 @@ import { zodResolver } from "@hookform/resolvers/zod";
import type { PeriodType } from "@prisma/client";
import { SchedulingType } from "@prisma/client";
import type { GetServerSidePropsContext } from "next";
import { useState } from "react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";
import { validateCustomEventName } from "@calcom/core/event";
import type { EventLocationType } from "@calcom/core/location";
import { validateBookingLimitOrder } from "@calcom/lib";
import { CAL_URL } from "@calcom/lib/constants";
@@ -16,6 +17,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
import { useTypedQuery } from "@calcom/lib/hooks/useTypedQuery";
import { HttpError } from "@calcom/lib/http-error";
import prisma from "@calcom/prisma";
import { eventTypeBookingFields } from "@calcom/prisma/zod-utils";
import type { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import type { RouterOutputs } from "@calcom/trpc/react";
import { trpc } from "@calcom/trpc/react";
@@ -86,6 +88,7 @@ export type FormValues = {
bookingLimits?: BookingLimit;
hosts: { userId: number }[];
hostsFixed: { userId: number }[];
bookingFields: z.infer<typeof eventTypeBookingFields>;
};
export type CustomInputParsed = typeof customInputSchema._output;
@@ -120,7 +123,7 @@ const EventTypePage = (props: EventTypeSetupProps) => {
extendsFeature: "EventType",
});
const { eventType, locationOptions, team, teamMembers, currentUserMembership } = props;
const { eventType, locationOptions, team, teamMembers, currentUserMembership, destinationCalendar } = props;
const [animationParentRef] = useAutoAnimate<HTMLDivElement>();
const updateMutation = trpc.viewer.eventTypes.update.useMutation({
@@ -178,48 +181,65 @@ const EventTypePage = (props: EventTypeSetupProps) => {
delete metadata.config?.useHostSchedulesForTeamEvent;
}
const formMethods = useForm<FormValues>({
defaultValues: {
title: eventType.title,
locations: eventType.locations || [],
recurringEvent: eventType.recurringEvent || null,
description: eventType.description ?? undefined,
schedule: eventType.schedule || undefined,
bookingLimits: eventType.bookingLimits || undefined,
length: eventType.length,
hidden: eventType.hidden,
periodDates: {
startDate: periodDates.startDate,
endDate: periodDates.endDate,
},
periodType: eventType.periodType,
periodCountCalendarDays: eventType.periodCountCalendarDays ? "1" : "0",
schedulingType: eventType.schedulingType,
minimumBookingNotice: eventType.minimumBookingNotice,
metadata,
hosts: !!eventType.hosts?.length
? eventType.hosts.filter((host) => !host.isFixed)
: eventType.users
.filter(() => eventType.schedulingType === SchedulingType.ROUND_ROBIN)
.map((user) => ({ userId: user.id })),
hostsFixed: !!eventType.hosts?.length
? eventType.hosts.filter((host) => host.isFixed)
: eventType.users
.filter(() => eventType.schedulingType === SchedulingType.COLLECTIVE)
.map((user) => ({ userId: user.id })),
const defaultValues = {
title: eventType.title,
locations: eventType.locations || [],
recurringEvent: eventType.recurringEvent || null,
description: eventType.description ?? undefined,
schedule: eventType.schedule || undefined,
bookingLimits: eventType.bookingLimits || undefined,
length: eventType.length,
hidden: eventType.hidden,
periodDates: {
startDate: periodDates.startDate,
endDate: periodDates.endDate,
},
bookingFields: eventType.bookingFields,
periodType: eventType.periodType,
periodCountCalendarDays: eventType.periodCountCalendarDays ? "1" : "0",
schedulingType: eventType.schedulingType,
minimumBookingNotice: eventType.minimumBookingNotice,
metadata,
hosts: !!eventType.hosts?.length
? eventType.hosts.filter((host) => !host.isFixed)
: eventType.users
.filter(() => eventType.schedulingType === SchedulingType.ROUND_ROBIN)
.map((user) => ({ userId: user.id })),
hostsFixed: !!eventType.hosts?.length
? eventType.hosts.filter((host) => host.isFixed)
: eventType.users
.filter(() => eventType.schedulingType === SchedulingType.COLLECTIVE)
.map((user) => ({ userId: user.id })),
} as const;
const formMethods = useForm<FormValues>({
defaultValues,
resolver: zodResolver(
z
.object({
// Length if string, is converted to a number or it can be a number
// Make it optional because it's not submitted from all tabs of the page
eventName: z
.string()
.refine((val) => validateCustomEventName(val, t("invalid_event_name_variables")) === true, {
message: t("invalid_event_name_variables"),
})
.optional(),
length: z.union([z.string().transform((val) => +val), z.number()]).optional(),
bookingFields: eventTypeBookingFields,
})
// TODO: Add schema for other fields later.
.passthrough()
),
});
useEffect(() => {
if (!formMethods.formState.isDirty) {
//TODO: What's the best way to sync the form with backend
formMethods.setValue("bookingFields", defaultValues.bookingFields);
}
}, [defaultValues]);
const appsMetadata = formMethods.getValues("metadata")?.apps;
const numberOfInstalledApps = eventTypeApps?.filter((app) => app.isInstalled).length || 0;
let numberOfActiveApps = 0;
@@ -241,6 +261,7 @@ const EventTypePage = (props: EventTypeSetupProps) => {
locationOptions={locationOptions}
team={team}
teamMembers={teamMembers}
destinationCalendar={destinationCalendar}
/>
),
availability: <AvailabilityTab isTeamEvent={!!team} />,
@@ -342,13 +363,7 @@ const EventTypePage = (props: EventTypeSetupProps) => {
};
const EventTypePageWrapper = (props: inferSSRProps<typeof getServerSideProps>) => {
const { data, isLoading } = trpc.viewer.eventTypes.get.useQuery(
{ id: props.type },
{
initialData: props.initialData,
}
);
const { data, isLoading } = trpc.viewer.eventTypes.get.useQuery({ id: props.type });
if (isLoading || !data) return null;
return <EventTypePage {...data} />;
};
@@ -391,9 +406,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
},
};
} catch (err) {
return {
notFound: true,
};
throw err;
}
};
+34 -25
View File
@@ -1,15 +1,13 @@
import { useAutoAnimate } from "@formkit/auto-animate/react";
import type { GetServerSidePropsContext } from "next";
import Link from "next/link";
import { useRouter } from "next/router";
import type { FC } from "react";
import { useEffect, useState, memo } from "react";
import { z } from "zod";
import {
CreateEventTypeButton,
EventTypeDescriptionLazy as EventTypeDescription,
} from "@calcom/features/eventtypes/components";
import { EventTypeDescriptionLazy as EventTypeDescription } from "@calcom/features/eventtypes/components";
import CreateEventTypeDialog from "@calcom/features/eventtypes/components/CreateEventTypeDialog";
import { DuplicateDialog } from "@calcom/features/eventtypes/components/DuplicateDialog";
import Shell from "@calcom/features/shell/Shell";
import { APP_NAME, CAL_URL, WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
@@ -36,6 +34,7 @@ import {
showToast,
Switch,
Tooltip,
CreateButton,
HorizontalTabs,
} from "@calcom/ui";
import {
@@ -60,8 +59,6 @@ import { HttpError } from "@lib/core/http/error";
import { EmbedButton, EmbedDialog } from "@components/Embed";
import SkeletonLoader from "@components/eventtype/SkeletonLoader";
import { ssrInit } from "@server/lib/ssr";
type EventTypeGroups = RouterOutputs["viewer"]["eventTypes"]["getByViewer"]["eventTypeGroups"];
type EventTypeGroupProfile = EventTypeGroups[number]["profile"];
@@ -73,6 +70,7 @@ interface EventTypeListHeadingProps {
type EventTypeGroup = EventTypeGroups[number];
type EventType = EventTypeGroup["eventTypes"][number];
interface EventTypeListProps {
group: EventTypeGroup;
groupIndex: number;
@@ -121,7 +119,7 @@ const Item = ({ type, group, readOnly }: { type: EventType; group: EventTypeGrou
<Link
href={`/event-types/${type.id}?tabName=setup`}
className="flex-1 overflow-hidden pr-4 text-sm"
title={`${type.title} ${type.description ? `– ${type.description}` : ""}`}>
title={type.title}>
<div>
<span
className="font-semibold text-gray-700 ltr:mr-1 rtl:ml-1"
@@ -134,18 +132,17 @@ const Item = ({ type, group, readOnly }: { type: EventType; group: EventTypeGrou
data-testid={"event-type-slug-" + type.id}>
{`/${group.profile.slug}/${type.slug}`}
</small>
) : (
<></>
)}
) : null}
{readOnly && (
<span className="inline items-center rounded-sm bg-gray-100 px-1.5 py-0.5 text-xs font-medium text-gray-800 ltr:ml-2 ltr:mr-2 rtl:ml-2">
<Badge variant="gray" className="ml-2">
{t("readonly")}
</span>
</Badge>
)}
</div>
<EventTypeDescription
// @ts-expect-error FIXME: We have a type mismatch here @hariombalhara @sean-brydon
eventType={type}
shortenDescription
/>
</Link>
);
@@ -244,7 +241,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
const openDuplicateModal = (eventType: EventType, group: EventTypeGroup) => {
const query = {
...router.query,
dialog: "duplicate-event-type",
dialog: "duplicate",
title: eventType.title,
description: eventType.description,
slug: eventType.slug,
@@ -374,6 +371,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
<ButtonGroup combined>
<Tooltip content={t("preview")}>
<Button
data-testid="preview-link-button"
color="secondary"
target="_blank"
variant="icon"
@@ -630,17 +628,37 @@ const CreateFirstEventTypeView = () => {
};
const CTA = () => {
const { t } = useLocale();
const query = trpc.viewer.eventTypes.getByViewer.useQuery();
if (!query.data) return null;
return <CreateEventTypeButton canAddEvents={true} options={query.data.profiles} />;
const profileOptions = query.data.profiles
.filter((profile) => !profile.readOnly)
.map((profile) => {
return {
teamId: profile.teamId,
label: profile.name || profile.slug,
image: profile.image,
slug: profile.slug,
};
});
return (
<CreateButton
subtitle={t("create_event_on").toUpperCase()}
options={profileOptions}
createDialog={CreateEventTypeDialog}
/>
);
};
const WithQuery = withQuery(trpc.viewer.eventTypes.getByViewer);
const EventTypesPage = () => {
const { t } = useLocale();
const router = useRouter();
const isMobile = useMediaQuery("(max-width: 768px)");
@@ -686,6 +704,7 @@ const EventTypesPage = () => {
)}
<EmbedDialog />
{router.query.dialog === "duplicate" && <DuplicateDialog />}
</>
)}
/>
@@ -694,14 +713,4 @@ const EventTypesPage = () => {
);
};
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const ssr = await ssrInit(context);
return {
props: {
trpcState: ssr.dehydrate(),
},
};
};
export default EventTypesPage;
+1 -5
View File
@@ -5,12 +5,8 @@ export default function MorePage() {
const { t } = useLocale();
return (
<Shell>
<div className="mt-8 max-w-screen-lg">
<div className="max-w-screen-lg">
<MobileNavigationMoreItems />
{/* Save it for next preview version
<div className="mt-6">
<UserV2OptInBanner />
</div> */}
<p className="mt-6 text-xs leading-tight text-gray-500 md:hidden">{t("more_page_footer")}</p>
</div>
</Shell>
@@ -1,13 +1,9 @@
import type { GetServerSidePropsContext } from "next";
import AdminAppsList from "@calcom/features/apps/AdminAppsList";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Meta } from "@calcom/ui";
import { getLayout } from "@components/auth/layouts/AdminLayout";
import { ssrInit } from "@server/lib/ssr";
function AdminAppsView() {
const { t } = useLocale();
return (
@@ -20,14 +16,4 @@ function AdminAppsView() {
AdminAppsView.getLayout = getLayout;
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const ssr = await ssrInit(context);
return {
props: {
trpcState: ssr.dehydrate(),
},
};
};
export default AdminAppsView;
@@ -1,2 +1 @@
export { getServerSideProps } from "./[category]";
export { default } from "./[category]";
@@ -1,4 +1,3 @@
import type { GetServerSidePropsContext } from "next";
import { signIn } from "next-auth/react";
import { useRef } from "react";
@@ -7,8 +6,6 @@ import { Button, Meta, TextField } from "@calcom/ui";
import { getLayout } from "@components/auth/layouts/AdminLayout";
import { ssrInit } from "@server/lib/ssr";
function AdminView() {
const { t } = useLocale();
const usernameRef = useRef<HTMLInputElement>(null);
@@ -41,14 +38,4 @@ function AdminView() {
AdminView.getLayout = getLayout;
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const ssr = await ssrInit(context);
return {
props: {
trpcState: ssr.dehydrate(),
},
};
};
export default AdminView;
-14
View File
@@ -1,11 +1,7 @@
import type { GetServerSidePropsContext } from "next";
import { Meta } from "@calcom/ui";
import { getLayout } from "@components/auth/layouts/AdminLayout";
import { ssrInit } from "@server/lib/ssr";
function AdminAppsView() {
return (
<>
@@ -17,14 +13,4 @@ function AdminAppsView() {
AdminAppsView.getLayout = getLayout;
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const ssr = await ssrInit(context);
return {
props: {
trpcState: ssr.dehydrate(),
},
};
};
export default AdminAppsView;
-13
View File
@@ -1,4 +1,3 @@
import type { GetServerSidePropsContext } from "next";
import { useRouter } from "next/router";
import { useState } from "react";
import { HelpScout, useChat } from "react-live-chat-loader";
@@ -10,8 +9,6 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Button, Meta } from "@calcom/ui";
import { FiExternalLink } from "@calcom/ui/components/icon";
import { ssrInit } from "@server/lib/ssr";
interface CtaRowProps {
title: string;
description: string;
@@ -72,14 +69,4 @@ const BillingView = () => {
BillingView.getLayout = getLayout;
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const ssr = await ssrInit(context);
return {
props: {
trpcState: ssr.dehydrate(),
},
};
};
export default BillingView;
@@ -1,4 +1,3 @@
import type { GetServerSidePropsContext } from "next";
import { useState } from "react";
import type { TApiKeys } from "@calcom/ee/api-keys/components/ApiKeyListItem";
@@ -19,8 +18,6 @@ import {
} from "@calcom/ui";
import { FiLink, FiPlus } from "@calcom/ui/components/icon";
import { ssrInit } from "@server/lib/ssr";
const ApiKeysView = () => {
const { t } = useLocale();
@@ -96,14 +93,4 @@ const ApiKeysView = () => {
ApiKeysView.getLayout = getLayout;
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const ssr = await ssrInit(context);
return {
props: {
trpcState: ssr.dehydrate(),
},
};
};
export default ApiKeysView;
@@ -1,4 +1,3 @@
import type { GetServerSidePropsContext } from "next";
import { Controller, useForm } from "react-hook-form";
import ThemeLabel from "@calcom/features/settings/ThemeLabel";
@@ -20,8 +19,6 @@ import {
UpgradeTeamsBadge,
} from "@calcom/ui";
import { ssrInit } from "@server/lib/ssr";
const SkeletonLoader = ({ title, description }: { title: string; description: string }) => {
return (
<SkeletonContainer>
@@ -215,14 +212,4 @@ const AppearanceView = () => {
AppearanceView.getLayout = getLayout;
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const ssr = await ssrInit(context);
return {
props: {
trpcState: ssr.dehydrate(),
},
};
};
export default AppearanceView;
@@ -1,4 +1,3 @@
import type { GetServerSidePropsContext } from "next";
import { Trans } from "next-i18next";
import Link from "next/link";
import { useRouter } from "next/router";
@@ -30,8 +29,6 @@ import { QueryCell } from "@lib/QueryCell";
import { CalendarSwitch } from "@components/settings/CalendarSwitch";
import { ssrInit } from "@server/lib/ssr";
const SkeletonLoader = () => {
return (
<SkeletonContainer>
@@ -228,14 +225,4 @@ const CalendarsView = () => {
CalendarsView.getLayout = getLayout;
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const ssr = await ssrInit(context);
return {
props: {
trpcState: ssr.dehydrate(),
},
};
};
export default CalendarsView;
@@ -1,8 +1,9 @@
import { useState } from "react";
import { useCallback, useState } from "react";
import type { EventLocationType } from "@calcom/app-store/locations";
import { getEventLocationTypeFromApp } from "@calcom/app-store/locations";
import { AppSetDefaultLinkDailog } from "@calcom/features/apps/components/AppSetDefaultLinkDialog";
import { AppSetDefaultLinkDialog } from "@calcom/features/apps/components/AppSetDefaultLinkDialog";
import { BulkEditDefaultConferencingModal } from "@calcom/features/eventtypes/components/BulkEditDefaultConferencingModal";
import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
@@ -62,17 +63,20 @@ const ConferencingLayout = () => {
},
});
const onSuccessCallback = useCallback(() => {
setBulkUpdateModal(true);
showToast("Default app updated successfully", "success");
}, []);
const updateDefaultAppMutation = trpc.viewer.updateUserDefaultConferencingApp.useMutation({
onSuccess: () => {
showToast("Default app updated successfully", "success");
utils.viewer.getUsersDefaultConferencingApp.invalidate();
},
onSuccess: onSuccessCallback,
onError: (error) => {
showToast(`Error: ${error.message}`, "error");
},
});
const [deleteAppModal, setDeleteAppModal] = useState(false);
const [bulkUpdateModal, setBulkUpdateModal] = useState(false);
const [locationType, setLocationType] = useState<(EventLocationType & { slug: string }) | undefined>(
undefined
);
@@ -167,7 +171,14 @@ const ConferencingLayout = () => {
</Dialog>
{locationType && (
<AppSetDefaultLinkDailog locationType={locationType} setLocationType={setLocationType} />
<AppSetDefaultLinkDialog
locationType={locationType}
setLocationType={setLocationType}
onSuccess={onSuccessCallback}
/>
)}
{bulkUpdateModal && (
<BulkEditDefaultConferencingModal open={bulkUpdateModal} setOpen={setBulkUpdateModal} />
)}
</div>
);

Some files were not shown because too many files have changed in this diff Show More