-
Notifications
You must be signed in to change notification settings - Fork 21
Fixes coordinator user filter in tag autocomplete #754
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
Merged
+3
−2
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ff9e606
changes param filter to role
DarrellRoberts 8b0f3cd
Merge branch 'develop' into darrell/fix/tagging-users-not-filtered
DarrellRoberts e0e22f7
Merge branch 'develop' into darrell/fix/tagging-users-not-filtered
need4deed 8a7138b
Merge branch 'develop' into darrell/fix/tagging-users-not-filtered
DarrellRoberts 9310880
Merge branch 'develop' into darrell/fix/tagging-users-not-filtered
need4deed ec315f6
Merge branch 'develop' into darrell/fix/tagging-users-not-filtered
need4deed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
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.
This bolts a one-off
role?: UserRolefield onto the shared, resource-agnosticParamsinterface used by ~30useGetQuerycall sites app-wide. The hook already has a generic mechanism for exactly this (filter?: FilterParam, aRecord<string, unknown>), used elsewhere for arbitrary resource filters, e.g.filter: { status: OpportunityStatusType.NEW }inNewestVolunteers.tsx/NewestOpportunities.tsx/OpportunityListController.tsx/AgentListController.tsx.roleis only ever set here, at this one call site. Sincebe'suserListQuerySchemahasadditionalProperties: falseand expectsroleas a flat param rather than nested, could this instead flow through the genericfilterpath ifgetReducedFilterflattened it accordingly (e.g. treatingfilterentries as top-level query keys), rather than adding a domain-specific field to the shared interface? Otherwise this sets a precedent: the next resource that needs a one-off top-level param gets its own bespoke field added here too, andParamskeeps growing with fields most callers never use.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.
thanks @nadavosa for reviewing! Tbh I'm not sure if there's a clean solution to this cleanup problem you highlighted considering in the
beit doesn't acceptfilter: {role }anymore.The main blocker here is that if we try to handle this inside the hook by flattening the filter object, it actually breaks the other 30 call sites. For example, if a query passes
{ filter: { status: 'new', role: 'coordinator' } }, we would have to write complex logic inside the generic hook to pluckroleout to the top level while leavingstatusnested inside the object so thebeviews don't break.My reasoning for adding it to the shared interface was that
UserRoleis a core concept that we will probably need in the future. Plus, since it’s optional, it won't affect any existing callers if left undefined.That said, if you have something in mind, I'd love to hear it
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.
alternatively, the other solution would be to change it back to what it was in the
bewhereroleis nested withinfilter. Either way, thefeandbeshould be aligned