feat: Add UTM parameter as an additional filter option #28717
Open
zakacat wants to merge 3 commits intocalcom:mainfrom
Open
feat: Add UTM parameter as an additional filter option #28717zakacat wants to merge 3 commits intocalcom:mainfrom
zakacat wants to merge 3 commits intocalcom:mainfrom
Conversation
Contributor
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Firstly, we understand that this issue was marked as "needs approval", but we decided to go ahead with the feature as we needed the material for our course. We understand that this PR may not ultimately be approved by a reviewer.
We began by extending the input filter schema to declare the five new UTM fields (utmSource, utmMedium, utmCampaign, utmTerm, utmContent), then modified the query handler to apply the corresponding WHERE clauses when those filters are active. From there we updated the booking filters hook to read the new filter values from the DataTable, registered the new columns in useBookingListColumns.tsx, and added the filterable column definitions to filterColumns.ts. The BookingListContainer.tsx was updated to map the new filter values through to the tRPC query input, and the English translation strings were added to common.json for the filter labels. Finally, we wrote unit tests to validate the new behaviour before and after the changes.
Image Demo:
BEFORE
AFTER
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Units tests were added to apps/web/modules/bookings/hooks/useActiveFiltersValidator.test.ts and packages/trpc/server/routers/viewer/bookings/get.handler.test.ts, accordingly.
Run
yarn test get.handler.test apps/web/modules/bookings/hooks/useActiveFiltersValidator.testto run tests specifc to the filters.