Page MenuHomePhabricator

[native] Prevent the only admin role from being changed
ClosedPublic

Authored by rohan on Jun 9 2023, 11:45 AM.
Tags
None
Referenced Files
F3236757: D8161.id.diff
Wed, Nov 13, 1:19 AM
Unknown Object (File)
Tue, Nov 12, 12:48 PM
Unknown Object (File)
Sat, Nov 9, 4:03 PM
Unknown Object (File)
Sat, Nov 9, 2:59 PM
Unknown Object (File)
Sat, Nov 9, 2:01 PM
Unknown Object (File)
Sat, Nov 9, 11:31 AM
Unknown Object (File)
Sat, Nov 9, 11:31 AM
Unknown Object (File)
Sat, Nov 9, 11:30 AM

Details

Summary

Just like on web, we want to make sure the last remaining admin in a community cannot remove themselves from the role until someone else is assigned the Admins role

Depends on D8160

Test Plan

Please see the video below that demonstrates this

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rohan requested review of this revision.Jun 9 2023, 12:02 PM

(Shellcheck CI job should pass after pulling in latest changes.)

Planning changes to hold off on review until feedback on D8141 is addressed

Refactor the way we indicate a role change cannot be possible to be similar to web (block the user from getting into an invalid state all together)

atul added a subscriber: ted.
atul added inline comments.
native/roles/change-roles-screen.react.js
166–173 ↗(On Diff #27708)

This seems like it would be a great candidate of something that could be included in design system... maybe NoticeBox? With InfoBox, WarningBox, ErrorBox` variants that have different icons/colors?

Nothing actionable with this diff, just a thought CC @ashoat, @ted

282 ↗(On Diff #27708)

What's this for? Didn't catch it in the screen recording, maybe a layout debugging artifact that got left in?

If it is something we're using, can we use a color from the design system instead?

This revision is now accepted and ready to land.Jun 14 2023, 10:17 AM
native/roles/change-roles-screen.react.js
282 ↗(On Diff #27708)

Oh yeah that's from debugging let me remove that

Remove unused green color

This revision was landed with ongoing or failed builds.Jun 21 2023, 8:42 AM
This revision was automatically updated to reflect the committed changes.