From 2b172e66da213a50748fb6735e4772ce09bdc904 Mon Sep 17 00:00:00 2001 From: Bert Verhelst Date: Mon, 8 Jul 2024 21:32:41 +0200 Subject: [PATCH] Console: allow user to collapse table treeview node --- .../src/lib/components/Services/Data/DataSubSidebar.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/libs/console/legacy-ce/src/lib/components/Services/Data/DataSubSidebar.js b/frontend/libs/console/legacy-ce/src/lib/components/Services/Data/DataSubSidebar.js index 5704f144c9994..9896210093230 100644 --- a/frontend/libs/console/legacy-ce/src/lib/components/Services/Data/DataSubSidebar.js +++ b/frontend/libs/console/legacy-ce/src/lib/components/Services/Data/DataSubSidebar.js @@ -106,15 +106,15 @@ const DataSubSidebar = props => { const onSchemaChange = value => { if (value === currentSchema) { - dispatch(_push(`/data/${currentDataSource}/schema/${value}`)); - return; + // Clicking the same schema again should collapse the treeview node + value = undefined; } setSchemaLoading(true); dispatch(updateCurrentSchema(value, currentDataSource)) .then(() => { - if (value === currentSchema) { - dispatch(_push(`/data/${currentDataSource}/schema/${value}`)); + if (!value) { + dispatch(_push(`/data/${currentDataSource}`)); } }) .finally(() => {