From 38c9bc0afc7a6eea0ed1695c15cf3efe966ae23a Mon Sep 17 00:00:00 2001 From: albinAppsmith <87797149+albinAppsmith@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:43:36 +0530 Subject: [PATCH] fix: datasource name not reflecting in schema pane (#37131) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Renaming the datasource was not getting updated in schema tab. This is caused because of the use of unpublished action object. Fixes #37118 ## Automation /ok-to-test tags="@tag.Sanity" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 2f3b111ab16c35080d1370757d39bb9a3dfbe48f > Cypress dashboard. > Tags: `@tag.Sanity` > Spec: >
Wed, 30 Oct 2024 17:09:22 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## Summary by CodeRabbit - **New Features** - Introduced a new selector for improved datasource retrieval in the Query Debugger. - **Improvements** - Enhanced the way datasource information is accessed, streamlining the process for the `Schema` component. - Updated test configuration to include a mock structure for testing datasource functionality. --- .../pages/Editor/QueryEditor/QueryDebuggerTabs.test.tsx | 1 + .../src/pages/Editor/QueryEditor/QueryDebuggerTabs.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/client/src/pages/Editor/QueryEditor/QueryDebuggerTabs.test.tsx b/app/client/src/pages/Editor/QueryEditor/QueryDebuggerTabs.test.tsx index 23de0834cd..6b6097e1b5 100644 --- a/app/client/src/pages/Editor/QueryEditor/QueryDebuggerTabs.test.tsx +++ b/app/client/src/pages/Editor/QueryEditor/QueryDebuggerTabs.test.tsx @@ -24,6 +24,7 @@ const storeState = { }, datasources: { structure: {}, + list: [], }, }, ui: { diff --git a/app/client/src/pages/Editor/QueryEditor/QueryDebuggerTabs.tsx b/app/client/src/pages/Editor/QueryEditor/QueryDebuggerTabs.tsx index 7d283d140f..54d13072d0 100644 --- a/app/client/src/pages/Editor/QueryEditor/QueryDebuggerTabs.tsx +++ b/app/client/src/pages/Editor/QueryEditor/QueryDebuggerTabs.tsx @@ -21,6 +21,7 @@ import type { SourceEntity } from "entities/AppsmithConsole"; import type { Action } from "entities/Action"; import QueryResponseTab from "PluginActionEditor/components/PluginActionResponse/components/QueryResponseTab"; import { + getDatasource, getDatasourceStructureById, getPluginDatasourceComponentFromId, } from "ee/selectors/entitiesSelector"; @@ -97,6 +98,10 @@ function QueryDebuggerTabs({ ), ); + const datasource = useSelector((state) => + getDatasource(state, currentActionConfig?.datasource?.id ?? ""), + ); + useEffect(() => { if ( currentActionConfig?.datasource?.id && @@ -252,7 +257,7 @@ function QueryDebuggerTabs({ ), });