mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat(sql lab): enable ACE editor search in SQL editors (#19328)
This commit is contained in:
@@ -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: () => {
|
||||
|
||||
1
superset-frontend/src/types/brace.d.ts
vendored
1
superset-frontend/src/types/brace.d.ts
vendored
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user