You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "CodeWithPravinMaske (via GitHub)" <gi...@apache.org> on 2026/10/22 10:32:11 UTC

[PR] fix(dashboard): offer image export only for Big Number charts [superset]

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

   ### SUMMARY
   Big Number (KPI) charts show a single final number. Their Download menu still offered "Export to .CSV", "Export to Excel" and "Export as PDF", although there is no table of data worth exporting, and a PDF of the card is the same picture as the PNG (the PDF/PNG chart exports came with #38535).
   
   This keeps the image exports (JPEG, PNG) and hides the data and PDF exports for `big_number`, `big_number_total` and `pop_kpi`:
   
   - dashboard chart menu (`SliceHeaderControls`): CSV, Excel and PDF are hidden for these chart types
   - Explore "Data Export Options" (`useExploreAdditionalActionsMenu`): CSV, JSON, Excel and PDF are hidden under both "Export All Data" and "Export Current View"
   
   The rule lives in one helper, `isImageOnlyExportViz`, so other single-value chart types can be added later. All other chart types are unchanged.
   
   I did not find an earlier discussion about whether these chart types should get the data and PDF exports (the review of #38535 was about code structure and tests), so I am happy to adjust which chart types are included, or to turn this into a per-viz setting if maintainers prefer.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before: Download menu of a Big Number chart lists .CSV, Excel, screenshot (jpeg), screenshot (png), PDF.
   After: only screenshot (jpeg) and screenshot (png).
   (screenshots attached below)
   
   ### TESTING INSTRUCTIONS
   1. Open a dashboard with a Big Number chart > chart three-dot menu > Download: only the image exports are listed.
   2. Same on a table chart: CSV, Excel, JPEG, PNG and PDF are still listed.
   3. In Explore with a Big Number chart > Data Export Options: only the image exports are listed. A table chart still shows all.
   
   Unit tests: `SliceHeaderControls.test.tsx`, `useExploreAdditionalActionsMenu.test.tsx`, `isImageOnlyExportViz.test.ts`.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] 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
   - [x] Removes existing feature or API (CSV/Excel/PDF menu items for Big Number charts only)
   


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


Re: [PR] fix(dashboard): offer image export only for single-number Big Number charts [superset]

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


##########
superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreAdditionalActionsMenu.test.tsx:
##########
@@ -520,3 +520,75 @@ test('Export All Data JPEG screenshot passes addWarningToast to downloadAsImage'
     mockAddWarningToast,
   );
 });
+
+test('A Big Number chart keeps only the image exports in Data Export Options', async () => {
+  render(
+    <TestComponent
+      {...defaultProps}
+      latestQueryFormData={{
+        datasource: '1__table',
+        viz_type: 'big_number_total',
+      }}
+    />,
+    {
+      useRedux: true,
+      initialState: { explore: { can_export_image: true } },
+    },
+  );
+
+  await userEvent.hover(await screen.findByText('Data Export Options'));
+  await userEvent.hover(await screen.findByText('Export All Data'));
+  expect(
+    await screen.findByText('Export screenshot (jpeg)'),
+  ).toBeInTheDocument();
+  expect(screen.getByText('Export screenshot (png)')).toBeInTheDocument();
+  expect(screen.queryByText('Export to .CSV')).not.toBeInTheDocument();
+  expect(screen.queryByText('Export to Excel')).not.toBeInTheDocument();
+  expect(screen.queryByText('Export as PDF')).not.toBeInTheDocument();
+});
+
+test('A Big Number chart keeps only the image exports in Export Current View', async () => {
+  render(
+    <TestComponent
+      {...defaultProps}
+      latestQueryFormData={{
+        datasource: '1__table',
+        viz_type: 'big_number_total',
+      }}
+    />,
+    {
+      useRedux: true,
+      initialState: { explore: { can_export_image: true } },
+    },
+  );
+
+  await userEvent.hover(await screen.findByText('Data Export Options'));
+  await userEvent.hover(await screen.findByText('Export Current View'));
+  expect(
+    await screen.findByText('Export screenshot (jpeg)'),
+  ).toBeInTheDocument();
+  expect(screen.getByText('Export screenshot (png)')).toBeInTheDocument();
+  expect(screen.queryByText('Export to .CSV')).not.toBeInTheDocument();
+  expect(screen.queryByText('Export to Excel')).not.toBeInTheDocument();
+  expect(screen.queryByText('Export as PDF')).not.toBeInTheDocument();

Review Comment:
   Neither image-only submenu test asserts that `Export to .JSON` is gone, so dropping `EXPORT_TO_JSON` and `EXPORT_CURRENT_TO_JSON` from `DATA_AND_PDF_EXPORT_KEYS` would put JSON back under both "Export All Data" and "Export Current View" for a Big Number chart while all of these tests still pass. Could both tests also assert `screen.queryByText('Export to .JSON')` is not in the document?



##########
superset-frontend/src/utils/isImageOnlyExportViz.ts:
##########
@@ -0,0 +1,31 @@
+/**
+ * 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 { VizType } from '@superset-ui/core';
+
+// A KPI card shows one final number: it has no table of data worth exporting, and a PDF
+// of it is the same picture as the PNG. These charts offer image exports only. Big Number with
+// Trendline is not listed: its query returns the daily series, which people export.
+const IMAGE_ONLY_EXPORT_VIZ_TYPES: string[] = [
+  VizType.BigNumberTotal,
+  VizType.BigNumberPeriodOverPeriod,

Review Comment:
   `pop_kpi` is not a single final number: its query takes `time_offsets` for each comparison period and `cols` as a group-by, and the card renders the current value against those comparison columns. Listing it here removes CSV/JSON/Excel of the current-versus-previous values in Explore and CSV/Excel on the dashboard, so someone who exports the numbers behind a "revenue vs. 1 year ago" card loses the only way to get them. Should `BigNumberPeriodOverPeriod` stay out of this list, the same way the trendline chart did?



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


Re: [PR] fix(dashboard): offer image export only for single-number Big Number charts [superset]

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


##########
superset-frontend/src/utils/isImageOnlyExportViz.ts:
##########
@@ -0,0 +1,31 @@
+/**
+ * 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 { VizType } from '@superset-ui/core';
+
+// A KPI card shows one final number: it has no table of data worth exporting, and a PDF
+// of it is the same picture as the PNG. These charts offer image exports only.
+const IMAGE_ONLY_EXPORT_VIZ_TYPES: string[] = [
+  VizType.BigNumber,

Review Comment:
   You're right: big_number is Big Number with Trendline and its query returns the daily series, so it should keep CSV/Excel. Image-only is now limited to big_number_total and pop_kpi, and there is a test that the trendline chart keeps its data exports.



##########
superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreAdditionalActionsMenu.test.tsx:
##########
@@ -520,3 +520,29 @@ test('Export All Data JPEG screenshot passes addWarningToast to downloadAsImage'
     mockAddWarningToast,
   );
 });
+
+test('A Big Number chart keeps only the image exports in Data Export Options', async () => {
+  render(
+    <TestComponent
+      {...defaultProps}
+      latestQueryFormData={{
+        datasource: '1__table',
+        viz_type: 'big_number_total',
+      }}
+    />,
+    {
+      useRedux: true,
+      initialState: { explore: { can_export_image: true } },
+    },
+  );
+
+  await userEvent.hover(await screen.findByText('Data Export Options'));
+  await userEvent.hover(await screen.findByText('Export All Data'));

Review Comment:
   Added a test that opens Export Current View for a Big Number fixture and asserts that only the screenshot items remain.



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


Re: [PR] fix(dashboard): offer image export only for Big Number charts [superset]

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

   <img width="1500" height="758" alt="Screenshot 2026-10-22 at 4 08 00 PM" src="https://github.com/user-attachments/assets/3e6949eb-8ad7-4fe5-8eff-69b036a01991" />
   <img width="1502" height="762" alt="Screenshot 2026-10-22 at 4 07 53 PM" src="https://github.com/user-attachments/assets/7e8facb2-1c21-4d2d-88f8-ecb78d3686a4" />
   


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


Re: [PR] fix(dashboard): offer image export only for Big Number charts [superset]

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

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/45619?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 84.10%. Comparing base ([`47300cf`](https://app.codecov.io/gh/apache/superset/commit/47300cf4c2f13aa3a4bef6c7f349f58397de0035?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`440937a`](https://app.codecov.io/gh/apache/superset/commit/440937a28e90d74570d43bef8e59cc2e13eba250?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #45619   +/-   ##
   =======================================
     Coverage   84.10%   84.10%           
   =======================================
     Files        3056     3057    +1     
     Lines      201358   201376   +18     
     Branches    47085    47096   +11     
   =======================================
   + Hits       169356   169373   +17     
   - Misses      28756    28757    +1     
     Partials     3246     3246           
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/45619/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/45619/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `80.16% <100.00%> (+<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=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/45619?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


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


Re: [PR] fix(dashboard): offer image export only for Big Number charts [superset]

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

   Thanks @sadpandajoe, both fair points.
   
   You’re right: big_number is Big Number with Trendline and its query returns the daily series, so it should keep CSV/Excel. Image-only is now limited to big_number_total and pop_kpi, and there is a test that the trendline chart keeps its data exports.
   Added a test that opens “Export Current View” for a Big Number fixture and asserts that only the screenshot items remain.


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


Re: [PR] fix(dashboard): offer image export only for single-number Big Number charts [superset]

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


##########
superset-frontend/src/utils/isImageOnlyExportViz.ts:
##########
@@ -0,0 +1,31 @@
+/**
+ * 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 { VizType } from '@superset-ui/core';
+
+// A KPI card shows one final number: it has no table of data worth exporting, and a PDF
+// of it is the same picture as the PNG. These charts offer image exports only. Big Number with
+// Trendline is not listed: its query returns the daily series, which people export.
+const IMAGE_ONLY_EXPORT_VIZ_TYPES: string[] = [
+  VizType.BigNumberTotal,
+  VizType.BigNumberPeriodOverPeriod,

Review Comment:
   Agreed, pop_kpi returns the comparison columns (time_offsets), so it keeps its data exports. Image-only is now just big_number_total, and there is a test that pop_kpi keeps them.



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


Re: [PR] fix(dashboard): offer image export only for Big Number charts [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #45619:
URL: https://github.com/apache/superset/pull/45619#issuecomment-6338732296

   ## CodeAnt PR Risk: Low Risk
   
   - The PR appears safe to merge; no actionable issues were identified in the review.
   
   **Assessed commit:** `440937a28e90`


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


Re: [PR] fix(dashboard): offer image export only for Big Number charts [superset]

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


##########
superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreAdditionalActionsMenu.test.tsx:
##########
@@ -520,3 +520,29 @@ test('Export All Data JPEG screenshot passes addWarningToast to downloadAsImage'
     mockAddWarningToast,
   );
 });
+
+test('A Big Number chart keeps only the image exports in Data Export Options', async () => {
+  render(
+    <TestComponent
+      {...defaultProps}
+      latestQueryFormData={{
+        datasource: '1__table',
+        viz_type: 'big_number_total',
+      }}
+    />,
+    {
+      useRedux: true,
+      initialState: { explore: { can_export_image: true } },
+    },
+  );
+
+  await userEvent.hover(await screen.findByText('Data Export Options'));
+  await userEvent.hover(await screen.findByText('Export All Data'));

Review Comment:
   This test only opens "Export All Data", so the new `currentViewChildren` filtering is never exercised. If that filter were removed, CSV/JSON/Excel/PDF would reappear under "Export Current View" for a Big Number chart and this test would still pass. Could you also hover "Export Current View" for this fixture (the registry mock already enables it) and assert that only the screenshot items remain?



##########
superset-frontend/src/utils/isImageOnlyExportViz.ts:
##########
@@ -0,0 +1,31 @@
+/**
+ * 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 { VizType } from '@superset-ui/core';
+
+// A KPI card shows one final number: it has no table of data worth exporting, and a PDF
+// of it is the same picture as the PNG. These charts offer image exports only.
+const IMAGE_ONLY_EXPORT_VIZ_TYPES: string[] = [
+  VizType.BigNumber,

Review Comment:
   `VizType.BigNumber` is Big Number with Trendline, and its query returns the timestamp/metric series, not just the final number. Listing it here removes CSV/Excel export of that series in both the dashboard menu and Explore, so someone who exports the daily values behind a KPI-with-trendline loses the only way to get them. Should the trendline variant keep its data exports, with image-only limited to `big_number_total` and `pop_kpi`?



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


Re: [PR] fix(dashboard): offer image export only for single-number Big Number charts [superset]

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


##########
superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreAdditionalActionsMenu.test.tsx:
##########
@@ -520,3 +520,75 @@ test('Export All Data JPEG screenshot passes addWarningToast to downloadAsImage'
     mockAddWarningToast,
   );
 });
+
+test('A Big Number chart keeps only the image exports in Data Export Options', async () => {
+  render(
+    <TestComponent
+      {...defaultProps}
+      latestQueryFormData={{
+        datasource: '1__table',
+        viz_type: 'big_number_total',
+      }}
+    />,
+    {
+      useRedux: true,
+      initialState: { explore: { can_export_image: true } },
+    },
+  );
+
+  await userEvent.hover(await screen.findByText('Data Export Options'));
+  await userEvent.hover(await screen.findByText('Export All Data'));
+  expect(
+    await screen.findByText('Export screenshot (jpeg)'),
+  ).toBeInTheDocument();
+  expect(screen.getByText('Export screenshot (png)')).toBeInTheDocument();
+  expect(screen.queryByText('Export to .CSV')).not.toBeInTheDocument();
+  expect(screen.queryByText('Export to Excel')).not.toBeInTheDocument();
+  expect(screen.queryByText('Export as PDF')).not.toBeInTheDocument();
+});
+
+test('A Big Number chart keeps only the image exports in Export Current View', async () => {
+  render(
+    <TestComponent
+      {...defaultProps}
+      latestQueryFormData={{
+        datasource: '1__table',
+        viz_type: 'big_number_total',
+      }}
+    />,
+    {
+      useRedux: true,
+      initialState: { explore: { can_export_image: true } },
+    },
+  );
+
+  await userEvent.hover(await screen.findByText('Data Export Options'));
+  await userEvent.hover(await screen.findByText('Export Current View'));
+  expect(
+    await screen.findByText('Export screenshot (jpeg)'),
+  ).toBeInTheDocument();
+  expect(screen.getByText('Export screenshot (png)')).toBeInTheDocument();
+  expect(screen.queryByText('Export to .CSV')).not.toBeInTheDocument();
+  expect(screen.queryByText('Export to Excel')).not.toBeInTheDocument();
+  expect(screen.queryByText('Export as PDF')).not.toBeInTheDocument();

Review Comment:
   Added Export to .JSON absence assertions to both image-only submenu tests (Export All Data and Export Current View).



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