diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/channel_loader.jsx | 14 | ||||
-rw-r--r-- | web/react/components/posts_view.jsx | 10 | ||||
-rw-r--r-- | web/react/components/search_results.jsx | 15 | ||||
-rw-r--r-- | web/react/components/user_settings/manage_command_hooks.jsx | 4 | ||||
-rw-r--r-- | web/react/stores/socket_store.jsx | 14 |
5 files changed, 41 insertions, 16 deletions
diff --git a/web/react/components/channel_loader.jsx b/web/react/components/channel_loader.jsx index 174c8c4e1..2aa28d5c4 100644 --- a/web/react/components/channel_loader.jsx +++ b/web/react/components/channel_loader.jsx @@ -20,31 +20,31 @@ import {intlShape, injectIntl, defineMessages} from 'mm-intl'; const holders = defineMessages({ socketError: { id: 'channel_loader.socketError', - defaultMessage: 'Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port.' + defaultMessage: SocketStore.getDefaultTranslations().socketError }, someone: { id: 'channel_loader.someone', - defaultMessage: 'Someone' + defaultMessage: SocketStore.getDefaultTranslations().someone }, posted: { id: 'channel_loader.posted', - defaultMessage: 'Posted' + defaultMessage: SocketStore.getDefaultTranslations().posted }, uploadedImage: { id: 'channel_loader.uploadedImage', - defaultMessage: ' uploaded an image' + defaultMessage: SocketStore.getDefaultTranslations().uploadedImage }, uploadedFile: { id: 'channel_loader.uploadedFile', - defaultMessage: ' uploaded a file' + defaultMessage: SocketStore.getDefaultTranslations().uploadedFile }, something: { id: 'channel_loader.something', - defaultMessage: ' did something new' + defaultMessage: SocketStore.getDefaultTranslations().something }, wrote: { id: 'channel_loader.wrote', - defaultMessage: ' wrote: ' + defaultMessage: SocketStore.getDefaultTranslations().wrote } }); diff --git a/web/react/components/posts_view.jsx b/web/react/components/posts_view.jsx index ebe19abad..19ab7d5aa 100644 --- a/web/react/components/posts_view.jsx +++ b/web/react/components/posts_view.jsx @@ -535,7 +535,15 @@ function FloatingTimestamp({isScrolling, post}) { return <noscript />; } - const dateString = Utils.getDateForUnixTicks(post.create_at).toDateString(); + const dateString = ( + <FormattedDate + value={post.create_at} + weekday='short' + day='2-digit' + month='short' + year='numeric' + /> + ); let className = 'post-list__timestamp'; if (isScrolling) { diff --git a/web/react/components/search_results.jsx b/web/react/components/search_results.jsx index 4adc3afe0..12c066734 100644 --- a/web/react/components/search_results.jsx +++ b/web/react/components/search_results.jsx @@ -15,13 +15,16 @@ function getStateFromStores() { const results = SearchStore.getSearchResults(); const channels = new Map(); - const channelIds = results.order.map((postId) => results.posts[postId].channel_id); - for (const id of channelIds) { - if (channels.has(id)) { - continue; - } - channels.set(id, ChannelStore.get(id)); + if (results && results.order) { + const channelIds = results.order.map((postId) => results.posts[postId].channel_id); + for (const id of channelIds) { + if (channels.has(id)) { + continue; + } + + channels.set(id, ChannelStore.get(id)); + } } return { diff --git a/web/react/components/user_settings/manage_command_hooks.jsx b/web/react/components/user_settings/manage_command_hooks.jsx index f4009aeaa..bd0659a47 100644 --- a/web/react/components/user_settings/manage_command_hooks.jsx +++ b/web/react/components/user_settings/manage_command_hooks.jsx @@ -257,7 +257,7 @@ export default class ManageCommandCmds extends React.Component { let triggerDiv; if (cmd.trigger && cmd.trigger.length !== 0) { triggerDiv = ( - <div className='padding-top'> + <div className='padding-top x2'> <strong> <FormattedMessage id='user.settings.cmds.trigger' @@ -371,7 +371,7 @@ export default class ManageCommandCmds extends React.Component { /> </a> <a - className='webcmd__remove' + className='webhook__remove webcmd__remove' href='#' onClick={this.removeCmd.bind(this, cmd.id)} > diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx index e1b65fe14..424c7fe57 100644 --- a/web/react/stores/socket_store.jsx +++ b/web/react/stores/socket_store.jsx @@ -32,6 +32,8 @@ class SocketStoreClass extends EventEmitter { this.failCount = 0; + this.translations = this.getDefaultTranslations(); + this.initialize(); } @@ -174,6 +176,18 @@ class SocketStoreClass extends EventEmitter { this.translations = messages; } + getDefaultTranslations() { + return ({ + socketError: 'Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port.', + someone: 'Someone', + posted: 'Posted', + uploadedImage: ' uploaded an image', + uploadedFile: ' uploaded a file', + something: ' did something new', + wrote: ' wrote: ' + }); + } + close() { if (conn && conn.readyState === WebSocket.OPEN) { conn.close(); |