diff --git a/web/src/App.jsx b/web/src/App.jsx index 1c8a3b091b..4eda8d27b0 100644 --- a/web/src/App.jsx +++ b/web/src/App.jsx @@ -40,7 +40,7 @@ import { BUSY } from "~/client/status"; */ function App() { const client = useInstallerClient(); - const { error } = useInstallerClientStatus(); + const { connected, error } = useInstallerClientStatus(); const { products } = useProduct(); const { language } = useInstallerL10n(); const [status, setStatus] = useState(undefined); @@ -73,7 +73,12 @@ function App() { const Content = () => { if (error) return ; - if (!products) return ; + + if (phase === INSTALL) { + return ; + } + + if (!products || !connected) return ; if ((phase === STARTUP && status === BUSY) || phase === undefined || status === undefined) { return ; @@ -83,10 +88,6 @@ function App() { return ; } - if (phase === INSTALL) { - return ; - } - return ; }; diff --git a/web/src/SimpleLayout.jsx b/web/src/SimpleLayout.jsx index d34a84d988..cac41dc52b 100644 --- a/web/src/SimpleLayout.jsx +++ b/web/src/SimpleLayout.jsx @@ -33,7 +33,7 @@ import { _ } from "~/i18n"; * Simple layout for displaying content that comes before product configuration * TODO: improve documentation */ -export default function SimpleLayout() { +export default function SimpleLayout({ showOutlet = true, children }) { return ( @@ -49,7 +49,7 @@ export default function SimpleLayout() { - + {showOutlet ? : children} ); } diff --git a/web/src/components/core/InstallationFinished.jsx b/web/src/components/core/InstallationFinished.jsx index 7dc2ddef42..0c6c7e5eea 100644 --- a/web/src/components/core/InstallationFinished.jsx +++ b/web/src/components/core/InstallationFinished.jsx @@ -22,12 +22,16 @@ import React, { useState, useEffect } from "react"; import { Alert, + Button, + Card, CardBody, EmptyState, EmptyStateBody, EmptyStateHeader, EmptyStateIcon, ExpandableSection, + Flex, + Grid, GridItem, Stack, Text } from "@patternfly/react-core"; -import { Page } from "~/components/core"; -import { Icon } from "~/components/layout"; +import SimpleLayout from "~/SimpleLayout"; +import { Center, Icon } from "~/components/layout"; import { EncryptionMethods } from "~/client/storage"; import { _ } from "~/i18n"; import { useInstallerClient } from "~/context/installer"; @@ -83,31 +87,41 @@ function InstallationFinished() { }); return ( - // TRANSLATORS: page title - - - } - /> - - {_("The installation on your machine is complete.")} - - {usingIguana - ? _("At this point you can power off the machine.") - : _("At this point you can reboot the machine to log in to the new system.")} - - {usingTpm && } - - - - - - {usingIguana ? _("Finish") : _("Reboot")} - - - + +
+ + + + + + + } + /> + + {_("The installation on your machine is complete.")} + + {usingIguana + ? _("At this point you can power off the machine.") + : _("At this point you can reboot the machine to log in to the new system.")} + + {!usingTpm && } + + + + + + + + + + +
+
); } diff --git a/web/src/components/core/InstallationProgress.jsx b/web/src/components/core/InstallationProgress.jsx index 6497748722..4dcc00ce7a 100644 --- a/web/src/components/core/InstallationProgress.jsx +++ b/web/src/components/core/InstallationProgress.jsx @@ -20,19 +20,27 @@ */ import React from "react"; - +import { Card, CardBody, Grid, GridItem } from "@patternfly/react-core"; +import SimpleLayout from "~/SimpleLayout"; import ProgressReport from "./ProgressReport"; import { Center } from "~/components/layout"; -import { Page } from "~/components/core"; -import { Questions } from "~/components/questions"; import { _ } from "~/i18n"; function InstallationProgress() { return ( - -
- -
+ +
+ + + + + + + + + +
+
); } diff --git a/web/src/components/core/ProgressReport.jsx b/web/src/components/core/ProgressReport.jsx index e738b94e0c..f3bf05973f 100644 --- a/web/src/components/core/ProgressReport.jsx +++ b/web/src/components/core/ProgressReport.jsx @@ -23,7 +23,7 @@ import React, { useState, useEffect } from "react"; import { useCancellablePromise } from "~/utils"; import { useInstallerClient } from "~/context/installer"; -import { Progress, Text } from "@patternfly/react-core"; +import { Grid, GridItem, Progress, Text } from "@patternfly/react-core"; const ProgressReport = () => { const client = useInstallerClient(); @@ -57,29 +57,31 @@ const ProgressReport = () => { if (!progress.steps) return Waiting for progress status...; return ( - <> - + + + - - + + + ); }; diff --git a/web/src/components/storage/ProposalPageMenu.test.jsx b/web/src/components/storage/DevicesTechMenu.test.jsx similarity index 78% rename from web/src/components/storage/ProposalPageMenu.test.jsx rename to web/src/components/storage/DevicesTechMenu.test.jsx index c5bde266cd..ec7e7fb34c 100644 --- a/web/src/components/storage/ProposalPageMenu.test.jsx +++ b/web/src/components/storage/DevicesTechMenu.test.jsx @@ -23,7 +23,7 @@ import React from "react"; import { screen } from "@testing-library/react"; import { installerRender } from "~/test-utils"; import { createClient } from "~/client"; -import { ProposalPageMenu } from "~/components/storage"; +import DevicesTechMenu from "./DevicesTechMenu"; jest.mock("~/client"); @@ -51,43 +51,43 @@ beforeEach(() => { }); it("contains an entry for configuring iSCSI", async () => { - const { user } = installerRender(); + const { user } = installerRender(); const toggler = screen.getByRole("button"); await user.click(toggler); - const link = screen.getByRole("menuitem", { name: /iSCSI/ }); + const link = screen.getByRole("option", { name: /iSCSI/ }); expect(link).toHaveAttribute("href", "/storage/iscsi"); }); it("contains an entry for configuring DASD when is supported", async () => { isDASDSupportedFn.mockResolvedValue(true); - const { user } = installerRender(); + const { user } = installerRender(); const toggler = screen.getByRole("button"); await user.click(toggler); - const link = screen.getByRole("menuitem", { name: /DASD/ }); + const link = screen.getByRole("option", { name: /DASD/ }); expect(link).toHaveAttribute("href", "/storage/dasd"); }); it("does not contain an entry for configuring DASD when is NOT supported", async () => { isDASDSupportedFn.mockResolvedValue(false); - const { user } = installerRender(); + const { user } = installerRender(); const toggler = screen.getByRole("button"); await user.click(toggler); - expect(screen.queryByRole("menuitem", { name: /DASD/ })).toBeNull(); + expect(screen.queryByRole("option", { name: /DASD/ })).toBeNull(); }); it("contains an entry for configuring zFCP when is supported", async () => { isZFCPSupportedFn.mockResolvedValue(true); - const { user } = installerRender(); + const { user } = installerRender(); const toggler = screen.getByRole("button"); await user.click(toggler); - const link = screen.getByRole("menuitem", { name: /zFCP/ }); + const link = screen.getByRole("option", { name: /zFCP/ }); expect(link).toHaveAttribute("href", "/storage/zfcp"); }); it("does not contain an entry for configuring zFCP when is NOT supported", async () => { isZFCPSupportedFn.mockResolvedValue(false); - const { user } = installerRender(); + const { user } = installerRender(); const toggler = screen.getByRole("button"); await user.click(toggler); - expect(screen.queryByRole("menuitem", { name: /DASD/ })).toBeNull(); + expect(screen.queryByRole("option", { name: /DASD/ })).toBeNull(); }); diff --git a/web/src/components/storage/ProposalPage.test.jsx b/web/src/components/storage/ProposalPage.test.jsx index 1abb898656..801fcf5c3b 100644 --- a/web/src/components/storage/ProposalPage.test.jsx +++ b/web/src/components/storage/ProposalPage.test.jsx @@ -46,12 +46,12 @@ jest.mock("@patternfly/react-core", () => { }; }); -jest.mock("~/components/storage/ProposalPageMenu", () => () =>
ProposalPage Options
); +jest.mock("./DevicesTechMenu", () => () =>
Devices Tech Menu
); jest.mock("~/context/product", () => ({ ...jest.requireActual("~/context/product"), useProduct: () => ({ - selectedProduct : { name: "Test" } + selectedProduct: { name: "Test" } }) })); @@ -73,7 +73,7 @@ const vda = { active: true, name: "/dev/vda", size: 1e+12, - systems : ["Windows 11", "openSUSE Leap 15.2"], + systems: ["Windows 11", "openSUSE Leap 15.2"], udevIds: ["ata-Micron_1100_SATA_512GB_12563", "scsi-0ATA_Micron_1100_SATA_512GB"], udevPaths: ["pci-0000:00-12", "pci-0000:00-12-ata"], };