-
Notifications
You must be signed in to change notification settings - Fork 2
Confirmation modal #352
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
base: 1.9.0-Release
Are you sure you want to change the base?
Confirmation modal #352
Conversation
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.
I noticed that ProjectViewerModal and SubmissionViewerModal have been updated to use the new ModalWrapper library. I think it would be best if the ActionModal is also updated to use this wrapper (for consistency's sake).
ui/src/css/components/modal.css
Outdated
| } | ||
|
|
||
| .custom-confirm-overlay { | ||
| z-index: 99999 !important; |
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.
I would reconsider having such a high z-index. In the future, people might want to overlay over top this component (as unlikely as it may be) and would need a ridiculously high z-index for it.
ui/src/css/components/modal.css
Outdated
| top: 50% !important; | ||
| left: 50% !important; | ||
| transform: translate(-50%, -50%) !important; | ||
| z-index: 100000 !important; |
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.
similar idea here regarding z-index, my guess is its even higher than the last since it needs to go on top of it.
llf5185
left a comment
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.
Additionally, the modal used in ProposalPage.js has not been updated to match this new standard for modals.
This was what I was able to find so far, but there are likely more issues with this pull request I overlooked.
Leaving a note here that react-confirm-alert must be installed in the ui folder when updating the server to include these new features.
|
|
||
| /* Fix for sticky modals like ActionModal */ | ||
| .ui.modal.sticky { | ||
| position: fixed !important; |
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.
Be careful about using !important so frequently. If you need to use !important, justify its use with comments.
| // const [due, setDue] = useState(); | ||
| // const [late, setLate] = useState(false); | ||
| // const [day, setDay] = useState(0); | ||
| const { user } = useContext(UserContext); |
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.
Naming this variable user when there is a property called user may be confusing.
| const { user } = useContext(UserContext); | |
| const { userContext } = useContext(UserContext); |
| )} | ||
| </div> | ||
| } | ||
| title={`Time Submission For ${props.user}`} |
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.
The value passed from ProjectTIme.js to the IndividualTimeModal component for props.user is a JSX element, thus this text will render as:
Time Submission For [object Object]
| <> | ||
| <Modal | ||
| closeOnDimmerClick={false} | ||
| closeOnEscape={false} |
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.
To maximize the amount of page interaction that can be done with just the keyboard and for the sake of consistency, all modals should close on escape or have a comment stating why they shouldn't.
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 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.
Confirming the creation of a sponsor note produces an unsaved changes warning.
The screenshot below shows the warning given after pressing submit on a sponsor note.

Below screenshot shows what happens after you press "Discard Changes".

Below screenshot shows what happens after pressing "Keep Editing". In this case, the sponsor note is still created, but after closing the success modal, the sponsor note editor is left open.


Changes in this PR