From ffbfb7450f72602425c12df344aabb74c8f901fe Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Tue, 9 Jul 2024 12:18:45 +0200 Subject: [PATCH] revert part of change (#31055) fixes: #31038 Signed-off-by: Erik Jan de Wit --- js/apps/admin-ui/src/utils/client-url.test.ts | 2 +- js/apps/admin-ui/src/utils/client-url.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/apps/admin-ui/src/utils/client-url.test.ts b/js/apps/admin-ui/src/utils/client-url.test.ts index e5268047b0..fd525ab038 100644 --- a/js/apps/admin-ui/src/utils/client-url.test.ts +++ b/js/apps/admin-ui/src/utils/client-url.test.ts @@ -43,7 +43,7 @@ describe("convertClientToUrl", () => { ); //then - expect(result).toBe("/admin"); + expect(result).toBe("/admin/something"); }); it("when baseUrl when rootUrl is not set", () => { diff --git a/js/apps/admin-ui/src/utils/client-url.ts b/js/apps/admin-ui/src/utils/client-url.ts index ce5d23a7f2..28faa653bb 100644 --- a/js/apps/admin-ui/src/utils/client-url.ts +++ b/js/apps/admin-ui/src/utils/client-url.ts @@ -16,7 +16,10 @@ export const convertClientToUrl = ( } if (rootUrl === "${authBaseUrl}") { - return rootUrl.replace(/\$\{(authBaseUrl)\}/, environment.serverBaseUrl); + return joinPath( + rootUrl.replace(/\$\{(authBaseUrl)\}/, environment.serverBaseUrl), + baseUrl || "", + ); } if (rootUrl?.startsWith("http")) {