Skip to content
Snippets Groups Projects
Unverified Commit af200d4d authored by Kamil Mielnik's avatar Kamil Mielnik Committed by GitHub
Browse files

Fix - Description for calculated columns in model metadata editing page is...

Fix - Description for calculated columns in model metadata editing page is incorrectly populated with description from other columns (#39851)

* Fix metabase#34349

* Remove outdated comment

* Add repro for metabase#34349

* Add tag for issue 25884 and extract a constant
parent 6565d043
No related branches found
No related tags found
No related merge requests found
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
import { openQuestionActions, popover, restore } from "e2e/support/helpers";
const { ORDERS, ORDERS_ID } = SAMPLE_DATABASE;
const ID_DESCRIPTION =
"This is a unique ID for the product. It is also called the “Invoice number” or “Confirmation number” in customer facing emails and screens.";
describe("issues 25884 and 34349", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
});
it("should show empty description input for columns without description in metadata (metabase#25884, metabase#34349)", () => {
cy.createQuestion(
{
type: "model",
query: {
"source-table": ORDERS_ID,
expressions: {
Country: ["substring", "United States", 1, 20],
},
fields: [
["field", ORDERS.ID, { "base-type": "type/BigInteger" }],
["expression", "Country", { "base-type": "type/Text" }],
],
limit: 5, // optimization
},
},
{ visitQuestion: true },
);
openQuestionActions();
popover().findByText("Edit metadata").click();
cy.findByLabelText("Description").should("have.text", ID_DESCRIPTION);
cy.findAllByTestId("header-cell").contains("Country").click();
cy.findByLabelText("Description").should("have.text", "");
cy.findAllByTestId("header-cell").contains("ID").click();
cy.findByLabelText("Description").should("have.text", ID_DESCRIPTION);
});
});
......@@ -23,6 +23,7 @@ const FormTextAreaWidget = ({
aria-labelledby={`${field.name}-label`}
tabIndex={tabIndex}
{...formDomOnlyProps(field)}
value={field.value || ""}
/>
{helperText && (
<HelpText
......
......@@ -246,7 +246,6 @@ export const setup = async ({
setupModelIndexEndpoints(card.id, []);
}
// this workaround can be removed when metabase#34523 is fixed
if (card === null) {
fetchMock.get("path:/api/model-index", [createMockModelIndex()]);
}
......
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