From 1b476b6c7e46b09be276b374c133c31acababdf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atte=20Kein=C3=A4nen?= <atte.keinanen@gmail.com> Date: Tue, 9 May 2017 12:52:21 -0700 Subject: [PATCH] Update dashboard url method signature [ci e2e] --- .../metabase/containers/AddToDashSelectDashModal.jsx | 2 +- frontend/src/metabase/lib/urls.js | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/frontend/src/metabase/containers/AddToDashSelectDashModal.jsx b/frontend/src/metabase/containers/AddToDashSelectDashModal.jsx index a900ea345e6..f8f1646a27c 100644 --- a/frontend/src/metabase/containers/AddToDashSelectDashModal.jsx +++ b/frontend/src/metabase/containers/AddToDashSelectDashModal.jsx @@ -45,7 +45,7 @@ export default class AddToDashSelectDashModal extends Component { addToDashboard = (dashboard: Dashboard) => { // we send the user over to the chosen dashboard in edit mode with the current card added - this.props.onChangeLocation(Urls.dashboardWithAddCard(dashboard.id, this.props.card.id)); + this.props.onChangeLocation(Urls.dashboard(dashboard.id, {addCardWithId: this.props.card.id})); } createDashboard = async(newDashboard: Dashboard) => { diff --git a/frontend/src/metabase/lib/urls.js b/frontend/src/metabase/lib/urls.js index afb4f42f9b2..f63f4740306 100644 --- a/frontend/src/metabase/lib/urls.js +++ b/frontend/src/metabase/lib/urls.js @@ -23,12 +23,10 @@ export function question(cardId, hash = "", query = "") { : `/question${query}${hash}`; } -export function dashboard(dashboardId) { - return `/dashboard/${dashboardId}`; -} - -export function dashboardWithAddCard(dashboardId, cardId) { - return `/dashboard/${dashboardId}#add=${cardId}`; +export function dashboard(dashboardId, {addCardWithId} = {}) { + return addCardWithId != null + ? `/dashboard/${dashboardId}#add=${addCardWithId}` + : `/dashboard/${dashboardId}`; } export function modelToUrl(model, modelId) { -- GitLab