diff --git a/frontend/src/metabase-lib/lib/Question.js b/frontend/src/metabase-lib/lib/Question.js index 5ad23d592d90ecf7008a4f8b6f250b68b5272996..a494bb0080a617d51f512330239fd9c406172a08 100644 --- a/frontend/src/metabase-lib/lib/Question.js +++ b/frontend/src/metabase-lib/lib/Question.js @@ -252,6 +252,7 @@ export default class Question { const vizSettings = visualizationSettings ? visualizationSettings : this.card().visualization_settings; + const goalEnabled = vizSettings["graph.show_goal"]; const hasSingleYAxisColumn = vizSettings["graph.metrics"] && vizSettings["graph.metrics"].length === 1; diff --git a/frontend/src/metabase/query_builder/actions.js b/frontend/src/metabase/query_builder/actions.js index 63bad7149cfb1331402276368ac196ab6c153ac4..2a64ffd0d30218d3dc23ae1923931215938c5cc0 100644 --- a/frontend/src/metabase/query_builder/actions.js +++ b/frontend/src/metabase/query_builder/actions.js @@ -679,7 +679,7 @@ export const apiUpdateQuestion = (question) => { await dispatch(fetchAlertsForQuestion(updatedQuestion.id())) // remove the databases in the store that are used to populate the QB databases list. - // This is done when saving a Card because the newly saved card will be elligable for use as a source query + // This is done when saving a Card because the newly saved card will be eligible for use as a source query // so we want the databases list to be re-fetched next time we hit "New Question" so it shows up dispatch(clearRequestState({ statePath: ["metadata", "databases"] })); diff --git a/frontend/test/alert/alert.integ.spec.js b/frontend/test/alert/alert.integ.spec.js index 6273763a75024769c1709883703bae6f12258455..b99503f56e6d8ed149d3265909e879681201af21 100644 --- a/frontend/test/alert/alert.integ.spec.js +++ b/frontend/test/alert/alert.integ.spec.js @@ -99,6 +99,10 @@ describe("Alerts", () => { .addBreakout(["datetime-field", ["field-id", 1], "day"]) .question() .setDisplay("line") + .setVisualizationSettings({ + "graph.dimensions": ["CREATED_AT"], + "graph.metrics": ["count"] + }) .setDisplayName("Time series line") ) @@ -109,7 +113,12 @@ describe("Alerts", () => { .addBreakout(["datetime-field", ["field-id", 1], "day"]) .question() .setDisplay("line") - .setVisualizationSettings({ "graph.show_goal": true, "graph.goal_value": 10 }) + .setVisualizationSettings({ + "graph.show_goal": true, + "graph.goal_value": 10, + "graph.dimensions": ["CREATED_AT"], + "graph.metrics": ["count"] + }) .setDisplayName("Time series line with goal") ) @@ -317,7 +326,6 @@ describe("Alerts", () => { // as a recipient. useSharedAdminLogin() const adminUser = await UserApi.current(); - // TODO TODO TODO THIS ALERT HAZ A COMP-LETELY WRONG TYPE! await AlertApi.create(getDefaultAlert(timeSeriesWithGoalQuestion, adminUser)) useSharedNormalLogin()