[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