-
Notifications
You must be signed in to change notification settings - Fork 35
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
base: integrationTesting
Are you sure you want to change the base?
Int b 22701 ppm document loading mask service member #14953
Conversation
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.
Main b 22039 remove lat lon
…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
useEffect(() => { | ||
if (isDownloading) { | ||
document.body.classList.add('has-overlay'); | ||
} else { | ||
document.body.classList.remove('has-overlay'); | ||
} | ||
|
||
return () => { | ||
document.body.classList.remove('has-overlay'); | ||
}; | ||
}, [isDownloading]); |
There was a problem hiding this comment.
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
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.
Verification Steps for Reviewers
These are to be checked by a reviewer.
Setup to Run the Code
How to test
a. AOA will be "Downloading AOA Paperwork (PDF)..."
b. Download Payment Packet will be "Downloading Payment Packet (PDF)..."
Frontend
officeApp
class or custommin-width
styling is used to hide any states the would not be visible to the user.Backend
Database
Any new migrations/schema changes:
Screenshots
Screen.Recording.2025-03-04.at.4.37.44.PM.mov