Show only those facilties that aren't linked to user #6191
Closed
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
🤖 Generated by Copilot at 97c2bb7
Added a feature to exclude the facilities that are already linked to a user from the facility select options in the
UserFacilities
component. This required passing theusername
prop from theManageUsers
component and modifying theFacilitySelect
component.Proposed Changes
http://localhost:4000/users
Only shows those facilities in the drop-down that are not linked to the user.
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
HOW
🤖 Generated by Copilot at 97c2bb7
username
prop toFacilitySelectProps
interface andFacilitySelect
component to filter out linked facilities from facility select options (link, link)getUserListFacility
action from Redux actions module and dispatch it withusername
parameter to get the linked facilities of a user (link, link)linkedFacilities
andlinkedIDs
variables to store the results of the action and the ids of the linked facilities (link)loadOptions
function of theAutoCompleteAsync
component to use thefilter
method on theres?.data?.results
array and exclude the facilities that have ids matching thelinkedIDs
array (link)username
prop from theuser
object to theUserFacilities
component in theManageUsers
component (link)