Merge pull request #1985 from mattermost/PLT-7-client-infra5
PLT-7 fixing error bar msg
Этот коммит содержится в:
@@ -13,6 +13,12 @@ export default class ErrorBar extends React.Component {
|
|||||||
this.state = ErrorStore.getLastError();
|
this.state = ErrorStore.getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static propTypes() {
|
||||||
|
return {
|
||||||
|
intl: ReactIntl.intlShape.isRequired
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
isValidError(s) {
|
isValidError(s) {
|
||||||
if (!s) {
|
if (!s) {
|
||||||
return false;
|
return false;
|
||||||
@@ -41,6 +47,18 @@ export default class ErrorBar extends React.Component {
|
|||||||
return false;
|
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() {
|
componentDidMount() {
|
||||||
ErrorStore.addChangeListener(this.onErrorChange);
|
ErrorStore.addChangeListener(this.onErrorChange);
|
||||||
}
|
}
|
||||||
@@ -86,3 +104,5 @@ export default class ErrorBar extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ReactIntl.injectIntl(ErrorBar);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import ChannelView from '../components/channel_view.jsx';
|
import ChannelView from '../components/channel_view.jsx';
|
||||||
import ChannelLoader from '../components/channel_loader.jsx';
|
import ChannelLoader from '../components/channel_loader.jsx';
|
||||||
import ErrorBar from '../components/error_bar.jsx';
|
import ErrorBar from '../components/error_bar.jsx';
|
||||||
import ErrorStore from '../stores/error_store.jsx';
|
|
||||||
import * as Client from '../utils/client.jsx';
|
import * as Client from '../utils/client.jsx';
|
||||||
|
|
||||||
import GetTeamInviteLinkModal from '../components/get_team_invite_link_modal.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} />,
|
<Root map={props} />,
|
||||||
document.getElementById('channel_view')
|
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.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.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>
|
<style id="antiClickjack">body{display:none !important;}</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
ReactIntl.addLocaleData(ReactIntlLocaleData.en);
|
if ('ReactIntl' in window && 'ReactIntlLocaleData' in window) {
|
||||||
ReactIntl.addLocaleData(ReactIntlLocaleData.es);
|
Object.keys(ReactIntlLocaleData).forEach((lang) => {
|
||||||
|
ReactIntl.addLocaleData(ReactIntlLocaleData[lang]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
window.mm_config = {{ .ClientCfg }};
|
window.mm_config = {{ .ClientCfg }};
|
||||||
window.mm_license = {{ .ClientLicense }};
|
window.mm_license = {{ .ClientLicense }};
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user