diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index 1edf305..8be0f0d 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -15,8 +15,10 @@ else if (route === "Dump") return Dump; } - $: component = chooseComponent($currentRoute.component) as any; - $: params = $currentRoute.params as any; + $: r = { + component: chooseComponent($currentRoute.component) as any, + params: $currentRoute.params as any, + }; - + diff --git a/frontend/src/lib/nav/Nav.svelte b/frontend/src/lib/nav/Nav.svelte new file mode 100644 index 0000000..d11b345 --- /dev/null +++ b/frontend/src/lib/nav/Nav.svelte @@ -0,0 +1,55 @@ + + + diff --git a/frontend/src/lib/router.ts b/frontend/src/lib/router.ts index 92af540..1f7db14 100644 --- a/frontend/src/lib/router.ts +++ b/frontend/src/lib/router.ts @@ -4,8 +4,8 @@ import { writable } from "svelte/store"; export const routes = { Home: "/", Dump: "/dump/:dumpUrl", - Portal: "/portal/:portalUrl", - Dataset: "/portal/:portalUrl/dataset/:id", + Portal: "/dump/:dumpUrl/:portal", + Dataset: "/dump/:dumpUrl/:portal/dataset/:id", }; export type ComponentType = "NotFound" | keyof typeof routes; diff --git a/frontend/src/lib/routes/Dataset.svelte b/frontend/src/lib/routes/Dataset.svelte index bf1716d..cc70129 100644 --- a/frontend/src/lib/routes/Dataset.svelte +++ b/frontend/src/lib/routes/Dataset.svelte @@ -5,16 +5,19 @@ import NotFound from "./NotFound.svelte"; import { inject } from "regexparam"; import { routes } from "../router"; + import Nav from "../nav/Nav.svelte"; - export let params: { portalUrl: string; id: string }; - const url = decodeURIComponent(params.portalUrl); + export let params: { dumpUrl: string; portal: string; id: string }; + $: url = decodeURIComponent(params.dumpUrl) + "/" + params.portal; - const data = Promise.all([fetchData(url), fetchErrors(url)]).then( + $: data = Promise.all([fetchData(url), fetchErrors(url)]).then( ([data, errors]) => ({ data, errors }), );
+