From a92d087014a2359a2e47d9bc74d37f8757b5acef Mon Sep 17 00:00:00 2001 From: Simon Steinbeiss Date: Tue, 3 Jun 2025 18:34:01 +0200 Subject: [PATCH] Drop Edge Management federated module (HMS-8637) --- src/Components/LandingPage/LandingPage.tsx | 150 +----------------- src/Components/edge/ImageDetails.tsx | 44 ----- src/Components/edge/ImagesTable.tsx | 45 ------ .../sharedComponents/ImageBuilderHeader.tsx | 61 +------ src/Router.tsx | 20 +-- src/constants.ts | 5 - .../Components/edge/EdgeImagesTable.test.tsx | 8 - .../Components/edge/ImageDetails.test.tsx | 8 - src/test/setup.ts | 4 - 9 files changed, 11 insertions(+), 334 deletions(-) delete mode 100644 src/Components/edge/ImageDetails.tsx delete mode 100644 src/Components/edge/ImagesTable.tsx delete mode 100644 src/test/Components/edge/EdgeImagesTable.test.tsx delete mode 100644 src/test/Components/edge/ImageDetails.test.tsx diff --git a/src/Components/LandingPage/LandingPage.tsx b/src/Components/LandingPage/LandingPage.tsx index a1ea0ff7..0de0604d 100644 --- a/src/Components/LandingPage/LandingPage.tsx +++ b/src/Components/LandingPage/LandingPage.tsx @@ -1,13 +1,6 @@ -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { - Button, - Popover, - Tabs, - Tab, - TabTitleText, - Content, - TabAction, PageSection, Sidebar, SidebarContent, @@ -16,45 +9,18 @@ import { Toolbar, ToolbarContent, } from '@patternfly/react-core'; -import { ExternalLinkAltIcon, HelpIcon } from '@patternfly/react-icons'; -import { Outlet, useLocation, useNavigate } from 'react-router-dom'; +import { Outlet } from 'react-router-dom'; import './LandingPage.scss'; import { NewAlert } from './NewAlert'; -import { MANAGING_WITH_DNF_URL, OSTREE_URL } from '../../constants'; -import { manageEdgeImagesUrlName } from '../../Hooks/Edge/useGetNotificationProp'; -import { resolveRelPath } from '../../Utilities/path'; -import { useFlag } from '../../Utilities/useGetEnvironment'; import BlueprintsSidebar from '../Blueprints/BlueprintsSideBar'; -import EdgeImagesTable from '../edge/ImagesTable'; import ImagesTable from '../ImagesTable/ImagesTable'; import { ImageBuilderHeader } from '../sharedComponents/ImageBuilderHeader'; export const LandingPage = () => { const [showAlert, setShowAlert] = useState(true); - const { pathname } = useLocation(); - const navigate = useNavigate(); - const tabsPath = [ - resolveRelPath(''), - resolveRelPath(manageEdgeImagesUrlName), - ]; - const initialActiveTabKey = - tabsPath.indexOf(pathname) >= 0 ? tabsPath.indexOf(pathname) : 0; - const [activeTabKey, setActiveTabKey] = useState(initialActiveTabKey); - useEffect(() => { - setActiveTabKey(initialActiveTabKey); - }, [initialActiveTabKey]); - const handleTabClick = (_event: React.MouseEvent, tabIndex: number) => { - const tabPath = tabsPath[tabIndex]; - if (tabPath !== '') { - navigate(tabPath); - } - setActiveTabKey(tabIndex); - }; - - const edgeParityFlag = useFlag('edgeParity.image-list'); const imageList = ( <> @@ -85,115 +51,9 @@ export const LandingPage = () => { return ( <> - - - {edgeParityFlag ? ( - - Conventional (RPM-DNF){''} } - actions={ - - - - With RPM-DNF, you can manage the system software by - using the DNF package manager and updated RPM - packages. This is a simple and adaptive method of - managing and modifying the system over its lifecycle. - - - - - - - } - /> - } - > - {imageList} - - Immutable (OSTree) } - actions={ - - - With OSTree, you can manage the system software by - referencing a central image repository. OSTree images - contain a complete operating system ready to be remotely - installed at scale. You can track updates to images - through commits and enable secure updates that only - address changes and keep the operating system unchanged. - The updates are quick, and the rollbacks are easy. - - - - - - } - /> - } - > - - - - ) : ( - imageList - )} - - - - ); -}; - -type HelpPopoverPropTypes = { - header: string; - body: React.ReactNode; -}; - -const HelpPopover = ({ header, body }: HelpPopoverPropTypes) => { - const ref = React.createRef(); - return ( - <> - - - - + + {imageList} + ); }; diff --git a/src/Components/edge/ImageDetails.tsx b/src/Components/edge/ImageDetails.tsx deleted file mode 100644 index a15d259e..00000000 --- a/src/Components/edge/ImageDetails.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import React from 'react'; - -import AsyncComponent from '@redhat-cloud-services/frontend-components/AsyncComponent'; -import ErrorState from '@redhat-cloud-services/frontend-components/ErrorState'; -import Unavailable from '@redhat-cloud-services/frontend-components/Unavailable'; -import { useNavigate, useLocation, useParams } from 'react-router-dom'; - -import { - useGetNotificationProp, - manageEdgeImagesUrlName, -} from '../../Hooks/Edge/useGetNotificationProp'; -import { resolveRelPath } from '../../Utilities/path'; -import { useFlag } from '../../Utilities/useGetEnvironment'; - -const ImageDetail = () => { - const notificationProp = useGetNotificationProp(); - // Feature flag for the federated modules - const edgeParityFlag = useFlag('edgeParity.image-list'); - // Feature flag to access the 'local' images table list - const edgeLocalImageTable = useFlag('image-builder.edge.local-image-table'); - - if (edgeLocalImageTable) { - return
; - } - if (edgeParityFlag) { - return ( - } - navigateProp={useNavigate} - locationProp={useLocation} - notificationProp={notificationProp} - pathPrefix={resolveRelPath('')} - urlName={manageEdgeImagesUrlName} - paramsProp={useParams} - /> - ); - } else { - return ; - } -}; - -export default ImageDetail; diff --git a/src/Components/edge/ImagesTable.tsx b/src/Components/edge/ImagesTable.tsx deleted file mode 100644 index 7b7b486f..00000000 --- a/src/Components/edge/ImagesTable.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import React from 'react'; - -import AsyncComponent from '@redhat-cloud-services/frontend-components/AsyncComponent'; -import ErrorState from '@redhat-cloud-services/frontend-components/ErrorState'; -import Unavailable from '@redhat-cloud-services/frontend-components/Unavailable'; -import { useNavigate, useLocation } from 'react-router-dom'; - -import { CREATING_IMAGES_WITH_IB_URL } from '../../constants'; -import { - useGetNotificationProp, - manageEdgeImagesUrlName, -} from '../../Hooks/Edge/useGetNotificationProp'; -import { resolveRelPath } from '../../Utilities/path'; -import { useFlag } from '../../Utilities/useGetEnvironment'; - -const ImagesTable = () => { - const notificationProp = useGetNotificationProp(); - // Feature flag for the federated modules - const edgeParityFlag = useFlag('edgeParity.image-list'); - // Feature flag to access the 'local' images table list - const edgeLocalImageTable = useFlag('image-builder.edge.local-image-table'); - - if (edgeLocalImageTable) { - return
; - } - if (edgeParityFlag) { - return ( - } - navigateProp={useNavigate} - locationProp={useLocation} - showHeaderProp={false} - docLinkProp={CREATING_IMAGES_WITH_IB_URL} - notificationProp={notificationProp} - pathPrefix={resolveRelPath('')} - urlName={manageEdgeImagesUrlName} - /> - ); - } - return ; -}; - -export default ImagesTable; diff --git a/src/Components/sharedComponents/ImageBuilderHeader.tsx b/src/Components/sharedComponents/ImageBuilderHeader.tsx index d44279cd..d3158ba5 100644 --- a/src/Components/sharedComponents/ImageBuilderHeader.tsx +++ b/src/Components/sharedComponents/ImageBuilderHeader.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; -import { Button, Popover, Content, Flex, Alert } from '@patternfly/react-core'; +import { Button, Popover, Content, Flex } from '@patternfly/react-core'; import { ExternalLinkAltIcon, HelpIcon } from '@patternfly/react-icons'; // eslint-disable-next-line rulesdir/disallow-fec-relative-imports import { @@ -11,10 +11,8 @@ import { import { useNavigate } from 'react-router-dom'; import { - CREATE_RHEL_IMAGES_WITH_AUTOMATED_MANAGEMENT_URL, CREATING_IMAGES_WITH_IB_SERVICE_URL, OSBUILD_SERVICE_ARCHITECTURE_URL, - RHEM_DOCUMENTATION_URL, } from '../../constants'; import { useBackendPrefetch } from '../../store/backendApi'; import { useAppSelector } from '../../store/hooks'; @@ -24,6 +22,10 @@ import './ImageBuilderHeader.scss'; import { useFlagWithEphemDefault } from '../../Utilities/useGetEnvironment'; import { ImportBlueprintModal } from '../Blueprints/ImportBlueprintModal'; +type ImageBuilderHeaderPropTypes = { + inWizard?: boolean; +}; + const AboutImageBuilderPopover = () => { return ( { Image builder for RPM-DNF documentation - - - } > @@ -78,13 +67,7 @@ const AboutImageBuilderPopover = () => { ); }; -type ImageBuilderHeaderPropTypes = { - activeTab?: number; - inWizard?: boolean; -}; - export const ImageBuilderHeader = ({ - activeTab, inWizard, }: ImageBuilderHeaderPropTypes) => { const navigate = useNavigate(); @@ -96,7 +79,6 @@ export const ImageBuilderHeader = ({ 'image-builder.import.enabled' ); const [showImportModal, setShowImportModal] = useState(false); - const isOnBlueprintsTab = activeTab === 0; return ( <> {importExportFlag && ( @@ -124,7 +106,6 @@ export const ImageBuilderHeader = ({ variant="primary" data-testid="blueprints-create-button" onClick={() => navigate(resolveRelPath('imagewizard'))} - isDisabled={!isOnBlueprintsTab} onMouseEnter={() => prefetchTargets({ distribution: distribution, @@ -138,7 +119,6 @@ export const ImageBuilderHeader = ({ data-testid="import-blueprint-button" variant="secondary" onClick={() => setShowImportModal(true)} - isDisabled={!isOnBlueprintsTab} > Import @@ -148,37 +128,6 @@ export const ImageBuilderHeader = ({ } /> - {!isOnBlueprintsTab && !inWizard && !process.env.IS_ON_PREMISE && ( - Upcoming decommission of hosted Edge Management service} - className="pf-v6-u-mt-sm pf-v6-u-mb-sm" - > - - - As of July 31, 2025, the hosted edge management service will no - longer be supported. This means that pushing image updates to - Immutable (OSTree) systems using the Hybrid Cloud Console will - be discontinued. For an alternative way to manage edge systems, - customers are encouraged to explore Red Hat Edge Manager (RHEM). - - - - - - - )} ); diff --git a/src/Router.tsx b/src/Router.tsx index 287c5858..0963f7ca 100644 --- a/src/Router.tsx +++ b/src/Router.tsx @@ -2,13 +2,8 @@ import React, { lazy, Suspense } from 'react'; import { Route, Routes } from 'react-router-dom'; -import EdgeImageDetail from './Components/edge/ImageDetails'; import ShareImageModal from './Components/ShareImageModal/ShareImageModal'; -import { manageEdgeImagesUrlName } from './Hooks/Edge/useGetNotificationProp'; -import { - useFlag, - useFlagWithEphemDefault, -} from './Utilities/useGetEnvironment'; +import { useFlagWithEphemDefault } from './Utilities/useGetEnvironment'; const LandingPage = lazy(() => import('./Components/LandingPage/LandingPage')); const ImportImageWizard = lazy( @@ -17,7 +12,6 @@ const ImportImageWizard = lazy( const CreateImageWizard = lazy(() => import('./Components/CreateImageWizard')); export const Router = () => { - const edgeParityFlag = useFlag('edgeParity.image-list'); const importExportFlag = useFlagWithEphemDefault( 'image-builder.import.enabled' ); @@ -52,18 +46,6 @@ export const Router = () => { } /> - {edgeParityFlag && ( - } - > - } /> - } - /> - - )} ); }; diff --git a/src/constants.ts b/src/constants.ts index 3f518e6c..35dc9f72 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -35,13 +35,8 @@ export const MANAGING_WITH_DNF_URL = 'https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/managing_software_with_the_dnf_tool/index'; export const CREATING_IMAGES_WITH_IB_SERVICE_URL = 'https://docs.redhat.com/en/documentation/red_hat_insights/1-latest/html/deploying_and_managing_rhel_systems_in_hybrid_clouds/index'; -export const RHEM_DOCUMENTATION_URL = - 'https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.5/html/managing_device_fleets_with_the_red_hat_edge_manager/index'; -export const OSTREE_URL = 'https://ostreedev.github.io/ostree/'; export const DOCUMENTATION_URL = 'https://docs.redhat.com/en/documentation/red_hat_insights/1-latest/html/deploying_and_managing_rhel_systems_in_hybrid_clouds/index'; -export const CREATE_RHEL_IMAGES_WITH_AUTOMATED_MANAGEMENT_URL = - 'https://docs.redhat.com/en/documentation/edge_management/2022/html/create_rhel_for_edge_images_and_configure_automated_management/index'; export const OSBUILD_SERVICE_ARCHITECTURE_URL = 'https://osbuild.org/docs/service/architecture/'; export const GENERATING_SSH_KEY_PAIRS_URL = diff --git a/src/test/Components/edge/EdgeImagesTable.test.tsx b/src/test/Components/edge/EdgeImagesTable.test.tsx deleted file mode 100644 index dcb247fa..00000000 --- a/src/test/Components/edge/EdgeImagesTable.test.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { useFlag } from '@unleash/proxy-client-react'; - -describe('mocking unleash calls', () => { - test('the ege local image table is set to true', () => { - const edgeLocalImageTable = useFlag('image-builder.edge.local-image-table'); - expect(edgeLocalImageTable).toBe(true); - }); -}); diff --git a/src/test/Components/edge/ImageDetails.test.tsx b/src/test/Components/edge/ImageDetails.test.tsx deleted file mode 100644 index e1a3ffd6..00000000 --- a/src/test/Components/edge/ImageDetails.test.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { useFlag } from '../../../Utilities/useGetEnvironment'; - -describe('mocking unleash calls', () => { - test('the ege local image table is set to true', () => { - const edgeLocalImageTable = useFlag('image-builder.edge.local-image-table'); - expect(edgeLocalImageTable).toBe(true); - }); -}); diff --git a/src/test/setup.ts b/src/test/setup.ts index 3f1e2595..d3675dfd 100644 --- a/src/test/setup.ts +++ b/src/test/setup.ts @@ -57,10 +57,6 @@ vi.mock('@unleash/proxy-client-react', () => ({ switch (flag) { case 'image-builder.import.enabled': return true; - case 'edgeParity.image-list': - return true; - case 'image-builder.edge.local-image-table': - return true; case 'image-builder.satellite.enabled': return true; case 'image-builder.templates.enabled':