Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

[ICU-648] Fix download tooltip #692

Merged
merged 4 commits into from
Feb 6, 2018
Merged

[ICU-648] Fix download tooltip #692

merged 4 commits into from
Feb 6, 2018

Conversation

saturninoabril
Copy link
Member

@saturninoabril saturninoabril commented Jan 31, 2018

Summary

Move tooltip from filename to download icon

Others:

  • Refactor FileAttachment component
  • Add FileThumbnail component

@esethna Could you please check if the tooltip is positioned as you would expect? Thanks!

screen shot 2018-02-01 at 6 15 33 am

Update (Feb 2):
screen shot 2018-02-02 at 7 45 48 pm
screen shot 2018-02-02 at 7 45 11 pm

Ticket Link

This PR addressed item 1 of:

Checklist

  • Ran make check-style to check for style errors (required for all pull requests)
  • Ran make test to ensure unit and component tests passed
  • Added or updated unit tests (required for all new features)
  • Has UI changes

@saturninoabril saturninoabril added 1: PM Review Requires review by a product manager 2: Dev Review Requires review by a core commiter labels Jan 31, 2018
@saturninoabril saturninoabril added this to the v4.7.0 milestone Jan 31, 2018
iconClass={'post-image__download'}
index={index}
>
<DownloadIcon/>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual fix. Others are just refactor.

@esethna esethna added the Setup Old Test Server Triggers the creation of a test server label Feb 2, 2018
Copy link
Contributor

@esethna esethna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saturninoabril can we please,

  1. Move the tooltip to just above the download button. It looks too far away/disconnected right now. @asaadmahmood might be able to help if necessary.
  2. Change the text to just "Download" (without the file name)

@esethna esethna removed the Setup Old Test Server Triggers the creation of a test server label Feb 2, 2018
@mattermost mattermost deleted a comment from mattermod Feb 2, 2018
@mattermost mattermost deleted a comment from mattermod Feb 2, 2018
@saturninoabril
Copy link
Member Author

@esethna Thanks for the review. I have addressed both 1 & 2. See screenshots below.

screen shot 2018-02-02 at 7 45 48 pm
screen shot 2018-02-02 at 7 45 11 pm

@@ -40,7 +47,7 @@ export default class FileAttachment extends React.PureComponent {
super(props);

this.state = {
loaded: Utils.getFileType(props.fileInfo.extension) !== 'image'
loaded: getFileType(props.fileInfo.extension) !== 'image'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not part of this PR, I know, but it drives me crazy that getFileType doesn't return constant-defined strings that could be compared against. Would be great if someone refactored that...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense, I'll submit separate PR to refactor that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR submitted #701

@esethna esethna removed the 1: PM Review Requires review by a product manager label Feb 5, 2018
Copy link
Contributor

@esethna esethna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Saturn!

@saturninoabril
Copy link
Member Author

Rebased to latest and fixed merge conflicts

/**
* File URL
*/
fileURL: PropTypes.string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these props really not required? Just verifying as per last dev meeting.


export function trimFilename(filename) {
let trimmedFilename = filename;
if (filename.length > 35) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we define this magic 35 somewhere?

@saturninoabril saturninoabril added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels Feb 6, 2018
@saturninoabril saturninoabril assigned GoldUniform and unassigned esethna Feb 6, 2018
@GoldUniform GoldUniform merged commit ad3dd8f into mattermost:master Feb 6, 2018
@GoldUniform GoldUniform removed the 4: Reviews Complete All reviewers have approved the pull request label Feb 6, 2018
@lindalumitchell lindalumitchell added the Tests/Not Needed Does not require new release tests label Feb 6, 2018
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation Tests/Not Needed Does not require new release tests
Projects
None yet
7 participants