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

[CAL-1008] Fix 'All Bookings' filter not getting selected after coming from 'Your Bookings' #8902

Merged
merged 8 commits into from May 19, 2023

Conversation

asadath1395
Copy link
Contributor

What does this PR do?

[CAL-1008] Fix 'All Bookings' filter not getting selected after coming from 'Your Bookings'

Fixes #6937

Screen.Recording.2023-05-15.at.4.37.26.PM.mov

Environment: Staging(main branch) / Production

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  • Navigate to /bookings/upcoming
  • Check the All Bookings filter

@asadath1395 asadath1395 requested a review from zomars as a code owner May 15, 2023 11:09
@asadath1395 asadath1395 requested a review from a team May 15, 2023 11:09
@vercel
Copy link

vercel bot commented May 15, 2023

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

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2023 10:33pm

@vercel
Copy link

vercel bot commented May 15, 2023

@asadath1395 is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Contributor

github-actions bot commented May 15, 2023

📦 Next.js Bundle Analysis for @calcom/web

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

Four Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/[user]/book 254.34 KB 405.25 KB 115.79% (🟡 +0.14%)
/auth/setup 174.07 KB 324.97 KB 92.85% (🟢 -0.15%)
/d/[link]/book 253.99 KB 404.9 KB 115.68% (🟡 +0.15%)
/team/[slug]/book 253.99 KB 404.9 KB 115.69% (🟡 +0.14%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Copy link
Contributor

@joeauyeung joeauyeung left a comment

Choose a reason for hiding this comment

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

Works as intended but please see comment

@@ -86,5 +86,19 @@ export function useTypedQuery<T extends z.AnyZodObject>(schema: T) {
}
}

return { data: parsedQuery, setQuery, removeByKey, pushItemToKey, removeItemByKeyAndValue };
// Remove all query params from the URL
function removeAllQueryParams(keys: OutputOptionalKeys[]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed there is a non-optional function param but when you call this function, you don't pass any params.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joeauyeung Initially i had planned to create a function to remove multiple keys from the query param, then later on decided on the current approach and my bad i forgot to remove the unnecessary param

@@ -38,7 +38,7 @@ export const TeamsMemberFilter = () => {
checked={!query.teamIds && !query.userIds?.includes(session.data?.user.id || 0)}
onChange={() => {
setDropdownTitle(t("all_bookings_filter_label"));
removeByKey("teamIds"); // Always clear on toggle or not toggle (seems weird but when you know the behviour it works well )
Copy link
Contributor

Choose a reason for hiding this comment

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

@sean-brydon I saw that you made this comment. Are you ok with this approach?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah works for me :)

Copy link
Contributor

@joeauyeung joeauyeung left a comment

Choose a reason for hiding this comment

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

LGTM and working. Waiting for @sean-brydon's feedback

Copy link
Member

@sean-brydon sean-brydon left a comment

Choose a reason for hiding this comment

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

Noice 👍

@alannnc alannnc added the ♻️ autoupdate tells kodiak to keep this branch up-to-date label May 19, 2023
@alannnc alannnc enabled auto-merge May 19, 2023 22:29
@alannnc alannnc added this pull request to the merge queue May 19, 2023
Merged via the queue into calcom:main with commit 1b8ecbe May 19, 2023
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♻️ autoupdate tells kodiak to keep this branch up-to-date
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-1008] Booking filters weird edge case
4 participants