Page MenuHomePhabricator

[web] Confirm a user wants to exit if changes are made in the modal
ClosedPublic

Authored by rohan on Jun 7 2023, 5:06 AM.
Tags
None
Referenced Files
F3387411: D8139.id27581.diff
Fri, Nov 29, 9:21 AM
Unknown Object (File)
Mon, Nov 25, 10:28 PM
Unknown Object (File)
Mon, Nov 25, 9:52 PM
Unknown Object (File)
Mon, Nov 25, 9:36 PM
Unknown Object (File)
Mon, Nov 18, 10:28 AM
Unknown Object (File)
Mon, Nov 11, 11:11 AM
Unknown Object (File)
Mon, Nov 11, 3:22 AM
Unknown Object (File)
Sat, Nov 9, 1:25 PM

Details

Summary

Based on the designs, if a member's role is changed (not saved, but just different to their current role) in the dropdown menu, we need to add a confirmation exit modal to warn them that they will
lose their changes by closing the role change modal.

https://linear.app/comm/issue/ENG-4039/confirm-a-user-wants-to-exit-if-changes-are-made-in-the-modal

Depends on D8138

Test Plan

Please see the video below that covers the different use cases of no changes, changes, making a change but then changing the role back to the member's current role, etc.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rohan requested review of this revision.Jun 7 2023, 5:23 AM
atul added inline comments.
web/modals/unsaved-changes-modal.react.js
15–20 ↗(On Diff #27581)

Looks strange, but also reasonable?

This revision is now accepted and ready to land.Jun 9 2023, 3:25 PM
web/modals/threads/members/change-member-role-modal.react.js
50

It appears there there are other ways to close the modal that won't trigger UnsavedChangesModal. Is this addressed in later diffs?

web/modals/threads/members/change-member-role-modal.react.js
50

It's not, I hadn't considered the default modal close. I think the easiest solution is to get rid of popModal and have Modal onClose={onBackClick} (just off the top of my head, will test it before I put up a quick diff to address this)