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

392 button tech debt #2519

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft

392 button tech debt #2519

wants to merge 2 commits into from

Conversation

gdalcengio
Copy link
Contributor

  • feat: Add reporting step buttons component for reporting forms, separating save and continue buttons
  • chore: Add reporting step buttons to facility review page

@@ -44,10 +44,11 @@ const PersonResponsible = ({ version_id }: Props) => {
const router = useRouter();

const queryString = serializeSearchParams(useSearchParams());
const saveAndContinueUrl =
const continueUrl =
operationType === "Linear Facility Operation"
? `/reports/${version_id}/facilities/lfo-facilities${queryString}`
: `/reports/${version_id}/facilities/${facilityId}/review${queryString}&facilities_title=Facility`;
Copy link
Contributor

Choose a reason for hiding this comment

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

There is an issue here with this path. When queryString is null, we get:
.../review&facilities_title=Facility, which doesn't parse properly because we don't have the ? before the query params.

A potential solution (which would need to be investigated for side effects) is to change the serializeSearchParams utility function to return ? when there are no params & append & to the end of the querystring when there are.

We'd have to look at where serializeSearchParams is used & make sure everything still works as expected where it's implemented

Copy link
Contributor

Choose a reason for hiding this comment

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

To reproduce the bug, start a report & get to the Person Responsible page, once you enter data there & click Save&Continue, you'll get a 404 error because the params are missing the ? to start them off

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.

2 participants