Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

fix(qb): do not show view detail button in step preview (#63071)

Uladzimir Havenchyk6b8e95a34fbe
diff --git a/e2e/test/scenarios/question/notebook.cy.spec.js b/e2e/test/scenarios/question/notebook.cy.spec.js
index 7b1c629f74a..587e054608c 100644
--- a/e2e/test/scenarios/question/notebook.cy.spec.js
+++ b/e2e/test/scenarios/question/notebook.cy.spec.js
@@ -1309,6 +1309,26 @@ describe("scenarios > question > notebook", { tags: "@slow" }, () => {
);
});
});
+
+ it("should not render detail view column in preview (metabase#63070)", () => {
+ function openPreview() {
+ cy.findByTestId("step-preview-button").click();
+ }
+
+ function verifyPreviewIsRendered() {
+ cy.findByTestId("table-scroll-container").should("contain", "37.65");
+ }
+
+ function verifyIndexColumnsNotRendered() {
+ cy.findAllByTestId("row-id-cell").should("have.length", 0);
+ }
+
+ H.openOrdersTable({ mode: "notebook" });
+
+ openPreview();
+ verifyPreviewIsRendered();
+ verifyIndexColumnsNotRendered();
+ });
});
function assertTableRowCount(expectedCount) {
diff --git a/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStepPreview/NotebookStepPreview.jsx b/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStepPreview/NotebookStepPreview.jsx
index 5562b097d91..7394d527085 100644
--- a/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStepPreview/NotebookStepPreview.jsx
+++ b/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStepPreview/NotebookStepPreview.jsx
@@ -97,6 +97,7 @@ export const VisualizationPreview = ({ rawSeries, result, error }) => {
<Visualization
rawSeries={rawSeries}
error={err}
+ queryBuilderMode="notebook"
className={cx(CS.bordered, CS.shadowed, CS.rounded, CS.bgWhite, {
[CS.p2]: err,
})}