Skip to content
Snippets Groups Projects
Unverified Commit 1890179a authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

FE part of #37893: Do not offer alerts for models (#45611)

* Do not display alert icon for models

* Add e2e repro for #37893

* Put the guard higher

* Fix unrelated test

* Go back to keeping the logic in `shouldRender`

* Remove whitespace
parent d392a498
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@ describe("scenarios > embedding > smoke tests", { tags: "@OSS" }, () => {
cy.findByTestId("view-footer").within(() => {
cy.icon("download").should("exist");
cy.icon("bell").should("exist");
cy.icon("bell").should("not.exist");
cy.icon("share").should("not.exist");
});
});
......
import {
ORDERS_QUESTION_ID,
ORDERS_COUNT_QUESTION_ID,
ORDERS_MODEL_ID,
} from "e2e/support/cypress_sample_instance_data";
import {
restore,
setupSMTP,
mockSlackConfigured,
visitQuestion,
visitModel,
} from "e2e/support/helpers";
const channels = { slack: mockSlackConfigured, email: setupSMTP };
......@@ -87,4 +89,15 @@ describe("scenarios > alert", () => {
});
});
});
it("should not be offered for models (metabase#37893)", () => {
visitModel(ORDERS_MODEL_ID);
cy.findByTestId("view-footer").within(() => {
cy.findByTestId("question-row-count")
.should("have.text", "Showing first 2,000 rows")
.and("be.visible");
cy.icon("download").should("exist");
cy.icon("bell").should("not.exist");
});
});
});
......@@ -82,4 +82,6 @@ export default class QuestionAlertWidget extends Component {
}
QuestionAlertWidget.shouldRender = ({ question, visualizationSettings }) =>
question.alertType(visualizationSettings) !== null && !question.isArchived();
question.alertType(visualizationSettings) !== null &&
!question.isArchived() &&
question.type() !== "model";
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