dieterich-lab / scimodom

GNU Affero General Public License v3.0
0 stars 0 forks source link

Set-up routing configuration #16

Closed eboileau closed 3 months ago

eboileau commented 1 year ago

Aims/objectives.

Currently, all routes go to /. This is annoying and now I'm loosing time trying to find ways to navigate between pages, e.g. adding a link from one view to another only works with default target _self, but back/forward navigation do not work (goes back/forward to index /). Opening a view in a new tab/window _blank opens the index /.

Even though this is a SPA, I don't see no issue in having different route paths for different views, that is how most Vue apps are built anyway, see e.g. vue-router docs. I think we should go back to the initial/standard configuration, but we need to make sure this also works with the current deployment setup.

A clear and concise description of todo items.

eboileau commented 4 months ago

e.g. I want to add a link to Documentation from the project template form (after login). The link should open in a new tab, since the user is logged in and filling a form. None of this works, this opens a new tab on the index /.

<RouterLink
  :to="{ name: 'documentation' }"
  target="_blank"
>Click
</RouterLink>

or

import { useRouter } from 'vue-router'
const router = useRouter()
const routeData = router.resolve({name: 'documentation'})
const linkTo = () => {
    window.open(routeData.href, '_blank')
}
<Button @click="linkTo()" />
eboileau commented 4 months ago

e.g. on the Documentation view, there is a button Learn more, redirecting to the roadmap. This opens to the right page (default target), but using back navigation returns to the index /, whereas a user would expect to return to Documentation.