Page MenuHomePhabricator

[lib] Deprecate `useRoleDeletableAndEditableStatus` and determine `is[Editable/Deletable]` directly in `RoleActionsMenu`
ClosedPublic

Authored by atul on Mar 1 2024, 12:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 24, 7:47 AM
Unknown Object (File)
Tue, Dec 24, 7:47 AM
Unknown Object (File)
Tue, Dec 24, 7:47 AM
Unknown Object (File)
Tue, Dec 24, 7:47 AM
Unknown Object (File)
Tue, Dec 24, 7:47 AM
Unknown Object (File)
Tue, Dec 10, 9:45 PM
Unknown Object (File)
Mon, Dec 9, 6:30 AM
Unknown Object (File)
Sun, Dec 8, 11:25 AM
Subscribers

Details

Summary

Context: https://linear.app/comm/issue/ENG-6949/update-roledeletableandeditablestatus-to-use-specialrole-field

We can use specialRole field and roleIsDefaultRole and roleIsAdminRole utilities directly instead of doing this in a separate hook.


Depends on D11206

Test Plan

Make sure that RoleActionsMenu appears and behaves as expected.

Will put screenshots in here shortly:

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul requested review of this revision.Mar 1 2024, 1:13 PM

We should reintroduce the util (probably as a simple function) if we would need to decide if we can edit / delete a role in some other places.

This revision is now accepted and ready to land.Mar 4 2024, 1:05 AM

This is safe to land because we will fall back to previous roleIsAdminRole and roleIsDefaultRole logic if specialRole field is missing (as it will on web when landed prior to "flipping the switch").


We should reintroduce the util (probably as a simple function) if we would need to decide if we can edit / delete a role in some other places.

Yeah, agree but figure this reduces indirection for time being when there's a single instance.