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

Ops 441 initial page and combobox #2653

Merged
merged 20 commits into from
Aug 8, 2024
Merged

Conversation

johndeange
Copy link
Contributor

@johndeange johndeange commented Aug 7, 2024

What changed

  • Added User Admin page (only accessible by users with the USER_ADMIN role)
  • Added Budget Team user with roles BUDGET_TEAM and USER_ADMIN
  • Updated UserInfo component to make editable by USER_ADMIN (and display human readable values)
  • Added new RTKQ API opsAuthAPI
  • Improvements/fixes to msw JS stub (mocks.js)

Issue

#441

How to test

  1. Testing that only USER_ADMIN role can access the User Admin menu option
  • Login as Admin and the menu option should not be visible.
  • Login as Budget Team and the option should be visible (since BT is a USER_ADMIN)
  1. Testing that only USER_ADMIN has an editable view of UserInfo
  • Login as Admin (or any user other than Budget Team)

  • Click on the user's email address in the upper right of the page to go to the User Details page.

  • Verify that the UserInfo is read-only.

  • Login as Budget Team

  • Click on the user's email address in the upper right of the page to go to the User Details page.

  • Verify that the UserInfo is editable, i.e. has combo boxes for status, role, and division

N.B. The actual persistence of the UserInfo changes will be covered in a future PR. (There is already too much going on in this PR)

Screenshots

If relevant, e.g. for a front-end feature

Definition of Done Checklist

  • OESA: Code refactored for clarity
  • OESA: Dependency rules followed
  • Automated unit tests updated and passed
  • Automated integration tests updated and passed
  • Automated quality tests updated and passed
  • Automated load tests updated and passed
  • Automated a11y tests updated and passed
  • Automated security tests updated and passed
  • 90%+ Code coverage achieved
  • Form validations updated

Signed-off-by: John DeAngelis <[email protected]>
Signed-off-by: John DeAngelis <[email protected]>
Signed-off-by: John DeAngelis <[email protected]>
# Conflicts:
#	frontend/src/tests/data.js
Signed-off-by: John DeAngelis <[email protected]>
@johndeange johndeange marked this pull request as ready for review August 7, 2024 20:20
@fpigeonjr
Copy link
Contributor

👀
image

@fpigeonjr
Copy link
Contributor

fpigeonjr commented Aug 7, 2024

Login as Division Director and the option should be visible (since DD is a USER_ADMIN)

When logged in as as Director Dave, I am not seeing the User Admin tab

SCR-20240807-plho

When I login as Budget Team, then I see the User Admin tab

SCR-20240807-pmjx

@fpigeonjr
Copy link
Contributor

🥇 UserInfo is only editable by the Budget Team

image

const [selectedRoles, setSelectedRoles] = React.useState([]);
const statusData = [
{ id: 1, name: "ACTIVE" },
{ id: 2, name: "INACTIVE" },
Copy link
Contributor

Choose a reason for hiding this comment

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

ACTIVE, INACTIVE, LOCKED would be a good use-case for an ENUM

const { data: divisions, error: errorDivisions, isLoading: isLoadingDivisions } = useGetDivisionsQuery();
const { data: roles, error: errorRoles, isLoading: isLoadingRoles } = useGetRolesQuery();

useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

🔥nice useEffect


.centeredItem {
align-items: center;
display: flex;
Copy link
Contributor

Choose a reason for hiding this comment

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

may be able to use USWDS classes here like: "display-flex, flex-align-center"?

Copy link
Contributor

@fpigeonjr fpigeonjr left a comment

Choose a reason for hiding this comment

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

⭐ User-Admin is much improved. Have a few observations that don't pass the how-to-test section.

@johndeange
Copy link
Contributor Author

I apologize @fpigeonjr , I messed up the "How to Test" section. You are correct that the test user with the USER_ADMIN role is the Budget Team user. I updated the testing instructions.

Copy link
Contributor

@maiyerlee maiyerlee left a comment

Choose a reason for hiding this comment

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

I followed the steps in How To Test and the changes checked out.

* @property {string} INACTIVE - Represents an inactive status for a user.
* @property {string} LOCKED - Represents a locked status for a user.
*/
export const USER_STATUS = {
Copy link
Contributor

Choose a reason for hiding this comment

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

🤩

@johndeange johndeange merged commit 8cafd0d into main Aug 8, 2024
40 checks passed
@johndeange johndeange deleted the OPS-441-initial-page-and-combobox branch August 8, 2024 17:34
@jonnalley jonnalley mentioned this pull request Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants