mirror of
https://github.com/apache/superset.git
synced 2026-04-25 19:14:27 +00:00
feat(sqllab): Add a configuration option to disable data preview (#19104)
This commit is contained in:
@@ -43,11 +43,17 @@ interface Props {
|
||||
actions: {
|
||||
queryEditorSetSelectedText: (edit: any, text: null | string) => void;
|
||||
queryEditorSetFunctionNames: (queryEditor: object, dbId: number) => void;
|
||||
addTable: (queryEditor: any, value: any, schema: any) => void;
|
||||
addTable: (
|
||||
queryEditor: any,
|
||||
database: any,
|
||||
value: any,
|
||||
schema: any,
|
||||
) => void;
|
||||
};
|
||||
autocomplete: boolean;
|
||||
onBlur: (sql: string) => void;
|
||||
sql: string;
|
||||
database: any;
|
||||
schemas: any[];
|
||||
tables: any[];
|
||||
functionNames: string[];
|
||||
@@ -210,6 +216,7 @@ class AceEditorWrapper extends React.PureComponent<Props, State> {
|
||||
if (data.meta === 'table') {
|
||||
this.props.actions.addTable(
|
||||
this.props.queryEditor,
|
||||
this.props.database,
|
||||
data.value,
|
||||
this.props.queryEditor.schema,
|
||||
);
|
||||
|
||||
@@ -514,6 +514,7 @@ class SqlEditor extends React.PureComponent {
|
||||
onChange={this.onSqlChanged}
|
||||
queryEditor={this.props.queryEditor}
|
||||
sql={this.props.queryEditor.sql}
|
||||
database={this.props.database}
|
||||
schemas={this.props.queryEditor.schemaOptions}
|
||||
tables={this.props.queryEditor.tableOptions}
|
||||
functionNames={this.props.queryEditor.functionNames}
|
||||
|
||||
@@ -36,7 +36,7 @@ interface actionsTypes {
|
||||
queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
|
||||
collapseTable: (table: Table) => void;
|
||||
expandTable: (table: Table) => void;
|
||||
addTable: (queryEditor: any, value: any, schema: any) => void;
|
||||
addTable: (queryEditor: any, database: any, value: any, schema: any) => void;
|
||||
setDatabases: (arg0: any) => {};
|
||||
addDangerToast: (msg: string) => void;
|
||||
queryEditorSetSchema: (queryEditor: QueryEditor, schema?: string) => void;
|
||||
@@ -103,7 +103,7 @@ export default function SqlEditorLeftBar({
|
||||
|
||||
const onTableChange = (tableName: string, schemaName: string) => {
|
||||
if (tableName && schemaName) {
|
||||
actions.addTable(queryEditor, tableName, schemaName);
|
||||
actions.addTable(queryEditor, database, tableName, schemaName);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user