You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2022/04/04 08:22:25 UTC
[superset] 16/24: feat(sql lab): enable ACE editor search in SQL editors (#19328)
This is an automated email from the ASF dual-hosted git repository.
villebro pushed a commit to tag 1.5.0rc1
in repository https://gitbox.apache.org/repos/asf/superset.git
commit af0dc7520773d57c735be4517b7cfdc402562202
Author: Diego Medina <di...@gmail.com>
AuthorDate: Thu Mar 31 19:05:00 2022 -0400
feat(sql lab): enable ACE editor search in SQL editors (#19328)
(cherry picked from commit eab9388f7cdaca20588d4c94c929225fd9d59870)
---
superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx | 2 --
superset-frontend/src/components/AsyncAceEditor/index.tsx | 4 +++-
superset-frontend/src/types/brace.d.ts | 1 +
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx b/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx
index 25da49137a..35722ba866 100644
--- a/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx
+++ b/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx
@@ -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' },
diff --git a/superset-frontend/src/components/AsyncAceEditor/index.tsx b/superset-frontend/src/components/AsyncAceEditor/index.tsx
index 6d4619b326..521ae357be 100644
--- a/superset-frontend/src/components/AsyncAceEditor/index.tsx
+++ b/superset-frontend/src/components/AsyncAceEditor/index.tsx
@@ -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: () => {
diff --git a/superset-frontend/src/types/brace.d.ts b/superset-frontend/src/types/brace.d.ts
index 70d9275e41..0b3770eebe 100644
--- a/superset-frontend/src/types/brace.d.ts
+++ b/superset-frontend/src/types/brace.d.ts
@@ -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';