Skip to content
Snippets Groups Projects
Unverified Commit 88d550e7 authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Fix can't join a table with another native question based on the same table (#29879)

parent e2ad1106
No related branches found
No related tags found
No related merge requests found
import {
restore,
visualize,
popover,
openOrdersTable,
} from "e2e/support/helpers";
describe("issue 29795", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
});
it("should allow join based on native query (metabase#29795)", () => {
const NATIVE_QUESTION = "native question";
const LIMIT = 5;
cy.createNativeQuestion(
{
name: NATIVE_QUESTION,
native: { query: `SELECT * FROM "PUBLIC"."ORDERS" LIMIT ${LIMIT}` },
},
{ loadMetadata: true },
);
openOrdersTable({ mode: "notebook", limit: LIMIT });
cy.icon("join_left_outer").click();
popover().within(() => {
cy.icon("chevronleft").click();
cy.findByText("Saved Questions").click();
cy.findByRole("menuitem", { name: NATIVE_QUESTION }).click();
});
popover().within(() => {
cy.findByRole("option", { name: "ID" }).click();
});
popover().within(() => {
cy.findByRole("option", { name: "USER_ID" }).click();
});
visualize(() => {
cy.findAllByText(/User ID/i).should("have.length", 2);
});
});
});
......@@ -194,7 +194,8 @@ export default class DimensionList extends Component {
if (
shouldExcludeBinning ||
(preventNumberSubDimensions && dimension.field().isSummable())
(preventNumberSubDimensions && dimension.field().isSummable()) ||
dimension?.field().isFK()
) {
// If we don't let user choose the sub-dimension, we don't want to treat the field
// as a binned field (which would use the default binning)
......
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