From 845f28cb7617b7d7d06d9d7aef0c1da6114f6d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Tue, 13 Feb 2024 10:28:38 +0100 Subject: [PATCH] Fix system console plugin headers (#26196) * Fix system console plugin headers * Fix tests --- .../schema_admin_settings.test.tsx.snap | 4 +++- .../custom_plugin_settings.test.tsx.snap | 12 +++++++++--- .../admin_console/schema_admin_settings.tsx | 16 +++++++++++----- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/webapp/channels/src/components/admin_console/__snapshots__/schema_admin_settings.test.tsx.snap b/webapp/channels/src/components/admin_console/__snapshots__/schema_admin_settings.test.tsx.snap index 0cb6e2bbdf..3cff786aa3 100644 --- a/webapp/channels/src/components/admin_console/__snapshots__/schema_admin_settings.test.tsx.snap +++ b/webapp/channels/src/components/admin_console/__snapshots__/schema_admin_settings.test.tsx.snap @@ -92,7 +92,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
- config + + config +
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 53c5bd6506..94d7163855 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 @@ -4,7 +4,9 @@ exports[`components/admin_console/CustomPluginSettings should match snapshot wit
- testplugin + + testplugin +
@@ -233,7 +235,9 @@ exports[`components/admin_console/CustomPluginSettings should match snapshot wit
- testplugin + + testplugin +
@@ -300,7 +304,9 @@ exports[`components/admin_console/CustomPluginSettings should match snapshot wit
- testplugin + + testplugin +
diff --git a/webapp/channels/src/components/admin_console/schema_admin_settings.tsx b/webapp/channels/src/components/admin_console/schema_admin_settings.tsx index 7cb873f766..8349c92236 100644 --- a/webapp/channels/src/components/admin_console/schema_admin_settings.tsx +++ b/webapp/channels/src/components/admin_console/schema_admin_settings.tsx @@ -329,18 +329,24 @@ export class SchemaAdminSettings extends React.PureComponent { if (!this.props.schema) { return ''; } - if (!('name' in this.props.schema)) { - return this.props.schema.id; + + let name: string | MessageDescriptor = this.props.schema.id; + if (('name' in this.props.schema)) { + name = this.props.schema.name; } - if (typeof this.props.schema.name === 'string') { - return this.props.schema.name; + if (typeof name === 'string') { + return ( + + {name} + + ); } return ( );