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 3012/update change request filtering #3050

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Santi-3rd
Copy link
Contributor

@Santi-3rd Santi-3rd commented Nov 8, 2024

What changed

Change request filtering is now based on the division ID and the deputy division director's ID.

Issue

#3012

How to test

Run end-to-end tests

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

@fpigeonjr fpigeonjr added the tech-debt Resolved technical debt (tooling, configuration, or workflow) label Nov 8, 2024
@Santi-3rd Santi-3rd marked this pull request as ready for review November 12, 2024 23:39
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.

Looks good @Santi-3rd. I see schema changes and would ask to update the OpenApi spec as part of this effort.

@@ -1,13 +1,26 @@
import { CAN, URL } from "../CANs/CANTypes";
import { SafeUser } from "../Users/UserTypes";

export type Division = {
Copy link
Contributor

Choose a reason for hiding this comment

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

🧡 thx for keeping our types up-to-date

@@ -88,7 +88,8 @@ const useApproveAgreement = () => {
const agreementId = +urlPathParams.id;
const [searchParams] = useSearchParams();
const navigate = useNavigate();
const userDivisionId = useSelector((state) => state.auth?.activeUser?.division) ?? null;
const userDivisionId = useSelector((state) => state.auth?.activeUser?.division) ?? -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

wonder if we are using this variable anywhere?

Copy link
Contributor

@rajohnson90 rajohnson90 left a comment

Choose a reason for hiding this comment

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

Frank and I also talked and think that maybe the other uses of userDivisionId in the ApproveAgreement.hooks.js should be replaced with userId and the same check that we changed in the 'getInReviewChangeRequests' file. The concern was that if we were checking the ownership of the division is checked in different ways it could lead to unexpected inconsistencies.

export type Portfolio = {
id: number;
name?: string;
abbreviation: string;
status?: string;
cans?: CAN[];
division_id: number;
division?: Division;
Copy link
Contributor

Choose a reason for hiding this comment

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

Division is not optional. With the way the backfill works, if we have a division_id we will have a division. You should take out the question mark because any scenario where there isn't a division is just a data error.

@fpigeonjr
Copy link
Contributor

Didn't we also discuss removing the unneeded changeRequestsForUser variable in the ChangeRequestsList component?

@rajohnson90
Copy link
Contributor

Frank is right we also want to remove the changeRequestsForUser in the ChangeRequestsList component as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt Resolved technical debt (tooling, configuration, or workflow)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants