mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
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:
parent
6c615fb733
commit
3617aa4d8d
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user