From 41f33a38bce11b81e40a65aaa3487e9562766ef4 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Sun, 5 Jun 2022 23:18:42 +0800 Subject: [PATCH] feat: showing results pane in dashboard (#20144) --- .../SliceHeaderControls.test.tsx | 2 +- .../components/SliceHeaderControls/index.tsx | 38 ++++++++++++++++++- 2 files changed, 38 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 7806a91e9b..9e212018ad 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 e9a940e5f4..dcec62d88c 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,39 @@ class SliceHeaderControls extends React.PureComponent< )} + {this.props.supersetCanExplore && ( + + + {t('Drill to detail')} + + } + modalTitle={t('Chart Data: %s', slice.slice_name)} + modalBody={ + + } + modalFooter={ + + } + draggable + resizable + responsive + /> + + )} + {(slice.description || this.props.supersetCanExplore) && ( )}