-
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
refactor: update imports to use ShellHooksContext for authentication refactor: replace useAuth imports with useShellHooks for improved context management refactor: replace history.push with navigate for improved routing consistency fix: correct typo in workflows route and adjust account creation routes for consistency refactor: update type definitions to use React 18 JSX runtime and improve context imports refactor: replace history.replace with navigate for improved routing consistency refactor: replace history.location with useLocation for improved routing consistency fix useBasenameAndRelativeNavigate refactor: update routing links to use basePath for consistency and improve navigation refactor: update import paths for IconHelp and adjust route paths for improved consistency feat: add QueryClientProvider and enhance routing with accountName parameter; update mocks and improve navigation consistency refactor: update imports for QueryClientProvider and enhance routing consistency with basePath in navigation links refactor: update import for QueryClientProvider in VeeamWelcomeModal test file to enhance consistency with other components refactor: remove unused RemoteKeys type definition, update imports to use useShellHooks for authentication, and enhance routing consistency with useLocation and useBasenameRelativeNavigate refactor: update imports from 'react-router-dom' to 'react-router' for improved consistency across components and enhance routing practices refactor: streamline routing and import practices across components; remove console.log, enhance test consistency, and update path definitions for improved clarity refactor: enhance test structure and consistency by updating imports, utilizing NewWrapper for rendering, and improving component interactions across various LocationDetails tests refactor: update test implementations to use screen and container for element queries, enhance rendering with NewWrapper, and improve consistency in LocationDetails and Properties tests refactor: streamline test implementations by replacing deprecated element queries with container queries, enhance consistency in LocationDetails tests, and improve error handling in action dispatch tests refactor: update imports in multiple components to include JSX for improved type support and consistency across the application refactor: update imports across multiple components to include JSX for improved type support and consistency in the application refactor: update path matching in InternalRoutes to enforce strict matching, and add JSX imports in Breadcrumb and storageOptions for improved type support and consistency refactor: enhance LocationDetailsNFS tests by updating imports, improving element queries for better consistency, and ensuring proper rendering with NewWrapper; removed deprecated value checks in favor of presence checks refactor: enhance locations tests by adding ShellHooksProvider for improved context management, updating imports for mock utilities, and ensuring proper promise handling for asynchronous operations refactor: enhance InternalRoutes path matching by adding support for properties and specific bucket names, improving route handling and consistency across account-related routes feat: add new account management routes and update navigation paths for user and policy creation refactor: update path properties in AttachmentTabs to use empty string instead of pathname for improved clarity and consistency in tab navigation refactor: streamline test implementations by updating imports, enhancing element queries, and improving asynchronous handling across multiple test files fix: handle optional messages in networkActivity reducer and update test case for ReauthDialog refactor: update useShellHooks import to use @scality/module-federation fix: update retrieveConfiguration call in CertificateDownloadButton refactor: enhance jest setup with mockShellAlerts and mockShellHooks chore: update @scality/core-ui to version 0.155.0 and @scality/module-federation to version 1.4.0 refactor: update useBasenameRelativeNavigate import to use @scality/module-federation refactor: remove unused ShellHooksContext and update jest timeouts to 18 seconds for improved test reliability refactor: update @scality/module-federation mock to use actual router's useNavigate refactor: update test cases in Attachments.test.tsx for clarity and consistency; modify HeaderButtons and Breadcrumb components to improve pathname matching refactor: enhance routing consistency by updating bucket navigation paths and internal route matching for account-related routes refactor: reorganize imports and streamline routing in AccountContent and Breadcrumb components for improved consistency and clarity
- Loading branch information
1 parent
cd6ad85
commit a2b2830
Showing
175 changed files
with
6,076 additions
and
4,863 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 |
---|---|---|
|
@@ -12,3 +12,4 @@ coverage | |
.DS_Store | ||
|
||
build | ||
build_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,2 @@ | ||
export * from './compiled-types/src/FederatedApp'; | ||
export { default } from './compiled-types/src/FederatedApp'; |
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
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,6 @@ | ||
import { QueryClient } from 'react-query'; | ||
export declare const QueryClientProvider: React.ComponentType<{ | ||
client: QueryClient; | ||
contextSharing?: boolean; | ||
children?: React.ReactNode; | ||
}>; |
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
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 +1 @@ | ||
export declare const AlertContext: any; | ||
export declare const AlertContext: import("react").Context<any>; |
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
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
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
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
47 changes: 47 additions & 0 deletions
47
@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,47 @@ | ||
import { useNotificationCenter } from '../useNotificationCenter'; | ||
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; | ||
useNotificationCenter: typeof useNotificationCenter; | ||
}; | ||
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; |
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
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
4 changes: 2 additions & 2 deletions
4
@mf-types/shell/compiled-types/src/initFederation/ShellHistoryProvider.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export declare const useShellHistory: () => import("history").History<unknown>; | ||
export declare const useShellHistory: () => import("react-router").NavigateFunction; | ||
export declare const ShellHistoryProvider: ({ children }: { | ||
children: any; | ||
}) => JSX.Element; | ||
}) => 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
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
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
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
2 changes: 1 addition & 1 deletion
2
@mf-types/shell/compiled-types/src/navbar/NavbarUpdaterComponents.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 |
---|---|---|
@@ -1 +1 @@ | ||
export declare const NavbarUpdaterComponents: () => JSX.Element; | ||
export declare const NavbarUpdaterComponents: () => import("react/jsx-runtime").JSX.Element; |
2 changes: 1 addition & 1 deletion
2
@mf-types/shell/compiled-types/src/navbar/NotificationCenter.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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
declare const NotificationCenter: () => JSX.Element; | ||
declare const NotificationCenter: () => import("react/jsx-runtime").JSX.Element; | ||
export default NotificationCenter; |
2 changes: 1 addition & 1 deletion
2
@mf-types/shell/compiled-types/src/navbar/SleepingNotificationBell.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 |
---|---|---|
@@ -1 +1 @@ | ||
export declare const SleepingNotificationBell: () => JSX.Element; | ||
export declare const SleepingNotificationBell: () => 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
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
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,2 +1,3 @@ | ||
import type { Navbar } from './navbarHooks'; | ||
import './navbarHooks'; | ||
export declare const NavbarContext: any; | ||
export declare const NavbarContext: import("react").Context<Navbar>; |
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,2 @@ | ||
export * from './compiled-types/src/navbar/lang'; | ||
export { default } from './compiled-types/src/navbar/lang'; |
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,2 @@ | ||
export * from './compiled-types/src/useNotificationCenter'; | ||
export { default } from './compiled-types/src/useNotificationCenter'; |
2 changes: 2 additions & 0 deletions
2
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,2 @@ | ||
import { NavigateOptions, To } from 'react-router'; | ||
export declare const useBasenameRelativeNavigate: () => (to: To, options?: NavigateOptions) => void | Promise<void>; |
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
Oops, something went wrong.