From 5cd0c10b1ff4257b519e54b353c6e180d4441b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Dombya?= <135591453+hervedombya@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:59:38 +0100 Subject: [PATCH] Add patch for react-query and refactor ShellHooksContext imports --- ui/patches/react-query+3.34.0.patch | 10 ++++++++++ ui/src/ShellHooksContext.tsx | 8 ++++---- ui/src/components/__TEST__/util.tsx | 1 - 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 ui/patches/react-query+3.34.0.patch diff --git a/ui/patches/react-query+3.34.0.patch b/ui/patches/react-query+3.34.0.patch new file mode 100644 index 0000000000..0522a6f6a0 --- /dev/null +++ b/ui/patches/react-query+3.34.0.patch @@ -0,0 +1,10 @@ +diff --git a/node_modules/react-query/types/react/QueryClientProvider.d.ts b/node_modules/react-query/types/react/QueryClientProvider.d.ts +index 65e1214..ea9fbf0 100644 +--- a/node_modules/react-query/types/react/QueryClientProvider.d.ts ++++ b/node_modules/react-query/types/react/QueryClientProvider.d.ts +@@ -10,4 +10,4 @@ export interface QueryClientProviderProps { + client: QueryClient; + contextSharing?: boolean; + } +-export declare const QueryClientProvider: React.FC; ++export declare const QueryClientProvider: React.FC>; diff --git a/ui/src/ShellHooksContext.tsx b/ui/src/ShellHooksContext.tsx index 13e72f3f0e..4a9146104a 100644 --- a/ui/src/ShellHooksContext.tsx +++ b/ui/src/ShellHooksContext.tsx @@ -1,8 +1,8 @@ import { FC, ReactNode, useMemo, useSyncExternalStore } from 'react'; -import { ShellTypes } from '../@mf-types/shell/compiled-types/src/FederatedApp'; - -export type ShellHooks = ShellTypes['shellHooks']; -export type ShellAlerts = ShellTypes['shellAlerts']; +import { + ShellAlerts, + ShellHooks, +} from '../@mf-types/shell/compiled-types/src/hooks/useShellHooks'; type Listener = () => void; diff --git a/ui/src/components/__TEST__/util.tsx b/ui/src/components/__TEST__/util.tsx index 3f0ec3fbb1..29ccb2a2b5 100644 --- a/ui/src/components/__TEST__/util.tsx +++ b/ui/src/components/__TEST__/util.tsx @@ -138,7 +138,6 @@ const customRender = ( options = {}, providersArgs: [string] = ['/'], ) => - // @ts-expect-error - FIXME when you are working on it render(ui, { wrapper: AllTheProviders(...providersArgs), ...options,