mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
MM-50952 RFQA can save notifications
This commit is contained in:
@@ -2497,11 +2497,7 @@ const AdminDefinition = {
|
||||
it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.NOTIFICATIONS)),
|
||||
it.stateIsFalse('EmailSettings.SendEmailNotifications'),
|
||||
),
|
||||
|
||||
// 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'),
|
||||
validate: validators.isRequired(t('admin.environment.notifications.feedbackEmail.required'), '"Notification From Address" is required'),
|
||||
},
|
||||
{
|
||||
type: Constants.SettingsTypes.TYPE_TEXT,
|
||||
|
||||
@@ -1126,6 +1126,15 @@ export default class SchemaAdminSettings extends React.PureComponent {
|
||||
}
|
||||
|
||||
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]);
|
||||
if (!result.isValid()) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user