mirror of
https://github.com/apache/superset.git
synced 2024-09-06 13:57:40 -04:00
fix(sql lab): add quotes when autocompleting table names with spaces in the editor (#19311)
This commit is contained in:
parent
bbe0af348b
commit
8d4a52c9d0
@ -227,11 +227,15 @@ class AceEditorWrapper extends React.PureComponent<Props, State> {
|
||||
this.props.queryEditor.schema,
|
||||
);
|
||||
}
|
||||
|
||||
let { caption } = data;
|
||||
if (data.meta === 'table' && caption.includes(' ')) {
|
||||
caption = `"${caption}"`;
|
||||
}
|
||||
|
||||
// executing https://github.com/thlorenz/brace/blob/3a00c5d59777f9d826841178e1eb36694177f5e6/ext/language_tools.js#L1448
|
||||
editor.completer.insertMatch(
|
||||
`${data.caption}${
|
||||
['function', 'schema'].includes(data.meta) ? '' : ' '
|
||||
}`,
|
||||
`${caption}${['function', 'schema'].includes(data.meta) ? '' : ' '}`,
|
||||
);
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user