From 848a8663ed7f856aee3f801a62b82e87b20de0ea Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Fri, 3 Jun 2016 00:34:47 +0500 Subject: Multiple UI improvements (#3220) * Multiple UI improvements * Pushing time fix * Fixing absolute time stamps on IOS --- .../post_view/components/post_attachment.jsx | 16 ++++----- .../components/post_view/components/post_body.jsx | 1 + .../components/post_body_additional_content.jsx | 23 +++++++------ webapp/components/rhs_root_post.jsx | 12 ++++++- webapp/components/sidebar.jsx | 4 +-- webapp/components/time_since.jsx | 38 ++-------------------- .../user_settings/user_settings_display.jsx | 4 +-- 7 files changed, 40 insertions(+), 58 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/post_view/components/post_attachment.jsx b/webapp/components/post_view/components/post_attachment.jsx index 8b5ff91f2..4442b735a 100644 --- a/webapp/components/post_view/components/post_attachment.jsx +++ b/webapp/components/post_view/components/post_attachment.jsx @@ -9,11 +9,11 @@ import {intlShape, injectIntl, defineMessages} from 'react-intl'; const holders = defineMessages({ collapse: { id: 'post_attachment.collapse', - defaultMessage: '▲ collapse text' + defaultMessage: 'Show less...' }, more: { id: 'post_attachment.more', - defaultMessage: '▼ read more' + defaultMessage: 'Show more...' } }); @@ -44,7 +44,7 @@ class PostAttachment extends React.Component { getInitState() { const shouldCollapse = this.shouldCollapse(); const text = TextFormatting.formatText(this.props.attachment.text || ''); - const uncollapsedText = text + (shouldCollapse ? `${this.props.intl.formatMessage(holders.collapse)}` : ''); + const uncollapsedText = text + (shouldCollapse ? `
${this.props.intl.formatMessage(holders.collapse)}
` : ''); const collapsedText = shouldCollapse ? this.getCollapsedText() : text; return { @@ -78,7 +78,7 @@ class PostAttachment extends React.Component { text = text.substr(0, 700); } - return TextFormatting.formatText(text) + `${this.props.intl.formatMessage(holders.more)}`; + return TextFormatting.formatText(text) + `
${this.props.intl.formatMessage(holders.more)}
`; } getFieldsTable() { @@ -99,7 +99,7 @@ class PostAttachment extends React.Component { if (rowPos === 2 || !(field.short === true) || lastWasLong) { fieldTables.push( @@ -122,7 +122,7 @@ class PostAttachment extends React.Component { } headerCols.push(
@@ -131,7 +131,7 @@ class PostAttachment extends React.Component { ); bodyCols.push( @@ -143,7 +143,7 @@ class PostAttachment extends React.Component { if (headerCols.length > 0) { // Flush last fields fieldTables.push( diff --git a/webapp/components/post_view/components/post_body.jsx b/webapp/components/post_view/components/post_body.jsx index 75ba30f23..eba62ad77 100644 --- a/webapp/components/post_view/components/post_body.jsx +++ b/webapp/components/post_view/components/post_body.jsx @@ -171,6 +171,7 @@ export default class PostBody extends React.Component { ); } diff --git a/webapp/components/post_view/components/post_body_additional_content.jsx b/webapp/components/post_view/components/post_body_additional_content.jsx index 89941f5b2..ea6e1cb49 100644 --- a/webapp/components/post_view/components/post_body_additional_content.jsx +++ b/webapp/components/post_view/components/post_body_additional_content.jsx @@ -97,16 +97,18 @@ export default class PostBodyAdditionalContent extends React.Component { ); } - for (let i = 0; i < Constants.IMAGE_TYPES.length; i++) { - const imageType = Constants.IMAGE_TYPES[i]; - const suffix = link.substring(link.length - (imageType.length + 1)); - if (suffix === '.' + imageType || suffix === '=' + imageType) { - return ( - - ); + if (!this.props.compactDisplay) { + for (let i = 0; i < Constants.IMAGE_TYPES.length; i++) { + const imageType = Constants.IMAGE_TYPES[i]; + const suffix = link.substring(link.length - (imageType.length + 1)); + if (suffix === '.' + imageType || suffix === '=' + imageType) { + return ( + + ); + } } } @@ -158,5 +160,6 @@ export default class PostBodyAdditionalContent extends React.Component { PostBodyAdditionalContent.propTypes = { post: React.PropTypes.object.isRequired, + compactDisplay: React.PropTypes.bool, message: React.PropTypes.element.isRequired }; diff --git a/webapp/components/rhs_root_post.jsx b/webapp/components/rhs_root_post.jsx index e6edcb86a..f7c9c9141 100644 --- a/webapp/components/rhs_root_post.jsx +++ b/webapp/components/rhs_root_post.jsx @@ -41,6 +41,7 @@ export default class RhsRootPost extends React.Component { render() { const post = this.props.post; const user = this.props.user; + const mattermostLogo = Constants.MATTERMOST_ICON_SVG; var isOwner = this.props.currentUser.id === post.user_id; var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser(); const isSystemMessage = post.type && post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX); @@ -201,7 +202,7 @@ export default class RhsRootPost extends React.Component { ); } - const profilePic = ( + let profilePic = ( ); + if (PostUtils.isSystemMessage(post)) { + profilePic = ( + + ); + } + const messageWrapper = (
diff --git a/webapp/components/time_since.jsx b/webapp/components/time_since.jsx index 50a0f7d04..2fbf73e31 100644 --- a/webapp/components/time_since.jsx +++ b/webapp/components/time_since.jsx @@ -4,10 +4,6 @@ import Constants from 'utils/constants.jsx'; import * as Utils from 'utils/utils.jsx'; -import {FormattedRelative, FormattedDate} from 'react-intl'; - -import {Tooltip, OverlayTrigger} from 'react-bootstrap'; - import React from 'react'; import PureRenderMixin from 'react-addons-pure-render-mixin'; @@ -26,38 +22,10 @@ export default class TimeSince extends React.Component { clearInterval(this.intervalId); } render() { - if (this.props.sameUser || this.props.compactDisplay) { - return ( - - ); - } - - const tooltip = ( - - - - ); - return ( - - - + ); } } diff --git a/webapp/components/user_settings/user_settings_display.jsx b/webapp/components/user_settings/user_settings_display.jsx index 16175d4de..a7015d403 100644 --- a/webapp/components/user_settings/user_settings_display.jsx +++ b/webapp/components/user_settings/user_settings_display.jsx @@ -386,7 +386,7 @@ export default class UserSettingsDisplay extends React.Component { />
@@ -439,7 +439,7 @@ export default class UserSettingsDisplay extends React.Component { describe = ( ); } else { -- cgit v1.2.3-1-g7c22