From b5a4f26fabfb14ea5232e8b1fa315c39a7b7fb0a Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Fri, 20 May 2022 21:31:21 +0800 Subject: [PATCH 1/2] feat: add results pane in Dashboard rebase master change title remove unused --- .../SliceHeaderControls.test.tsx | 2 +- .../components/SliceHeaderControls/index.tsx | 40 ++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/dashboard/components/SliceHeaderControls/SliceHeaderControls.test.tsx b/superset-frontend/src/dashboard/components/SliceHeaderControls/SliceHeaderControls.test.tsx index 7806a91e9b9ef..9e212018ad422 100644 --- a/superset-frontend/src/dashboard/components/SliceHeaderControls/SliceHeaderControls.test.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeaderControls/SliceHeaderControls.test.tsx @@ -90,7 +90,7 @@ const createProps = (viz_type = 'sunburst') => ({ chartStatus: 'rendered', showControls: true, supersetCanShare: true, - formData: { slice_id: 1, datasource: '58__table' }, + formData: { slice_id: 1, datasource: '58__table', viz_type: 'sunburst' }, }); test('Should render', () => { diff --git a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx index e9a940e5f431b..4dcad8b463a15 100644 --- a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx @@ -34,7 +34,9 @@ import { FeatureFlag, isFeatureEnabled } from 'src/featureFlags'; import CrossFilterScopingModal from 'src/dashboard/components/CrossFilterScopingModal/CrossFilterScopingModal'; import Icons from 'src/components/Icons'; import ModalTrigger from 'src/components/ModalTrigger'; +import Button from 'src/components/Button'; import ViewQueryModal from 'src/explore/components/controls/ViewQueryModal'; +import { ResultsPane } from 'src/explore/components/DataTablesPane'; const MENU_KEYS = { CROSS_FILTER_SCOPING: 'cross_filter_scoping', @@ -46,6 +48,7 @@ const MENU_KEYS = { FULLSCREEN: 'fullscreen', TOGGLE_CHART_DESCRIPTION: 'toggle_chart_description', VIEW_QUERY: 'view_query', + VIEW_RESULTS: 'view_results', }; const VerticalDotsContainer = styled.div` @@ -102,7 +105,7 @@ export interface SliceHeaderControlsProps { updatedDttm: number | null; isFullSize?: boolean; isDescriptionExpanded?: boolean; - formData: Pick; + formData: QueryFormData; onExploreChart: () => void; forceRefresh: (sliceId: number, dashboardId: number) => void; @@ -327,6 +330,41 @@ class SliceHeaderControls extends React.PureComponent< )} + {this.props.supersetCanExplore && ( + + + {t('View results')} + + } + modalTitle={t('Chart Data: %s', slice.slice_name)} + modalBody={ + + } + modalFooter={ + <> + + + } + draggable + resizable + responsive + /> + + )} + {(slice.description || this.props.supersetCanExplore) && ( )} From 5f4a5a0051e47b333125086f2553df3ac74088db Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Sun, 5 Jun 2022 21:12:50 +0800 Subject: [PATCH 2/2] rename menu --- .../components/SliceHeaderControls/index.tsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx index 4dcad8b463a15..dcec62d88c0e4 100644 --- a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx @@ -335,7 +335,7 @@ class SliceHeaderControls extends React.PureComponent< - {t('View results')} + {t('Drill to detail')} } modalTitle={t('Chart Data: %s', slice.slice_name)} @@ -348,15 +348,13 @@ class SliceHeaderControls extends React.PureComponent< /> } modalFooter={ - <> - - + } draggable resizable