Skip to content
Snippets Groups Projects
Commit d27982ce authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Extract card adding url to urls.js [ci e2e]

parent 3bc64557
No related branches found
No related tags found
No related merge requests found
......@@ -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.dashboard(dashboard.id)+"#add="+this.props.card.id);
this.props.onChangeLocation(Urls.dashboardWithAddCard(dashboard.id, this.props.card.id));
}
createDashboard = async(newDashboard: Dashboard) => {
......
......@@ -27,6 +27,10 @@ export function dashboard(dashboardId) {
return `/dashboard/${dashboardId}`;
}
export function dashboardWithAddCard(dashboardId, cardId) {
return `/dashboard/${dashboardId}#add=${cardId}`;
}
export function modelToUrl(model, modelId) {
switch (model) {
case "card":
......
......@@ -3,7 +3,6 @@ export const incrementDashboardCount = () => {
dashboardCount += 1;
}
export const getLatestDashboardUrl = () => {
console.log(`/dashboard/${dashboardCount}`)
return `/dashboard/${dashboardCount}`
}
export const getPreviousDashboardUrl = (nFromLatest) => {
......
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