Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/cute-seas-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@cloudoperators/juno-app-supernova": patch
---

- Update tanstack router to fix issue where the basepath would be overwritten while redirection.
- Remove manual normalization part of legacy state to `undefined` that is no longer needed with latest version of the router.
7 changes: 7 additions & 0 deletions .changeset/orange-eagles-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@cloudoperators/juno-app-greenhouse": patch
"@cloudoperators/juno-app-heureka": patch
"@cloudoperators/juno-app-doop": patch
---

Update tanstack router to fix issue where the basepath would be overwritten while redirection.
4 changes: 2 additions & 2 deletions apps/doop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@cloudoperators/juno-config": "workspace:*",
"@tanstack/react-query": "5.62.2",
"@tailwindcss/vite": "4.1.13",
"@tanstack/router-plugin": "1.131.25",
"@tanstack/router-plugin": "1.133.22",
"@testing-library/jest-dom": "6.8.0",
"@testing-library/react": "16.3.0",
"@types/react": "19.1.8",
Expand Down Expand Up @@ -47,7 +47,7 @@
"@cloudoperators/juno-messages-provider": "workspace:*",
"@cloudoperators/juno-ui-components": "workspace:*",
"@cloudoperators/juno-url-state-provider": "workspace:*",
"@tanstack/react-router": "1.131.25",
"@tanstack/react-router": "1.133.22",
"react": "19.1.0",
"react-dom": "19.1.0"
}
Expand Down
8 changes: 7 additions & 1 deletion apps/doop/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@
import { createFileRoute, redirect } from "@tanstack/react-router"

export const Route = createFileRoute("/")({
loader: () => redirect({ to: "/violations", search: (prev) => ({ ...prev }) }), // redirect to the default /violations page
beforeLoad: () => {
// eslint-disable-next-line @typescript-eslint/only-throw-error
throw redirect({
to: "/violations",
search: (prev) => ({ ...prev }),
})
},
})
4 changes: 2 additions & 2 deletions apps/greenhouse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"devDependencies": {
"@cloudoperators/juno-config": "workspace:*",
"@tailwindcss/vite": "4.1.13",
"@tanstack/router-plugin": "1.131.25",
"@tanstack/router-plugin": "1.133.22",
"@testing-library/jest-dom": "6.8.0",
"@testing-library/react": "16.3.0",
"@types/lodash": "4.17.16",
Expand Down Expand Up @@ -58,7 +58,7 @@
"@cloudoperators/juno-oauth": "workspace:*",
"@cloudoperators/juno-ui-components": "workspace:*",
"@cloudoperators/juno-url-state-provider": "workspace:*",
"@tanstack/react-router": "1.131.25",
"@tanstack/react-router": "1.133.22",
"lodash": "4.17.21"
}
}
2 changes: 1 addition & 1 deletion apps/greenhouse/src/components/Extension.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function Extension({ id, config, auth, appProps }: ExtensionProps) {
? {
embedded: true,
token: auth?.JWT,
basePath: `${router.basepath}/${config.id}`,
basePath: `${router.basepath === "/" ? "" : router.basepath}/${config.id}`,
enableHashedRouting: appProps?.enableHashedRouting || false,
}
: { auth: auth }),
Expand Down
4 changes: 2 additions & 2 deletions apps/heureka/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@cloudoperators/juno-ui-components": "workspace:*",
"@cloudoperators/juno-url-state-provider": "workspace:*",
"@tanstack/react-query": "5.89.0",
"@tanstack/react-router": "1.131.25",
"@tanstack/react-router": "1.133.22",
"lodash": "4.17.21",
"react": "19.1.0",
"react-dom": "19.1.0"
Expand All @@ -44,7 +44,7 @@
"@graphql-codegen/typescript": "4.1.6",
"@graphql-codegen/typescript-operations": "4.6.1",
"@graphql-codegen/typescript-react-apollo": "4.3.3",
"@tanstack/router-plugin": "1.131.25",
"@tanstack/router-plugin": "1.133.22",
"@tailwindcss/vite": "4.1.13",
"@testing-library/jest-dom": "6.8.0",
"@testing-library/react": "16.3.0",
Expand Down
8 changes: 7 additions & 1 deletion apps/heureka/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@
import { createFileRoute, redirect } from "@tanstack/react-router"

export const Route = createFileRoute("/")({
loader: () => redirect({ to: "/services", search: (prev) => ({ ...prev }) }), // redirect to the default /services page
beforeLoad: () => {
// eslint-disable-next-line @typescript-eslint/only-throw-error
throw redirect({
to: "/services",
search: (prev) => ({ ...prev }),
})
},
})
4 changes: 2 additions & 2 deletions apps/supernova/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@cloudoperators/juno-config": "workspace:*",
"@tailwindcss/vite": "4.1.13",
"@tanstack/react-query": "5.62.2",
"@tanstack/router-plugin": "1.131.25",
"@tanstack/router-plugin": "1.133.22",
"@testing-library/jest-dom": "6.6.3",
"@testing-library/react": "16.3.0",
"@types/react": "19.1.8",
Expand Down Expand Up @@ -50,7 +50,7 @@
"@cloudoperators/juno-messages-provider": "workspace:*",
"@cloudoperators/juno-ui-components": "workspace:*",
"@cloudoperators/juno-url-state-provider": "workspace:*",
"@tanstack/react-router": "1.131.25",
"@tanstack/react-router": "1.133.22",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-error-boundary": "4.1.2"
Expand Down
12 changes: 0 additions & 12 deletions apps/supernova/src/lib/urlStateUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,6 @@ describe("readLegacyUrlState", () => {
silencesRegEx: "regexPattern",
})
})

it("should handle NaN values for predefinedFilter and showDetailsFor", () => {
const state = {
p: NaN,
d: NaN,
}

const result = readLegacyUrlState(state)

expect(result.predefinedFilter).toBeUndefined()
expect(result.showDetailsFor).toBeUndefined()
})
})

describe("getFiltersForUrl", () => {
Expand Down
4 changes: 2 additions & 2 deletions apps/supernova/src/lib/urlStateUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const readLegacyUrlState = (state: any) => {
const activeFilters = state?.[ACTIVE_FILTERS]
const pausedFilters = state?.[PAUSED_FILTERS]
const searchTerm = state?.[SEARCH_TERM]
const predefinedFilter = !isNaN(state?.[ACTIVE_PREDEFINED_FILTER]) ? state?.[ACTIVE_PREDEFINED_FILTER] : undefined // for some reason old state return NaN if the value not present
const showDetailsFor = !isNaN(state?.[DETAILS_FOR]) ? state?.[DETAILS_FOR] : undefined // for some reason old state return NaN if the value not present
const predefinedFilter = state?.[ACTIVE_PREDEFINED_FILTER]
const showDetailsFor = state?.[DETAILS_FOR]
const activeTab = state?.[ACTIVE_TAB]
const silencesRegEx = state?.[SILENCE_REG_EX]
const silencesStatus = state?.[SILENCE_STATUS]
Expand Down
8 changes: 7 additions & 1 deletion apps/supernova/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@
import { createFileRoute, redirect } from "@tanstack/react-router"

export const Route = createFileRoute("/")({
loader: () => redirect({ to: "/alerts", search: (prev) => ({ ...prev }) }), // redirect to the default /services page
beforeLoad: () => {
// eslint-disable-next-line @typescript-eslint/only-throw-error
throw redirect({
to: "/alerts",
search: (prev) => ({ ...prev }),
})
},
})
Loading
Loading