HomePhabricator
Diffusion Comm a150256e793f

[native] Use CreateRolesScreenHeaderRightButton to save a new role

Description

[native] Use CreateRolesScreenHeaderRightButton to save a new role

Summary:
This is the client-side implementation of allowing a user to save their custom role for their community. Since CreateRolesHeaderRightButton needs access to both the roleName and the rolePermissions, it made sense to include those in the navigation route params, and I can pull them directly from there. That's why the React.useEffect hook updates the params.

This is also useful because once I work on the edit_role flow, I can default the roleName and rolePermissions to the existing name/permissions to 'pre-fill' the info for the client.

Depends on D8420

ENG-4174.

Test Plan:
Create a new role and click on the 'Create' button. Check my local DB and verify that the role has been created with the selected permissions (for the demo video, you should be able to see all of the guaranteed permissions from the previous diff, and just the manage_pins and descendant_manage_pins from the configurable permissions).

Reviewers: atul, ginsu

Reviewed By: ginsu

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D8421

Details

Provenance
rohanAuthored on Jul 27 2023, 1:51 AM
Reviewer
ginsu
Differential Revision
D8421: [native] Use CreateRolesScreenHeaderRightButton to save a new role
Parents
rCOMM9034ce7f2ecb: [keyserver/lib] Add keyserver support for creating roles
Branches
Unknown
Tags
Unknown