mirror of https://github.com/apache/superset.git
feat(sql lab): enable ACE editor search in SQL editors (#19328)
This commit is contained in:
parent
ab3770667c
commit
eab9388f7c
|
@ -127,8 +127,6 @@ class AceEditorWrapper extends React.PureComponent<Props, State> {
|
|||
}
|
||||
|
||||
onEditorLoad(editor: any) {
|
||||
editor.commands.removeCommand('find');
|
||||
|
||||
editor.commands.addCommand({
|
||||
name: 'runQuery',
|
||||
bindKey: { win: 'Alt-enter', mac: 'Alt-enter' },
|
||||
|
|
|
@ -68,6 +68,7 @@ const aceModuleLoaders = {
|
|||
'theme/textmate': () => import('brace/theme/textmate'),
|
||||
'theme/github': () => import('brace/theme/github'),
|
||||
'ext/language_tools': () => import('brace/ext/language_tools'),
|
||||
'ext/searchbox': () => import('brace/ext/searchbox'),
|
||||
};
|
||||
|
||||
export type AceModule = keyof typeof aceModuleLoaders;
|
||||
|
@ -164,10 +165,11 @@ export const SQLEditor = AsyncAceEditor([
|
|||
'mode/sql',
|
||||
'theme/github',
|
||||
'ext/language_tools',
|
||||
'ext/searchbox',
|
||||
]);
|
||||
|
||||
export const FullSQLEditor = AsyncAceEditor(
|
||||
['mode/sql', 'theme/github', 'ext/language_tools'],
|
||||
['mode/sql', 'theme/github', 'ext/language_tools', 'ext/searchbox'],
|
||||
{
|
||||
// a custom placeholder in SQL lab for less jumpy re-renders
|
||||
placeholder: () => {
|
||||
|
|
|
@ -26,3 +26,4 @@ declare module 'brace/mode/javascript';
|
|||
declare module 'brace/theme/textmate';
|
||||
declare module 'brace/theme/github';
|
||||
declare module 'brace/ext/language_tools';
|
||||
declare module 'brace/ext/searchbox';
|
||||
|
|
Loading…
Reference in New Issue