superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject [incubator-superset] branch master updated: Insert a space after auto complete (#6717)
Date Fri, 18 Jan 2019 17:39:01 GMT
This is an automated email from the ASF dual-hosted git repository.

beto pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new c954fe3  Insert a space after auto complete (#6717)
c954fe3 is described below

commit c954fe314d905ad579a15c8122bfc58c1ed4d050
Author: Beto Dealmeida <roberto@dealmeida.net>
AuthorDate: Fri Jan 18 09:38:56 2019 -0800

    Insert a space after auto complete (#6717)
    
    * Insert space after auto complete
    
    * Fix autocomplete with space
---
 superset/assets/src/SqlLab/components/AceEditorWrapper.jsx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/superset/assets/src/SqlLab/components/AceEditorWrapper.jsx b/superset/assets/src/SqlLab/components/AceEditorWrapper.jsx
index 24bfb43..4b01b51 100644
--- a/superset/assets/src/SqlLab/components/AceEditorWrapper.jsx
+++ b/superset/assets/src/SqlLab/components/AceEditorWrapper.jsx
@@ -124,7 +124,13 @@ class AceEditorWrapper extends React.PureComponent {
     this.props.onChange(text);
   }
   getCompletions(aceEditor, session, pos, prefix, callback) {
-    callback(null, this.state.words);
+    const completer = {
+      insertMatch: (editor, data) => {
+        editor.completer.insertMatch({ value: data.caption + ' ' });
+      },
+    };
+    const words = this.state.words.map(word => ({ ...word, completer }));
+    callback(null, words);
   }
   setAutoCompleter(props) {
     // Loading table and column names as auto-completable words


Mime
View raw message