Page MenuHomePhabricator

[web] Create the modals that will allow the user to confirm role deletion
ClosedPublic

Authored by rohan on Jul 25 2023, 8:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 8:36 AM
Unknown Object (File)
Tue, Nov 26, 8:24 AM
Unknown Object (File)
Tue, Nov 26, 5:42 AM
Unknown Object (File)
Sun, Nov 24, 7:50 AM
Unknown Object (File)
Sat, Nov 23, 6:56 PM
Unknown Object (File)
Sat, Nov 23, 4:23 PM
Unknown Object (File)
Sat, Nov 23, 4:22 PM
Unknown Object (File)
Mon, Nov 11, 8:20 PM
Subscribers

Details

Summary

This should be the final stack in the entire roles project. This is the client-side logic for web to handle role deletion. Per the designs, the warning message is the same as on native, with
either a generic deletion message if nobody is assigned the role or a more specific one if members have this custom role.

ENG-4432

Depends on D8624

Test Plan

Verified that the modal appears as expected for roles with and without members, and pressing the delete button actually deletes

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

rohan edited the test plan for this revision. (Show Details)
rohan edited the summary of this revision. (Show Details)
rohan requested review of this revision.Jul 25 2023, 8:44 AM
web/roles/delete-role-modal.react.js
46–50 ↗(On Diff #29024)

cc @ashoat for the copy (same as in D8574), the copy will be more visible in the test plan video

atul requested changes to this revision.Jul 26 2023, 3:30 PM

Only thing blocking this diff is awaiting the call to callDeleteCommunityRole(...) before calling popModal(...).

web/roles/delete-role-modal.react.js
39–50 ↗(On Diff #29024)

We could create a function above the component that takes in memberCount and defaultRoleName and returns a string to reduce clutter here?

Totally up to you

52–68 ↗(On Diff #29024)

Same feedback as in D8595 where we should await the call to callDeleteCommunityRole(...) before calling popModal(...)

web/roles/role-actions-menu.react.js
31 ↗(On Diff #29024)

Isn't this invariant really more "default role should exist"?

35 ↗(On Diff #29024)

Isn't this invariant really more "existing role should exist"?

This revision now requires changes to proceed.Jul 26 2023, 3:30 PM
rohan edited the test plan for this revision. (Show Details)
  1. Use the new helper function in lib to construct the deletion message
  2. await the call to delete the community role before closing the modal
  3. Add a loading indicator
  4. Update the invariant messages

Thanks for going through and addressing feedback!

This revision is now accepted and ready to land.Jul 28 2023, 12:03 PM
This revision was landed with ongoing or failed builds.Jul 31 2023, 6:15 PM
This revision was automatically updated to reflect the committed changes.