Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the invitation process to include the role of the person being invited to a workspace #54794

Open
anmurali opened this issue Jan 3, 2025 · 5 comments
Labels
Daily KSv2 Improvement Item broken or needs improvement.

Comments

@anmurali
Copy link

anmurali commented Jan 3, 2025

Workspace - Member - Invite member - select (or enter) email or phone number - add message

Let's add the role as the final step in the invitation process
image

@jamesdeanexpensify @shawnborton should we also change the title of this step?

@anmurali anmurali added Daily KSv2 Improvement Item broken or needs improvement. labels Jan 3, 2025
@Shahidullah-Muffakir
Copy link
Contributor

@anmurali If a user invites multiple members at once, should the selected role be applied to all the invited members?

@truph01
Copy link
Contributor

truph01 commented Jan 4, 2025

Edited by proposal-police: This proposal was edited at 2025-01-04 02:33:28 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

  • Update the invitation process to include the role of the person being invited to a workspace

What is the root cause of that problem?

  • New feature

What changes do you think we should make in order to solve the problem?

  • Add a input component which allow user to select the role in here:
                        <View style={{marginHorizontal: -20}}>
                            <InputWrapper
                                InputComponent={ValuePicker}
                                inputID={'role'}
                                label={'Role'}
                                items={[
                                    {label: 'Admin', value: 'admin'},
                                    {label: 'User', value: 'user'},
                                    {label: 'AUDITOR', value: 'auditor'},
                                ]}
                                value={role}
                                onValueChange={(value) => setRole(value)}
                            />
                        </View>
  • In here:

Member.addMembersToWorkspace(invitedEmailsToAccountIDsDraft ?? {}, `${welcomeNoteSubject}\n\n${welcomeNote}`, route.params.policyID, policyMemberAccountIDs);

pass the above role value to Member.addMembersToWorkspace so that in:

API.write(WRITE_COMMANDS.ADD_MEMBERS_TO_WORKSPACE, params, {optimisticData, successData, failureData});

we can use the role data to:

  1. Update the optimistic data in:

role: CONST.POLICY.ROLE.USER,

instead of default user.

  1. Send the role data to BE via:

API.write(WRITE_COMMANDS.ADD_MEMBERS_TO_WORKSPACE, params, {optimisticData, successData, failureData});

  • These are the primary steps required to implement this feature. The detailed implementation can be addressed during the PR phase.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@parasharrajat
Copy link
Member

@truph01 The Proposal looks good to me. I believe that role would be assigned to all invited members.

@shawnborton
Copy link
Contributor

should we also change the title of this step?

@anmurali what are you thinking to change it to? Perhaps something like "Confirm invite"?

Copy link

melvin-bot bot commented Jan 7, 2025

Whoops! This issue is 2 days overdue. Let's get this updated quick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daily KSv2 Improvement Item broken or needs improvement.
Projects
None yet
Development

No branches or pull requests

5 participants