teamspaces / web

Web & API – Spaces is knowledge management for teams.
0 stars 0 forks source link

Redirect on page deletion #268

Closed emmanuelmillionaer closed 7 years ago

emmanuelmillionaer commented 7 years ago

What

After a page get's deleted, redirect to the correct path

Gif (optional)

emmanuelmillionaer commented 7 years ago

@MrTin big thanks for the comments on this PR! 💯 Could you please further explain what you mean with: 🙂 where to redirect on all page links? Can you find a way to only do this when you actually delete a page?

Here to all page-delete-links I always pass (optionally)the current-page. So that it redirects to it, after the page was deleted. That's because when the user is for example on the marketing-page and he deletes the globalstrategy-page I thought he should end again on the marketing-page. It's basically a redirect :back I only perform queries when the user actually is, on the page he deletes.

You are right that in Page::NextPageQuery there are a lot of if/else and closure-tree methods called to find the next page. First I had a custom query there, with that I tried to find the next page, but I noticed that it's better to use the predefined closure-tree methods for that.

MrTin commented 7 years ago

Thanks for clarifying @emmanuelmillionaer. Lets talk over phone so I better understand what you are doing here :)