The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Contain layout for notebook preview (#68448)
Romeo Van Snickc902d22458b3
diff --git a/e2e/test/scenarios/question-reproductions/reproductions.cy.spec.ts b/e2e/test/scenarios/question-reproductions/reproductions.cy.spec.tsindex 91e12d06f5d..4fa2950e385 100644--- a/e2e/test/scenarios/question-reproductions/reproductions.cy.spec.ts+++ b/e2e/test/scenarios/question-reproductions/reproductions.cy.spec.ts@@ -1477,3 +1477,20 @@ describe("issue 66210", () => {H.entityPickerModalLevel(1).findByText(METRIC_NAME).should("not.exist");});});++describe("issue #67903", () => {+ beforeEach(() => {+ cy.viewport(1000, 800);+ H.restore();+ cy.signInAsAdmin();+ });++ it("shoult not show preview table headers on top of other elements (metabase#67903)", () => {+ H.startNewQuestion();+ H.miniPickerBrowseAll().click();+ H.entityPickerModalItem(1, "Orders").click();+ H.getNotebookStep("data").findByTestId("step-preview-button").click();+ H.queryBuilderHeader().findByLabelText("View SQL").click();+ cy.findByTestId("table-header").should("not.be.visible");+ });+});diff --git a/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStepPreview/NotebookStepPreview.jsx b/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStepPreview/NotebookStepPreview.jsxindex db3d4fbfee8..8029ba4fcc8 100644--- a/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStepPreview/NotebookStepPreview.jsx+++ b/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStepPreview/NotebookStepPreview.jsx@@ -12,6 +12,8 @@ import Visualization from "metabase/visualizations/components/Visualization";import * as Lib from "metabase-lib";import Question from "metabase-lib/v1/Question";+import S from "./NotebookStepPreview.module.css";+const PREVIEW_ROWS_LIMIT = 10;const getPreviewQuestion = (step) => {@@ -97,9 +99,16 @@ export const VisualizationPreview = ({ rawSeries, result, error }) => {rawSeries={rawSeries}error={err}queryBuilderMode="notebook"- className={cx(CS.bordered, CS.shadowed, CS.rounded, CS.bgWhite, {- [CS.p2]: err,- })}+ className={cx(+ S.PreviewVisualization,+ CS.bordered,+ CS.shadowed,+ CS.rounded,+ CS.bgWhite,+ {+ [CS.p2]: err,+ },+ )}style={{height: err ? "auto" : getPreviewHeightForResult(result),}}diff --git a/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStepPreview/NotebookStepPreview.module.css b/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStepPreview/NotebookStepPreview.module.cssnew file mode 100644index 00000000000..0d0b7c12ed9--- /dev/null+++ b/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStepPreview/NotebookStepPreview.module.css@@ -0,0 +1,3 @@+.PreviewVisualization {+ contain: strict;+}