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
F3207503: D8625.id29404.diff
Sun, Nov 10, 2:24 AM
F3205327: D8625.id29344.diff
Sat, Nov 9, 11:24 PM
F3205324: D8625.id29085.diff
Sat, Nov 9, 11:24 PM
F3205154: D8625.id29024.diff
Sat, Nov 9, 10:56 PM
F3205014: D8625.id29102.diff
Sat, Nov 9, 10:36 PM
F3201341: D8625.diff
Sat, Nov 9, 4:18 PM
Unknown Object (File)
Thu, Nov 7, 6:00 PM
Unknown Object (File)
Wed, Nov 6, 8:00 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.