App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2021-09-28] Avatar Image picker should be restricted to image extensions only.

Open Santhosh-Sellavel 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!


Able to pick other file types for profile avatar and workspace avatar image.

Action Performed:

  1. Go to Settings
  2. Click Profile
  3. Click the pen icon to update or add a profile photo
  4. Click upload photo
  5. In Desktop or web -> file picker opens and allowed to select all file types
  6. In Mobile we show different options, Camera, Gallery, Document picker -> allows picking to other file types

Expected Result:

Should allow only to pick the image file formats or atleast show error after picking it's not a valid file format

Actual Result:

We allow picking other file types also, do not show any error messages also after picking

https://user-images.githubusercontent.com/85645967/129383495-bd1f53d2-f479-472d-bf5e-b9d940232ebe.mp4

https://user-images.githubusercontent.com/85645967/129383304-12185ae5-529a-4e52-950f-4a90aa9343cb.mov

Workaround:

Users can able to select images.

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Suggestion

We should restrict file types while picking in desktop, we should not show document picker options in mobile.

Proposal

After discussion will provide a technical solution. Thanks

Version Number: Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Expensify/Expensify Issue URL:

View all open jobs on Upwork

view this job

Santhosh-Sellavel avatar Aug 13 '21 15:08 Santhosh-Sellavel

Triggered auto assignment to @lschurr (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

MelvinBot avatar Aug 13 '21 15:08 MelvinBot

Triggered auto assignment to @yuwenmemon (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot avatar Aug 13 '21 15:08 MelvinBot

Proposal

To achieve this we could do the following.

  1. In component AttachmentPicker we could introduce a new prop type. Like shown below Screenshot 2021-08-21 at 10 15 07 PM

For web/desktop

  1. In AttachmentPicker index.js we can add a new method, Screenshot 2021-08-21 at 10 18 00 PM

And use it in lines below, pass it as prop like accept={getAcceptableFileTypes(this.props.type)} https://github.com/Expensify/App/blob/bdcafa3444f3839d7f5de2300e258caf681a50e3/src/components/AttachmentPicker/index.js#L15-L30

For Native

  1. In AttachmentPicker index.native.js, Move the following lines, https://github.com/Expensify/App/blob/bdcafa3444f3839d7f5de2300e258caf681a50e3/src/components/AttachmentPicker/index.native.js#L82-L86

as shown below. For image picker, IMO I feel this unnecessary option so adding only when AttachmentPicker type is not image Screenshot 2021-08-21 at 10 27 08 PM

Note: We want to use the above option also, then we can achieve just by modifying documentPickerOptions

we can add a new method, Screenshot 2021-08-21 at 10 24 08 PM

And use it in here, Screenshot 2021-08-21 at 10 31 57 PM

  1. We have a separate component AvatarWithImagePicker in there we should pass the type image as shown below. Screenshot 2021-08-21 at 10 32 58 PM

Let me know your thoughts on this thanks! @yuwenmemon

Santhosh-Sellavel avatar Aug 21 '21 17:08 Santhosh-Sellavel

This looks like an issue worth solving, adding the External label for Triage.

yuwenmemon avatar Sep 01 '21 18:09 yuwenmemon

@yuwenmemon there is no assignees here

Santhosh-Sellavel avatar Sep 02 '21 19:09 Santhosh-Sellavel

Triggered auto assignment to @jboniface (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

MelvinBot avatar Sep 02 '21 19:09 MelvinBot

uw posting is here: view this job

jboniface avatar Sep 02 '21 20:09 jboniface

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

MelvinBot avatar Sep 02 '21 20:09 MelvinBot

@tgolen it looks like we have a proposal for review here

jboniface avatar Sep 02 '21 20:09 jboniface

The proposal looks good to me. Let's move forward 🟢

tgolen avatar Sep 03 '21 18:09 tgolen

@Santhosh-Sellavel please submit a proposal to the job so I can hire you when you get a chance

jboniface avatar Sep 03 '21 19:09 jboniface

@jboniface submitted on proposal on upwork

Santhosh-Sellavel avatar Sep 03 '21 19:09 Santhosh-Sellavel

@tgolen Few questions just to clarify the expected outcome.

Choose document options can I remove it for image picker flow alone as I proposed in the solution? image

Santhosh-Sellavel avatar Sep 03 '21 19:09 Santhosh-Sellavel

For the image picker case, yes, I agree with removing that.

On Fri, Sep 3, 2021 at 1:32 PM Santhoshkumar Sellavel < @.***> wrote:

@tgolen https://github.com/tgolen Few questions just to clarify the expected outcome.

Choose document options can I remove it? [image: image] https://user-images.githubusercontent.com/85645967/132056604-f12cf3e3-2ca5-4e75-818b-269aed0320ee.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Expensify/App/issues/4645#issuecomment-912764529, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJMAB3BPXCQH6JHTFQDO3TUAEPFBANCNFSM5CD2HYQQ .

tgolen avatar Sep 03 '21 20:09 tgolen

Looks like the 7 day hold just started

jboniface avatar Sep 13 '21 19:09 jboniface

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.1.0-2 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pulls/5320\n

If no regressions arise, payment will be issued on 2021-09-28. :confetti_ball:

botify avatar Sep 21 '21 23:09 botify