You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "lilykuang (via GitHub)" <gi...@apache.org> on 2023/04/06 00:17:51 UTC

[GitHub] [superset] lilykuang opened a new pull request, #23603: feat: implement drill by table [WIP]

lilykuang opened a new pull request, #23603:
URL: https://github.com/apache/superset/pull/23603

   <!---
   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 -->
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   ![DrillByTable](https://user-images.githubusercontent.com/5705598/230241608-eed690f2-8bf3-4f97-9612-b2162cde1f5b.gif)
   
   
   ### 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] kgabryje commented on a diff in pull request #23603: feat: implement drill by table [WIP]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #23603:
URL: https://github.com/apache/superset/pull/23603#discussion_r1159612238


##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:
##########
@@ -106,6 +118,12 @@ export default function DrillByModal({
   dataset,
 }: DrillByModalProps) {
   const theme = useTheme();
+  const [chartDataResult, setChartDataResult] = useState<QueryData[]>();
+  const [showChart, setShowChart] = useState(true);

Review Comment:
   Can we use ChartType enum instead of a boolean here? I think it will be easier to understand the intention of showing table instead of just NOT showing the chart 🙂 



-- 
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] kgabryje commented on a diff in pull request #23603: feat: implement drill by table [WIP]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #23603:
URL: https://github.com/apache/superset/pull/23603#discussion_r1160682693


##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:
##########
@@ -88,24 +94,28 @@ const ModalFooter = ({ formData, closeModal }: ModalFooterProps) => {
 
 interface DrillByModalProps {
   column?: Column;
+  dataset: Dataset;
   filters?: BinaryQueryObjectFilterClause[];
   formData: BaseFormData & { [key: string]: any };
   groupbyFieldName?: string;
   onHideModal: () => void;
-  showModal: boolean;
-  dataset: Dataset;
 }
 
 export default function DrillByModal({
   column,
+  dataset,
   filters,
   formData,
   groupbyFieldName = 'groupby',
   onHideModal,
-  showModal,
-  dataset,
 }: DrillByModalProps) {
   const theme = useTheme();
+  const [chartDataResult, setChartDataResult] = useState<QueryData[]>();
+  const [drillBy, setDrillBy] = useState<DrillByType>(DrillByType.Chart);

Review Comment:
   Could you change the name to sth more descriptive? Like for example `displayMode` or `drillByDisplayMode`?



-- 
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] kgabryje commented on a diff in pull request #23603: feat: implement drill by table [WIP]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #23603:
URL: https://github.com/apache/superset/pull/23603#discussion_r1159599979


##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:
##########
@@ -62,18 +72,20 @@ const ModalFooter = ({ formData, closeModal }: ModalFooterProps) => {
   }, [dashboardPageId, datasource_id, datasource_type, formData]);
   return (
     <>
-      <Button buttonStyle="secondary" buttonSize="small" onClick={noOp}>
-        <Link
-          css={css`
-            &:hover {
-              text-decoration: none;
-            }
-          `}
-          to={url}
-        >
-          {t('Edit chart')}
-        </Link>
-      </Button>
+      {showEditChart && (

Review Comment:
   I think we should still show the button even in table mode, and open the drill by chart just like before (I mean, with original viz type, not table). @kasiazjc wdyt?



-- 
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] kgabryje commented on a diff in pull request #23603: feat: implement drill by table [WIP]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #23603:
URL: https://github.com/apache/superset/pull/23603#discussion_r1160745649


##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:
##########
@@ -175,7 +195,47 @@ export default function DrillByModal({
         `}
       >
         {metadataBar}
-        <DrillByChart formData={updatedFormData} />
+        <div
+          css={css`
+            margin-bottom: ${theme.gridUnit * 6}px;
+            .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {
+              box-shadow: none;
+            }
+          `}
+        >
+          <Radio.Group
+            onChange={({ target: { value } }) => {
+              setDrillBy(value);
+            }}
+            defaultValue={DrillByType.Chart}
+          >
+            <Radio.Button
+              value={DrillByType.Chart}
+              data-test="drill-by-chart-radio"
+            >
+              {t('Chart')}
+            </Radio.Button>
+            <Radio.Button
+              value={DrillByType.Table}
+              data-test="drill-by-table-radio"
+            >
+              {t('Table')}
+            </Radio.Button>
+          </Radio.Group>
+        </div>
+        {drillBy === DrillByType.Chart && chartDataResult && (

Review Comment:
   We probably should display the spinner for Table mode too



-- 
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 #23603: feat: implement drill by table [WIP]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #23603:
URL: https://github.com/apache/superset/pull/23603#issuecomment-1500739798

   ## [Codecov](https://codecov.io/gh/apache/superset/pull/23603?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 [#23603](https://codecov.io/gh/apache/superset/pull/23603?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (de62ff5) into [master](https://codecov.io/gh/apache/superset/commit/8ef49a578980dfc166a61f944f3c336fed17f466?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8ef49a5) will **increase** coverage by `0.00%`.
   > The diff coverage is `83.33%`.
   
   > :exclamation: Current head de62ff5 differs from pull request most recent head 1e45718. Consider uploading reports for the commit 1e45718 to get more accurate results
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #23603   +/-   ##
   =======================================
     Coverage   67.70%   67.71%           
   =======================================
     Files        1918     1918           
     Lines       74133    74165   +32     
     Branches     8052     8056    +4     
   =======================================
   + Hits        50193    50219   +26     
     Misses      21887    21887           
   - Partials     2053     2059    +6     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `53.89% <82.60%> (-0.01%)` | :arrow_down: |
   
   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/23603?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...tend/src/components/Chart/DrillBy/DrillByChart.tsx](https://codecov.io/gh/apache/superset/pull/23603?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ2hhcnQvRHJpbGxCeS9EcmlsbEJ5Q2hhcnQudHN4) | `100.00% <ø> (ø)` | |
   | [.../src/components/Chart/DrillBy/DrillByMenuItems.tsx](https://codecov.io/gh/apache/superset/pull/23603?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ2hhcnQvRHJpbGxCeS9EcmlsbEJ5TWVudUl0ZW1zLnRzeA==) | `84.37% <0.00%> (-1.34%)` | :arrow_down: |
   | [...src/dashboard/components/PropertiesModal/index.tsx](https://codecov.io/gh/apache/superset/pull/23603?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1Byb3BlcnRpZXNNb2RhbC9pbmRleC50c3g=) | `64.03% <ø> (ø)` | |
   | [superset/migrations/env.py](https://codecov.io/gh/apache/superset/pull/23603?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvbWlncmF0aW9ucy9lbnYucHk=) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/23603?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [...tend/src/components/Chart/DrillBy/DrillByModal.tsx](https://codecov.io/gh/apache/superset/pull/23603?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ2hhcnQvRHJpbGxCeS9EcmlsbEJ5TW9kYWwudHN4) | `76.74% <76.92%> (-9.93%)` | :arrow_down: |
   | [superset/views/core.py](https://codecov.io/gh/apache/superset/pull/23603?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `75.27% <86.66%> (+0.39%)` | :arrow_up: |
   | [...t-frontend/src/explore/actions/saveModalActions.js](https://codecov.io/gh/apache/superset/pull/23603?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvYWN0aW9ucy9zYXZlTW9kYWxBY3Rpb25zLmpz) | `98.75% <100.00%> (+1.41%)` | :arrow_up: |
   | [superset/security/manager.py](https://codecov.io/gh/apache/superset/pull/23603?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc2VjdXJpdHkvbWFuYWdlci5weQ==) | `95.96% <100.00%> (+0.01%)` | :arrow_up: |
   | [superset/utils/decorators.py](https://codecov.io/gh/apache/superset/pull/23603?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvZGVjb3JhdG9ycy5weQ==) | `94.36% <100.00%> (ø)` | |
   | ... and [2 more](https://codecov.io/gh/apache/superset/pull/23603?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ... and [1 file with indirect coverage changes](https://codecov.io/gh/apache/superset/pull/23603/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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] kgabryje commented on a diff in pull request #23603: feat: implement drill by table [WIP]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #23603:
URL: https://github.com/apache/superset/pull/23603#discussion_r1160745446


##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:
##########
@@ -175,7 +195,47 @@ export default function DrillByModal({
         `}
       >
         {metadataBar}
-        <DrillByChart formData={updatedFormData} />
+        <div
+          css={css`
+            margin-bottom: ${theme.gridUnit * 6}px;
+            .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {
+              box-shadow: none;
+            }
+          `}
+        >
+          <Radio.Group
+            onChange={({ target: { value } }) => {
+              setDrillBy(value);
+            }}
+            defaultValue={DrillByType.Chart}
+          >
+            <Radio.Button
+              value={DrillByType.Chart}
+              data-test="drill-by-chart-radio"
+            >
+              {t('Chart')}
+            </Radio.Button>
+            <Radio.Button
+              value={DrillByType.Table}
+              data-test="drill-by-table-radio"
+            >
+              {t('Table')}
+            </Radio.Button>
+          </Radio.Group>
+        </div>
+        {drillBy === DrillByType.Chart && chartDataResult && (

Review Comment:
   I think we shouldn't check for `chartDataResult` here because then we won't be displaying the loading spinner from `DrillByChart`. So we should either remove that check here or move the loading spinner to this 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] lilykuang merged pull request #23603: feat: implement drill by table

Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang merged PR #23603:
URL: https://github.com/apache/superset/pull/23603


-- 
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] lilykuang commented on a diff in pull request #23603: feat: implement drill by table [WIP]

Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang commented on code in PR #23603:
URL: https://github.com/apache/superset/pull/23603#discussion_r1160797818


##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:
##########
@@ -175,7 +195,47 @@ export default function DrillByModal({
         `}
       >
         {metadataBar}
-        <DrillByChart formData={updatedFormData} />
+        <div
+          css={css`
+            margin-bottom: ${theme.gridUnit * 6}px;
+            .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {
+              box-shadow: none;
+            }
+          `}
+        >
+          <Radio.Group
+            onChange={({ target: { value } }) => {
+              setDrillBy(value);
+            }}
+            defaultValue={DrillByType.Chart}
+          >
+            <Radio.Button
+              value={DrillByType.Chart}
+              data-test="drill-by-chart-radio"
+            >
+              {t('Chart')}
+            </Radio.Button>
+            <Radio.Button
+              value={DrillByType.Table}
+              data-test="drill-by-table-radio"
+            >
+              {t('Table')}
+            </Radio.Button>
+          </Radio.Group>
+        </div>
+        {drillBy === DrillByType.Chart && chartDataResult && (

Review Comment:
   i agreed . i will move the spinner to the modal 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] kasiazjc commented on a diff in pull request #23603: feat: implement drill by table [WIP]

Posted by "kasiazjc (via GitHub)" <gi...@apache.org>.
kasiazjc commented on code in PR #23603:
URL: https://github.com/apache/superset/pull/23603#discussion_r1159606910


##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:
##########
@@ -62,18 +72,20 @@ const ModalFooter = ({ formData, closeModal }: ModalFooterProps) => {
   }, [dashboardPageId, datasource_id, datasource_type, formData]);
   return (
     <>
-      <Button buttonStyle="secondary" buttonSize="small" onClick={noOp}>
-        <Link
-          css={css`
-            &:hover {
-              text-decoration: none;
-            }
-          `}
-          to={url}
-        >
-          {t('Edit chart')}
-        </Link>
-      </Button>
+      {showEditChart && (

Review Comment:
   definitely agree with @kgabryje. Button should stay and should open the chart from the "chart" tab, as "table" tab is more like an underlying data preview, not viz



-- 
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] kgabryje commented on a diff in pull request #23603: feat: implement drill by table [WIP]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #23603:
URL: https://github.com/apache/superset/pull/23603#discussion_r1159622348


##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:
##########
@@ -175,7 +209,48 @@ export default function DrillByModal({
         `}
       >
         {metadataBar}
-        <DrillByChart formData={updatedFormData} />
+        <div
+          css={css`
+            margin-bottom: ${theme.gridUnit * 6}px;
+            .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {
+              box-shadow: none;
+            }
+          `}
+        >
+          <Radio.Group
+            onChange={({ target: { value } }) => {
+              setShowChart(value === DrillByType.chart);
+            }}
+            defaultValue={DrillByType.chart}
+          >
+            <Radio.Button
+              value={DrillByType.chart}
+              data-test="drill-by-chart-radio"
+            >
+              {t('Chart')}
+            </Radio.Button>
+            <Radio.Button
+              value={DrillByType.table}
+              data-test="drill-by-table-radio"
+            >
+              {t('Table')}
+            </Radio.Button>
+          </Radio.Group>
+        </div>
+        {showChart && chartDataResult && (
+          <DrillByChart formData={updatedFormData} result={chartDataResult} />
+        )}
+        {!showChart && chartDataResult && (
+          <SingleQueryResultPane
+            data={chartDataResult[0].data}
+            colnames={chartDataResult[0].colnames}
+            coltypes={chartDataResult[0].coltypes}
+            datasourceId={datasourceId}
+            dataSize={DATA_SIZE}
+            key={1}
+            isVisible={!showChart}

Review Comment:
   nit: `isVisible` will always be true (because otherwise we won't render the component - line 243) so maybe we could just use `isVisible` without the condition here?



-- 
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] lilykuang commented on a diff in pull request #23603: feat: implement drill by table [WIP]

Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang commented on code in PR #23603:
URL: https://github.com/apache/superset/pull/23603#discussion_r1160797818


##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:
##########
@@ -175,7 +195,47 @@ export default function DrillByModal({
         `}
       >
         {metadataBar}
-        <DrillByChart formData={updatedFormData} />
+        <div
+          css={css`
+            margin-bottom: ${theme.gridUnit * 6}px;
+            .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {
+              box-shadow: none;
+            }
+          `}
+        >
+          <Radio.Group
+            onChange={({ target: { value } }) => {
+              setDrillBy(value);
+            }}
+            defaultValue={DrillByType.Chart}
+          >
+            <Radio.Button
+              value={DrillByType.Chart}
+              data-test="drill-by-chart-radio"
+            >
+              {t('Chart')}
+            </Radio.Button>
+            <Radio.Button
+              value={DrillByType.Table}
+              data-test="drill-by-table-radio"
+            >
+              {t('Table')}
+            </Radio.Button>
+          </Radio.Group>
+        </div>
+        {drillBy === DrillByType.Chart && chartDataResult && (

Review Comment:
   i agreed =. i will move the spinner to the modal 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] kgabryje commented on a diff in pull request #23603: feat: implement drill by table [WIP]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #23603:
URL: https://github.com/apache/superset/pull/23603#discussion_r1159626451


##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:
##########
@@ -150,17 +178,23 @@ export default function DrillByModal({
         }
       `}
       show={showModal}
-      onHide={onHideModal ?? (() => null)}
+      onHide={() => {
+        setShowChart(true);
+        setChartDataResult(undefined);

Review Comment:
   What do you think about conditionally rendering the modal in `DrillByMenuItems`? Like, instead of passing `showModal` prop to `DrillByModal`, we could do `{showModal && <DrillByModal ... />}`. That way, we probably wouldn't need to worry about cleaning up on modal hide.



-- 
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] kgabryje commented on a diff in pull request #23603: feat: implement drill by table [WIP]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #23603:
URL: https://github.com/apache/superset/pull/23603#discussion_r1159617467


##########
superset-frontend/src/components/Chart/types.ts:
##########
@@ -17,6 +17,11 @@
  * under the License.
  */
 
+export enum DrillByType {
+  chart,

Review Comment:
   We mix every imaginable naming convention for enums in Superset, but I think the one we agreed to use some time ago is PascalCase 😄 



-- 
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] kgabryje commented on a diff in pull request #23603: feat: implement drill by table [WIP]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #23603:
URL: https://github.com/apache/superset/pull/23603#discussion_r1159620856


##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:
##########
@@ -175,7 +209,48 @@ export default function DrillByModal({
         `}
       >
         {metadataBar}
-        <DrillByChart formData={updatedFormData} />
+        <div
+          css={css`
+            margin-bottom: ${theme.gridUnit * 6}px;
+            .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {
+              box-shadow: none;
+            }
+          `}
+        >
+          <Radio.Group
+            onChange={({ target: { value } }) => {
+              setShowChart(value === DrillByType.chart);
+            }}
+            defaultValue={DrillByType.chart}
+          >
+            <Radio.Button
+              value={DrillByType.chart}
+              data-test="drill-by-chart-radio"
+            >
+              {t('Chart')}
+            </Radio.Button>
+            <Radio.Button
+              value={DrillByType.table}
+              data-test="drill-by-table-radio"
+            >
+              {t('Table')}
+            </Radio.Button>
+          </Radio.Group>
+        </div>
+        {showChart && chartDataResult && (
+          <DrillByChart formData={updatedFormData} result={chartDataResult} />
+        )}
+        {!showChart && chartDataResult && (
+          <SingleQueryResultPane
+            data={chartDataResult[0].data}
+            colnames={chartDataResult[0].colnames}
+            coltypes={chartDataResult[0].coltypes}
+            datasourceId={datasourceId}
+            dataSize={DATA_SIZE}
+            key={1}

Review Comment:
   I think `key` is not necessary since we only display 1 query result



-- 
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] kasiazjc commented on a diff in pull request #23603: feat: implement drill by table [WIP]

Posted by "kasiazjc (via GitHub)" <gi...@apache.org>.
kasiazjc commented on code in PR #23603:
URL: https://github.com/apache/superset/pull/23603#discussion_r1159606910


##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx:
##########
@@ -62,18 +72,20 @@ const ModalFooter = ({ formData, closeModal }: ModalFooterProps) => {
   }, [dashboardPageId, datasource_id, datasource_type, formData]);
   return (
     <>
-      <Button buttonStyle="secondary" buttonSize="small" onClick={noOp}>
-        <Link
-          css={css`
-            &:hover {
-              text-decoration: none;
-            }
-          `}
-          to={url}
-        >
-          {t('Edit chart')}
-        </Link>
-      </Button>
+      {showEditChart && (

Review Comment:
   definitely agree with @kgabryje. Button should stay and should open the chart from the "chart" tab, as "table" tab is more like an underlying data, not viz



-- 
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] kgabryje commented on pull request #23603: feat: implement drill by table [WIP]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on PR #23603:
URL: https://github.com/apache/superset/pull/23603#issuecomment-1500349555

   Just noticed a bug, but it might be a problem with DataTable component - some bottom rows are visible from under the pagination
   
   <img width="899" alt="image" src="https://user-images.githubusercontent.com/15073128/230627420-a020abfa-0ea7-4237-aed2-7a972b9908fd.png">
   


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