From 05a6590349431a573f510f796cc575cc667f69f2 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 9 Sep 2024 17:20:44 +0200 Subject: [PATCH] custom baseUrl fixes --- frontend/src/lib/components/sidebar/MenuLink.svelte | 3 ++- frontend/src/lib/components/sidebar/WorkspaceMenu.svelte | 3 +-- .../src/routes/(root)/(logged)/runs/[...path]/+page.svelte | 3 ++- .../routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/components/sidebar/MenuLink.svelte b/frontend/src/lib/components/sidebar/MenuLink.svelte index 8ce1cc1628157..eba95b1313c5f 100644 --- a/frontend/src/lib/components/sidebar/MenuLink.svelte +++ b/frontend/src/lib/components/sidebar/MenuLink.svelte @@ -2,6 +2,7 @@ import { classNames } from '$lib/utils' import { navigating, page } from '$app/stores' import Popover from '../Popover.svelte' + import { base } from '$app/paths' export let label: string export let href: string @@ -13,7 +14,7 @@ let isSelected = false navigating.subscribe(() => { - if (href === '/') { + if (href === `${base}/`) { isSelected = $page.url.pathname === href } else { isSelected = $page.url.pathname.includes(href) diff --git a/frontend/src/lib/components/sidebar/WorkspaceMenu.svelte b/frontend/src/lib/components/sidebar/WorkspaceMenu.svelte index beb76d3ab20a1..1d1857588e278 100644 --- a/frontend/src/lib/components/sidebar/WorkspaceMenu.svelte +++ b/frontend/src/lib/components/sidebar/WorkspaceMenu.svelte @@ -42,10 +42,9 @@ if ($page.url.searchParams.get('workspace')) { $page.url.searchParams.set('workspace', id) } - goto($page.url.toString()) } else { - await goto('/') switchWorkspace(id) + await goto('/') } } diff --git a/frontend/src/routes/(root)/(logged)/runs/[...path]/+page.svelte b/frontend/src/routes/(root)/(logged)/runs/[...path]/+page.svelte index 59b184f755d67..419465c623d77 100644 --- a/frontend/src/routes/(root)/(logged)/runs/[...path]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/runs/[...path]/+page.svelte @@ -37,6 +37,7 @@ import ToggleButton from '$lib/components/common/toggleButton-v2/ToggleButton.svelte' import DropdownV2 from '$lib/components/DropdownV2.svelte' import { goto } from '$app/navigation' + import { base } from '$app/paths' let jobs: Job[] | undefined let selectedIds: string[] = [] @@ -293,7 +294,7 @@ let newPath = path ? `/${path}` : '' - let newUrl = `/runs${newPath}?${searchParams.toString()}` + let newUrl = `${base}/runs${newPath}?${searchParams.toString()}` if ( $page.url.searchParams.toString() != searchParams.toString() || $page.url.pathname != newUrl.split('?')[0] diff --git a/frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte b/frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte index 6acdf9637f03c..0f95c5f5f0e6a 100644 --- a/frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte @@ -748,7 +748,7 @@