App icon indicating copy to clipboard operation
App copied to clipboard

Expensify.Cash - Unable to add multiple emails to workspace separated by comma

Open jliexpensify opened this issue 5 years ago • 16 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Login to expensify.cash using an account under freePlan beta
  2. Create a workspace via Global create (i.e. the green + icon)
  3. Go to Settings and access the Workspace
  4. Go to People tab
  5. Select "Invite"
  6. Attempt to invite multiple valid email addresses and separate them by comma

image

Note: you will need to be a part of the freePlan beta to test this issue. if you are hired, please let us know your test email/s and we can add you!

Expected Result:

Multiple users should be added to this workspace (i.e. emails should be able to be separated by commas).

Actual Result:

"Invalid Email" error occurs:

image

Workaround:

N/A

Platform:

Where is this issue occurring?

Web ✔️ iOS✔️ Android✔️ Desktop App✔️ Mobile Web✔️

Version Number: 1.0.77-2

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos:

View all open jobs on Upwork

jliexpensify avatar Jul 14 '21 05:07 jliexpensify

Posted to Upworks: https://www.upwork.com/jobs/~0185dff64f02b86eaf

jliexpensify avatar Jul 14 '21 05:07 jliexpensify

Triggered auto assignment to @marcaaron (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

MelvinBot avatar Jul 14 '21 05:07 MelvinBot

I have a suggestion to improve the input. I think this input for entering emails should expand based on the number of emails.

parasharrajat avatar Jul 14 '21 05:07 parasharrajat

Proposal

  1. We have to update inviteUser method https://github.com/Expensify/Expensify.cash/blob/f1ea424068fea065809c95f8a32ff2e08d7d52dc/src/pages/workspace/WorkspaceInvitePage.js#L74. We split the emailorPhone state property via , and then validate each email or phone input as we are currently doing.
  2. We will update the state variable name to be more relavant.
  3. We will highlight the email which is wrong in the Error Growl.
  4. We have to update the invite method https://github.com/Expensify/Expensify.cash/blob/f1ea424068fea065809c95f8a32ff2e08d7d52dc/src/libs/actions/Policy.js#L142. So that it takes an array of login instead of a single user. we already support multiple employees in https://github.com/Expensify/Expensify.cash/blob/f1ea424068fea065809c95f8a32ff2e08d7d52dc/src/libs/actions/Policy.js#L154.

This will fix the issue at hand.

Suggestions

  1. We should highlight the User emails in the input for clarity for example [email protected], [email protected]
  2. We should increase the height of the input so that it is easier to see all the entered emails and wrap emails in next line.

parasharrajat avatar Jul 14 '21 06:07 parasharrajat

@parasharrajat, your proposal sounds right for this. I think you can go ahead and work on it!

3. We will highlight the email which is wrong in the Error Growl. - not strictly necessary, but would be a very helpful feature - I like it.

For the first suggestion, what do you mean by We should highlight the User emails in the input for clarity. Do you mean to literally just bolden the emails?

TomatoToaster avatar Jul 14 '21 14:07 TomatoToaster

Yeah, I meant bolden the emails as we currently don't have Email Input fields where each email is shown with a close button to interact separately instead of using backspace to remove it.

parasharrajat avatar Jul 14 '21 14:07 parasharrajat

Hey @TomatoToaster, Str.isValidPhone is returning true for 98?

parasharrajat avatar Jul 14 '21 15:07 parasharrajat

I found the following issues while working on this.

  1. If we invite a phone number, It is not added to the assignee list until we refresh the page.
  2. Str.isValidPhone is returning true for value 98?

parasharrajat avatar Jul 14 '21 17:07 parasharrajat

Thanks for the investigation @parasharrajat - I'll go ahead and hire you for this job.

jliexpensify avatar Jul 15 '21 00:07 jliexpensify

Hey, @TomatoToaster Please check https://github.com/Expensify/Expensify.cash/issues/4029#issuecomment-880087243. What do you think?

parasharrajat avatar Jul 16 '21 11:07 parasharrajat

If we invite a phone number, It is not added to the assignee list until we refresh the page.

Ooh now this is weird. I would think the optimistic addition from here would add them in. Did it work before with just one phone number?

Str.isValidPhone is returning true for value 98? When I read this, I thought this must be a bug, but it turns out it's technically right 😖 ?

It looks like we're using the E.164 specification and technically those can be valid international numbers. 2 digits seems really short, but I think that's fine since it matches the specification. A source I found for this: https://stackoverflow.com/questions/6478875/regular-expression-matching-e-164-formatted-phone-numbers/23299989#23299989

Some others buffer it by more digits, but I don't think we need to change this part.

TomatoToaster avatar Jul 16 '21 16:07 TomatoToaster

Ooh now this is weird. I would think the optimistic addition from here would add them in. Did it work before with just one phone number?

I think the list expects emails so a ph number should be converted to @expensify.sms email first.

Some others buffer it by more digits, but I don't think we need to change this part.

Ok.

parasharrajat avatar Jul 16 '21 16:07 parasharrajat

What is the update on this change?

MitchExpensify avatar Jul 27 '21 23:07 MitchExpensify

@MitchExpensify PR merged https://github.com/Expensify/App/pull/4068

parasharrajat avatar Jul 27 '21 23:07 parasharrajat

It's been deployed recently to prod I believe.

TomatoToaster avatar Jul 29 '21 15:07 TomatoToaster

Paid, sorry for the delay @parasharrajat !

jliexpensify avatar Aug 02 '21 00:08 jliexpensify