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, Apr 9, 11:55 PM
Unknown Object (File)
Apr 5 2024, 12:38 AM
Unknown Object (File)
Apr 2 2024, 7:16 AM
Unknown Object (File)
Mar 31 2024, 4:25 PM
Unknown Object (File)
Mar 30 2024, 2:42 PM
Unknown Object (File)
Mar 11 2024, 12:07 AM
Unknown Object (File)
Mar 9 2024, 5:13 PM
Unknown Object (File)
Mar 7 2024, 11:09 PM
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.