Open gabalafou opened 2 weeks ago
Does this mean that to get to let's say namespace/environments
right now the user has to go through /
then find their way through clicks to namespace/environments
?
Yes that's exactly the issue
Pffff that sounds awful. So I would be in favour of finding a better way to deal with routes.
Exactly. The current configuration defeats the whole point of adding URL routing to the UI app. Part of the argument for getting rid of the tabbed interface was that a user could ctrl- or cmd-click on environments to open them in a new browser tab rather than a new Conda Store UI tab. But if we can't load the UI at URLs like /:namespace/:environment, then that ability to open environments directly in a new tab (or share them with others via URL) does not work.
I believe the usual solution here is to create catch-all or fallback route on the server that serves conda-store-ui.html. Right now, I believe the server is configured to serve that file at one and only one URL: "/" by default, or "/conda-store" in other configurations.
I assigned you @gabalafou and @peytondmurray - I would like you two to figure a solution to this.
For my understanding, when a user pastes https://example.com/conda-store/foo/bar
window.location
gets parsed to take the user to the bar
environment in the foo
namespaceIs that right?
Yes! Except it's not technically a redirect. It's not a 301. It's a 200 and you serve the conda-store-ui.html template at /foo/bar.
Cool, thanks for the clarification - that solution sounds reasonable to me.
@gabalafou Feel free to pick this up as time permits.
Should we redirect all unknown routes to the React (UI) app?
When a user goes directly to a React app-defined sub-route (by sub-route I mean any route that is not the root route, "/"), such as "/:namespace/new-environment", the server will return a 404 instead of returning the conda-store-ui.html page.
We should probably redirect all unknown routes to the React (UI) app, conda-store-ui.
That way a user can copy-paste a link like "https://example.com/conda-store/default/new-environment" directly into their browser, as opposed to always having to start from "https://example.com/conda-store". Being able to load non-root routes was the whole point of introducing URL routing into the front end.