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

Enable field 2 in Basic State Information #139460

Merged
merged 15 commits into from
Sep 25, 2023
Merged

Enable field 2 in Basic State Information #139460

merged 15 commits into from
Sep 25, 2023

Conversation

gmrabian
Copy link
Contributor

@gmrabian gmrabian commented Sep 19, 2023

Description

Make Question 2, Program Type, in Basic State Information editable, and update corresponding logic to make form react to this update

Three tables hold information for programType:

  • state
  • sections
  • state-status

state – holds a static value and thus we should seek to neither update nor read programType from this in the app's flow
sections – no change, holds the programType value from the user's choice in the UI
state-status – is now updated with the value from sections, and is the sole reference for that value in the frontend because it is accessible to all user types

Related ticket(s)

MDCT-2993


How to test

  • Login as admin
  • Generate 2022 and 2023 forms
  • Login as stateuser2 and select the 2023 form
  • Question two of Basic State Information should be editable
  • The blue banners in Section 1 should react to the changes (Part 1 and 3 get bannered when you select the third option; parts 2 and 4 when you choose the second; none bannered for the first). There are other pages in the form that also change as a result and they can be identified by searching show_if_state_program_type_in in seed-section-base-2023.json

Author checklist

  • I have performed a self-review of my code
  • I have added thorough tests, if necessary

Copy link
Contributor Author

@gmrabian gmrabian left a comment

Choose a reason for hiding this comment

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

Initial refactor. There are other places that use programType differently and will need to be remedied. This is just a start.

services/app-api/handlers/formTemplates/post.ts Outdated Show resolved Hide resolved
services/ui-src/src/store/formData.js Show resolved Hide resolved
services/ui-src/src/util/shouldDisplay.js Outdated Show resolved Hide resolved
Copy link
Contributor Author

@gmrabian gmrabian left a comment

Choose a reason for hiding this comment

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

Check it out!

services/app-api/handlers/section/update.ts Show resolved Hide resolved
services/app-api/handlers/section/update.ts Outdated Show resolved Hide resolved
services/ui-src/src/components/layout/Part.js Show resolved Hide resolved
services/ui-src/src/store/stateUser.js Show resolved Hide resolved
services/ui-src/src/util/shouldDisplay.js Outdated Show resolved Hide resolved
@gmrabian gmrabian marked this pull request as ready for review September 21, 2023 16:48
BearHanded
BearHanded previously approved these changes Sep 21, 2023
Copy link
Contributor

@BearHanded BearHanded left a comment

Choose a reason for hiding this comment

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

Looked at this pretty thoroughly, and this looks solid, but I haven't had a chance to run it locally. Will update if I do.

@gmrabian gmrabian added the ready for review Ready for all the reviews! label Sep 21, 2023
Copy link
Contributor

@benmartin-coforma benmartin-coforma left a comment

Choose a reason for hiding this comment

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

Very nice. Especially like that you updated the shouldDisplay tests for clarity 👍

Copy link
Contributor

@BearHanded BearHanded left a comment

Choose a reason for hiding this comment

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

Ran this locally and tested it against rendering sections. I am seeing that the browser needs to refresh before rendering the new state for a section.

Replication steps:

  • Start with the report as a "combo"
  • Switch to Medicaid Expansion CHIP Only
  • Navigate to 3F - The form appears when it shouldn't
  • Refresh, you should now see the correct state

@codeclimate
Copy link

codeclimate bot commented Sep 25, 2023

Code Climate has analyzed commit 9ca805e and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (90% is the threshold).

This pull request will bring the total coverage in the repository to 61.4% (0.1% change).

View more on Code Climate.

@gmrabian gmrabian merged commit ecfd6c5 into main Sep 25, 2023
14 checks passed
@gmrabian gmrabian deleted the mdct-2933-enable-fields branch September 25, 2023 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Ready for all the reviews!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants