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

Show download link and icon based on contentUrl #2868

Merged
merged 10 commits into from
Feb 6, 2020

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Jan 29, 2020

Fixes #2864.

Changelog Entry

Fixed

  • Fixes #2864. Replaced DownloadAttachment and UploadAttachment with FileAttachment, which show download link and icon if the attachment contains contentUrl, by @compulim in PR #XXX

Description

Today, we assume the channel do not allow end-user to download the file they uploaded. This assumption is not valid for channels other than Direct Line.

We should use activity.attachments[].contentUrl to determine whether the file can be downloaded or not.

Specific Changes

  • For incoming activities, if the attachment should not be downloaded, empty out contentUrl
    • If the URL is pointing to Direct Line dummy placeholder, it should not be downloadable
    • If the URL protocol is blob:, it should not be downloadable
  • Replace <DownloadAttachment> and <UploadAttachment> with <FileAttachment>, which will determine if the download link and icon should be shown or not, based on contentUrl is truthy or not
  • Expose <FileContent> similar to other components, e.g. <AudioContent>, <TextContent>, <VideoContent>, etc

  • Testing Added

@compulim compulim changed the title Show download link and icon based on contentUrl [DRAFT] Show download link and icon based on contentUrl Jan 29, 2020
@compulim compulim marked this pull request as ready for review January 30, 2020 03:16
@compulim compulim changed the title [DRAFT] Show download link and icon based on contentUrl Show download link and icon based on contentUrl Jan 30, 2020
CHANGELOG.md Outdated Show resolved Hide resolved
@compulim
Copy link
Contributor Author

compulim commented Feb 6, 2020

Thanks @tdurnford for reviewing this PR.

@compulim compulim merged commit 17f4069 into microsoft:master Feb 6, 2020
@compulim compulim deleted the feat-file-content branch February 6, 2020 10:48
@compulim compulim mentioned this pull request Mar 5, 2020
40 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[IC3] Activity.attachments[].contentUrl should be used for allowing download attachments or not
2 participants