HomePhabricator
Diffusion Comm 008a3c5a95cb

[native] Prevent duplicate role names in one community on the client

Description

[native] Prevent duplicate role names in one community on the client

Summary:
This is the client-side error handling for when a user tries to create a role with the same name as an existing role in the community. keyserver support for this is added in D8432 by creating a unique key, but we want to ideally prevent the user from getting to a point where a duplicate role name is sent to the keyserver and an error is thrown.

Here, when the 'Create' button is clicked, we check the role names in the current threadInfo, and if the same role name exists, we use the ActionResultModal to indicate why this role name cannot be used. Using ActionResultModal was discussed in DES-44.

Part of ENG-4178.

Depends on D8432

Test Plan:
Create a role with the same name as Admins (exists), then create a role with a new name that does not exist. Expect the error to display the first time, but the role to create the second time.

Reviewers: atul, ginsu

Reviewed By: ginsu

Subscribers: ted, ashoat, tomek

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

Details

Provenance
rohanAuthored on Jul 19 2023, 2:27 PM
Reviewer
ginsu
Differential Revision
D8445: [native] Prevent duplicate role names in one community on the client
Parents
rCOMM39ceae667aae: [keyserver] Add unique key on thread_name in the roles table
Branches
Unknown
Tags
Unknown