Skip to content

Commit

Permalink
Merge pull request #3173 from HHS/OPS-3111/add-procurement-team-role
Browse files Browse the repository at this point in the history
Ops 3111/add procurement team role
  • Loading branch information
johndeange authored Dec 5, 2024
2 parents f4459a3 + 625c5ac commit 83af5b0
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 5 deletions.
52 changes: 49 additions & 3 deletions backend/data_tools/data/user_data.json5
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,46 @@
"GET_UPLOAD_DOCUMENT",
"POST_UPLOAD_DOCUMENT"
]
},
{ // 6 Procurement Team Member
name: "PROCUREMENT_TEAM",
permissions: [
"GET_AGREEMENT",

"GET_BUDGET_LINE_ITEM",

"GET_SERVICES_COMPONENT",

"GET_BLI_PACKAGE",

"GET_CAN",

"GET_DIVISION",

"GET_NOTIFICATION",
"PUT_NOTIFICATION",
"PATCH_NOTIFICATION",

"GET_PORTFOLIO",

"GET_RESEARCH_PROJECT",

"GET_USER",
"PUT_USER",
"PATCH_USER",

"GET_HISTORY",

"GET_WORKFLOW",

"GET_CHANGE_REQUEST",

"GET_CHANGE_REQUEST_REVIEW",

"GET_UPLOAD_DOCUMENT",
"POST_UPLOAD_DOCUMENT",
"PATCH_UPLOAD_DOCUMENT"
],
}
],
ops_user: [
Expand Down Expand Up @@ -494,7 +534,6 @@
email: "[email protected]",
oidc_id: "00000000-0000-1111-a111-000000000021",
roles: [{"tablename": "role", "id": 4}, {"tablename": "role", "id": 5}],
groups: [],
status: "ACTIVE"
},
{ // 524
Expand All @@ -503,7 +542,6 @@
division: 1,
email: "[email protected]",
roles: [{"tablename": "role", "id": 2}],
groups: [],
status: "ACTIVE"
},
{ // 525
Expand All @@ -513,7 +551,6 @@
email: "[email protected]",
roles: [{"tablename": "role", "id": 3}],
oidc_id: "00000000-0000-1111-a111-000000000022",
groups: [],
status: "ACTIVE"
},
{ // 526
Expand All @@ -536,6 +573,15 @@
email: "[email protected]",
roles: [{"tablename": "role", "id": 1}, {"tablename": "role", "id": 4}, {"tablename": "role", "id": 5}],
status: "ACTIVE"
},
{ // 529
first_name: "Procurement",
last_name: "Team",
division: 1,
email: "[email protected]",
oidc_id: "00000000-0000-1111-a111-000000000027",
roles: [{"tablename": "role", "id": 6}],
status: "ACTIVE"
}
],
notification: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ def __init__(
"email": "[email protected]",
"sub": "00000000-0000-1111-a111-000000000019",
},
"procurement_team": {
"given_name": "Procurement",
"family_name": "Team",
"email": "[email protected]",
"sub": "00000000-0000-1111-a111-000000000027",
},
}

def authenticate(self, auth_code):
Expand Down
3 changes: 3 additions & 0 deletions frontend/cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ Cypress.Commands.add("FakeAuth", (user) => {
case "budget-team":
cy.contains("Budget Team Member").click();
break;
case "procurement-team":
cy.contains("Procurement Team Member").click();
break;
default:
// Handle any unspecified user types if necessary
break;
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/components/Auth/MultiAuthSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ const MultiAuthSection = () => {
Budget Team Member
</button>
</p>
<p>
<button
className="usa-button usa-button--outline width-full"
onClick={() => handleFakeAuthLogin("procurement_team")}
>
Procurement Team Member
</button>
</p>
<p>
<button
className="usa-button usa-button--outline width-full"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Users/UserInfo/UserInfo.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ describe("UserInfo", () => {
expect(await screen.findByText("Reviewer/Approver")).toBeInTheDocument();
expect(await screen.findByText("User Admin")).toBeInTheDocument();
expect(await screen.findByText("Budget Team")).toBeInTheDocument();
expect(await screen.findByText("Procurement Team")).toBeInTheDocument();
});

test("renders correctly - status", async () => {
Expand Down Expand Up @@ -233,7 +234,6 @@ describe("UserInfo", () => {
await browserUser.click(getByText("Viewer/Editor"));

// check that the 2 roles are selected
screen.debug();
expect(rolesComboBox).toHaveTextContent("System Owner");
expect(rolesComboBox).toHaveTextContent("Viewer/Editor");
});
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const constants = {
{ name: "VIEWER_EDITOR", label: "Viewer/Editor" },
{ name: "REVIEWER_APPROVER", label: "Reviewer/Approver" },
{ name: "USER_ADMIN", label: "User Admin" },
{ name: "BUDGET_TEAM", label: "Budget Team" }
{ name: "BUDGET_TEAM", label: "Budget Team" },
{ name: "PROCUREMENT_TEAM", label: "Procurement Team" }
]
};

Expand Down
4 changes: 4 additions & 0 deletions frontend/src/tests/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,10 @@ export const roles = [
{
id: 5,
name: "BUDGET_TEAM"
},
{
id: 6,
name: "PROCUREMENT_TEAM"
}
];

Expand Down

0 comments on commit 83af5b0

Please sign in to comment.