Skip to content

Commit 58523a3

Browse files
committed
chore(juno): apps no longer need to keep 'org' url search param
1 parent 5315151 commit 58523a3

7 files changed

Lines changed: 6 additions & 71 deletions

File tree

apps/doop/src/routes/violations.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { isObjectWithKeys } from "../lib/helpers"
2020

2121
const searchSchema = z
2222
.object({
23-
org: z.string().optional(),
2423
searchTerm: z.string().optional(),
2524
violationGroup: z.string().optional(),
2625
})
@@ -38,13 +37,6 @@ const searchSchema = z
3837

3938
export const Route = createFileRoute("/violations")({
4039
validateSearch: searchSchema,
41-
search: {
42-
/**
43-
* TODO: remove it when no longer needed
44-
* but we need to keep "org" search parameter due to it's significance in the shell app.
45-
*/
46-
middlewares: [retainSearchParams(["org"])],
47-
},
4840
beforeLoad: ({ search }) => {
4941
// extract alerts specific state from the URL search params
5042
const { activeFilters, searchTerm, violationGroup } = convertUrlStateToAppState(search)

apps/greenhouse/src/routes/$extensionId.$.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,13 @@
44
*/
55

66
import React from "react"
7-
import { createFileRoute, retainSearchParams } from "@tanstack/react-router"
8-
import { z } from "zod"
7+
import { createFileRoute } from "@tanstack/react-router"
98

109
import { usePlugin } from "../components/StoreProvider"
1110
import { useAuth } from "../components/AuthProvider"
1211
import Extension from "../components/Extension"
1312

14-
const searchSchema = z.object({
15-
/**
16-
* TODO: remove it when no longer needed
17-
* but we need to keep "org" search parameter due to it's significance in the shell app.
18-
*/
19-
org: z.string().optional(),
20-
})
21-
2213
export const Route = createFileRoute("/$extensionId/$")({
23-
validateSearch: searchSchema,
24-
search: {
25-
/**
26-
* TODO: remove it when no longer needed
27-
* but we need to keep "org" search parameter due to it's significance in the shell app.
28-
*/
29-
middlewares: [retainSearchParams(["org"])],
30-
},
3114
component: RouteComponent,
3215
})
3316

apps/heureka/src/routes/services/$service.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,18 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { createFileRoute, retainSearchParams } from "@tanstack/react-router"
6+
import { createFileRoute } from "@tanstack/react-router"
77
import { z } from "zod"
88
import { Service } from "../../components/Service"
99
import { LoaderWithCrumb } from "../-types"
1010
import { fetchService } from "../../api/fetchService"
1111

1212
const serviceSearchSchema = z.object({
13-
org: z.string().optional(),
1413
imageVersion: z.string().optional(),
1514
})
1615

1716
export const Route = createFileRoute("/services/$service")({
1817
validateSearch: serviceSearchSchema,
19-
search: {
20-
/**
21-
* TODO: remove it when no longer needed
22-
* but we need to keep "org" search parameter due to it's significance in the shell app.
23-
*/
24-
middlewares: [retainSearchParams(["org"])],
25-
},
2618
shouldReload: false,
2719
loaderDeps: ({ search }) => {
2820
const { imageVersion, ...rest } = search

apps/heureka/src/routes/services/index.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { createFileRoute, retainSearchParams } from "@tanstack/react-router"
6+
import { createFileRoute } from "@tanstack/react-router"
77
import { z } from "zod"
88
import { Services } from "../../components/Services"
99
import { SELECTED_FILTER_PREFIX } from "../../constants"
@@ -19,7 +19,6 @@ import {
1919
// Schema for validating and transforming search parameters related to /services page.
2020
const servicesSearchSchema = z
2121
.object({
22-
org: z.string().optional(),
2322
service: z.string().optional(),
2423
searchTerm: z.string().optional(),
2524
})
@@ -39,13 +38,6 @@ export type ServicesSearchParams = z.infer<typeof servicesSearchSchema>
3938

4039
export const Route = createFileRoute("/services/")({
4140
validateSearch: servicesSearchSchema,
42-
search: {
43-
/**
44-
* TODO: remove it when no longer needed
45-
* but we need to keep "org" search parameter due to it's significance in the shell app.
46-
*/
47-
middlewares: [retainSearchParams(["org"])],
48-
},
4941
loaderDeps: ({ search }) => {
5042
const { service, ...rest } = search
5143
return rest

apps/heureka/src/routes/vulnerabilities/index.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { createFileRoute, retainSearchParams } from "@tanstack/react-router"
6+
import { createFileRoute } from "@tanstack/react-router"
77
import { z } from "zod"
88
import { Vulnerabilities } from "../../components/Vulnerabilities"
99
import { SELECTED_FILTER_PREFIX } from "../../constants"
@@ -17,7 +17,6 @@ import {
1717

1818
const vulnerabilitiesSearchSchema = z
1919
.object({
20-
org: z.string().optional(),
2120
vulnerability: z.string().optional(),
2221
searchTerm: z.preprocess((val) => (typeof val === "number" ? val.toString() : val), z.string().optional()),
2322
})
@@ -37,13 +36,6 @@ export type VulnerabilitiesSearchParams = z.infer<typeof vulnerabilitiesSearchSc
3736

3837
export const Route = createFileRoute("/vulnerabilities/")({
3938
validateSearch: vulnerabilitiesSearchSchema,
40-
search: {
41-
/**
42-
* TODO: remove it when no longer needed
43-
* but we need to keep "org" search parameter due to it's significance in the shell app.
44-
*/
45-
middlewares: [retainSearchParams(["org"])],
46-
},
4739
loaderDeps: ({ search }) => {
4840
const { vulnerability, ...rest } = search
4941
return rest

apps/supernova/src/routes/alerts.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import React, { useLayoutEffect } from "react"
7-
import { createFileRoute, retainSearchParams } from "@tanstack/react-router"
7+
import { createFileRoute } from "@tanstack/react-router"
88
import { z } from "zod"
99
import { MessagesProvider } from "@cloudoperators/juno-messages-provider"
1010
import AlertDetail from "../components/alerts/AlertDetail"
@@ -17,7 +17,6 @@ import { isObjectWithKeys } from "../lib/utils"
1717

1818
const searchSchema = z
1919
.object({
20-
org: z.string().optional(),
2120
searchTerm: z.string().optional(),
2221
showDetailsFor: z.string().optional(),
2322
predefinedFilter: z.string().optional(),
@@ -41,13 +40,6 @@ const searchSchema = z
4140

4241
export const Route = createFileRoute("/alerts")({
4342
validateSearch: searchSchema,
44-
search: {
45-
/**
46-
* TODO: remove it when no longer needed
47-
* but we need to keep "org" search parameter due to it's significance in the shell app.
48-
*/
49-
middlewares: [retainSearchParams(["org"])],
50-
},
5143
beforeLoad: ({ search }) => {
5244
// extract alerts specific state from the URL search params
5345
const { activeFilters, pausedFilters, predefinedFilter, searchTerm, showDetailsFor } =

apps/supernova/src/routes/silences.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,19 @@
44
*/
55

66
import React, { useLayoutEffect } from "react"
7-
import { createFileRoute, retainSearchParams } from "@tanstack/react-router"
7+
import { createFileRoute } from "@tanstack/react-router"
88
import { z } from "zod"
99
import SilencesList from "../components/silences/SilencesList"
1010
import { convertUrlStateToAppState } from "../lib/urlStateUtils"
1111
import { useSilencesActions } from "../components/StoreProvider"
1212

1313
const searchSchema = z.object({
14-
org: z.string().optional(),
1514
silencesRegEx: z.string().optional(),
1615
silencesStatus: z.string().optional(),
1716
})
1817

1918
export const Route = createFileRoute("/silences")({
2019
validateSearch: searchSchema,
21-
search: {
22-
/**
23-
* TODO: remove it when no longer needed
24-
* but we need to keep "org" search parameter due to it's significance in the shell app.
25-
*/
26-
middlewares: [retainSearchParams(["org"])],
27-
},
2820
beforeLoad: ({ search }) => {
2921
// extract silences specific state from the URL search params
3022
const { silencesRegEx, silencesStatus } = convertUrlStateToAppState(search)

0 commit comments

Comments
 (0)