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/04 22:46:19 UTC

[GitHub] [superset] JosueLugaro opened a new pull request #17926: Josue/sqleditorleftbar to typescript

JosueLugaro opened a new pull request #17926:
URL: https://github.com/apache/superset/pull/17926


   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   Working on converting SqlEditorLeftBar to TypeScript
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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


[GitHub] [superset] codecov[bot] edited a comment on pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17926:
URL: https://github.com/apache/superset/pull/17926#issuecomment-1023625882


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#17926](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5d26a63) into [master](https://codecov.io/gh/apache/superset/commit/568b8e160fc8f3d2965ec3ac8a6d0fd6f20a860f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (568b8e1) will **increase** coverage by `0.00%`.
   > The diff coverage is `63.63%`.
   
   > :exclamation: Current head 5d26a63 differs from pull request most recent head c07f7a7. Consider uploading reports for the commit c07f7a7 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17926/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #17926   +/-   ##
   =======================================
     Coverage   66.05%   66.05%           
   =======================================
     Files        1591     1591           
     Lines       62418    62411    -7     
     Branches     6286     6289    +3     
   =======================================
   - Hits        41228    41225    -3     
   + Misses      19568    19564    -4     
     Partials     1622     1622           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `50.86% <63.63%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ntend/src/SqlLab/components/TableElement/index.tsx](https://codecov.io/gh/apache/superset/pull/17926/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmxlRWxlbWVudC9pbmRleC50c3g=) | `72.30% <ø> (ø)` | |
   | [...d/src/SqlLab/components/SqlEditorLeftBar/index.tsx](https://codecov.io/gh/apache/superset/pull/17926/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvckxlZnRCYXIvaW5kZXgudHN4) | `57.14% <63.63%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [568b8e1...c07f7a7](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


[GitHub] [superset] codecov[bot] edited a comment on pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17926:
URL: https://github.com/apache/superset/pull/17926#issuecomment-1023625882


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#17926](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cc9fada) into [master](https://codecov.io/gh/apache/superset/commit/568b8e160fc8f3d2965ec3ac8a6d0fd6f20a860f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (568b8e1) will **increase** coverage by `0.00%`.
   > The diff coverage is `53.84%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17926/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #17926   +/-   ##
   =======================================
     Coverage   66.05%   66.05%           
   =======================================
     Files        1591     1591           
     Lines       62418    62411    -7     
     Branches     6286     6289    +3     
   =======================================
   - Hits        41228    41225    -3     
   + Misses      19568    19564    -4     
     Partials     1622     1622           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `50.86% <53.84%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ntend/src/SqlLab/components/TableElement/index.tsx](https://codecov.io/gh/apache/superset/pull/17926/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmxlRWxlbWVudC9pbmRleC50c3g=) | `72.30% <ø> (ø)` | |
   | [...d/src/SqlLab/components/SqlEditorLeftBar/index.tsx](https://codecov.io/gh/apache/superset/pull/17926/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvckxlZnRCYXIvaW5kZXgudHN4) | `57.14% <53.84%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [568b8e1...cc9fada](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


[GitHub] [superset] codecov[bot] edited a comment on pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17926:
URL: https://github.com/apache/superset/pull/17926#issuecomment-1023625882


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#17926](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (34be0db) into [master](https://codecov.io/gh/apache/superset/commit/568b8e160fc8f3d2965ec3ac8a6d0fd6f20a860f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (568b8e1) will **increase** coverage by `0.00%`.
   > The diff coverage is `53.84%`.
   
   > :exclamation: Current head 34be0db differs from pull request most recent head cc9fada. Consider uploading reports for the commit cc9fada to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17926/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #17926   +/-   ##
   =======================================
     Coverage   66.05%   66.05%           
   =======================================
     Files        1591     1591           
     Lines       62418    62411    -7     
     Branches     6286     6289    +3     
   =======================================
   - Hits        41228    41225    -3     
   + Misses      19568    19564    -4     
     Partials     1622     1622           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `50.86% <53.84%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ntend/src/SqlLab/components/TableElement/index.tsx](https://codecov.io/gh/apache/superset/pull/17926/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmxlRWxlbWVudC9pbmRleC50c3g=) | `72.30% <ø> (ø)` | |
   | [...d/src/SqlLab/components/SqlEditorLeftBar/index.tsx](https://codecov.io/gh/apache/superset/pull/17926/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvckxlZnRCYXIvaW5kZXgudHN4) | `57.14% <53.84%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [568b8e1...cc9fada](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


[GitHub] [superset] JosueLugaro commented on a change in pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
JosueLugaro commented on a change in pull request #17926:
URL: https://github.com/apache/superset/pull/17926#discussion_r794110802



##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -17,86 +17,100 @@
  * under the License.
  */
 import React from 'react';
-import PropTypes from 'prop-types';
 import Button from 'src/components/Button';
-import { t, styled, css } from '@superset-ui/core';
+import { t, styled, css, SupersetTheme } from '@superset-ui/core';
 import Collapse from 'src/components/Collapse';
 import Icons from 'src/components/Icons';
 import TableSelector from 'src/components/TableSelector';
 import { IconTooltip } from 'src/components/IconTooltip';
-import TableElement from '../TableElement';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement, { Table, TableElementProps } from '../TableElement';
 
-const propTypes = {
-  queryEditor: PropTypes.object.isRequired,
-  height: PropTypes.number,
-  tables: PropTypes.array,
-  actions: PropTypes.object,
-  database: PropTypes.object,
-  offline: PropTypes.bool,
-};
+interface ExtendedTable extends Table {
+  expanded: any;

Review comment:
       Changed the expanded type from any to boolean, which is what it was originally.👍




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


[GitHub] [superset] hughhhh commented on a change in pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
hughhhh commented on a change in pull request #17926:
URL: https://github.com/apache/superset/pull/17926#discussion_r793986707



##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -17,86 +17,105 @@
  * under the License.
  */
 import React from 'react';
-import PropTypes from 'prop-types';
 import Button from 'src/components/Button';
-import { t, styled, css } from '@superset-ui/core';
+import { t, styled, css, SupersetTheme } from '@superset-ui/core';
 import Collapse from 'src/components/Collapse';
 import Icons from 'src/components/Icons';
 import TableSelector from 'src/components/TableSelector';
 import { IconTooltip } from 'src/components/IconTooltip';
-import TableElement from '../TableElement';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement, { Table, TableElementProps } from '../TableElement';
 
-const propTypes = {
-  queryEditor: PropTypes.object.isRequired,
-  height: PropTypes.number,
-  tables: PropTypes.array,
-  actions: PropTypes.object,
-  database: PropTypes.object,
-  offline: PropTypes.bool,
-};
+interface ExtendedTable extends Table {
+  expanded: any;
+}
+
+interface actionsTypes {
+  queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+  queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+  collapseTable: (table: Table) => void;
+  expandTable: (table: Table) => void;
+  addTable: (queryEditor: any, value: any, schema: any) => void;
+  setDatabases: (arg0: any) => {};
+  addDangerToast: (msg: string) => void;
+  queryEditorSetSchema: (schema?: string) => void;
+  queryEditorSetSchemaOptions: () => void;
+  queryEditorSetTableOptions: (options: Array<any>) => void;
+  resetState: () => void;
+}
 
-const defaultProps = {
-  actions: {},
-  height: 500,
-  offline: false,
-  tables: [],
+type dbType = {
+  id: number;
 };
 
+interface SqlEditorLeftBarProps {
+  queryEditor: QueryEditor;
+  height?: number;
+  tables?: ExtendedTable[];
+  actions: actionsTypes & TableElementProps['actions'];
+  database: DatabaseObject;
+  offline: boolean;
+}
+
 const StyledScrollbarContainer = styled.div`
   flex: 1 1 auto;
   overflow: auto;
 `;
 
-const collapseStyles = css`
+const collapseStyles = (theme: SupersetTheme) => css`
   .ant-collapse-item {
-    margin-bottom: ${({ theme }) => theme.gridUnit * 3}px;
+    margin-bottom: ${theme.gridUnit * 3}px;
   }
   .ant-collapse-header {
     padding: 0px !important;
     display: flex;
     align-items: center;
   }
   .ant-collapse-content-box {
-    padding: 0px ${({ theme }) => theme.gridUnit * 4}px 0px 0px !important;
+    padding: 0px ${theme.gridUnit * 4}px 0px 0px !important;
   }
   .ant-collapse-arrow {
-    top: ${({ theme }) => theme.gridUnit * 2}px !important;
-    color: ${({ theme }) => theme.colors.primary.dark1} !important;
+    top: ${theme.gridUnit * 2}px !important;
+    color: ${theme.colors.primary.dark1} !important;
     &: hover {
-      color: ${({ theme }) => theme.colors.primary.dark2} !important;
+      color: ${theme.colors.primary.dark2} !important;
     }
   }
 `;
 
 export default function SqlEditorLeftBar({
   actions,
   database,
-  height,
+  height = 500,

Review comment:
       nit: put height as the last param




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


[GitHub] [superset] AAfghahi commented on pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
AAfghahi commented on pull request #17926:
URL: https://github.com/apache/superset/pull/17926#issuecomment-1023619705


   /testenv up
   


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


[GitHub] [superset] JosueLugaro commented on a change in pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
JosueLugaro commented on a change in pull request #17926:
URL: https://github.com/apache/superset/pull/17926#discussion_r794053122



##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -17,86 +17,105 @@
  * under the License.
  */
 import React from 'react';
-import PropTypes from 'prop-types';
 import Button from 'src/components/Button';
-import { t, styled, css } from '@superset-ui/core';
+import { t, styled, css, SupersetTheme } from '@superset-ui/core';
 import Collapse from 'src/components/Collapse';
 import Icons from 'src/components/Icons';
 import TableSelector from 'src/components/TableSelector';
 import { IconTooltip } from 'src/components/IconTooltip';
-import TableElement from '../TableElement';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement, { Table, TableElementProps } from '../TableElement';
 
-const propTypes = {
-  queryEditor: PropTypes.object.isRequired,
-  height: PropTypes.number,
-  tables: PropTypes.array,
-  actions: PropTypes.object,
-  database: PropTypes.object,
-  offline: PropTypes.bool,
-};
+interface ExtendedTable extends Table {
+  expanded: any;
+}
+
+interface actionsTypes {
+  queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+  queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+  collapseTable: (table: Table) => void;
+  expandTable: (table: Table) => void;
+  addTable: (queryEditor: any, value: any, schema: any) => void;
+  setDatabases: (arg0: any) => {};
+  addDangerToast: (msg: string) => void;
+  queryEditorSetSchema: (schema?: string) => void;
+  queryEditorSetSchemaOptions: () => void;
+  queryEditorSetTableOptions: (options: Array<any>) => void;
+  resetState: () => void;
+}
 
-const defaultProps = {
-  actions: {},
-  height: 500,
-  offline: false,
-  tables: [],
+type dbType = {
+  id: number;
 };
 
+interface SqlEditorLeftBarProps {
+  queryEditor: QueryEditor;
+  height?: number;
+  tables?: ExtendedTable[];
+  actions: actionsTypes & TableElementProps['actions'];
+  database: DatabaseObject;
+  offline: boolean;
+}
+
 const StyledScrollbarContainer = styled.div`
   flex: 1 1 auto;
   overflow: auto;
 `;
 
-const collapseStyles = css`
+const collapseStyles = (theme: SupersetTheme) => css`
   .ant-collapse-item {
-    margin-bottom: ${({ theme }) => theme.gridUnit * 3}px;
+    margin-bottom: ${theme.gridUnit * 3}px;
   }
   .ant-collapse-header {
     padding: 0px !important;
     display: flex;
     align-items: center;
   }
   .ant-collapse-content-box {
-    padding: 0px ${({ theme }) => theme.gridUnit * 4}px 0px 0px !important;
+    padding: 0px ${theme.gridUnit * 4}px 0px 0px !important;
   }
   .ant-collapse-arrow {
-    top: ${({ theme }) => theme.gridUnit * 2}px !important;
-    color: ${({ theme }) => theme.colors.primary.dark1} !important;
+    top: ${theme.gridUnit * 2}px !important;
+    color: ${theme.colors.primary.dark1} !important;
     &: hover {
-      color: ${({ theme }) => theme.colors.primary.dark2} !important;
+      color: ${theme.colors.primary.dark2} !important;
     }
   }
 `;
 
 export default function SqlEditorLeftBar({
   actions,
   database,
-  height,
+  height = 500,

Review comment:
       Made height the last param👍




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


[GitHub] [superset] JosueLugaro commented on a change in pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
JosueLugaro commented on a change in pull request #17926:
URL: https://github.com/apache/superset/pull/17926#discussion_r794091440



##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -17,86 +17,100 @@
  * under the License.
  */
 import React from 'react';
-import PropTypes from 'prop-types';
 import Button from 'src/components/Button';
-import { t, styled, css } from '@superset-ui/core';
+import { t, styled, css, SupersetTheme } from '@superset-ui/core';
 import Collapse from 'src/components/Collapse';
 import Icons from 'src/components/Icons';
 import TableSelector from 'src/components/TableSelector';
 import { IconTooltip } from 'src/components/IconTooltip';
-import TableElement from '../TableElement';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement, { Table, TableElementProps } from '../TableElement';
 
-const propTypes = {
-  queryEditor: PropTypes.object.isRequired,
-  height: PropTypes.number,
-  tables: PropTypes.array,
-  actions: PropTypes.object,
-  database: PropTypes.object,
-  offline: PropTypes.bool,
-};
+interface ExtendedTable extends Table {
+  expanded: any;

Review comment:
       I'll have to look at a previous commit to see what it was previously. Once I do I'll change it to that type.




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


[GitHub] [superset] AAfghahi commented on pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
AAfghahi commented on pull request #17926:
URL: https://github.com/apache/superset/pull/17926#issuecomment-1023799419






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


[GitHub] [superset] codecov[bot] edited a comment on pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17926:
URL: https://github.com/apache/superset/pull/17926#issuecomment-1023625882


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#17926](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5d26a63) into [master](https://codecov.io/gh/apache/superset/commit/568b8e160fc8f3d2965ec3ac8a6d0fd6f20a860f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (568b8e1) will **increase** coverage by `0.00%`.
   > The diff coverage is `63.63%`.
   
   > :exclamation: Current head 5d26a63 differs from pull request most recent head 1cc8a00. Consider uploading reports for the commit 1cc8a00 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17926/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #17926   +/-   ##
   =======================================
     Coverage   66.05%   66.05%           
   =======================================
     Files        1591     1591           
     Lines       62418    62411    -7     
     Branches     6286     6289    +3     
   =======================================
   - Hits        41228    41225    -3     
   + Misses      19568    19564    -4     
     Partials     1622     1622           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `50.86% <63.63%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ntend/src/SqlLab/components/TableElement/index.tsx](https://codecov.io/gh/apache/superset/pull/17926/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmxlRWxlbWVudC9pbmRleC50c3g=) | `72.30% <ø> (ø)` | |
   | [...d/src/SqlLab/components/SqlEditorLeftBar/index.tsx](https://codecov.io/gh/apache/superset/pull/17926/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvckxlZnRCYXIvaW5kZXgudHN4) | `57.14% <63.63%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [568b8e1...1cc8a00](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


[GitHub] [superset] hughhhh merged pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
hughhhh merged pull request #17926:
URL: https://github.com/apache/superset/pull/17926


   


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


[GitHub] [superset] AAfghahi commented on a change in pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
AAfghahi commented on a change in pull request #17926:
URL: https://github.com/apache/superset/pull/17926#discussion_r782245845



##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -0,0 +1,239 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import Button from 'src/components/Button';
+import { t, styled, css } from '@superset-ui/core';
+import Collapse from 'src/components/Collapse';
+import Icons from 'src/components/Icons';
+import TableSelector from 'src/components/TableSelector';
+import { IconTooltip } from 'src/components/IconTooltip';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement from '../TableElement';
+
+// const propTypes = {
+//   queryEditor: PropTypes.object.isRequired,
+//   height: PropTypes.number,
+//   tables: PropTypes.array,
+//   actions: PropTypes.object,
+//   database: PropTypes.object,
+//   offline: PropTypes.bool,
+// };
+
+/**
+    onSchemaChange={actions.queryEditorSetSchema}
+    onSchemasLoad={actions.queryEditorSetSchemaOptions}
+    onTableChange={onTableChange}
+    onTablesLoad={actions.queryEditorSetTableOptions}
+ */
+
+// anywhere there is void or any I didnt know what to put, will look into it
+
+interface actionsTypes {
+  queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+  queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+  /*
+    Need to add:
+    addTable (X)
+    collapseTable (X)
+    expandTable (X)
+    queryEditorSetSchemaOptions (X)
+    queryEditorSetTableOptions (X)
+    resetState (X)
+  */
+
+  collapseTable: (table: tableType) => void;
+  expandTable: (table: tableType) => void;
+
+  // This came from /home/josue/superset/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx
+  addTable: (queryEditor: any, value: any, schema: any) => void;
+
+  // utilized the typing that TableSelector used for its props, which are the same functions for these two below
+  setDatabases: (arg0: any) => {};
+  addDangerToast: (msg: string) => void;
+  queryEditorSetSchema: (schema?: string) => void;
+  queryEditorSetSchemaOptions: () => void;
+  queryEditorSetTableOptions: (options: Array<any>) => void;
+  resetState: () => void;
+}
+
+// my first attempt at actionTypes:
+// interface actionsTypes {
+//   queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+//   queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+//   setDatabases: (databases: any) => object;
+//   addDangerToast: (text: string, options?: ToastOptions) => void;
+//   queryEditorSetSchema: (queryEditor: QueryEditor, schema: any) => void;
+// }
+
+type tableType = {
+  id: number;
+  expanded: boolean;
+};
+
+type dbType = {
+  id: number;
+};
+
+interface propTypes {
+  queryEditor: QueryEditor;
+  height: number;

Review comment:
       both height and tables have a default value, which make me think that they are optional. 

##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -0,0 +1,239 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import Button from 'src/components/Button';
+import { t, styled, css } from '@superset-ui/core';
+import Collapse from 'src/components/Collapse';
+import Icons from 'src/components/Icons';
+import TableSelector from 'src/components/TableSelector';
+import { IconTooltip } from 'src/components/IconTooltip';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement from '../TableElement';
+
+// const propTypes = {
+//   queryEditor: PropTypes.object.isRequired,
+//   height: PropTypes.number,
+//   tables: PropTypes.array,
+//   actions: PropTypes.object,
+//   database: PropTypes.object,
+//   offline: PropTypes.bool,
+// };
+
+/**
+    onSchemaChange={actions.queryEditorSetSchema}
+    onSchemasLoad={actions.queryEditorSetSchemaOptions}
+    onTableChange={onTableChange}
+    onTablesLoad={actions.queryEditorSetTableOptions}
+ */
+
+// anywhere there is void or any I didnt know what to put, will look into it
+
+interface actionsTypes {
+  queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+  queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+  /*
+    Need to add:
+    addTable (X)
+    collapseTable (X)
+    expandTable (X)
+    queryEditorSetSchemaOptions (X)
+    queryEditorSetTableOptions (X)
+    resetState (X)
+  */
+
+  collapseTable: (table: tableType) => void;
+  expandTable: (table: tableType) => void;
+
+  // This came from /home/josue/superset/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx
+  addTable: (queryEditor: any, value: any, schema: any) => void;
+
+  // utilized the typing that TableSelector used for its props, which are the same functions for these two below
+  setDatabases: (arg0: any) => {};
+  addDangerToast: (msg: string) => void;
+  queryEditorSetSchema: (schema?: string) => void;
+  queryEditorSetSchemaOptions: () => void;
+  queryEditorSetTableOptions: (options: Array<any>) => void;
+  resetState: () => void;
+}
+
+// my first attempt at actionTypes:
+// interface actionsTypes {
+//   queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+//   queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+//   setDatabases: (databases: any) => object;
+//   addDangerToast: (text: string, options?: ToastOptions) => void;
+//   queryEditorSetSchema: (queryEditor: QueryEditor, schema: any) => void;
+// }
+
+type tableType = {
+  id: number;
+  expanded: boolean;
+};
+
+type dbType = {
+  id: number;
+};
+
+interface propTypes {

Review comment:
       we should change this name to be more specific to the component that we are using. Maybe SqlEditorLeftBarProps, which is a mouthful, but I think more specific than what we have currently. 




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


[GitHub] [superset] AAfghahi commented on a change in pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
AAfghahi commented on a change in pull request #17926:
URL: https://github.com/apache/superset/pull/17926#discussion_r793989485



##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -17,86 +17,105 @@
  * under the License.
  */
 import React from 'react';
-import PropTypes from 'prop-types';
 import Button from 'src/components/Button';
-import { t, styled, css } from '@superset-ui/core';
+import { t, styled, css, SupersetTheme } from '@superset-ui/core';
 import Collapse from 'src/components/Collapse';
 import Icons from 'src/components/Icons';
 import TableSelector from 'src/components/TableSelector';
 import { IconTooltip } from 'src/components/IconTooltip';
-import TableElement from '../TableElement';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement, { Table, TableElementProps } from '../TableElement';
 
-const propTypes = {
-  queryEditor: PropTypes.object.isRequired,
-  height: PropTypes.number,
-  tables: PropTypes.array,
-  actions: PropTypes.object,
-  database: PropTypes.object,
-  offline: PropTypes.bool,
-};
+interface ExtendedTable extends Table {
+  expanded: any;
+}
+
+interface actionsTypes {
+  queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+  queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+  collapseTable: (table: Table) => void;
+  expandTable: (table: Table) => void;
+  addTable: (queryEditor: any, value: any, schema: any) => void;
+  setDatabases: (arg0: any) => {};
+  addDangerToast: (msg: string) => void;
+  queryEditorSetSchema: (schema?: string) => void;
+  queryEditorSetSchemaOptions: () => void;
+  queryEditorSetTableOptions: (options: Array<any>) => void;
+  resetState: () => void;
+}
 
-const defaultProps = {
-  actions: {},
-  height: 500,
-  offline: false,
-  tables: [],
+type dbType = {
+  id: number;
 };
 
+interface SqlEditorLeftBarProps {
+  queryEditor: QueryEditor;
+  height?: number;
+  tables?: ExtendedTable[];
+  actions: actionsTypes & TableElementProps['actions'];
+  database: DatabaseObject;
+  offline: boolean;
+}
+
 const StyledScrollbarContainer = styled.div`
   flex: 1 1 auto;
   overflow: auto;
 `;
 
-const collapseStyles = css`
+const collapseStyles = (theme: SupersetTheme) => css`
   .ant-collapse-item {
-    margin-bottom: ${({ theme }) => theme.gridUnit * 3}px;
+    margin-bottom: ${theme.gridUnit * 3}px;
   }
   .ant-collapse-header {
     padding: 0px !important;
     display: flex;
     align-items: center;
   }
   .ant-collapse-content-box {
-    padding: 0px ${({ theme }) => theme.gridUnit * 4}px 0px 0px !important;
+    padding: 0px ${theme.gridUnit * 4}px 0px 0px !important;
   }
   .ant-collapse-arrow {
-    top: ${({ theme }) => theme.gridUnit * 2}px !important;
-    color: ${({ theme }) => theme.colors.primary.dark1} !important;
+    top: ${theme.gridUnit * 2}px !important;
+    color: ${theme.colors.primary.dark1} !important;
     &: hover {
-      color: ${({ theme }) => theme.colors.primary.dark2} !important;
+      color: ${theme.colors.primary.dark2} !important;
     }
   }
 `;
 
 export default function SqlEditorLeftBar({

Review comment:
       shouldn't offline be in here with a default variable?

##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -17,86 +17,105 @@
  * under the License.
  */
 import React from 'react';
-import PropTypes from 'prop-types';
 import Button from 'src/components/Button';
-import { t, styled, css } from '@superset-ui/core';
+import { t, styled, css, SupersetTheme } from '@superset-ui/core';
 import Collapse from 'src/components/Collapse';
 import Icons from 'src/components/Icons';
 import TableSelector from 'src/components/TableSelector';
 import { IconTooltip } from 'src/components/IconTooltip';
-import TableElement from '../TableElement';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement, { Table, TableElementProps } from '../TableElement';
 
-const propTypes = {
-  queryEditor: PropTypes.object.isRequired,
-  height: PropTypes.number,
-  tables: PropTypes.array,
-  actions: PropTypes.object,
-  database: PropTypes.object,
-  offline: PropTypes.bool,
-};
+interface ExtendedTable extends Table {
+  expanded: any;
+}
+
+interface actionsTypes {
+  queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+  queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+  collapseTable: (table: Table) => void;
+  expandTable: (table: Table) => void;
+  addTable: (queryEditor: any, value: any, schema: any) => void;
+  setDatabases: (arg0: any) => {};
+  addDangerToast: (msg: string) => void;
+  queryEditorSetSchema: (schema?: string) => void;
+  queryEditorSetSchemaOptions: () => void;
+  queryEditorSetTableOptions: (options: Array<any>) => void;
+  resetState: () => void;
+}
 
-const defaultProps = {
-  actions: {},
-  height: 500,
-  offline: false,
-  tables: [],
+type dbType = {
+  id: number;
 };
 
+interface SqlEditorLeftBarProps {
+  queryEditor: QueryEditor;
+  height?: number;
+  tables?: ExtendedTable[];
+  actions: actionsTypes & TableElementProps['actions'];
+  database: DatabaseObject;
+  offline: boolean;
+}
+
 const StyledScrollbarContainer = styled.div`
   flex: 1 1 auto;
   overflow: auto;
 `;
 
-const collapseStyles = css`
+const collapseStyles = (theme: SupersetTheme) => css`
   .ant-collapse-item {
-    margin-bottom: ${({ theme }) => theme.gridUnit * 3}px;
+    margin-bottom: ${theme.gridUnit * 3}px;
   }
   .ant-collapse-header {
     padding: 0px !important;
     display: flex;
     align-items: center;
   }
   .ant-collapse-content-box {
-    padding: 0px ${({ theme }) => theme.gridUnit * 4}px 0px 0px !important;
+    padding: 0px ${theme.gridUnit * 4}px 0px 0px !important;
   }
   .ant-collapse-arrow {
-    top: ${({ theme }) => theme.gridUnit * 2}px !important;
-    color: ${({ theme }) => theme.colors.primary.dark1} !important;
+    top: ${theme.gridUnit * 2}px !important;
+    color: ${theme.colors.primary.dark1} !important;
     &: hover {
-      color: ${({ theme }) => theme.colors.primary.dark2} !important;
+      color: ${theme.colors.primary.dark2} !important;
     }
   }
 `;
 
 export default function SqlEditorLeftBar({
   actions,
   database,
-  height,
+  height = 500,
   queryEditor,
-  tables: tb,
-}) {
-  const onDbChange = db => {
+  tables = [],
+}: SqlEditorLeftBarProps) {
+  const onDbChange = (db: dbType) => {

Review comment:
       is there a reason we are putting in an entire DB in here if we just use the id? WOuld it be better if we passed in just the db.id and then you don't need the DbType type?

##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -17,86 +17,105 @@
  * under the License.
  */
 import React from 'react';
-import PropTypes from 'prop-types';
 import Button from 'src/components/Button';
-import { t, styled, css } from '@superset-ui/core';
+import { t, styled, css, SupersetTheme } from '@superset-ui/core';
 import Collapse from 'src/components/Collapse';
 import Icons from 'src/components/Icons';
 import TableSelector from 'src/components/TableSelector';
 import { IconTooltip } from 'src/components/IconTooltip';
-import TableElement from '../TableElement';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement, { Table, TableElementProps } from '../TableElement';
 
-const propTypes = {
-  queryEditor: PropTypes.object.isRequired,
-  height: PropTypes.number,
-  tables: PropTypes.array,
-  actions: PropTypes.object,
-  database: PropTypes.object,
-  offline: PropTypes.bool,
-};
+interface ExtendedTable extends Table {
+  expanded: any;
+}
+
+interface actionsTypes {
+  queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+  queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+  collapseTable: (table: Table) => void;
+  expandTable: (table: Table) => void;
+  addTable: (queryEditor: any, value: any, schema: any) => void;
+  setDatabases: (arg0: any) => {};
+  addDangerToast: (msg: string) => void;
+  queryEditorSetSchema: (schema?: string) => void;
+  queryEditorSetSchemaOptions: () => void;
+  queryEditorSetTableOptions: (options: Array<any>) => void;
+  resetState: () => void;
+}
 
-const defaultProps = {
-  actions: {},
-  height: 500,
-  offline: false,
-  tables: [],
+type dbType = {
+  id: number;
 };
 
+interface SqlEditorLeftBarProps {
+  queryEditor: QueryEditor;
+  height?: number;
+  tables?: ExtendedTable[];
+  actions: actionsTypes & TableElementProps['actions'];
+  database: DatabaseObject;
+  offline: boolean;

Review comment:
       since this has a default value, should it be required?

##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -17,86 +17,105 @@
  * under the License.
  */
 import React from 'react';
-import PropTypes from 'prop-types';
 import Button from 'src/components/Button';
-import { t, styled, css } from '@superset-ui/core';
+import { t, styled, css, SupersetTheme } from '@superset-ui/core';
 import Collapse from 'src/components/Collapse';
 import Icons from 'src/components/Icons';
 import TableSelector from 'src/components/TableSelector';
 import { IconTooltip } from 'src/components/IconTooltip';
-import TableElement from '../TableElement';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement, { Table, TableElementProps } from '../TableElement';
 
-const propTypes = {
-  queryEditor: PropTypes.object.isRequired,
-  height: PropTypes.number,
-  tables: PropTypes.array,
-  actions: PropTypes.object,
-  database: PropTypes.object,
-  offline: PropTypes.bool,
-};
+interface ExtendedTable extends Table {
+  expanded: any;
+}
+
+interface actionsTypes {
+  queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+  queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+  collapseTable: (table: Table) => void;
+  expandTable: (table: Table) => void;
+  addTable: (queryEditor: any, value: any, schema: any) => void;
+  setDatabases: (arg0: any) => {};
+  addDangerToast: (msg: string) => void;
+  queryEditorSetSchema: (schema?: string) => void;
+  queryEditorSetSchemaOptions: () => void;
+  queryEditorSetTableOptions: (options: Array<any>) => void;
+  resetState: () => void;
+}
 
-const defaultProps = {
-  actions: {},
-  height: 500,
-  offline: false,
-  tables: [],
+type dbType = {

Review comment:
       is there a reason that this is a type over an interface?




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


[GitHub] [superset] codecov[bot] commented on pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #17926:
URL: https://github.com/apache/superset/pull/17926#issuecomment-1023625882


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#17926](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5d26a63) into [master](https://codecov.io/gh/apache/superset/commit/568b8e160fc8f3d2965ec3ac8a6d0fd6f20a860f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (568b8e1) will **increase** coverage by `0.00%`.
   > The diff coverage is `63.63%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17926/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #17926   +/-   ##
   =======================================
     Coverage   66.05%   66.05%           
   =======================================
     Files        1591     1591           
     Lines       62418    62411    -7     
     Branches     6286     6289    +3     
   =======================================
   - Hits        41228    41225    -3     
   + Misses      19568    19564    -4     
     Partials     1622     1622           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `50.86% <63.63%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ntend/src/SqlLab/components/TableElement/index.tsx](https://codecov.io/gh/apache/superset/pull/17926/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmxlRWxlbWVudC9pbmRleC50c3g=) | `72.30% <ø> (ø)` | |
   | [...d/src/SqlLab/components/SqlEditorLeftBar/index.tsx](https://codecov.io/gh/apache/superset/pull/17926/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvckxlZnRCYXIvaW5kZXgudHN4) | `57.14% <63.63%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [568b8e1...5d26a63](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


[GitHub] [superset] JosueLugaro commented on a change in pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
JosueLugaro commented on a change in pull request #17926:
URL: https://github.com/apache/superset/pull/17926#discussion_r794026878



##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -17,86 +17,105 @@
  * under the License.
  */
 import React from 'react';
-import PropTypes from 'prop-types';
 import Button from 'src/components/Button';
-import { t, styled, css } from '@superset-ui/core';
+import { t, styled, css, SupersetTheme } from '@superset-ui/core';
 import Collapse from 'src/components/Collapse';
 import Icons from 'src/components/Icons';
 import TableSelector from 'src/components/TableSelector';
 import { IconTooltip } from 'src/components/IconTooltip';
-import TableElement from '../TableElement';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement, { Table, TableElementProps } from '../TableElement';
 
-const propTypes = {
-  queryEditor: PropTypes.object.isRequired,
-  height: PropTypes.number,
-  tables: PropTypes.array,
-  actions: PropTypes.object,
-  database: PropTypes.object,
-  offline: PropTypes.bool,
-};
+interface ExtendedTable extends Table {
+  expanded: any;
+}
+
+interface actionsTypes {
+  queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+  queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+  collapseTable: (table: Table) => void;
+  expandTable: (table: Table) => void;
+  addTable: (queryEditor: any, value: any, schema: any) => void;
+  setDatabases: (arg0: any) => {};
+  addDangerToast: (msg: string) => void;
+  queryEditorSetSchema: (schema?: string) => void;
+  queryEditorSetSchemaOptions: () => void;
+  queryEditorSetTableOptions: (options: Array<any>) => void;
+  resetState: () => void;
+}
 
-const defaultProps = {
-  actions: {},
-  height: 500,
-  offline: false,
-  tables: [],
+type dbType = {
+  id: number;
 };
 
+interface SqlEditorLeftBarProps {
+  queryEditor: QueryEditor;
+  height?: number;
+  tables?: ExtendedTable[];
+  actions: actionsTypes & TableElementProps['actions'];
+  database: DatabaseObject;
+  offline: boolean;
+}
+
 const StyledScrollbarContainer = styled.div`
   flex: 1 1 auto;
   overflow: auto;
 `;
 
-const collapseStyles = css`
+const collapseStyles = (theme: SupersetTheme) => css`
   .ant-collapse-item {
-    margin-bottom: ${({ theme }) => theme.gridUnit * 3}px;
+    margin-bottom: ${theme.gridUnit * 3}px;
   }
   .ant-collapse-header {
     padding: 0px !important;
     display: flex;
     align-items: center;
   }
   .ant-collapse-content-box {
-    padding: 0px ${({ theme }) => theme.gridUnit * 4}px 0px 0px !important;
+    padding: 0px ${theme.gridUnit * 4}px 0px 0px !important;
   }
   .ant-collapse-arrow {
-    top: ${({ theme }) => theme.gridUnit * 2}px !important;
-    color: ${({ theme }) => theme.colors.primary.dark1} !important;
+    top: ${theme.gridUnit * 2}px !important;
+    color: ${theme.colors.primary.dark1} !important;
     &: hover {
-      color: ${({ theme }) => theme.colors.primary.dark2} !important;
+      color: ${theme.colors.primary.dark2} !important;
     }
   }
 `;
 
 export default function SqlEditorLeftBar({

Review comment:
       Offline was removed in my functional conversion PR because the value was never read or used anywhere in the component.




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


[GitHub] [superset] github-actions[bot] commented on pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #17926:
URL: https://github.com/apache/superset/pull/17926#issuecomment-1023620843


   @AAfghahi Ephemeral environment spinning up at http://54.202.74.189:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.


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


[GitHub] [superset] codecov[bot] edited a comment on pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17926:
URL: https://github.com/apache/superset/pull/17926#issuecomment-1023625882


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#17926](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (34be0db) into [master](https://codecov.io/gh/apache/superset/commit/568b8e160fc8f3d2965ec3ac8a6d0fd6f20a860f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (568b8e1) will **increase** coverage by `0.00%`.
   > The diff coverage is `53.84%`.
   
   > :exclamation: Current head 34be0db differs from pull request most recent head c07f7a7. Consider uploading reports for the commit c07f7a7 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17926/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #17926   +/-   ##
   =======================================
     Coverage   66.05%   66.05%           
   =======================================
     Files        1591     1591           
     Lines       62418    62411    -7     
     Branches     6286     6289    +3     
   =======================================
   - Hits        41228    41225    -3     
   + Misses      19568    19564    -4     
     Partials     1622     1622           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `50.86% <53.84%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ntend/src/SqlLab/components/TableElement/index.tsx](https://codecov.io/gh/apache/superset/pull/17926/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmxlRWxlbWVudC9pbmRleC50c3g=) | `72.30% <ø> (ø)` | |
   | [...d/src/SqlLab/components/SqlEditorLeftBar/index.tsx](https://codecov.io/gh/apache/superset/pull/17926/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvckxlZnRCYXIvaW5kZXgudHN4) | `57.14% <53.84%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [568b8e1...c07f7a7](https://codecov.io/gh/apache/superset/pull/17926?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


[GitHub] [superset] github-actions[bot] commented on pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #17926:
URL: https://github.com/apache/superset/pull/17926#issuecomment-1023801343


   @AAfghahi Ephemeral environment spinning up at http://54.213.205.134:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.


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


[GitHub] [superset] github-actions[bot] commented on pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #17926:
URL: https://github.com/apache/superset/pull/17926#issuecomment-1024598523


   Ephemeral environment shutdown and build artifacts deleted.


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


[GitHub] [superset] JosueLugaro commented on a change in pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
JosueLugaro commented on a change in pull request #17926:
URL: https://github.com/apache/superset/pull/17926#discussion_r794029886



##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -17,86 +17,105 @@
  * under the License.
  */
 import React from 'react';
-import PropTypes from 'prop-types';
 import Button from 'src/components/Button';
-import { t, styled, css } from '@superset-ui/core';
+import { t, styled, css, SupersetTheme } from '@superset-ui/core';
 import Collapse from 'src/components/Collapse';
 import Icons from 'src/components/Icons';
 import TableSelector from 'src/components/TableSelector';
 import { IconTooltip } from 'src/components/IconTooltip';
-import TableElement from '../TableElement';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement, { Table, TableElementProps } from '../TableElement';
 
-const propTypes = {
-  queryEditor: PropTypes.object.isRequired,
-  height: PropTypes.number,
-  tables: PropTypes.array,
-  actions: PropTypes.object,
-  database: PropTypes.object,
-  offline: PropTypes.bool,
-};
+interface ExtendedTable extends Table {
+  expanded: any;
+}
+
+interface actionsTypes {
+  queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+  queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+  collapseTable: (table: Table) => void;
+  expandTable: (table: Table) => void;
+  addTable: (queryEditor: any, value: any, schema: any) => void;
+  setDatabases: (arg0: any) => {};
+  addDangerToast: (msg: string) => void;
+  queryEditorSetSchema: (schema?: string) => void;
+  queryEditorSetSchemaOptions: () => void;
+  queryEditorSetTableOptions: (options: Array<any>) => void;
+  resetState: () => void;
+}
 
-const defaultProps = {
-  actions: {},
-  height: 500,
-  offline: false,
-  tables: [],
+type dbType = {
+  id: number;
 };
 
+interface SqlEditorLeftBarProps {
+  queryEditor: QueryEditor;
+  height?: number;
+  tables?: ExtendedTable[];
+  actions: actionsTypes & TableElementProps['actions'];
+  database: DatabaseObject;
+  offline: boolean;
+}
+
 const StyledScrollbarContainer = styled.div`
   flex: 1 1 auto;
   overflow: auto;
 `;
 
-const collapseStyles = css`
+const collapseStyles = (theme: SupersetTheme) => css`
   .ant-collapse-item {
-    margin-bottom: ${({ theme }) => theme.gridUnit * 3}px;
+    margin-bottom: ${theme.gridUnit * 3}px;
   }
   .ant-collapse-header {
     padding: 0px !important;
     display: flex;
     align-items: center;
   }
   .ant-collapse-content-box {
-    padding: 0px ${({ theme }) => theme.gridUnit * 4}px 0px 0px !important;
+    padding: 0px ${theme.gridUnit * 4}px 0px 0px !important;
   }
   .ant-collapse-arrow {
-    top: ${({ theme }) => theme.gridUnit * 2}px !important;
-    color: ${({ theme }) => theme.colors.primary.dark1} !important;
+    top: ${theme.gridUnit * 2}px !important;
+    color: ${theme.colors.primary.dark1} !important;
     &: hover {
-      color: ${({ theme }) => theme.colors.primary.dark2} !important;
+      color: ${theme.colors.primary.dark2} !important;
     }
   }
 `;
 
 export default function SqlEditorLeftBar({
   actions,
   database,
-  height,
+  height = 500,
   queryEditor,
-  tables: tb,
-}) {
-  const onDbChange = db => {
+  tables = [],
+}: SqlEditorLeftBarProps) {
+  const onDbChange = (db: dbType) => {

Review comment:
       Good catch, will fix that asap.




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


[GitHub] [superset] JosueLugaro commented on a change in pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
JosueLugaro commented on a change in pull request #17926:
URL: https://github.com/apache/superset/pull/17926#discussion_r793910993



##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -0,0 +1,239 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import Button from 'src/components/Button';
+import { t, styled, css } from '@superset-ui/core';
+import Collapse from 'src/components/Collapse';
+import Icons from 'src/components/Icons';
+import TableSelector from 'src/components/TableSelector';
+import { IconTooltip } from 'src/components/IconTooltip';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement from '../TableElement';
+
+// const propTypes = {
+//   queryEditor: PropTypes.object.isRequired,
+//   height: PropTypes.number,
+//   tables: PropTypes.array,
+//   actions: PropTypes.object,
+//   database: PropTypes.object,
+//   offline: PropTypes.bool,
+// };
+
+/**
+    onSchemaChange={actions.queryEditorSetSchema}
+    onSchemasLoad={actions.queryEditorSetSchemaOptions}
+    onTableChange={onTableChange}
+    onTablesLoad={actions.queryEditorSetTableOptions}
+ */
+
+// anywhere there is void or any I didnt know what to put, will look into it
+
+interface actionsTypes {
+  queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+  queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+  /*
+    Need to add:
+    addTable (X)
+    collapseTable (X)
+    expandTable (X)
+    queryEditorSetSchemaOptions (X)
+    queryEditorSetTableOptions (X)
+    resetState (X)
+  */
+
+  collapseTable: (table: tableType) => void;
+  expandTable: (table: tableType) => void;
+
+  // This came from /home/josue/superset/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx
+  addTable: (queryEditor: any, value: any, schema: any) => void;
+
+  // utilized the typing that TableSelector used for its props, which are the same functions for these two below
+  setDatabases: (arg0: any) => {};
+  addDangerToast: (msg: string) => void;
+  queryEditorSetSchema: (schema?: string) => void;
+  queryEditorSetSchemaOptions: () => void;
+  queryEditorSetTableOptions: (options: Array<any>) => void;
+  resetState: () => void;
+}
+
+// my first attempt at actionTypes:
+// interface actionsTypes {
+//   queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+//   queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+//   setDatabases: (databases: any) => object;
+//   addDangerToast: (text: string, options?: ToastOptions) => void;
+//   queryEditorSetSchema: (queryEditor: QueryEditor, schema: any) => void;
+// }
+
+type tableType = {
+  id: number;
+  expanded: boolean;
+};
+
+type dbType = {
+  id: number;
+};
+
+interface propTypes {

Review comment:
       Thank you for the feed back, I changed the interface to SqlEditorLeftBarProps.




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


[GitHub] [superset] JosueLugaro commented on a change in pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
JosueLugaro commented on a change in pull request #17926:
URL: https://github.com/apache/superset/pull/17926#discussion_r793911211



##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -0,0 +1,239 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import Button from 'src/components/Button';
+import { t, styled, css } from '@superset-ui/core';
+import Collapse from 'src/components/Collapse';
+import Icons from 'src/components/Icons';
+import TableSelector from 'src/components/TableSelector';
+import { IconTooltip } from 'src/components/IconTooltip';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement from '../TableElement';
+
+// const propTypes = {
+//   queryEditor: PropTypes.object.isRequired,
+//   height: PropTypes.number,
+//   tables: PropTypes.array,
+//   actions: PropTypes.object,
+//   database: PropTypes.object,
+//   offline: PropTypes.bool,
+// };
+
+/**
+    onSchemaChange={actions.queryEditorSetSchema}
+    onSchemasLoad={actions.queryEditorSetSchemaOptions}
+    onTableChange={onTableChange}
+    onTablesLoad={actions.queryEditorSetTableOptions}
+ */
+
+// anywhere there is void or any I didnt know what to put, will look into it
+
+interface actionsTypes {
+  queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+  queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+  /*
+    Need to add:
+    addTable (X)
+    collapseTable (X)
+    expandTable (X)
+    queryEditorSetSchemaOptions (X)
+    queryEditorSetTableOptions (X)
+    resetState (X)
+  */
+
+  collapseTable: (table: tableType) => void;
+  expandTable: (table: tableType) => void;
+
+  // This came from /home/josue/superset/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx
+  addTable: (queryEditor: any, value: any, schema: any) => void;
+
+  // utilized the typing that TableSelector used for its props, which are the same functions for these two below
+  setDatabases: (arg0: any) => {};
+  addDangerToast: (msg: string) => void;
+  queryEditorSetSchema: (schema?: string) => void;
+  queryEditorSetSchemaOptions: () => void;
+  queryEditorSetTableOptions: (options: Array<any>) => void;
+  resetState: () => void;
+}
+
+// my first attempt at actionTypes:
+// interface actionsTypes {
+//   queryEditorSetDb: (queryEditor: QueryEditor, dbId: number) => void;
+//   queryEditorSetFunctionNames: (queryEditor: QueryEditor, dbId: number) => void;
+//   setDatabases: (databases: any) => object;
+//   addDangerToast: (text: string, options?: ToastOptions) => void;
+//   queryEditorSetSchema: (queryEditor: QueryEditor, schema: any) => void;
+// }
+
+type tableType = {
+  id: number;
+  expanded: boolean;
+};
+
+type dbType = {
+  id: number;
+};
+
+interface propTypes {
+  queryEditor: QueryEditor;
+  height: number;

Review comment:
       Made both of these properties optional👍.




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


[GitHub] [superset] lyndsiWilliams commented on a change in pull request #17926: refactor: sqleditorleftbar to typescript

Posted by GitBox <gi...@apache.org>.
lyndsiWilliams commented on a change in pull request #17926:
URL: https://github.com/apache/superset/pull/17926#discussion_r794086343



##########
File path: superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
##########
@@ -17,86 +17,100 @@
  * under the License.
  */
 import React from 'react';
-import PropTypes from 'prop-types';
 import Button from 'src/components/Button';
-import { t, styled, css } from '@superset-ui/core';
+import { t, styled, css, SupersetTheme } from '@superset-ui/core';
 import Collapse from 'src/components/Collapse';
 import Icons from 'src/components/Icons';
 import TableSelector from 'src/components/TableSelector';
 import { IconTooltip } from 'src/components/IconTooltip';
-import TableElement from '../TableElement';
+import { QueryEditor } from 'src/SqlLab/types';
+import { DatabaseObject } from 'src/components/DatabaseSelector';
+import TableElement, { Table, TableElementProps } from '../TableElement';
 
-const propTypes = {
-  queryEditor: PropTypes.object.isRequired,
-  height: PropTypes.number,
-  tables: PropTypes.array,
-  actions: PropTypes.object,
-  database: PropTypes.object,
-  offline: PropTypes.bool,
-};
+interface ExtendedTable extends Table {
+  expanded: any;

Review comment:
       Is this able to be described by a type? I remember seeing this with you the other day but don't remember exactly what it was, I think this might have been a `string` or a `boolean`?




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