You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/03/23 16:13:45 UTC

[GitHub] [incubator-superset] nytai commented on a change in pull request #9338: [SQLLAB] add checkbox to control autocomplete

nytai commented on a change in pull request #9338: [SQLLAB] add checkbox to control autocomplete
URL: https://github.com/apache/incubator-superset/pull/9338#discussion_r396573149
 
 

 ##########
 File path: superset-frontend/src/SqlLab/components/AceEditorWrapper.tsx
 ##########
 @@ -34,41 +33,44 @@ import {
 
 const langTools = ace.acequire('ace/ext/language_tools');
 
-const propTypes = {
-  actions: PropTypes.object.isRequired,
-  onBlur: PropTypes.func,
-  sql: PropTypes.string.isRequired,
-  schemas: PropTypes.array,
-  tables: PropTypes.array,
-  functionNames: PropTypes.array,
-  extendedTables: PropTypes.array,
-  queryEditor: PropTypes.object.isRequired,
-  height: PropTypes.string,
-  hotkeys: PropTypes.arrayOf(
-    PropTypes.shape({
-      key: PropTypes.string.isRequired,
-      descr: PropTypes.string.isRequired,
-      func: PropTypes.func.isRequired,
-    }),
-  ),
-  onChange: PropTypes.func,
+type HotKey = {
+  key: string;
+  descr: string;
+  name: string;
+  func: () => void;
 };
 
-const defaultProps = {
-  onBlur: () => {},
-  onChange: () => {},
-  schemas: [],
-  tables: [],
-  functionNames: [],
-  extendedTables: [],
-};
 
 Review comment:
   Ah nice, I like that pattern. I went on a bit of a fruitless rabbit hole a while back trying to figure out how to make defaultProps work with the Props types. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org