Skip to content

Decouple ElementNavigation from the router

Erwan Rouchet requested to merge unroute-element-navigation into master

Closes #1073 (closed)
Closes #1083 (closed)
Closes #1055 (closed)

This stops the ElementNavigation from watching the $route and calling the router directly by using a query prop which is managed by the parent components. Any default filters to be applied are to be applied by the parent view's or the router's navigation guards and not by the navigation component itself.

I have tried to use the Composition API, and did manage to get it to play with the Options API in a roundabout way, despite Vue saying that you can't access stuff from the Options API in the Composition API. This however did not fix anything at all; the router was still making a complete mess of the component.

After implementing this, I went to assign myself to some other issues in the milestone, and found out that #1055 (closed) had the same root cause; ElementNavigation was adding the order and order_direction filters using $router.push, which could cause a user to be stuck.

TODO:

  • Add the query prop
  • Remove all uses of the router from the component
  • Prevent a redirection due to the default order parameters
  • Test for #1073 (closed) and #1083 (closed)
  • Restore the default filters on corpus navigation
  • Test harder
Edited by Bastien Abadie

Merge request reports

Loading