PLT-7 fixing error bar msg
Этот коммит содержится в:
@@ -3,6 +3,17 @@
|
||||
|
||||
import ErrorStore from '../stores/error_store.jsx';
|
||||
|
||||
var intlShape = ReactIntl.intlShape;
|
||||
var injectIntl = ReactIntl.injectIntl;
|
||||
var defineMessages = ReactIntl.defineMessages;
|
||||
|
||||
const messages = defineMessages({
|
||||
previewMode: {
|
||||
id: 'error_bar.preview_mode',
|
||||
defaultMessage: 'Preview Mode: Email notifications have not been configured'
|
||||
}
|
||||
});
|
||||
|
||||
export default class ErrorBar extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
@@ -13,6 +24,12 @@ export default class ErrorBar extends React.Component {
|
||||
this.state = ErrorStore.getLastError();
|
||||
}
|
||||
|
||||
static propTypes() {
|
||||
return {
|
||||
intl: intlShape.isRequired
|
||||
};
|
||||
}
|
||||
|
||||
isValidError(s) {
|
||||
if (!s) {
|
||||
return false;
|
||||
@@ -41,6 +58,14 @@ export default class ErrorBar extends React.Component {
|
||||
return false;
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const {formatMessage} = this.props.intl;
|
||||
if (global.window.mm_config.SendEmailNotifications === 'false') {
|
||||
ErrorStore.storeLastError({message: formatMessage(messages.previewMode)});
|
||||
this.onErrorChange();
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
ErrorStore.addChangeListener(this.onErrorChange);
|
||||
}
|
||||
@@ -86,3 +111,5 @@ export default class ErrorBar extends React.Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default injectIntl(ErrorBar);
|
||||
|
||||
@@ -113,9 +113,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();
|
||||
}
|
||||
};
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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!)"
|
||||
}
|
||||
@@ -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 }};
|
||||
|
||||
Ссылка в новой задаче
Block a user