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

Spikes: Element Ids, Clear actions #116

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

Spikes: Element Ids, Clear actions #116

wants to merge 16 commits into from

Conversation

BearHanded
Copy link
Contributor

@BearHanded BearHanded commented Feb 13, 2025

Description

Apologies in advance, this has very much been an exercise in yak shaving. Set out to just get clear functionality working and kept brushing up against other issues or requirements to do so.

This PR:

  • Adds Ids to report page elements. These are required fields in the schemas moving forward, and a report won't generate without them.
  • Introduces a clear and reset action ("Reset" being a hard reset, clear just removing all but the whitelisted answers)
  • Fixes behavior in the quality measure element and radio to save correctly, and ties into the recent fix to display at the correct time
  • Removes the cmit entry in state because it was leaning on needing a setMeasure call in advance to prep loading a page. Moved that cmitId to the measure page objects themselves. That gets added during buildReport from the uid.

Gotchas:

  • I owe the reset files unit tests (Got me)
  • Children still need to be cleared in the reset file, but that's just a matter of looking up the children and adding a recursive call to the method
  • The reporting button has an upcoming ticket to do the work, but currently triggers the clearing method on clicking "no". This sets the report store to the correct state, but has not been tied to the react hook form.

Related ticket(s)

CMDCT-4241, CMDCT-4169


How to test

Important updates


Author checklist

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

convert to a different template: test → val | val → prod

@BearHanded BearHanded marked this pull request as ready for review February 13, 2025 21:41
@BearHanded BearHanded requested a review from braxex as a code owner February 13, 2025 21:41
@BearHanded BearHanded changed the title WIP: Element Ids, Clear actions Spikes: Element Ids, Clear actions Feb 13, 2025
Copy link

codeclimate bot commented Feb 13, 2025

Code Climate has analyzed commit dbd833b and detected 11 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 11

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

This pull request will bring the total coverage in the repository to 90.4%.

View more on Code Climate.

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.

1 participant