diff --git a/frontend/src/metabase/containers/AddToDashSelectDashModal.jsx b/frontend/src/metabase/containers/AddToDashSelectDashModal.jsx index a900ea345e6445b44efcbde598f43ed886f9a6bf..f8f1646a27c6dec88cee88eb28ccf0d2054f703a 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 afb4f42f9b203727e1c6316e98ce8cd17783b379..f63f47403069f448d5f6a7e1a4da1c7669420d5a 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) {