Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/booking page refactor #3035

Merged
merged 53 commits into from
Jun 15, 2022
Merged

Feature/booking page refactor #3035

merged 53 commits into from
Jun 15, 2022

Conversation

emrysal
Copy link
Contributor

@emrysal emrysal commented Jun 9, 2022

Goal of this PR: Get rid of getServerSideProps altogether, use getStaticProps & tRPC to make slot lookahead possible.

Current state: Able to take into account workingHours, the DatePicker is entirely revamped (but looks the same). Much will happen serverside going forward.

@vercel
Copy link

vercel bot commented Jun 9, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Jun 15, 2022 at 8:46PM (UTC)
3 Ignored Deployments
Name Status Preview Updated
docs ⬜️ Ignored (Inspect) Jun 15, 2022 at 8:46PM (UTC)
swagger ⬜️ Ignored (Inspect) Jun 15, 2022 at 8:46PM (UTC)
ui ⬜️ Ignored (Inspect) Jun 15, 2022 at 8:46PM (UTC)

@zomars zomars mentioned this pull request Jun 15, 2022
@zomars
Copy link
Member

zomars commented Jun 15, 2022

Instead of making code suggestions made another PR #3067

@emrysal emrysal force-pushed the feature/booking-page-refactor branch from d68b18e to e6f0ee8 Compare June 15, 2022 19:08
* Cleanup

* Cleanup

* Uses zod to parse params

* Type fixes

* Fixes ISR

* E2E fixes

* Disabled dynamic bookings until post v1.7

* More test fixes
Comment on lines +115 to +117
const eventType = user.eventTypes.find((et, i) =>
user.plan === UserPlan.FREE ? i === 0 && et.slug === slug : et.slug === slug
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes E2E tests that allowed free users to use more than 1 event type

Comment on lines +28 to +31
.refine(
(data) => !!data.eventTypeId || !!data.usernameList,
"Either usernameList or eventTypeId should be filled in."
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we have one or another

Comment on lines +112 to +113
if (!currentSeats && eventType?.seatsPerTimeSlot)
currentSeats = await getCurrentSeats(eventType.id, dateFrom, dateTo);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we don't overfetch if we already have this data

Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking Gucci

zomars and others added 2 commits June 15, 2022 14:03
@zomars zomars merged commit e9f3248 into main Jun 15, 2022
@zomars zomars deleted the feature/booking-page-refactor branch June 15, 2022 20:54
@zomars zomars mentioned this pull request Jun 15, 2022
zomars added a commit that referenced this pull request Jun 15, 2022
* updates api submodule

* Fix credential creation flow for msteams app (#3029)

* Fix credential creation flow for msteams app

* Code review improve

* Fix preffer early returns

Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* Flicker on booking success page (#3063)

* The booker get’s the Ui option to reschedule but can’t reschedule (#3061)

* Update CalendarService.ts (#3060)

* Revert "The booker get’s the Ui option to reschedule but can’t reschedule (#3061)"

This reverts commit 8cfc91d.

* New Crowdin translations by Github Action (#3065)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>

* Missing calendar toggles fix (#3066)

* onboarding flag fix

* Adjusting text + adding into locales file

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

* fixed flickering of more event name variables (#3069)

* Feature/booking page refactor (#3035)

* Extracted UI related logic on the DatePicker, stripped out all logic

* wip

* fixed small regression due to merge

* Fix alignment of the chevrons

* Added isToday dot, added onMonthChange so we can fetch this month slots

* Added includedDates to inverse excludedDates

* removed trpcState

* Improvements to the state

* All params are now dynamic

* This builds the flat map so not all paths block on every new build

* Added requiresConfirmation

* Correctly take into account getFilteredTimes to make the calendar function

* Rewritten team availability, seems to work

* Circumvent i18n flicker by showing the loader instead

* 'You can remove this code. Its not being used now' - Hariom

* Nailed a persistent little bug, new Date() caused the current day to flicker on and off

* TS fixes

* Fix some eventType details in AvailableTimes

* '5 / 6 Seats Available' instead of '6 / Seats Available'

* More type fixes

* Removed unrelated merge artifact

* Use WEBAPP_URL instead of hardcoded

* Next round of TS fixes

* I believe this was mistyped

* Temporarily disabled rescheduling 'this is when you originally scheduled', so removed dep

* Sorting some dead code

* This page has a lot of red, not all related to this PR

* A PR to your PR (#3067)

* Cleanup

* Cleanup

* Uses zod to parse params

* Type fixes

* Fixes ISR

* E2E fixes

* Disabled dynamic bookings until post v1.7

* More test fixes

* Fixed border position (transparent border) to prevent dot from jumping - and possibly fix spacing

* Disabled style nitpicks

* Delete useSlots.ts

Removed early design artifact

* Unlock DatePicker locale

* Adds mini spinner to DatePicker

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>

* v1.7.0

Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: GitStart <1501599+gitstart@users.noreply.github.com>
Co-authored-by: m4tze <m4tze@gmx.net>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Leo Giovanetti <hello@leog.me>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
},
})
: [];
const workingHours = userSchedules.flatMap((s) => s.workingHours);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, but caused an issue I'm working around in the simplest method I could think of: #3082

@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants