Skip to content

New release - HPC w26 #17747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"managed_vcd_dashboard_service_management": "Service management",
"managed_vcd_dashboard_mailing_list": "Mailing list",
"managed_vcd_dashboard_service_renew": "Renewal",
"managed_vcd_dashboard_service_cancellation": "Close service",
"managed_vcd_dashboard_service_cancellation": "Cancel the service",
"managed_vcd_dashboard_password": "Password",
"managed_vcd_dashboard_password_renew": "Renew the admin password",
"managed_vcd_dashboard_password_tooltip": "If you would like to change your admin password, please contact support",
Expand Down
17 changes: 12 additions & 5 deletions packages/manager/apps/hpc-vmware-managed-vcd/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import React from 'react';
import React, { Suspense } from 'react';
import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { RouterProvider, createHashRouter } from 'react-router-dom';
import { Routes } from './routes/routes';
import {
RouterProvider,
createHashRouter,
createRoutesFromElements,
} from 'react-router-dom';
import Routes from '@/routes/routes';
import { MessageContextProvider } from './context/Message.context';
import Loading from './components/loading/Loading.component';

const queryClient = new QueryClient({
defaultOptions: {
Expand All @@ -14,12 +19,14 @@ const queryClient = new QueryClient({
});

function App() {
const router = createHashRouter(Routes);
const routes = createHashRouter(createRoutesFromElements(Routes));

return (
<QueryClientProvider client={queryClient}>
<MessageContextProvider>
<RouterProvider router={router} />
<Suspense fallback={<Loading />}>
<RouterProvider router={routes} />
</Suspense>
</MessageContextProvider>
<ReactQueryDevtools />
</QueryClientProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ vi.mock('@ovh-ux/manager-react-shell-client', async (importOriginal) => {
};
});

vi.mock('react-router-dom', async (importOriginal) => {
const module: typeof import('react-router-dom') = await importOriginal();
return {
...module,
useNavigate: () => vi.fn(),
useParams: () => ({ id: 'id' }),
Route: module.Route,
};
});

const queryClient = new QueryClient({
defaultOptions: {
queries: {
Expand All @@ -35,11 +45,6 @@ const queryClient = new QueryClient({
},
});

vi.mock('react-router-dom', () => ({
useNavigate: () => ({ navigate: vi.fn() }),
useParams: () => ({ id: 'id' }),
}));

const vcdOrg = {
currentState: {
apiUrl: 'https://vcd.my.demo.lab',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ import OrganizationServiceManagementTile from './OrganizationServiceManagementTi
import { labels } from '../../../test-utils';
import { subRoutes, urls } from '../../../routes/routes.constant';

vi.mock('react-router-dom', async (importOriginal) => ({
...(await importOriginal()),
useHref: () => urls.resetPassword.replace(subRoutes.dashboard, 'id'),
useNavigate: () => ({ navigate: vi.fn() }),
useParams: () => ({ id: 'id' }),
}));
vi.mock('react-router-dom', async (importOriginal) => {
const module: typeof import('react-router-dom') = await importOriginal();
return {
...module,
useHref: () => urls.resetPassword.replace(subRoutes.dashboard, 'id'),
useNavigate: () => vi.fn(),
useParams: () => ({ id: 'id' }),
};
});

const shellContext = {
environment: {
Expand Down
Loading
Loading