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

Person Responsible link addresses #2740

Open
5 tasks
acatchpole opened this issue Jan 27, 2025 · 0 comments
Open
5 tasks

Person Responsible link addresses #2740

acatchpole opened this issue Jan 27, 2025 · 0 comments

Comments

@acatchpole
Copy link
Contributor

Description of the Tech Debt

The logic on Person Responsible page to decide Continue URL uses a facility_report_id to access operation_type. In an LFO, this might now return any value. The useEffect portion of this form needs to be refactored to properly allow for an LFO operation type.

The continue URL on the Person Responsible page is different based on the Operation Type.

operationType === "Linear Facility Operation"
      ? `/reports/${version_id}/review-facilities-list`
      : `/reports/${version_id}/facilities/${facilityId}/activities`;

But Operation Type is set like

  useEffect(() => {
    const getFacilityId = async () => {
      const facilityReport = await getFacilityReport(version_id);
      if (facilityReport?.facility_id) {
        setFacilityId(facilityReport.facility_id);
        setOperationType(facilityReport.operation_type);
      } else {
        setFacilityId(undefined);
        setOperationType(undefined);
      }
    };
    getFacilityId();
  }, []);

Development Checklist:

  • Checklist item
  • Checklist item
  • Checklist item

Acceptance Criteria:

  • When the operation is an LFO, continue goes to Review Facilities List page
  • Otherwise continue goes to activities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant