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

feat(initial submission): Set up New Submission triage options #140

Merged
merged 19 commits into from
Sep 29, 2023

Conversation

hannasage
Copy link

@hannasage hannasage commented Sep 26, 2023

Purpose

This PR adds in the triage of navigation options for the New Submission screen, so a user can select the authority type, document type, and navigate to the desired page.

NOTE: The only functional one is SPA > Medicaid SPA which will link to our current dummy form for facilitating development.

Screen Shot 2023-09-26 at 1 18 54 PM Screen Shot 2023-09-26 at 1 19 03 PM

Linked Issues to Close

https://qmacbis.atlassian.net/browse/OY2-25391

Approach

We have a single component that acts as a reusable page (OptionsPage) made of sub-components that handle styling. Each route links to a specific instance of the OptionsPage fed with different OptionData values. These values dictate the title, description, and path linked to.

Let's say you arrive at /new-submission, this is what powers the page of initial options:

export const NewSubmissionInitialOptions = () => (
    <OptionsPage
        title="Submission Type"
        fieldsetLegend="Select a Submission Type"
        options={AUTHORITY_OPTIONS}
    />
);

And this will be one of your options:

{
    title: "State Plan Amendment (SPA)",
    description: "Submit a Medicaid or CHIP State Plan Amendment",
    linkTo: ROUTES.SPA_SUBMISSION_OPTIONS
}

The above example links to /new-submission/spa, and on that page, we render:

export const SPASubmissionOptions = () => (
    <OptionsPage
        title="SPA Type"
        fieldsetLegend="Select a SPA type to start your submission"
        options={SPA_OPTIONS} />
);

which will have subsequent options with subsequent links.

The router includes the following to wire this up:

{ path: ROUTES.NEW_SUBMISSION_OPTIONS, element: <P.NewSubmissionInitialOptions /> },
{ path: ROUTES.SPA_SUBMISSION_OPTIONS, element: <P.SPASubmissionOptions /> },

Assorted Notes/Considerations/Learning

I fixed up the CardWithTopBorder styles a bit. The gradient bar wasn't rounded, and the border was overlapping it a bit, so I yanked some of the styles from OneMAC to patch it up and added padding back where necessary, hence some seemingly rogue changes in the PR (faq and description used the component)

@hannasage hannasage self-assigned this Sep 26, 2023
@@ -0,0 +1,10 @@
/** TODO: Implement enum values where `to` or `href` is currently just a string. */
export enum ROUTES {
Copy link
Author

Choose a reason for hiding this comment

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

To prevent circular imports between router.tsx and the components/pages using ROUTES, they've been broken out into their own file -- this can be something of an "all constants" file in the future if we need it. Without this separation, the circular dependency between files leads to an undefined error when importing and using the constant values.

@hannasage
Copy link
Author

@hannasage hannasage marked this pull request as ready for review September 26, 2023 20:34
@hannasage hannasage changed the title Set up New Submission triage options feat(initial submission): Set up New Submission triage options Sep 27, 2023
Copy link
Collaborator

@benjaminpaige benjaminpaige left a comment

Choose a reason for hiding this comment

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

semantic html, routing consts, unit tests, inline comments and a thorough pr write up... oh my good heavens!

@hannasage hannasage merged commit 4253123 into master Sep 29, 2023
@hannasage hannasage deleted the oy2-25391 branch September 29, 2023 20:29
Copy link
Contributor

🎉 This PR is included in version 1.5.0-val.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants