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
Conversation
…g from 'Your Bookings'
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@asadath1395 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 Four Pages Changed SizeThe following pages changed size from the code in this PR compared to its base branch:
DetailsOnly 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 Any third party scripts you have added directly to your app using the 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. |
There was a problem hiding this 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
packages/lib/hooks/useTypedQuery.ts
Outdated
@@ -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[]) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah works for me :)
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noice 👍
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
How should this be tested?
/bookings/upcoming
All Bookings
filter