Skip to content

Commit

Permalink
ARTESCA-13972 // Migration to React 18
Browse files Browse the repository at this point in the history
  • Loading branch information
hervedombya committed Dec 18, 2024
1 parent cd6ad85 commit ffa4025
Show file tree
Hide file tree
Showing 8 changed files with 4,436 additions and 2,284 deletions.
66 changes: 6 additions & 60 deletions @mf-types/shell/compiled-types/src/FederatedApp.d.ts
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;
2 changes: 1 addition & 1 deletion @mf-types/shell/compiled-types/src/alerts/alertHooks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export declare const useHighestSeverityAlerts: (filters: FilterLabels) => Alert[
*
* @returns react query result
*/
export declare function useAlerts(filters: FilterLabels): any;
export declare function useAlerts(filters?: FilterLabels): any;
45 changes: 45 additions & 0 deletions @mf-types/shell/compiled-types/src/hooks/useShellHooks.d.ts
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;
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 {};
Loading

0 comments on commit ffa4025

Please sign in to comment.