Skip to content
Snippets Groups Projects
Unverified Commit 993370a1 authored by Paul Rosenzweig's avatar Paul Rosenzweig Committed by GitHub
Browse files

don't get parameter options for text box cards (#11929)

parent c48a788e
Branches
Tags
No related merge requests found
......@@ -206,6 +206,10 @@ export function getParameterMappingOptions(
card: Card,
): ParameterMappingUIOption[] {
const options = [];
if (card.display === "text") {
// text cards don't have parameters
return [];
}
const query = new Question(card, metadata).query();
......
import { signInAsAdmin } from "__support__/cypress";
import { signInAsAdmin, popover, modal } from "__support__/cypress";
describe("dashboard", () => {
beforeEach(signInAsAdmin);
......@@ -76,4 +76,40 @@ var iframeUrl = METABASE_SITE_URL + "/embed/dashboard/" + token + "#bordered=tru
.clear();
cy.contains("Save").click();
});
it("should let you add a parameter to a dashboard with a text box", () => {
cy.visit("/dashboard/1");
// click pencil icon to edit
cy.get(".Icon-pencil").click();
// add text box with text
cy.get(".Icon-string").click();
cy.get(".DashCard")
.last()
.find("textarea")
.type("text text text");
cy.get(".Icon-funnel_add").click();
popover()
.contains("Other Categories")
.click();
cy.contains("Done").click();
cy.contains("Save").click();
// confirm text box and filter are still there
cy.contains("text text text");
cy.get("input[placeholder=Category]");
// reset
// remove text box
cy.get(".Icon-pencil").click();
cy.get(".DashCard")
.last()
.find(".Icon-close")
.click({ force: true });
modal()
.contains("button", "Remove")
.click({ force: true });
// remove filter
cy.contains("Remove").click();
cy.contains("Save").click();
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment