MM-50952 RFQA can save notifications
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5267dfdcc6
Коммит
c78d6d47ac
@@ -2497,11 +2497,7 @@ const AdminDefinition = {
|
|||||||
it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.NOTIFICATIONS)),
|
it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.NOTIFICATIONS)),
|
||||||
it.stateIsFalse('EmailSettings.SendEmailNotifications'),
|
it.stateIsFalse('EmailSettings.SendEmailNotifications'),
|
||||||
),
|
),
|
||||||
|
validate: validators.isRequired(t('admin.environment.notifications.feedbackEmail.required'), '"Notification From Address" is required'),
|
||||||
// MM-50952
|
|
||||||
// If the setting is hidden, then it is not being set in state so there is
|
|
||||||
// nothing to validate, and validation would fail anyways and prevent saving
|
|
||||||
validate: it.configIsFalse('ExperimentalSettings', 'RestrictSystemAdmin') && validators.isRequired(t('admin.environment.notifications.feedbackEmail.required'), '"Notification From Address" is required'),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: Constants.SettingsTypes.TYPE_TEXT,
|
type: Constants.SettingsTypes.TYPE_TEXT,
|
||||||
|
|||||||
@@ -1126,6 +1126,15 @@ export default class SchemaAdminSettings extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (setting.validate) {
|
if (setting.validate) {
|
||||||
|
if (setting.isHidden?.(this.props.config)) {
|
||||||
|
// MM-50952
|
||||||
|
// If the setting is hidden, then it is not being set in state so there is
|
||||||
|
// nothing to validate, and validation would fail anyways and prevent saving
|
||||||
|
// In practice, this only happens in custom cloud setup environments like RFQA
|
||||||
|
// where it sets things in the config file directly instead of in the environment
|
||||||
|
// (like cloud Mattermost does)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const result = setting.validate(this.state[setting.key]);
|
const result = setting.validate(this.state[setting.key]);
|
||||||
if (!result.isValid()) {
|
if (!result.isValid()) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user