mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-52835]: Migrate "components/admin_console/settings_group.jsx" and tests to Typescript (#23563)
This commit is contained in:
parent
8690da4b0d
commit
ce7578615c
@ -15,10 +15,7 @@ exports[`components/BleveSettings should match snapshot, disabled 1`] = `
|
||||
id="admin.bleve.title"
|
||||
/>
|
||||
</AdminHeader>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
show={true}
|
||||
>
|
||||
<SettingsGroup>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
falseText={
|
||||
@ -277,10 +274,7 @@ exports[`components/BleveSettings should match snapshot, enabled 1`] = `
|
||||
id="admin.bleve.title"
|
||||
/>
|
||||
</AdminHeader>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
show={true}
|
||||
>
|
||||
<SettingsGroup>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
falseText={
|
||||
|
@ -15,10 +15,7 @@ exports[`components/ClusterSettings should match snapshot, compression disabled
|
||||
id="admin.advance.cluster"
|
||||
/>
|
||||
</AdminHeader>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
show={true}
|
||||
>
|
||||
<SettingsGroup>
|
||||
<ClusterTableContainer />
|
||||
<div
|
||||
className="banner"
|
||||
@ -291,10 +288,7 @@ exports[`components/ClusterSettings should match snapshot, compression enabled 1
|
||||
id="admin.advance.cluster"
|
||||
/>
|
||||
</AdminHeader>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
show={true}
|
||||
>
|
||||
<SettingsGroup>
|
||||
<ClusterTableContainer />
|
||||
<div
|
||||
className="banner"
|
||||
@ -567,10 +561,7 @@ exports[`components/ClusterSettings should match snapshot, encryption disabled 1
|
||||
id="admin.advance.cluster"
|
||||
/>
|
||||
</AdminHeader>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
show={true}
|
||||
>
|
||||
<SettingsGroup>
|
||||
<ClusterTableContainer />
|
||||
<div
|
||||
className="banner"
|
||||
@ -843,10 +834,7 @@ exports[`components/ClusterSettings should match snapshot, encryption enabled 1`
|
||||
id="admin.advance.cluster"
|
||||
/>
|
||||
</AdminHeader>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
show={true}
|
||||
>
|
||||
<SettingsGroup>
|
||||
<ClusterTableContainer />
|
||||
<div
|
||||
className="banner"
|
||||
|
@ -15,10 +15,7 @@ exports[`components/DatabaseSettings should match snapshot 1`] = `
|
||||
id="admin.database.title"
|
||||
/>
|
||||
</AdminHeader>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
show={true}
|
||||
>
|
||||
<SettingsGroup>
|
||||
<div
|
||||
className="banner"
|
||||
>
|
||||
|
@ -15,10 +15,7 @@ exports[`components/ElasticSearchSettings should match snapshot, disabled 1`] =
|
||||
id="admin.elasticsearch.title"
|
||||
/>
|
||||
</AdminHeader>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
show={true}
|
||||
>
|
||||
<SettingsGroup>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
falseText={
|
||||
@ -486,10 +483,7 @@ exports[`components/ElasticSearchSettings should match snapshot, enabled 1`] = `
|
||||
id="admin.elasticsearch.title"
|
||||
/>
|
||||
</AdminHeader>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
show={true}
|
||||
>
|
||||
<SettingsGroup>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
falseText={
|
||||
|
@ -15,10 +15,7 @@ exports[`components/MessageExportSettings should match snapshot, disabled, actia
|
||||
id="admin.complianceExport.title"
|
||||
/>
|
||||
</AdminHeader>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
show={true}
|
||||
>
|
||||
<SettingsGroup>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
falseText={
|
||||
@ -192,10 +189,7 @@ exports[`components/MessageExportSettings should match snapshot, disabled, globa
|
||||
id="admin.complianceExport.title"
|
||||
/>
|
||||
</AdminHeader>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
show={true}
|
||||
>
|
||||
<SettingsGroup>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
falseText={
|
||||
@ -294,9 +288,7 @@ exports[`components/MessageExportSettings should match snapshot, disabled, globa
|
||||
}
|
||||
/>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
id="globalRelaySettings"
|
||||
show={true}
|
||||
>
|
||||
<RadioSetting
|
||||
disabled={true}
|
||||
@ -466,10 +458,7 @@ exports[`components/MessageExportSettings should match snapshot, enabled, actian
|
||||
id="admin.complianceExport.title"
|
||||
/>
|
||||
</AdminHeader>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
show={true}
|
||||
>
|
||||
<SettingsGroup>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
falseText={
|
||||
@ -643,10 +632,7 @@ exports[`components/MessageExportSettings should match snapshot, enabled, global
|
||||
id="admin.complianceExport.title"
|
||||
/>
|
||||
</AdminHeader>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
show={true}
|
||||
>
|
||||
<SettingsGroup>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
falseText={
|
||||
@ -745,9 +731,7 @@ exports[`components/MessageExportSettings should match snapshot, enabled, global
|
||||
}
|
||||
/>
|
||||
<SettingsGroup
|
||||
container={true}
|
||||
id="globalRelaySettings"
|
||||
show={true}
|
||||
>
|
||||
<RadioSetting
|
||||
disabled={false}
|
||||
|
@ -63,7 +63,6 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
|
||||
>
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
show={true}
|
||||
>
|
||||
<AdminTextSetting
|
||||
disabled={false}
|
||||
|
@ -15,7 +15,7 @@ import BooleanSetting from './boolean_setting';
|
||||
import TextSetting from './text_setting';
|
||||
import JobsTable from './jobs';
|
||||
import RequestButton from './request_button/request_button';
|
||||
import SettingsGroup from './settings_group.jsx';
|
||||
import SettingsGroup from './settings_group';
|
||||
|
||||
export default class BleveSettings extends AdminSettings {
|
||||
getConfigFromState = (config) => {
|
||||
|
@ -15,7 +15,7 @@ import ExternalLink from 'components/external_link';
|
||||
import AdminSettings from './admin_settings';
|
||||
import BooleanSetting from './boolean_setting';
|
||||
import ClusterTableContainer from './cluster_table_container.jsx';
|
||||
import SettingsGroup from './settings_group.jsx';
|
||||
import SettingsGroup from './settings_group';
|
||||
import TextSetting from './text_setting';
|
||||
|
||||
export default class ClusterSettings extends AdminSettings {
|
||||
|
@ -20,7 +20,6 @@ exports[`components/admin_console/CustomPluginSettings should match snapshot wit
|
||||
>
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
show={true}
|
||||
>
|
||||
<div
|
||||
className="banner"
|
||||
@ -332,7 +331,6 @@ exports[`components/admin_console/CustomPluginSettings should match snapshot wit
|
||||
>
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
show={true}
|
||||
>
|
||||
<div
|
||||
className="banner"
|
||||
|
@ -8,7 +8,7 @@ import {AdminConfig, ClientLicense} from '@mattermost/types/config';
|
||||
import {TermsOfService} from '@mattermost/types/terms_of_service';
|
||||
|
||||
import AdminSettings, {BaseProps, BaseState} from 'components/admin_console/admin_settings';
|
||||
import SettingsGroup from 'components/admin_console/settings_group.jsx';
|
||||
import SettingsGroup from 'components/admin_console/settings_group';
|
||||
import BooleanSetting from 'components/admin_console/boolean_setting';
|
||||
import TextSetting from 'components/admin_console/text_setting';
|
||||
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
|
||||
|
@ -13,7 +13,7 @@ import ExternalLink from 'components/external_link';
|
||||
import AdminSettings from './admin_settings';
|
||||
import BooleanSetting from './boolean_setting';
|
||||
import RequestButton from './request_button/request_button';
|
||||
import SettingsGroup from './settings_group.jsx';
|
||||
import SettingsGroup from './settings_group';
|
||||
import TextSetting from './text_setting';
|
||||
|
||||
import MigrationsTable from './database';
|
||||
|
@ -15,7 +15,7 @@ import AdminSettings from './admin_settings';
|
||||
import BooleanSetting from './boolean_setting';
|
||||
import JobsTable from './jobs';
|
||||
import RequestButton from './request_button/request_button';
|
||||
import SettingsGroup from './settings_group.jsx';
|
||||
import SettingsGroup from './settings_group';
|
||||
import TextSetting from './text_setting';
|
||||
|
||||
export default class ElasticsearchSettings extends AdminSettings {
|
||||
|
@ -16,7 +16,7 @@ import AdminSettings from './admin_settings';
|
||||
import BooleanSetting from './boolean_setting';
|
||||
import DropdownSetting from './dropdown_setting.jsx';
|
||||
import JobsTable from './jobs';
|
||||
import SettingsGroup from './settings_group.jsx';
|
||||
import SettingsGroup from './settings_group';
|
||||
import TextSetting from './text_setting';
|
||||
import RadioSetting from './radio_setting';
|
||||
|
||||
|
@ -10,7 +10,7 @@ import {t} from 'utils/i18n';
|
||||
|
||||
import AdminSettings from './admin_settings';
|
||||
import Setting from './setting';
|
||||
import SettingsGroup from './settings_group.jsx';
|
||||
import SettingsGroup from './settings_group';
|
||||
import TextSetting from './text_setting';
|
||||
|
||||
export default class PasswordSettings extends AdminSettings {
|
||||
|
@ -24,7 +24,6 @@ exports[`components/PluginManagement should match snapshot 1`] = `
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
@ -374,7 +373,6 @@ exports[`components/PluginManagement should match snapshot when \`Enable Marketp
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
@ -724,7 +722,6 @@ exports[`components/PluginManagement should match snapshot when \`Enable Plugins
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<div
|
||||
className="form-group"
|
||||
@ -821,7 +818,6 @@ exports[`components/PluginManagement should match snapshot when \`Enable Remote
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
@ -1171,7 +1167,6 @@ exports[`components/PluginManagement should match snapshot when \`Require Signat
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
@ -1523,7 +1518,6 @@ exports[`components/PluginManagement should match snapshot, No installed plugins
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
@ -1877,7 +1871,6 @@ exports[`components/PluginManagement should match snapshot, allow insecure URL e
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
@ -2227,7 +2220,6 @@ exports[`components/PluginManagement should match snapshot, disabled 1`] = `
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
@ -2554,7 +2546,6 @@ exports[`components/PluginManagement should match snapshot, text entered into th
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
@ -2904,7 +2895,6 @@ exports[`components/PluginManagement should match snapshot, upload disabled 1`]
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
@ -3261,7 +3251,6 @@ exports[`components/PluginManagement should match snapshot, with installed plugi
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
@ -3674,7 +3663,6 @@ exports[`components/PluginManagement should match snapshot, with installed plugi
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
@ -4055,7 +4043,6 @@ exports[`components/PluginManagement should match snapshot, with installed plugi
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
@ -4436,7 +4423,6 @@ exports[`components/PluginManagement should match snapshot, with installed plugi
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
@ -4817,7 +4803,6 @@ exports[`components/PluginManagement should match snapshot, with installed plugi
|
||||
<SettingsGroup
|
||||
container={false}
|
||||
id="PluginSettings"
|
||||
show={true}
|
||||
>
|
||||
<BooleanSetting
|
||||
disabled={false}
|
||||
|
@ -17,7 +17,7 @@ import ConfirmModal from 'components/confirm_modal';
|
||||
|
||||
import AdminSettings, {BaseProps, BaseState} from '../admin_settings';
|
||||
import BooleanSetting from '../boolean_setting';
|
||||
import SettingsGroup from '../settings_group.jsx';
|
||||
import SettingsGroup from '../settings_group';
|
||||
import TextSetting from '../text_setting';
|
||||
import {appsPluginID} from 'utils/apps';
|
||||
import ExternalLink from 'components/external_link';
|
||||
|
@ -11,7 +11,7 @@ import * as Utils from 'utils/utils';
|
||||
|
||||
import AdminSettings from './admin_settings';
|
||||
import DropdownSetting from './dropdown_setting.jsx';
|
||||
import SettingsGroup from './settings_group.jsx';
|
||||
import SettingsGroup from './settings_group';
|
||||
import TextSetting from './text_setting';
|
||||
|
||||
const PUSH_NOTIFICATIONS_OFF = 'off';
|
||||
|
@ -22,7 +22,7 @@ import RadioSetting from 'components/admin_console/radio_setting';
|
||||
import ColorSetting from 'components/admin_console/color_setting';
|
||||
import GeneratedSetting from 'components/admin_console/generated_setting';
|
||||
import UserAutocompleteSetting from 'components/admin_console/user_autocomplete_setting';
|
||||
import SettingsGroup from 'components/admin_console/settings_group.jsx';
|
||||
import SettingsGroup from 'components/admin_console/settings_group';
|
||||
import JobsTable from 'components/admin_console/jobs';
|
||||
import FileUploadSetting from 'components/admin_console/file_upload_setting.jsx';
|
||||
import RemoveFileSetting from 'components/admin_console/remove_file_setting';
|
||||
|
@ -9,7 +9,7 @@ import * as Utils from 'utils/utils';
|
||||
|
||||
import AdminSettings from './admin_settings';
|
||||
import BooleanSetting from './boolean_setting';
|
||||
import SettingsGroup from './settings_group.jsx';
|
||||
import SettingsGroup from './settings_group';
|
||||
import TextSetting from './text_setting';
|
||||
|
||||
export default class SessionLengthSettings extends AdminSettings {
|
||||
|
@ -1,65 +1,48 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
|
||||
export default class SettingsGroup extends React.PureComponent {
|
||||
static get propTypes() {
|
||||
return {
|
||||
show: PropTypes.bool.isRequired,
|
||||
header: PropTypes.node,
|
||||
title: PropTypes.node,
|
||||
subtitle: PropTypes.node,
|
||||
children: PropTypes.node,
|
||||
container: PropTypes.bool,
|
||||
};
|
||||
}
|
||||
type Props = {
|
||||
id?: string;
|
||||
show?: boolean;
|
||||
header?: React.ReactNode;
|
||||
title?: React.ReactNode;
|
||||
subtitle?: React.ReactNode;
|
||||
children?: React.ReactNode;
|
||||
container?: boolean;
|
||||
};
|
||||
|
||||
static get defaultProps() {
|
||||
return {
|
||||
show: true,
|
||||
container: true,
|
||||
};
|
||||
}
|
||||
export default class SettingsGroup extends React.PureComponent<Props> {
|
||||
render(): React.ReactNode {
|
||||
const {show = true, container = true} = this.props;
|
||||
|
||||
render() {
|
||||
let wrapperClass = '';
|
||||
let contentClass = '';
|
||||
|
||||
if (!this.props.show) {
|
||||
if (!show) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (this.props.container) {
|
||||
if (container) {
|
||||
wrapperClass = 'admin-console__wrapper';
|
||||
contentClass = 'admin-console__content';
|
||||
}
|
||||
|
||||
let header = null;
|
||||
if (this.props.header) {
|
||||
header = (
|
||||
<h4>
|
||||
{this.props.header}
|
||||
</h4>
|
||||
);
|
||||
header = <h4>{this.props.header}</h4>;
|
||||
}
|
||||
|
||||
let title = null;
|
||||
if (!this.props.header && this.props.title) {
|
||||
title = (
|
||||
<div className={'section-title'}>
|
||||
{this.props.title}
|
||||
</div>
|
||||
);
|
||||
title = <div className={'section-title'}>{this.props.title}</div>;
|
||||
}
|
||||
|
||||
let subtitle = null;
|
||||
if (!this.props.header && this.props.subtitle) {
|
||||
subtitle = (
|
||||
<div className={'section-subtitle'}>
|
||||
{this.props.subtitle}
|
||||
</div>
|
||||
<div className={'section-subtitle'}>{this.props.subtitle}</div>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user