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
This commit is contained in:
Vijay Prasanna 2021-05-04 15:23:15 +05:30 committed by hasura-bot
parent d362e0726e
commit f015234ef6

View File

@ -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,
};
});