feat: remove gdc sources from run sql view

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9659
GitOrigin-RevId: cedaf4e389b7499c2b9580f3296d54cb4b56e1ed
This commit is contained in:
Luca Restagno 2023-06-26 15:48:50 +02:00 committed by hasura-bot
parent 6c615fb733
commit 3617aa4d8d

View File

@ -629,16 +629,32 @@ RawSQL.propTypes = {
statementTimeout: PropTypes.string.isRequired,
};
const mapStateToProps = state => ({
...state.rawSQL,
migrationMode: state.main.migrationMode,
currentSchema: state.tables.currentSchema,
allSchemas: state.tables.allSchemas,
serverVersion: state.main.serverVersion ? state.main.serverVersion : '',
sources: getDataSources(state),
currentDataSource: state.tables.currentDataSource,
metadataSources: state.metadata.metadataObject.sources,
});
const mapStateToProps = state => {
const nativeSources = state.metadata.metadataObject.sources.filter(source =>
nativeDrivers.includes(source.kind)
);
const sources = getDataSources(state).filter(source =>
nativeDrivers.includes(source.driver)
);
const currentDataSource = sources.find(
source => source.name === state.tables.currentDataSource
)
? state.tables.currentDataSource
: sources?.[0]?.name || '';
return {
...state.rawSQL,
migrationMode: state.main.migrationMode,
currentSchema: state.tables.currentSchema,
allSchemas: state.tables.allSchemas,
serverVersion: state.main.serverVersion ? state.main.serverVersion : '',
sources,
currentDataSource,
metadataSources: nativeSources,
};
};
const rawSQLConnector = connect => connect(mapStateToProps)(RawSQL);