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

Dmirano/4570 new prev activities mmis #4588

Merged
merged 42 commits into from
Mar 17, 2023

Conversation

mirano-darren
Copy link
Contributor

@mirano-darren mirano-darren commented Mar 6, 2023

Resolves #4570

Description

Updates the Results of Previous Activities page for MMIS. This adds DDI and M&O funding types.

Significant changes or possible side effects

Created a brand new file vs adapting the current HITECH one.
Also changed the selector to not be specific to ffp level. (6 functions re-factored into 2)

Automated test cases written

Given When Then Type (jest, tap, cypress)
Results of Previous Activities page Changing value (90 DDI, 75 DDI/M&O, 50 DDI/M&O) Correct function gets called with the correct values Jest
Results of Previous Activities page Calculating the totals for the totals table Correct values are calculated Jest
Results of Previous Activities page On the page All tables are present Cypress

Steps to manually verify this change

  1. Navigate the the Results of Previous Activities page for an MMIS APD
  2. Verify design matches Figma
  3. Verify Results of Previous Activities page isn't changed for HITECH APDs
  4. (dev) Please check that I did my mongo migrations correctly 😅

This pull request is ready to code review when

  • Automated tests are updated (and all tests are passing)
  • New automated test cases are documented above
  • Pull request has been labeled, if applicable with feature, content, bug,
    tests, refactor
  • Associated OpenAPI documentation has been updated
  • The experience passes a basic manual accessibility audit (keyboard nav,
    screenreader, text scaling) OR an exemption is documented

This pull request is ready to test when

  • Code has been reviewed by someone other than the original author

This pull request is ready to review when the QA has

  • Verified the functionality related to the change
  • Verified that the change works with Narrator on Windows
  • Verified that the change works with VoiceOver on Mac
  • Verified all updated pages with the WAVE tool
  • Verified tab and keyboard navigation functionality

This pull request can be merged when

  • Design has approved the experience
  • Product has approved the experience

@mirano-darren mirano-darren added the feature PR label for release log label Mar 6, 2023
@codecov
Copy link

codecov bot commented Mar 6, 2023

Codecov Report

Merging #4588 (91f8dec) into main (5a745e6) will decrease coverage by 2.36%.
The diff coverage is 97.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4588      +/-   ##
==========================================
- Coverage   94.28%   91.92%   -2.36%     
==========================================
  Files         271      268       -3     
  Lines        8622     8450     -172     
  Branches     1721     1707      -14     
==========================================
- Hits         8129     7768     -361     
- Misses        469      649     +180     
- Partials       24       33       +9     
Flag Coverage Δ
api ∅ <ø> (∅)
common 100.00% <ø> (ø)
web 91.55% <97.89%> (-2.47%) ⬇️
Impacted Files Coverage Δ
e2e/cypress/page-objects/export-page.js 64.95% <ø> (ø)
...evious-activities/MmisApdPreviousActivityTables.js 92.85% <92.85%> (ø)
...e/cypress/page-objects/previous-activities-page.js 100.00% <100.00%> (ø)
...ious-activities/HitechApdPreviousActivityTables.js 100.00% <100.00%> (ø)
...us-activities/HitechPreviousActivityTotalsTable.js 100.00% <100.00%> (ø)
...ious-activities/MmisPreviousActivityTotalsTable.js 100.00% <100.00%> (ø)
...ages/apd/previous-activities/PreviousActivities.js 100.00% <100.00%> (ø)
.../previous-activities/PreviousActivitiesReadOnly.js 100.00% <100.00%> (ø)
...eb/src/redux/actions/editApd/previousActivities.js 100.00% <100.00%> (ø)
web/src/redux/selectors/apd.selectors.js 95.89% <100.00%> (-4.11%) ⬇️

... and 25 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a745e6...91f8dec. Read the comment docs.

Copy link
Contributor

@thetif thetif left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for tackling this!

Copy link
Contributor

@amyd11 amyd11 left a comment

Choose a reason for hiding this comment

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

Looks good! I just have a few questions mentioned in comments

Comment on lines 24 to 28
{apdType === 'HITECH' && <HitechApdPreviousActivityTables isViewOnly />}
{apdType === 'HITECH' && <HitechPreviousActivityTotalsTable />}

{apdType === 'MMIS' && <MmisApdPreviousActivityTable isViewOnly />}
{apdType === 'MMIS' && <MmisPreviousActivityTotalsTable isViewOnly />}
Copy link
Contributor

Choose a reason for hiding this comment

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

This totally works, so no need to change! Just wanted to offer another option for handling this kind of logic- I love a good mapping, so you could add an object like:

const activityTableMapping = {
  [APD_TYPE.HITECH]: <HitechApdPreviousActivityTables isViewOnly />,
  [APD_TYPE.MMIS]: <MmisApdPreviousActivityTable isViewOnly />
}

and then in the render you can reference the correct component by activityTableMapping[apdType].
Ultimately it's just a nice way to be able to simplify number of lines in the render and also set the code up for easy expansion of adding more options to the mapping in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will make this change, thanks!

expense
expense,
level,
fundingType
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we've been referring to "DDI" and "M&O" as a fundingCategory. I wonder if we can make that consistent?

)
);

export const selectPreviousActivityExpensesTotalsMMIS = createSelector(
Copy link
Contributor

Choose a reason for hiding this comment

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

Good use of selectors here!

[selectApdData],
({ previousActivities }) =>
Object.entries(previousActivities.actualExpenditures).reduce(
(o, [year, expenses]) => ({
...o,
[year]: expenses.mmis
[year]: expenses
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this still be referenced the same for hitech? As in, don't we still need the .mmis?

Or it looks like you're getting all the expenses with this selector. So maybe taking MMIS out of the name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For MMIS, the mmis object was replaced with ddi and m&o. So I had to remove the .mmis
For HITECH, there is a mmis and hithie object, so I'm using this selector to pass in both of those and just reference them in the file

[year]: {
ddi: {
50: {
federalActual: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the migration script supposed to populate the value of the previous activity in here or is it just to create the structure and have it all zeroed out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe create the structure and zero it out. Since the previous values would have the wrong structure so their actual values would be irrelevant

@thetif thetif removed the request for review from Sun-Mountain March 13, 2023 16:37
@cms-eapd-bot
Copy link

cms-eapd-bot commented Mar 13, 2023

See this pull request in action: https://ec2-18-206-78-121.compute-1.amazonaws.com

91f8dec

@thetif
Copy link
Contributor

thetif commented Mar 14, 2023

Everything looks good!

Given When Then Result
A HITECH APD On the Results of Previous Activities page page should stay the same ✅ Pass
A MMIS APD On the Results of Previous Activities page 75% and 50% FFP should have M&O tables ✅ Pass
A MMIS APD On the Results of Previous Activities page tables should have headers with funding type ✅ Pass
A MMIS APD On the Results of Previous Activities page tables should show current FFY and previous 2 FFYs ✅ Pass
A MMIS APD On the Results of Previous Activities page tables should calculate based on the correct FFP ✅ Pass
A MMIS APD On the Results of Previous Activities page, changing/adding/deleting values in the tables values are saved ✅ Pass
A MMIS APD On the Results of Previous Activities page, changing/adding/deleting values in the tables totals table below adapts to the change ✅ Pass

Copy link

@stephanieboydcms stephanieboydcms left a comment

Choose a reason for hiding this comment

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

Reviewed and good to go!

Copy link

@SGilliamA1M SGilliamA1M left a comment

Choose a reason for hiding this comment

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

The changes look fantastic, and the values populate correctly. Excellent work!

Copy link
Contributor

@jeromeleecms jeromeleecms left a comment

Choose a reason for hiding this comment

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

@mirano-darren before I sign off on this, can you verify that this went through a screen reader? I did it through NVDA and when it reads to the form fields it gives a really long description of the field and includes the language "object, object" -- I also can't get the screen reader to pick up the "Approved XX% FFP" column either, but I know my version of NVDA doesn't seem to work with all the cheatsheet commands.

Everything else looks right + the math appears to be calculating correctly.

@mirano-darren
Copy link
Contributor Author

mirano-darren commented Mar 16, 2023

@mirano-darren before I sign off on this, can you verify that this went through a screen reader? I did it through NVDA and when it reads to the form fields it gives a really long description of the field and includes the language "object, object" -- I also can't get the screen reader to pick up the "Approved XX% FFP" column either, but I know my version of NVDA doesn't seem to work with all the cheatsheet commands.

Everything else looks right + the math appears to be calculating correctly.

So I can get the Approved XX% FFP column read out. It says FFP quite a lot so I had to listen closely but it did read out the column. I also do also get the "object, object" read out loud too. I will look into it

Copy link
Contributor

@jeromeleecms jeromeleecms left a comment

Choose a reason for hiding this comment

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

OK - the object, object narrative is done and it seems to be reading correctly.

@mirano-darren mirano-darren merged commit 3a94636 into main Mar 17, 2023
@mirano-darren mirano-darren deleted the dmirano/4570-new-prev-activities-mmis branch March 17, 2023 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature PR label for release log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Update the Results of Previous Activities form for MMIS
8 participants