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

feat: (Overlay) Persist toggle option #11961

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

sean-brydon
Copy link
Member

@sean-brydon sean-brydon commented Oct 18, 2023

Adds persistant state to the toggle switch so you dont have to toggle this on every single time you visit a new booking page

Loom: https://www.loom.com/share/aa582bb2c1a2446a99e7cb66c27258fb

@vercel
Copy link

vercel bot commented Oct 18, 2023

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

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2023 9:33am
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2023 9:33am
cal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2023 9:33am
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2023 9:33am
qa 🔄 Building (Inspect) Visit Preview 💬 Add feedback Oct 18, 2023 9:33am
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2023 9:33am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview 💬 Add feedback Oct 18, 2023 9:33am

@sean-brydon
Copy link
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 18, 2023

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link to collect XP and win prizes!

@zomars zomars added the core area: core, team members only label Oct 18, 2023
Comment on lines +173 to +177
<OverlayCalendarSwitch
setCalendarSettingsOverlay={setCalendarSettingsOverlay}
setContinueWithProvider={setContinueWithProvider}
enabled={switchEnabled}
/>
Copy link
Member Author

Choose a reason for hiding this comment

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

Extracted into a seperate component to not clog up the container

Comment on lines -79 to -106
// Toggle query param for overlay calendar
const toggleOverlayCalendarQueryParam = useCallback(
(state: boolean) => {
const current = new URLSearchParams(Array.from(searchParams.entries()));
if (state) {
current.set("overlayCalendar", "true");
} else {
current.delete("overlayCalendar");
}
// cast to string
const value = current.toString();
const query = value ? `?${value}` : "";
router.push(`${pathname}${query}`);
},
[searchParams, pathname, router]
);

/**
* If a user is not logged in and the overlay calendar query param is true,
* show the continue modal so they can login / create an account
*/
useEffect(() => {
if (!session && overlayCalendarQueryParam === "true") {
toggleOverlayCalendarQueryParam(false);
setContinueWithProvider(true);
}
}, [session, overlayCalendarQueryParam, toggleOverlayCalendarQueryParam]);

Copy link
Member Author

Choose a reason for hiding this comment

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

Logic has been move to switch component above

@deploysentinel
Copy link

deploysentinel bot commented Oct 18, 2023

Current Playwright Test Results Summary

✅ 162 Passing - ⚠️ 4 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 10/18/2023 09:34:00am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: af7bb15

Started: 10/18/2023 09:31:09am UTC

⚠️ Flakes

📄   apps/web/playwright/login.2fa.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
2FA Tests should allow a user to enable 2FA and login using 2FA
Retry 1Initial Attempt
1.75% (5) 5 / 285 runs
failed over last 7 days
29.12% (83) 83 / 285 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should open embed iframe on click - Configured with light theme
Retry 1Initial Attempt
3.34% (10) 10 / 299 runs
failed over last 7 days
35.45% (106) 106 / 299 runs
flaked over last 7 days
Popup Tests should be able to reschedule
Retry 1Initial Attempt
9.06% (27) 27 / 298 runs
failed over last 7 days
89.60% (267) 267 / 298 runs
flaked over last 7 days

📄   apps/web/playwright/integrations-stripe.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Stripe integration Paid booking should be able to be rescheduled
Retry 1Initial Attempt
3.02% (9) 9 / 298 runs
failed over last 7 days
6.38% (19) 19 / 298 runs
flaked over last 7 days

View Detailed Build Results


@github-actions
Copy link
Contributor

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

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

LGTM.

Just one thing I don't get any warning or error when my calendar credentials are broken. I only see it after opening calendar settings

Screenshot 2023-10-18 at 3 42 39 PM Screenshot 2023-10-18 at 3 42 52 PM

@sean-brydon
Copy link
Member Author

LGTM.

Just one thing I don't get any warning or error when my calendar credentials are broken. I only see it after opening calendar settings

Screenshot 2023-10-18 at 3 42 39 PM Screenshot 2023-10-18 at 3 42 52 PM

Created an issue for this - nice spot

@sean-brydon sean-brydon merged commit 0b46f61 into main Oct 18, 2023
@sean-brydon sean-brydon deleted the 10-18-feat_Overlay_Persist_toggle_option branch October 18, 2023 10:16
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.

3 participants