diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
index 64522a21054..2323b749c58 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
@@ -157,62 +157,47 @@ describe('Drill to detail modal', () => {
it('refreshes the data', () => {
openModalFromMenu('big_number_total');
// move to the last page
- cy.get(".pagination-container [role='navigation'] [role='button']")
- .eq(7)
- .click();
+ cy.get('.ant-pagination-item').eq(5).click();
+ // skips error on pagination
+ cy.on('uncaught:exception', () => false);
cy.wait('@samples');
// reload
cy.get("[aria-label='reload']").click();
cy.wait('@samples');
// make sure it started back from first page
- cy.get(".pagination-container [role='navigation'] li.active").should(
- 'contain',
- '1',
- );
+ cy.get('.ant-pagination-item-active').should('contain', '1');
});
it('paginates', () => {
openModalFromMenu('big_number_total');
// checking the data
cy.getBySel('row-count-label').should('contain', '75.7k rows');
- cy.get(".ant-modal-body [role='rowgroup'] [role='row']")
- .should('have.length', 50)
- .then($rows => {
- expect($rows).to.contain('Amy');
- });
+ cy.get('.virtual-table-cell').then($rows => {
+ expect($rows).to.contain('Amy');
+ });
// checking the paginated data
- cy.get(".pagination-container [role='navigation'] [role='button']")
- .should('have.length', 9)
+ cy.get('.ant-pagination-item')
+ .should('have.length', 6)
.then($pages => {
expect($pages).to.contain('1');
expect($pages).to.contain('1514');
});
- cy.get(".pagination-container [role='navigation'] [role='button']")
- .eq(7)
- .click();
+ cy.get('.ant-pagination-item').eq(4).click();
+ // skips error on pagination
+ cy.on('uncaught:exception', () => false);
cy.wait('@samples');
- cy.get("[role='rowgroup'] [role='row']")
- .should('have.length', 43)
- .then($rows => {
- expect($rows).to.contain('Victoria');
- });
+ cy.get('.virtual-table-cell').then($rows => {
+ expect($rows).to.contain('Kelly');
+ });
// verify scroll top on pagination
- cy.getBySelLike('Number-modal')
- .find('.table-condensed')
- .scrollTo(0, 100);
+ cy.getBySelLike('Number-modal').find('.virtual-grid').scrollTo(0, 200);
- cy.get("[role='rowgroup'] [role='row']")
- .contains('Miguel')
- .should('not.be.visible');
+ cy.get('.virtual-grid').contains('Juan').should('not.be.visible');
- cy.get(".pagination-container [role='navigation'] [role='button']")
- .eq(1)
- .click();
+ cy.get('.ant-pagination-item').eq(0).click();
- cy.get("[role='rowgroup'] [role='row']")
- .contains('Aaron')
- .should('be.visible');
+ cy.get('.virtual-grid').contains('Aaron').should('be.visible');
});
});
@@ -478,8 +463,8 @@ describe('Drill to detail modal', () => {
// checking the filter
cy.getBySel('filter-val').should('contain', 'boy');
cy.getBySel('row-count-label').should('contain', '39.2k rows');
- cy.get(".pagination-container [role='navigation'] [role='button']")
- .should('have.length', 9)
+ cy.get('.ant-pagination-item')
+ .should('have.length', 6)
.then($pages => {
expect($pages).to.contain('1');
expect($pages).to.contain('785');
@@ -489,12 +474,9 @@ describe('Drill to detail modal', () => {
cy.getBySel('filter-col').find("[aria-label='close']").click();
cy.wait('@samples');
cy.getBySel('row-count-label').should('contain', '75.7k rows');
- cy.get(".pagination-container [role='navigation'] li.active").should(
- 'contain',
- '1',
- );
- cy.get(".pagination-container [role='navigation'] [role='button']")
- .should('have.length', 9)
+ cy.get('.ant-pagination-item-active').should('contain', '1');
+ cy.get('.ant-pagination-item')
+ .should('have.length', 6)
.then($pages => {
expect($pages).to.contain('1');
expect($pages).to.contain('1514');
diff --git a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx
index 160796c308b..e1207f8aac5 100644
--- a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx
+++ b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx
@@ -110,6 +110,7 @@ export default function DrillDetailModal({
}}
draggable
destroyOnClose
+ maskClosable={false}
>
diff --git a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.test.tsx b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.test.tsx
index 4b42c39da8b..a6c8fd06b07 100644
--- a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.test.tsx
+++ b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.test.tsx
@@ -134,7 +134,12 @@ test('should render the table with results', async () => {
fetchWithData();
await waitForRender();
expect(screen.getByRole('table')).toBeInTheDocument();
- expect(screen.getAllByRole('row')).toHaveLength(4);
+ expect(screen.getByText('1996')).toBeInTheDocument();
+ expect(screen.getByText('11.27')).toBeInTheDocument();
+ expect(screen.getByText('1989')).toBeInTheDocument();
+ expect(screen.getByText('23.2')).toBeInTheDocument();
+ expect(screen.getByText('1999')).toBeInTheDocument();
+ expect(screen.getByText('9')).toBeInTheDocument();
expect(
screen.getByRole('columnheader', { name: 'year' }),
).toBeInTheDocument();
diff --git a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx
index e90b30e1d7a..f3e33298d11 100644
--- a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx
+++ b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx
@@ -22,6 +22,7 @@ import React, {
useMemo,
useCallback,
useRef,
+ ReactElement,
} from 'react';
import { useSelector } from 'react-redux';
import {
@@ -32,24 +33,54 @@ import {
useTheme,
QueryFormData,
JsonObject,
+ GenericDataType,
} from '@superset-ui/core';
+import { useResizeDetector } from 'react-resize-detector';
import Loading from 'src/components/Loading';
+import BooleanCell from 'src/components/Table/cell-renderers/BooleanCell';
+import NullCell from 'src/components/Table/cell-renderers/NullCell';
+import TimeCell from 'src/components/Table/cell-renderers/TimeCell';
import { EmptyStateMedium } from 'src/components/EmptyState';
-import TableView, { EmptyWrapperType } from 'src/components/TableView';
-import { useTableColumns } from 'src/explore/components/DataTableControl';
import { getDatasourceSamples } from 'src/components/Chart/chartAction';
+import Table, {
+ ColumnsType,
+ TablePaginationConfig,
+ TableSize,
+} from 'src/components/Table';
import MetadataBar, {
ContentType,
MetadataType,
} from 'src/components/MetadataBar';
import Alert from 'src/components/Alert';
import { useApiV1Resource } from 'src/hooks/apiResources';
+import HeaderWithRadioGroup from 'src/components/Table/header-renderers/HeaderWithRadioGroup';
import TableControls from './DrillDetailTableControls';
import { getDrillPayload } from './utils';
import { Dataset, ResultsPage } from './types';
const PAGE_SIZE = 50;
+interface DataType {
+ [key: string]: any;
+}
+
+// Must be outside of the main component due to problems in
+// react-resize-detector with conditional rendering
+// https://github.com/maslianok/react-resize-detector/issues/178
+function Resizable({ children }: { children: ReactElement }) {
+ const { ref, height } = useResizeDetector();
+ return (
+
+ {React.cloneElement(children, { height })}
+
+ );
+}
+
+enum TimeFormatting {
+ Original,
+ Formatted,
+}
+
export default function DrillDetailPane({
formData,
initialFilters,
@@ -66,6 +97,7 @@ export default function DrillDetailPane({
const [resultsPages, setResultsPages] = useState