Conversation
CAL-1801 Org bookings
Implement the different filters in the bookings page for an organization based on designs |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
|
Thank you for following the naming conventions! 🙏 |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 Nine 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. |
Current Playwright Test Results Summary✅ 127 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 07/04/2023 02:43:23pm UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: 497d14e Started: 07/04/2023 02:39:25pm UTC
|
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Manage Booking Questions For Team EventType -- old-booker Do a booking with a user added question and verify a few thing in b/w
Retry 1 • Initial Attempt |
0% (0)0 / 233 runsfailed over last 7 days |
2.15% (5)5 / 233 runsflaked over last 7 days |
📄 packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 2 Flakes
Top 1 Common Error Messages
|
|
2 Test Cases Affected |
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Popup Tests -- new-booker should be able to reschedule
Retry 1 • Initial Attempt |
12.86% (18)18 / 140 runsfailed over last 7 days |
59.29% (83)83 / 140 runsflaked over last 7 days |
|
Popup Tests -- old-booker should be able to reschedule
Retry 1 • Initial Attempt |
2.88% (4)4 / 139 runsfailed over last 7 days |
44.60% (62)62 / 139 runsflaked over last 7 days |
📄 apps/web/playwright/booking-seats.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Reschedule for booking with seats -- old-booker Should reschedule booking with seats
Retry 1 • Initial Attempt |
0% (0)0 / 234 runsfailed over last 7 days |
0.43% (1)1 / 234 runflaked over last 7 days |
| // label: "date_range", | ||
| // StartIcon: Calendar, | ||
| // }, |
There was a problem hiding this comment.
Filter by date range will be added later
There was a problem hiding this comment.
You can reuse the component I used on insights 👍
CAL-2022 Booking filters: Pending (and possibly all) members are showing up as blank people
In bookings tab I can see 3 blank users. The org has 1 confirmed member and 2 pending. |
| export const FilterSearchField = forwardRef<HTMLInputElement, InputFieldProps>(function TextField( | ||
| props, | ||
| ref | ||
| ) { | ||
| return ( | ||
| <div | ||
| dir="ltr" | ||
| className="focus-within:ring-brand-default group relative mx-3 mb-1 mt-2.5 flex items-center rounded-md focus-within:outline-none focus-within:ring-2"> | ||
| <div className="addon-wrapper border-default [input:hover_+_&]:border-emphasis [input:hover_+_&]:border-l-default [&:has(+_input:hover)]:border-emphasis [&:has(+_input:hover)]:border-r-default flex h-7 items-center justify-center rounded-l-md border border-r-0"> | ||
| <Search className="ms-3 h-4 w-4" /> | ||
| </div> | ||
| <Input | ||
| ref={ref} | ||
| className="disabled:bg-subtle disabled:hover:border-subtle !my-0 h-7 rounded-l-none border-l-0 !ring-0 disabled:cursor-not-allowed" | ||
| {...props} | ||
| /> | ||
| </div> | ||
| ); | ||
| }); |
There was a problem hiding this comment.
Should this be here or in filters? Im not too sure myself so just wanted to know what others think
There was a problem hiding this comment.
This field can be used in other pages such as insights
There was a problem hiding this comment.
This should be a feature component IMHO. It belongs to features/filters/components.
|
@ericrommel I had to remove location filter for now because eventType.locations has Json type(@zod.custom(imports.eventTypeLocations)) in the schema and PostgreSQL does not support filtering on object key value inside array https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-object-key-value-inside-array. so we can't use this query inside booking get handler while i can filter location in the Booking table because it is of type string but we won't be able to filter for location that you mentioned (Conferencing/Organizer, Phone/Attendee and Phone/Organizer) @CarinaWolli fixed the mobile view Screen.Recording.2023-07-01.at.2.49.22.PM.mov |
| // }, | ||
| ], | ||
| isFilterActive: (label: addFilterOption["label"]) => { | ||
| return !get().addFilterOptions.some((option) => option.label === label); |
There was a problem hiding this comment.
nit: I am not a fan of using translation key as identifier. We should have a separate id field maybe to identify an item uniquely. That way changing translation strings doesn't impact the logic
| state.addFilterOptions, | ||
| state.toggleOption, | ||
| state.isFilterActive, | ||
| shallow, |
There was a problem hiding this comment.
I don't think we are passing it correctly. It should have been an argument to useBookingMultiFilterStore
| isFilterActive: (label: addFilterOption["label"]) => boolean; | ||
| }; | ||
|
|
||
| export const useBookingMultiFilterStore = create<BookingMultiFilterStore>((set, get) => ({ |
There was a problem hiding this comment.
nit: I am not sure if we need to use a zustand store for it. It could have been a local state to FiltersContainer. I am just learning zustand @sean-brydon what do you think?
There was a problem hiding this comment.
Something simpler will be good I guess as @hariombalhara says.
| type FilterTypes = "teams" | "people" | "eventType"; | ||
| const PeopleFilter = () => { | ||
| const { t } = useLocale(); | ||
| const { data: query, pushItemToKey, removeItemByKeyAndValue, removeByKey } = useFilterQuery(); |
There was a problem hiding this comment.
| const { data: query, pushItemToKey, removeItemByKeyAndValue, removeByKey } = useFilterQuery(); | |
| const { data: query, pushItemToKey, removeItemByKeyAndValue } = useFilterQuery(); |
Unused.
| const members = trpc.viewer.teams.listMembers.useQuery({}); | ||
|
|
||
| const filteredMembers = members?.data | ||
| ?.filter((member) => member.accepted) |
There was a problem hiding this comment.
nit: It's already fetching accepted team members only. So it might not be necessary
| Trigger?: React.ReactNode; | ||
| defaultOpen?: boolean; |
There was a problem hiding this comment.
I don't see these two props being used by any of the AnimatedPopover instances.
| "no_status_bookings_yet_description": "You have no {{status}} bookings. {{description}}", | ||
| "event_between_users": "{{eventName}} between {{host}} and {{attendeeName}}", | ||
| "bookings": "Bookings", | ||
| "booking_not_found": "Booking not found", |
hariombalhara
left a comment
There was a problem hiding this comment.
LGTM!! Great work @Udit-takkar. No blocker. Just a few nits.
|
This PR currently has a merge conflict. Please resolve this and then re-add the |
alannnc
left a comment
There was a problem hiding this comment.
Handling nits and merge conflicts should be enough before merge with main.
497d14e
* feat: booking filters Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> * fix: responsive issues Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> * fix: only show accepted members in filter Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> * chore: translations Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> * fix: remove organizer default Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> * chore Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> * fix: remove locationValues Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> * fix: remove unused and mobile 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: Leo Giovanetti <hello@leog.me>

What does this PR do?
Fixes https://linear.app/calcom/issue/CAL-1801/org-bookings
Fixes https://linear.app/calcom/issue/CAL-2022/booking-filters-pending-and-possibly-all-members-are-showing-up-as
Screen.Recording.2023-06-21.at.11.47.39.PM.mov
Type of change
How should this be tested?