Skip to content
Open
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
161 changes: 127 additions & 34 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"react-linkify": "^0.2.2",
"react-modal": "^3.12.1",
"react-redux": "7.2.9",
"react-router-dom-v5-compat": "^6.30.0",
"react-router-dom": "^6.30.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the latest 6.x version of react-router-dom is 6.30.3

"redux": "4.0.1",
"use-query-params": "^2.2.1",
"victory": "^37.3.6"
Expand Down
7 changes: 4 additions & 3 deletions web/src/components/dashboards/perses/dashboard-list-page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { type FC } from 'react';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import React, { type FC } from 'react';
import { QueryParamProvider } from 'use-query-params';
import { ReactRouter5Adapter } from 'use-query-params/adapters/react-router-5';
import { ReactRouter6Adapter } from 'use-query-params/adapters/react-router-6';
import { DashboardList } from './dashboard-list';
import { ToastProvider } from './ToastProvider';

Expand All @@ -16,7 +17,7 @@ const queryClient = new QueryClient({

const DashboardListPage: FC = () => {
return (
<QueryParamProvider adapter={ReactRouter5Adapter}>
<QueryParamProvider adapter={ReactRouter6Adapter}>
<QueryClientProvider client={queryClient}>
<ToastProvider>
<DashboardList />
Expand Down
11 changes: 6 additions & 5 deletions web/src/components/dashboards/perses/dashboard-page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { useEffect, type FC } from 'react';
import React, { useEffect, type FC } from 'react';
import { useTranslation } from 'react-i18next';
import { useSearchParams } from 'react-router-dom-v5-compat';
import { useLocation } from 'react-router-dom';
import { QueryParamProvider } from 'use-query-params';
import { ReactRouter5Adapter } from 'use-query-params/adapters/react-router-5';
import { ReactRouter6Adapter } from 'use-query-params/adapters/react-router-6';
import { LoadingInline } from '../../console/console-shared/src/components/loading/LoadingInline';
import { OCPDashboardApp } from './dashboard-app';
import { DashboardFrame } from './dashboard-frame';
Expand All @@ -22,7 +22,8 @@ const queryClient = new QueryClient({

const DashboardPage_: FC = () => {
const { t } = useTranslation(process.env.I18N_NAMESPACE);
const [searchParams] = useSearchParams();
Copy link
Contributor

@jgbernalp jgbernalp Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can still use useSearchParams in react router 6: https://reactrouter.com/6.30.3/hooks/use-search-params

const location = useLocation();
const searchParams = new URLSearchParams(location.search);

const {
activeProjectDashboardsMetadata,
Expand Down Expand Up @@ -100,7 +101,7 @@ const DashboardPage_: FC = () => {

const DashboardPage: React.FC = () => {
return (
<QueryParamProvider adapter={ReactRouter5Adapter}>
<QueryParamProvider adapter={ReactRouter6Adapter}>
<QueryClientProvider client={queryClient}>
<ToastProvider>
<DashboardPage_ />
Expand Down
4 changes: 2 additions & 2 deletions web/src/contexts/MonitoringContext.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useMemo } from 'react';
import { MonitoringPlugins, Prometheus } from '../components/utils';
import { QueryParamProvider } from 'use-query-params';
import { ReactRouter5Adapter } from 'use-query-params/adapters/react-router-5';
import { ReactRouter6Adapter } from 'use-query-params/adapters/react-router-6';
import { useAccessReview } from '@openshift-console/dynamic-plugin-sdk';

type MonitoringContextType = {
Expand Down Expand Up @@ -67,7 +67,7 @@ export const MonitoringProvider: React.FC<{

return (
<MonitoringContext.Provider value={monContext}>
<QueryParamProvider adapter={ReactRouter5Adapter}>{children}</QueryParamProvider>
<QueryParamProvider adapter={ReactRouter6Adapter}>{children}</QueryParamProvider>
</MonitoringContext.Provider>
);
};