From f015234ef6b0aa2875fe6ea5fd1435b6afbf353a Mon Sep 17 00:00:00 2001 From: Vijay Prasanna Date: Tue, 4 May 2021 15:23:15 +0530 Subject: [PATCH] console: fix allSourcesSchemas mapping when there are sources with no tables **How to repro this bug:** 1. Create another source, in addition the existing `default source` 2. this new source has one or more tables while the `default` has none. 3. If you check the Redux State object, the `allSourcesSchemas` attribute has the wrong mapping of objects ```JSON allSourcesSchemas: default: {} ``` This results in the table_types not being mapped properly. For example in the below screenshot, I have 2 db objects, one is a view and the other is a table. Since the `allSourcesSchemas` is not mapped properly, the table_type is not available to `DataSubSidebar.js` ![Screenshot 2021-05-04 at 11 22 27 AM](https://user-images.githubusercontent.com/11921040/116965274-065c8f80-accb-11eb-9a4f-c1fedced8e6a.png) GitOrigin-RevId: d728f08306ce7a8770d7d08a6236b76cd379f140 --- console/src/components/Services/Data/DataActions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/console/src/components/Services/Data/DataActions.js b/console/src/components/Services/Data/DataActions.js index 4d3c44d0169..806ce4de097 100644 --- a/console/src/components/Services/Data/DataActions.js +++ b/console/src/components/Services/Data/DataActions.js @@ -585,7 +585,7 @@ export const getDatabaseTableTypeInfoForAllSources = schemaRequests => ( return {}; } const trackedTables = getTablesFromAllSources(getState()).filter( - ({ source }) => source === schemaRequests[index]?.sourceName + ({ source }) => source === bulkQueries[index]?.args?.source ); const schemasInfo = {}; @@ -622,7 +622,7 @@ export const getDatabaseTableTypeInfoForAllSources = schemaRequests => ( }; }); return { - source: schemaRequests[index]?.sourceName, + source: bulkQueries[index]?.args?.source, schemaInfo: schemasInfo, }; });