Skip to content
Snippets Groups Projects
Unverified Commit 4f53b0b9 authored by Anton Kulyk's avatar Anton Kulyk Committed by GitHub
Browse files

Fix updating table questions in the notebook editor before running a query (#44428)

* Add repro test

* Fix null check
parent 3ccf4d41
No related branches found
No related tags found
No related merge requests found
......@@ -718,3 +718,61 @@ describe("issue 44071", () => {
.should("be.visible");
});
});
describe("issue 44415", () => {
beforeEach(() => {
restore();
cy.signIn("admin");
createQuestion(
{
query: {
"source-table": ORDERS_ID,
filter: [
"and",
[
"not-null",
["field", ORDERS.DISCOUNT, { "base-type": "type/Float" }],
],
],
},
visualization_settings: {
"table.columns": [
{
name: "ID",
fieldRef: ["field", ORDERS.ID, null],
enabled: true,
},
{
name: "DISCOUNT",
fieldRef: ["field", ORDERS.DISCOUNT, null],
enabled: true,
},
],
},
},
{ wrapId: true },
);
});
it("should be able to edit a table question in the notebook editor before running its query (metabase#44415)", () => {
cy.get("@questionId").then(questionId =>
cy.visit(`/question/${questionId}/notebook`),
);
getNotebookStep("filter")
.findAllByTestId("notebook-cell-item")
.first()
.icon("close")
.click();
getNotebookStep("filter").should("not.exist");
visualize();
cy.findByTestId("qb-filters-panel").should("not.exist");
cy.get("@questionId").then(questionId => {
cy.url().should("not.include", `/question/${questionId}`);
cy.url().should("include", "question#");
});
});
});
......@@ -27,10 +27,10 @@ export function syncVizSettingsWithSeries(
const series = _series?.[0];
const previousSeries = _previousSeries?.[0];
if (series && !series.error) {
if (series?.data && !series?.error) {
newSettings = syncTableColumnSettings(newSettings, series);
if (previousSeries && !previousSeries.error) {
if (previousSeries?.data && !previousSeries?.error) {
newSettings = syncGraphMetricSettings(
newSettings,
series,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment