App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2021-09-16] Remove the download attachment button in the upload attachment preview modal

Open isagoico opened this issue 5 years ago β€’ 20 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. Run Web, Mobile Web, or Desktop version.
  2. Open any Chat
  3. Click + (Actions) button, Click Add Attachment
  4. Choose Image or any document to upload.
  5. Click Download button at top right in Send attachment modal.

Expected Result:

Should download file with original file name and extension. or There should not be an download attachment button if the file has not been uploaded yet.

Actual Result:

Downloading file with long file name without extension.

Workaround:

N/A.

Platform:

Where is this issue occurring?

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

Version Number: 1.0.93-0

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

Notes/Photos/Videos: Any additional supporting documentation

image

Upwork job URL: https://www.upwork.com/jobs/~01c46bee71798ea0e6

View all open jobs on GitHub


From @PrashantMangukiya https://expensify.slack.com/archives/C01GTK53T8Q/p1630508588269200

Download via Send attachment modal does not save file extension.

isagoico avatar Sep 03 '21 17:09 isagoico

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

MelvinBot avatar Sep 03 '21 17:09 MelvinBot

Let's remove that button when you're previewing what is about to be uploaded. It doesn't make sense to have it shown.

tgolen avatar Sep 03 '21 19:09 tgolen

Proposal

We have to update code at line 136 within AttachmentModal.js file as shown under,

Code before update (line 136 AttachmentModal.js): https://github.com/Expensify/App/blob/01748665595da12e56ec2428f78547e018f32f24/src/components/AttachmentModal.js#L131-L139

Code after update (line 136 AttachmentModal.js):

    <HeaderWithCloseButton
        title={this.props.isUploadingAttachment
            ? this.props.translate('reportActionCompose.sendAttachment')
            : this.props.translate('common.attachment')}
        shouldShowBorderBottom
        shouldShowDownloadButton={!this.props.isUploadingAttachment}   // Condition added here
        onDownloadButtonPress={() => fileDownload(sourceURL)}
        onCloseButtonPress={() => this.setState({isModalOpen: false})}
    />

As shown above we have to add condition at line 136, so it will not show download button for uploading attachment, but if someone view attachment it will show download button.

Here is screen recording for web version. i.e. How it works once code updated. Similar behaviour will be there for other platform also.

https://user-images.githubusercontent.com/7823358/132067024-1c5f2fef-5b74-4658-aec8-183d17efd035.mov

If my solution considered the kindly invite me on Upwork once project posted. So I will do testing for other platform and submit pull request thereafter. Here is my Upwork profile: https://www.upwork.com/freelancers/~01c718889ed7821f82

PrashantMangukiya avatar Sep 03 '21 20:09 PrashantMangukiya

Triggered auto assignment to @trjExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Sep 03 '21 20:09 MelvinBot

Oops, I meant to label this as external earlier. @parasharrajat Wouldn't that remove the button completely? We still want it there when someone is viewing an attachment.

tgolen avatar Sep 03 '21 20:09 tgolen

Hi @tgolen, Good catch. You are right, let me figure out solution so download button will be removed during send attachment (i.e. during file upload) time only and available when someone view the attachment. Thanks.

PrashantMangukiya avatar Sep 03 '21 20:09 PrashantMangukiya

Hi @tgolen. I updated my proposal, now it will show download button when someone view the attachment, but not during attachment upload time. Here is my updated proposal. https://github.com/Expensify/App/issues/5066#issuecomment-912801001 Thanks.

PrashantMangukiya avatar Sep 03 '21 21:09 PrashantMangukiya

Cool, I think that's solid now. Thanks! @trjExpensify I will let you take over from here, but the proposal has my 🟒 (please don't work on it yet @PrashantMangukiya )

tgolen avatar Sep 03 '21 21:09 tgolen

Hi @tgolen, Thanks. Just to clarify that there is not any proposal yet from parasarrajat, did you mean green signal to my proposal? my github id is @PrashantMangukiya as I posted proposal above.

PrashantMangukiya avatar Sep 03 '21 21:09 PrashantMangukiya

Sorry, yes. My bad! I'll edit my post

tgolen avatar Sep 03 '21 22:09 tgolen

Updated the issue title to be a tad more reflective of the scope here. Upwork job can be found here, @PrashantMangukiya I've invited you to the job for ease, so feel free to apply and we'll then assign this issue to you. Thanks!

trjExpensify avatar Sep 06 '21 09:09 trjExpensify

Hi @trjExpensify, Thank you for the invitation. I applied for the job. Kindly assign me.

PrashantMangukiya avatar Sep 06 '21 10:09 PrashantMangukiya

Yup, sent you the offer. Once accepted, I'll assign it over to you. πŸ‘

trjExpensify avatar Sep 06 '21 10:09 trjExpensify

@trjExpensify, Just accepted. Thank you.

PrashantMangukiya avatar Sep 06 '21 10:09 PrashantMangukiya

Hi, @trjExpensify Pull request #5101 submitted and ready for review.

PrashantMangukiya avatar Sep 06 '21 16:09 PrashantMangukiya

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

botify avatar Sep 07 '21 17:09 botify

πŸš€ Deployed to staging by @tgolen in version: 1.0.94-2 πŸš€

platform result
πŸ€– android πŸ€– success βœ…
πŸ–₯ desktop πŸ–₯ success βœ…
🍎 iOS 🍎 success βœ…
πŸ•Έ web πŸ•Έ success βœ…

botify avatar Sep 08 '21 22:09 botify

πŸš€ Deployed to production by @yuwenmemon in version: 1.0.95-1 πŸš€

platform result
πŸ€– android πŸ€– success βœ…
πŸ–₯ desktop πŸ–₯ success βœ…
🍎 iOS 🍎 success βœ…
πŸ•Έ web πŸ•Έ success βœ…

botify avatar Sep 09 '21 21:09 botify

Paid πŸ‘

trjExpensify avatar Sep 16 '21 14:09 trjExpensify

@trjExpensify Received thanks.

PrashantMangukiya avatar Sep 16 '21 14:09 PrashantMangukiya