diff options
author | Corey Hulen <corey@hulen.com> | 2016-01-25 20:59:01 -0500 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-01-25 20:59:01 -0500 |
commit | c44048e5f95b4be43443761c2d7645fee456897c (patch) | |
tree | 2694d508473fa5c66a841743b9e92fb0b2155e58 | |
parent | 2a29232185ed169a9e63e479b7eb67f289be7b68 (diff) | |
parent | 64247fd18c915bda5a2c00e61f0880f153e76235 (diff) | |
download | chat-c44048e5f95b4be43443761c2d7645fee456897c.tar.gz chat-c44048e5f95b4be43443761c2d7645fee456897c.tar.bz2 chat-c44048e5f95b4be43443761c2d7645fee456897c.zip |
Merge pull request #1985 from mattermost/PLT-7-client-infra5
PLT-7 fixing error bar msg
-rw-r--r-- | web/react/components/error_bar.jsx | 20 | ||||
-rw-r--r-- | web/react/pages/channel.jsx | 6 | ||||
-rw-r--r-- | web/static/i18n/en.json | 3 | ||||
-rw-r--r-- | web/static/i18n/es.json | 3 | ||||
-rw-r--r-- | web/templates/head.html | 7 |
5 files changed, 29 insertions, 10 deletions
diff --git a/web/react/components/error_bar.jsx b/web/react/components/error_bar.jsx index 921e8afe1..e93545c25 100644 --- a/web/react/components/error_bar.jsx +++ b/web/react/components/error_bar.jsx @@ -13,6 +13,12 @@ export default class ErrorBar extends React.Component { this.state = ErrorStore.getLastError(); } + static propTypes() { + return { + intl: ReactIntl.intlShape.isRequired + }; + } + isValidError(s) { if (!s) { return false; @@ -41,6 +47,18 @@ export default class ErrorBar extends React.Component { return false; } + componentWillMount() { + if (global.window.mm_config.SendEmailNotifications === 'false') { + ErrorStore.storeLastError({message: this.props.intl.formatMessage( + { + id: 'error_bar.preview_mode', + defaultMessage: 'Preview Mode: Email notifications have not been configured' + } + )}); + this.onErrorChange(); + } + } + componentDidMount() { ErrorStore.addChangeListener(this.onErrorChange); } @@ -86,3 +104,5 @@ export default class ErrorBar extends React.Component { ); } } + +export default ReactIntl.injectIntl(ErrorBar); diff --git a/web/react/pages/channel.jsx b/web/react/pages/channel.jsx index 37c59b75f..1e28dab8b 100644 --- a/web/react/pages/channel.jsx +++ b/web/react/pages/channel.jsx @@ -4,7 +4,6 @@ import ChannelView from '../components/channel_view.jsx'; import ChannelLoader from '../components/channel_loader.jsx'; import ErrorBar from '../components/error_bar.jsx'; -import ErrorStore from '../stores/error_store.jsx'; import * as Client from '../utils/client.jsx'; import GetTeamInviteLinkModal from '../components/get_team_invite_link_modal.jsx'; @@ -113,9 +112,4 @@ global.window.setup_channel_page = function setup(props, team, channel) { <Root map={props} />, document.getElementById('channel_view') ); - - if (global.window.mm_config.SendEmailNotifications === 'false') { - ErrorStore.storeLastError({message: 'Preview Mode: Email notifications have not been configured'}); - ErrorStore.emitChange(); - } };
\ No newline at end of file diff --git a/web/static/i18n/en.json b/web/static/i18n/en.json index 038b1342d..cb955ee6b 100644 --- a/web/static/i18n/en.json +++ b/web/static/i18n/en.json @@ -1,4 +1,5 @@ { "login.find_teams": "Find your other teams", - "login.forgot_password": "I forgot my password" + "login.forgot_password": "I forgot my password", + "error_bar.preview_mode": "Preview Mode: Email notifications have not been configured" }
\ No newline at end of file diff --git a/web/static/i18n/es.json b/web/static/i18n/es.json index b849489cb..ade5f585e 100644 --- a/web/static/i18n/es.json +++ b/web/static/i18n/es.json @@ -1,4 +1,5 @@ { "login.find_teams": "Find your other teams (spanish!)", - "login.forgot_password": "I forgot my password (spanish!)" + "login.forgot_password": "I forgot my password (spanish!)", + "error_bar.preview_mode": "Preview Mode: Email notifications have not been configured (spanish!)" }
\ No newline at end of file diff --git a/web/templates/head.html b/web/templates/head.html index 4060d2410..845cc76e7 100644 --- a/web/templates/head.html +++ b/web/templates/head.html @@ -62,8 +62,11 @@ <style id="antiClickjack">body{display:none !important;}</style> <script> - ReactIntl.addLocaleData(ReactIntlLocaleData.en); - ReactIntl.addLocaleData(ReactIntlLocaleData.es); + if ('ReactIntl' in window && 'ReactIntlLocaleData' in window) { + Object.keys(ReactIntlLocaleData).forEach((lang) => { + ReactIntl.addLocaleData(ReactIntlLocaleData[lang]); + }); + } window.mm_config = {{ .ClientCfg }}; window.mm_license = {{ .ClientLicense }}; |