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)
Mon, Nov 25, 12:24 AM
Unknown Object (File)
Sun, Nov 24, 11:53 PM
Unknown Object (File)
Sun, Nov 24, 9:21 PM
Unknown Object (File)
Wed, Nov 20, 6:22 PM
Unknown Object (File)
Thu, Nov 7, 3:17 AM
Unknown Object (File)
Oct 15 2024, 9:04 PM
Unknown Object (File)
Oct 15 2024, 9:04 PM
Unknown Object (File)
Oct 15 2024, 9:04 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.