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

Int b 22701 ppm document loading mask service member #14953

Open
wants to merge 23 commits into
base: integrationTesting
Choose a base branch
from

Conversation

msaki-caci
Copy link
Contributor

B-22701

Summary

Currently, when a user is reviewing a PPM with a packed download available (AOA and Payment Packet), the user clicks on the packet, and even though the download  process is occurring in the background, the link remains clickable. 

This story will make it so if you select the AOA or Payment Packet links as a service member, you will be presented with a loading mask to cover up the screen while the PDF is downloading. I did make a small change to the default message for the loadspinner component that @danieljordan-caci made so any message that is displayed will have an ellipsis. I also added some new tests to check that the masking appears and goes away as it should.

Verification Steps for the Author

These are to be checked by the author.

  • Tested in the Experimental environment (for changes to containers, app startup, or connection to data stores)
  • Have the Agility acceptance criteria been met for this change?

Verification Steps for Reviewers

These are to be checked by a reviewer.

  • Has the branch been pulled in and checked out?
  • Have the BL acceptance criteria been met for this change?
  • Was the CircleCI build successful?
  • Has the code been reviewed from a standards and best practices point of view?

Setup to Run the Code

How to test

  1. Create a PPM Shipment as a service member.
  2. Fill out all the necessary fields but make sure to select the AOA payment advance option.
  3. Approve the shipment as an SC.
  4. Finish the closeout documentation as a service member.
  5. Approve all the requests as an SC.
  6. Go back to view your move as a service member and attempt to select the Download AOA Paperwork (PDF) or the Download Payment Packet button.
  7. Verify that the load mask appears with the spinner and the customized message.
    a. AOA will be "Downloading AOA Paperwork (PDF)..."
    b. Download Payment Packet will be "Downloading Payment Packet (PDF)..."

Frontend

  • There are no aXe warnings for UI.
  • This works in Supported Browsers and their phone views (Chrome, Firefox, Edge).
  • There are no new console errors in the browser devtools.
  • There are no new console errors in the test output.
  • If this PR adds a new component to Storybook, it ensures the component is fully responsive, OR if it is intentionally not, a wrapping div using the officeApp class or custom min-width styling is used to hide any states the would not be visible to the user.
  • This change meets the standards for Section 508 compliance.

Backend

Database

Any new migrations/schema changes:

  • Follows our guidelines for Zero-Downtime Deploys.
  • Have been communicated to #g-database.
  • Secure migrations have been tested following the instructions in our docs.

Screenshots

Screen.Recording.2025-03-04.at.4.37.44.PM.mov

dependabot bot and others added 23 commits February 4, 2025 19:16
Bumps [store2](https://github.com/nbubna/store) from 2.14.2 to 2.14.4.
- [Commits](nbubna/store@2.14.2...2.14.4)

---
updated-dependencies:
- dependency-name: store2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
This is a first crack at trying to get the load mask to work. One thing
to note is that I am currently doing this for the Download Payment Packet
just to see how things will work. Will refactor so it is just for AOA packet
Went in and cleaned up some unnessecary code from the first commit.
Realized there didn't need to be any CSS changes for the PPMSummaryList.
Removed handleDownloadFailure as it wasn't needed.
…2-2.14.4

Bump store2 from 2.14.2 to 2.14.4
Make sure that the message that appears on the screen is
removed if there is an error. Also check base case for the message.
…into INT-B-22701_PPM_Document_Loading_mask_service_member
…into INT-B-22701_PPM_Document_Loading_mask_service_member
@msaki-caci msaki-caci added INTEGRATION Slated for Integration Testing Go-Rillaz Go-Rillaz frontend labels Mar 4, 2025
@msaki-caci msaki-caci requested a review from a team March 4, 2025 22:40
@msaki-caci msaki-caci self-assigned this Mar 4, 2025
@msaki-caci msaki-caci requested a review from a team as a code owner March 4, 2025 22:40
Comment on lines +139 to +149
useEffect(() => {
if (isDownloading) {
document.body.classList.add('has-overlay');
} else {
document.body.classList.remove('has-overlay');
}

return () => {
document.body.classList.remove('has-overlay');
};
}, [isDownloading]);
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a much easier and concise way to show this overlay. Check out where I do it in EditOrdersForm or wherever.

Import the redux action:

import { setShowLoadingSpinner as setShowLoadingSpinnerAction } from 'store/general/actions';

You'll see the mapDispatchToProps at the bottom with this:

setShowLoadingSpinner: setShowLoadingSpinnerAction

Then you add that action into your component via the props, so in this case:

const MoveHome = ({ serviceMemberMoves, isProfileComplete, serviceMember, signedCertification, updateAllMoves, setShowLoadingSpinner }) => {

Then all you need to do is handle displaying/hiding the spinner around the function you're calling:

onStart={() => setShowLoadingSpinner(true, `Downloading AOA Paperwork (PDF)`);

And then in your onSuccess and onFailure functions, just make sure you're turning it back off:

setShowLoadingSpinner(false, null);

This way you don't need the useEffect or useState here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Go-Rillaz Go-Rillaz INTEGRATION Slated for Integration Testing
Development

Successfully merging this pull request may close these issues.

5 participants