Skip to content
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

PIMS-1985: Agency selection on add property #2629

Merged
merged 11 commits into from
Aug 15, 2024

Conversation

GrahamS-Quartech
Copy link
Contributor

🎯 Summary

PIMS-1985

  • Added a hook that lets you easily get the list of agencies only relevant to the current user.
  • Made the agency dropdown a part of the general info form so that it will be displayed both when adding or updating a project.
  • The dropdown will show you the user's parent agency and children if you are a general user, or simply all agencies if you are an admin.

🔰 Checklist

  • I have read and agree with the following checklist and am following the guidelines in our Code of Conduct document.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation where required.
  • I have tested my changes to the best of my ability.
  • My changes generate no new warnings.

…encies if admin. Updated property general form to use this in an autocomplete component. Field is marked required.
Copy link

🚀 Deployment Information

The React APP Image has been built with the tag: 2629. Please make sure to utilize this specific tag when promoting these changes to the TEST and PROD environments during the APP deployment. For more updates please monitor Image Tags Page on Wiki.

… Improved the getUserAgencies hook to leverage the groupedAgencies hook for improved display in the dropdown.
Copy link

codeclimate bot commented Aug 15, 2024

Code Climate has analyzed commit 4a6be49 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 66.6% (50% is the threshold).

This pull request will bring the total coverage in the repository to 93.7%.

View more on Code Climate.

Copy link
Collaborator

@LawrenceLau2020 LawrenceLau2020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made myself a General user with agency of "School District 100" whose parent is Education and Child Care (ECC). I seem to be only able to see my own agency and none of the other children agencies of ECC.

@dbarkowsky
Copy link
Collaborator

I made myself a General user with agency of "School District 100" whose parent is Education and Child Care (ECC). I seem to be only able to see my own agency and none of the other children agencies of ECC.

This is what we want, right? Users of parent agencies can see the children, but child agencies cannot.

@GrahamS-Quartech
Copy link
Contributor Author

I made myself a General user with agency of "School District 100" whose parent is Education and Child Care (ECC). I seem to be only able to see my own agency and none of the other children agencies of ECC.

This is what we want, right? Users of parent agencies can see the children, but child agencies cannot.

Yeah this is intentional from what I understood.

@LawrenceLau2020
Copy link
Collaborator

LawrenceLau2020 commented Aug 15, 2024

I made myself a General user with agency of "School District 100" whose parent is Education and Child Care (ECC). I seem to be only able to see my own agency and none of the other children agencies of ECC.

This is what we want, right? Users of parent agencies can see the children, but child agencies cannot.

Yeah this is intentional from what I understood.

Ok, sounds good, my bad.....I misunderstood the requirements.

Copy link
Collaborator

@dbarkowsky dbarkowsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working for me now as expected.
Thanks for adding the indented select options.

Copy link
Collaborator

@LawrenceLau2020 LawrenceLau2020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well, was able to see only my agency when my user's agency is a child agency, and tested as a user belonging to a parent agency, was able to change an existing property to other child agencies.

@GrahamS-Quartech
Copy link
Contributor Author

I made myself a General user with agency of "School District 100" whose parent is Education and Child Care (ECC). I seem to be only able to see my own agency and none of the other children agencies of ECC.

Just adding for documentation purposes that I checked in with Josh and Steven and this is indeed the expected behavior. So I will now merge.

@GrahamS-Quartech GrahamS-Quartech merged commit 604f054 into main Aug 15, 2024
13 checks passed
@GrahamS-Quartech GrahamS-Quartech deleted the PIMS-1985-AgencySelectionOnAddProperty branch August 15, 2024 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants