-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARTESCA-13972 // Migration to React 18
- Loading branch information
1 parent
cd6ad85
commit ffa4025
Showing
8 changed files
with
4,436 additions
and
2,284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,13 @@ | ||
import React from 'react'; | ||
import { QueryClient } from 'react-query'; | ||
import { NotificationCenterContextType } from './NotificationCenterProvider'; | ||
import { useAuthConfig } from './auth/AuthConfigProvider'; | ||
import { useAuth } from './auth/AuthProvider'; | ||
import { ShellAlerts, ShellHooks } from './hooks/useShellHooks'; | ||
import './index.css'; | ||
import { useConfigRetriever, useConfig, useDiscoveredViews, useLinkOpener, BuildtimeWebFinger, RuntimeWebFinger } from './initFederation/ConfigurationProviders'; | ||
import { useShellConfig } from './initFederation/ShellConfigProvider'; | ||
import { useShellThemeSelector } from './initFederation/ShellThemeSelectorProvider'; | ||
import { useDeployedApps } from './initFederation/UIListProvider'; | ||
import { useLanguage } from './navbar/lang'; | ||
import AlertProvider from './alerts/AlertProvider'; | ||
import { getAlertingAlertSelectors, getAuthenticationAlertSelectors, getBootstrapAlertSelectors, getDashboardingAlertSelectors, getIngressControllerAlertSelectors, getK8SMasterAlertSelectors, getLoggingAlertSelectors, getMonitoringAlertSelectors, getNetworksAlertSelectors, getNodesAlertSelectors, getPlatformAlertSelectors, getServicesAlertSelectors, getVolumesAlertSelectors, useAlerts, useHighestSeverityAlerts } from './alerts'; | ||
import { useHistory } from 'react-router'; | ||
import { UseQueryResult } from 'react-query'; | ||
export declare const queryClient: QueryClient; | ||
export type ShellTypes = { | ||
shellHooks: { | ||
useAuthConfig: typeof useAuthConfig; | ||
useAuth: typeof useAuth; | ||
useConfigRetriever: typeof useConfigRetriever; | ||
useDiscoveredViews: typeof useDiscoveredViews; | ||
useShellConfig: typeof useShellConfig; | ||
useLanguage: typeof useLanguage; | ||
useConfig: typeof useConfig; | ||
useLinkOpener: typeof useLinkOpener; | ||
useDeployedApps: typeof useDeployedApps; | ||
useShellThemeSelector: typeof useShellThemeSelector; | ||
}; | ||
shellAlerts: { | ||
AlertsProvider: typeof AlertProvider; | ||
hooks: { | ||
useAlerts: typeof useAlerts; | ||
useHighestSeverityAlerts: typeof useHighestSeverityAlerts; | ||
}; | ||
alertSelectors: { | ||
getPlatformAlertSelectors: typeof getPlatformAlertSelectors; | ||
getNodesAlertSelectors: typeof getNodesAlertSelectors; | ||
getVolumesAlertSelectors: typeof getVolumesAlertSelectors; | ||
getNetworksAlertSelectors: typeof getNetworksAlertSelectors; | ||
getServicesAlertSelectors: typeof getServicesAlertSelectors; | ||
getK8SMasterAlertSelectors: typeof getK8SMasterAlertSelectors; | ||
getBootstrapAlertSelectors: typeof getBootstrapAlertSelectors; | ||
getMonitoringAlertSelectors: typeof getMonitoringAlertSelectors; | ||
getAlertingAlertSelectors: typeof getAlertingAlertSelectors; | ||
getLoggingAlertSelectors: typeof getLoggingAlertSelectors; | ||
getDashboardingAlertSelectors: typeof getDashboardingAlertSelectors; | ||
getIngressControllerAlertSelectors: typeof getIngressControllerAlertSelectors; | ||
getAuthenticationAlertSelectors: typeof getAuthenticationAlertSelectors; | ||
}; | ||
}; | ||
export type FederatedAppProps = { | ||
shellHooks: ShellHooks; | ||
shellAlerts: ShellAlerts; | ||
}; | ||
declare global { | ||
interface Window { | ||
shellContexts: { | ||
ShellHistoryContext: React.Context<ReturnType<typeof useHistory> | null>; | ||
NotificationContext: React.Context<null | NotificationCenterContextType>; | ||
WebFingersContext: React.Context<null | UseQueryResult<BuildtimeWebFinger | RuntimeWebFinger<Record<string, unknown>>, unknown>[]>; | ||
}; | ||
shellHooks: ShellTypes['shellHooks']; | ||
shellAlerts: ShellTypes['shellAlerts']; | ||
} | ||
} | ||
export declare function WithInitFederationProviders({ children, }: { | ||
children: React.ReactNode; | ||
}): JSX.Element; | ||
export default function App(): JSX.Element; | ||
}): import("react/jsx-runtime").JSX.Element; | ||
export default function App(): import("react/jsx-runtime").JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
@mf-types/shell/compiled-types/src/hooks/useShellHooks.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { useAlerts, getPlatformAlertSelectors, getNodesAlertSelectors, getVolumesAlertSelectors, getNetworksAlertSelectors, getServicesAlertSelectors, getK8SMasterAlertSelectors, getBootstrapAlertSelectors, getMonitoringAlertSelectors, getAlertingAlertSelectors, getLoggingAlertSelectors, getDashboardingAlertSelectors, getIngressControllerAlertSelectors, getAuthenticationAlertSelectors, useHighestSeverityAlerts } from '../alerts'; | ||
import AlertProvider from '../alerts/AlertProvider'; | ||
import { useAuthConfig } from '../auth/AuthConfigProvider'; | ||
import { useAuth } from '../auth/AuthProvider'; | ||
import { useConfig, useConfigRetriever, useDiscoveredViews, useLinkOpener } from '../initFederation/ConfigurationProviders'; | ||
import { useShellConfig } from '../initFederation/ShellConfigProvider'; | ||
import { useShellThemeSelector } from '../initFederation/ShellThemeSelectorProvider'; | ||
import { useDeployedApps } from '../initFederation/UIListProvider'; | ||
import { useLanguage } from '../navbar/lang'; | ||
export type ShellHooks = { | ||
useAuthConfig: typeof useAuthConfig; | ||
useAuth: typeof useAuth; | ||
useConfigRetriever: typeof useConfigRetriever; | ||
useDiscoveredViews: typeof useDiscoveredViews; | ||
useShellConfig: typeof useShellConfig; | ||
useLanguage: typeof useLanguage; | ||
useConfig: typeof useConfig; | ||
useLinkOpener: typeof useLinkOpener; | ||
useDeployedApps: typeof useDeployedApps; | ||
useShellThemeSelector: typeof useShellThemeSelector; | ||
}; | ||
export type ShellAlerts = { | ||
AlertsProvider: typeof AlertProvider; | ||
alertHooks: { | ||
useAlerts: typeof useAlerts; | ||
useHighestSeverityAlerts: typeof useHighestSeverityAlerts; | ||
}; | ||
alertSelectors: { | ||
getPlatformAlertSelectors: typeof getPlatformAlertSelectors; | ||
getNodesAlertSelectors: typeof getNodesAlertSelectors; | ||
getVolumesAlertSelectors: typeof getVolumesAlertSelectors; | ||
getNetworksAlertSelectors: typeof getNetworksAlertSelectors; | ||
getServicesAlertSelectors: typeof getServicesAlertSelectors; | ||
getK8SMasterAlertSelectors: typeof getK8SMasterAlertSelectors; | ||
getBootstrapAlertSelectors: typeof getBootstrapAlertSelectors; | ||
getMonitoringAlertSelectors: typeof getMonitoringAlertSelectors; | ||
getAlertingAlertSelectors: typeof getAlertingAlertSelectors; | ||
getLoggingAlertSelectors: typeof getLoggingAlertSelectors; | ||
getDashboardingAlertSelectors: typeof getDashboardingAlertSelectors; | ||
getIngressControllerAlertSelectors: typeof getIngressControllerAlertSelectors; | ||
getAuthenticationAlertSelectors: typeof getAuthenticationAlertSelectors; | ||
}; | ||
}; | ||
export declare const shellHooks: ShellHooks; | ||
export declare const shellAlerts: ShellAlerts; |
21 changes: 21 additions & 0 deletions
21
build_ts/.dev-server/compiled-types/src/react/ShellHooksContext.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { FC, ReactNode } from 'react'; | ||
import { ShellAlerts, ShellHooks } from '../@mf-types/shell/compiled-types/src/hooks/useShellHooks'; | ||
type Listener = () => void; | ||
export declare const shellHooksStore: { | ||
getShellHooks: () => any; | ||
subscribe: (listener: Listener) => () => void; | ||
setShellHooks: (newHooks: ShellHooks) => void; | ||
}; | ||
export declare const shellAlertsStore: { | ||
getShellAlerts: () => any; | ||
subscribe: (listener: Listener) => () => void; | ||
setShellAlerts: (newAlerts: ShellAlerts) => void; | ||
}; | ||
export declare const useShellHooks: () => ShellHooks; | ||
export declare const useShellAlerts: () => ShellAlerts; | ||
export declare const ShellHooksProvider: FC<{ | ||
shellHooks: ShellHooks; | ||
shellAlerts: ShellAlerts; | ||
children: ReactNode; | ||
}>; | ||
export {}; |
Oops, something went wrong.