From ce7578615cf75bceaa9ae7886afddf6df7e8680e Mon Sep 17 00:00:00 2001 From: Tejas Karelia Date: Tue, 6 Jun 2023 00:24:31 -0700 Subject: [PATCH] [MM-52835]: Migrate "components/admin_console/settings_group.jsx" and tests to Typescript (#23563) --- .../bleve_settings.test.jsx.snap | 10 +--- .../cluster_settings.test.jsx.snap | 20 ++------ .../database_settings.test.jsx.snap | 5 +- .../elasticsearch_settings.test.jsx.snap | 10 +--- .../message_export_settings.test.jsx.snap | 24 ++------- .../schema_admin_settings.test.jsx.snap | 1 - .../admin_console/bleve_settings.jsx | 2 +- .../admin_console/cluster_settings.jsx | 2 +- .../custom_plugin_settings.test.tsx.snap | 2 - .../custom_terms_of_service_settings.tsx | 2 +- .../admin_console/database_settings.jsx | 2 +- .../admin_console/elasticsearch_settings.jsx | 2 +- .../admin_console/message_export_settings.jsx | 2 +- .../admin_console/password_settings.jsx | 2 +- .../plugin_management.test.tsx.snap | 15 ------ .../plugin_management/plugin_management.tsx | 2 +- .../admin_console/push_settings.jsx | 2 +- .../admin_console/schema_admin_settings.jsx | 2 +- .../admin_console/session_length_settings.jsx | 2 +- ...{settings_group.jsx => settings_group.tsx} | 51 +++++++------------ 20 files changed, 41 insertions(+), 119 deletions(-) rename webapp/channels/src/components/admin_console/{settings_group.jsx => settings_group.tsx} (54%) diff --git a/webapp/channels/src/components/admin_console/__snapshots__/bleve_settings.test.jsx.snap b/webapp/channels/src/components/admin_console/__snapshots__/bleve_settings.test.jsx.snap index 8a4ee8a51a..8e2237bae8 100644 --- a/webapp/channels/src/components/admin_console/__snapshots__/bleve_settings.test.jsx.snap +++ b/webapp/channels/src/components/admin_console/__snapshots__/bleve_settings.test.jsx.snap @@ -15,10 +15,7 @@ exports[`components/BleveSettings should match snapshot, disabled 1`] = ` id="admin.bleve.title" /> - + - + - +
- +
- +
- +
- +
diff --git a/webapp/channels/src/components/admin_console/__snapshots__/elasticsearch_settings.test.jsx.snap b/webapp/channels/src/components/admin_console/__snapshots__/elasticsearch_settings.test.jsx.snap index e631afb756..eb330530b7 100644 --- a/webapp/channels/src/components/admin_console/__snapshots__/elasticsearch_settings.test.jsx.snap +++ b/webapp/channels/src/components/admin_console/__snapshots__/elasticsearch_settings.test.jsx.snap @@ -15,10 +15,7 @@ exports[`components/ElasticSearchSettings should match snapshot, disabled 1`] = id="admin.elasticsearch.title" /> - + - + - + - + - + - + { diff --git a/webapp/channels/src/components/admin_console/cluster_settings.jsx b/webapp/channels/src/components/admin_console/cluster_settings.jsx index b53aa7ec9b..900d2b8d56 100644 --- a/webapp/channels/src/components/admin_console/cluster_settings.jsx +++ b/webapp/channels/src/components/admin_console/cluster_settings.jsx @@ -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 { diff --git a/webapp/channels/src/components/admin_console/custom_plugin_settings/__snapshots__/custom_plugin_settings.test.tsx.snap b/webapp/channels/src/components/admin_console/custom_plugin_settings/__snapshots__/custom_plugin_settings.test.tsx.snap index 164257b8ff..c53667cdca 100644 --- a/webapp/channels/src/components/admin_console/custom_plugin_settings/__snapshots__/custom_plugin_settings.test.tsx.snap +++ b/webapp/channels/src/components/admin_console/custom_plugin_settings/__snapshots__/custom_plugin_settings.test.tsx.snap @@ -20,7 +20,6 @@ exports[`components/admin_console/CustomPluginSettings should match snapshot wit >
{ + 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 = ( -

- {this.props.header} -

- ); + header =

{this.props.header}

; } let title = null; if (!this.props.header && this.props.title) { - title = ( -
- {this.props.title} -
- ); + title =
{this.props.title}
; } let subtitle = null; if (!this.props.header && this.props.subtitle) { subtitle = ( -
- {this.props.subtitle} -
+
{this.props.subtitle}
); }