PLT-6283 Hide Preview Mode error bar after enabling email notifications (#6180)

Этот коммит содержится в:
Harrison Healey
2017-04-25 12:39:08 -04:00
коммит произвёл Corey Hulen
родитель 8d1a132eda
Коммит 7fc663ca75
5 изменённых файлов: 63 добавлений и 34 удалений

Просмотреть файл

@@ -6,6 +6,7 @@ import {FormattedMessage} from 'react-intl';
import ErrorStore from 'stores/error_store.jsx';
import {ErrorBarTypes} from 'utils/constants.jsx';
import * as Utils from 'utils/utils.jsx';
import AdminSettings from './admin_settings.jsx';
@@ -67,10 +68,8 @@ export default class ConfigurationSettings extends AdminSettings {
}
handleSaved(newConfig) {
const lastError = ErrorStore.getLastError();
if (lastError && lastError.message === 'error_bar.site_url' && newConfig.ServiceSettings.SiteURL) {
ErrorStore.clearLastError(true);
if (newConfig.ServiceSettings.SiteURL) {
ErrorStore.clearError(ErrorBarTypes.SITE_URL);
}
}

Просмотреть файл

@@ -3,6 +3,9 @@
import React from 'react';
import ErrorStore from 'stores/error_store.jsx';
import {ErrorBarTypes} from 'utils/constants.jsx';
import * as Utils from 'utils/utils.jsx';
import AdminSettings from './admin_settings.jsx';
@@ -19,6 +22,8 @@ export default class EmailSettings extends AdminSettings {
this.getConfigFromState = this.getConfigFromState.bind(this);
this.handleSaved = this.handleSaved.bind(this);
this.renderSettings = this.renderSettings.bind(this);
}
@@ -39,6 +44,12 @@ export default class EmailSettings extends AdminSettings {
return config;
}
handleSaved(newConfig) {
if (newConfig.EmailSettings.SendEmailNotifications) {
ErrorStore.clearError(ErrorBarTypes.PREVIEW_MODE);
}
}
getStateFromConfig(config) {
return {
sendEmailNotifications: config.EmailSettings.SendEmailNotifications,