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 2022/01/19 18:24:05 UTC

[GitHub] [superset] eschutho commented on a change in pull request #17807: refactor: sqleditorleftbar to functional

eschutho commented on a change in pull request #17807:
URL: https://github.com/apache/superset/pull/17807#discussion_r788026014



##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.jsx
##########
@@ -161,79 +112,74 @@ export default class SqlEditorLeftBar extends React.PureComponent {
     </IconTooltip>
   );
 
-  render() {
-    const shouldShowReset = window.location.search === '?reset=1';
-    const tableMetaDataHeight = this.props.height - 130; // 130 is the height of the selects above
-    const qe = this.props.queryEditor;
-    return (
-      <div className="SqlEditorLeftBar">
-        <TableSelector
-          database={this.props.database}
-          dbId={qe.dbId}
-          getDbList={this.getDbList}
-          handleError={this.props.actions.addDangerToast}
-          onDbChange={this.onDbChange}
-          onSchemaChange={this.onSchemaChange}
-          onSchemasLoad={this.onSchemasLoad}
-          onTableChange={this.onTableChange}
-          onTablesLoad={this.onTablesLoad}
-          schema={qe.schema}
-          sqlLabMode
-        />
-        <div className="divider" />
-        <StyledScrollbarContainer>
-          <StyledScrollbarContent contentHeight={tableMetaDataHeight}>
-            <Collapse
-              activeKey={this.props.tables
-                .filter(({ expanded }) => expanded)
-                .map(({ id }) => id)}
-              css={theme => css`
-                .ant-collapse-item {
-                  margin-bottom: ${theme.gridUnit * 3}px;
-                }
-                .ant-collapse-header {
-                  padding: 0px !important;
-                  display: flex;
-                  align-items: center;
-                }
-                .ant-collapse-content-box {
-                  padding: 0px ${theme.gridUnit * 4}px 0px 0px !important;
-                }
-                .ant-collapse-arrow {
-                  top: ${theme.gridUnit * 2}px !important;
-                  color: ${theme.colors.primary.dark1} !important;
-                  &: hover {
-                    color: ${theme.colors.primary.dark2} !important;
-                  }
+  const shouldShowReset = window.location.search === '?reset=1';
+  const tableMetaDataHeight = props.height - 130; // 130 is the height of the selects above
+  const qe = props.queryEditor;
+
+  return (
+    <div className="SqlEditorLeftBar">
+      <TableSelector
+        database={props.database}
+        dbId={qe.dbId}
+        getDbList={() => getDbList}
+        handleError={props.actions.addDangerToast}
+        onDbChange={onDbChange}
+        onSchemaChange={onSchemaChange}
+        onSchemasLoad={() => onSchemasLoad}

Review comment:
       You're correct @JosueLugaro. I realized that below. It looks like you got it, though!




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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