From 3aa6b5a5156821ed81e994ed2074456fc5cae767 Mon Sep 17 00:00:00 2001 From: Ilyas <31275446+LahmerIlyas@users.noreply.github.com> Date: Thu, 2 Jun 2022 05:42:51 +0100 Subject: [PATCH] fix: exporting CSV can't apply pagination #17861 (#20178) --- .../src/dashboard/components/gridComponents/Chart.jsx | 1 + .../src/explore/components/ExploreChartHeader/index.jsx | 2 ++ .../src/explore/components/ExploreViewContainer/index.jsx | 1 + .../components/useExploreAdditionalActionsMenu/index.jsx | 2 ++ 4 files changed, 6 insertions(+) diff --git a/superset-frontend/src/dashboard/components/gridComponents/Chart.jsx b/superset-frontend/src/dashboard/components/gridComponents/Chart.jsx index 33b16c7d8fe04..7be6df4ee9409 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Chart.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Chart.jsx @@ -299,6 +299,7 @@ export default class Chart extends React.Component { resultType: 'full', resultFormat: 'csv', force: true, + ownState: this.props.ownState, }); } diff --git a/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx b/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx index fa3f5f93542a3..fb85882f02337 100644 --- a/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx +++ b/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx @@ -65,6 +65,7 @@ export const ExploreChartHeader = ({ slice, actions, formData, + ownState, chart, user, canOverwrite, @@ -138,6 +139,7 @@ export const ExploreChartHeader = ({ slice, actions.redirectSQLLab, openPropertiesModal, + ownState, ); const oldSliceName = slice?.slice_name; diff --git a/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx b/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx index bf8a17a3650cc..3685023f39f0e 100644 --- a/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx +++ b/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx @@ -521,6 +521,7 @@ function ExploreViewContainer(props) { table_name={props.table_name} formData={props.form_data} chart={props.chart} + ownState={props.ownState} user={props.user} reports={props.reports} onSaveChart={toggleModal} diff --git a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx index cc416dd56165a..652347326778f 100644 --- a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx +++ b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx @@ -95,6 +95,7 @@ export const useExploreAdditionalActionsMenu = ( slice, onOpenInEditor, onOpenPropertiesModal, + ownState, ) => { const theme = useTheme(); const { addDangerToast, addSuccessToast } = useToasts(); @@ -132,6 +133,7 @@ export const useExploreAdditionalActionsMenu = ( canDownloadCSV ? exportChart({ formData: latestQueryFormData, + ownState, resultType: 'full', resultFormat: 'csv', })