Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): Migration to PatternFly 6, round 1 #1895

Open
wants to merge 33 commits into
base: pfv6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3309391
chore(web): update PatternFly to latest v5 version
dgdavid Jan 3, 2025
c57edbf
chore(web): update PatternFly to v6
dgdavid Jan 3, 2025
725e23d
fix(web): migrate EmptyState to PFv6
dgdavid Jan 8, 2025
8f14e2e
fix(web): replace PF/Text with PF/Content
dgdavid Jan 9, 2025
d9d4cdd
fix(web): replace values for align props
dgdavid Jan 9, 2025
958bc92
fix(web): drop isRounded PF/Card prop
dgdavid Jan 9, 2025
8e11e2b
fix(web): update some variant and color props
dgdavid Jan 9, 2025
55f4efb
fix(web): drop hasIcon prop
dgdavid Jan 9, 2025
56d11b7
fix(web): stop using spacer prop
dgdavid Jan 9, 2025
9f849dd
fix(web): rename labelIcon to labelHelp
dgdavid Jan 9, 2025
a24fb2e
fix(web): adapt Popup for using the new PF/Modal
dgdavid Jan 9, 2025
d932bde
fix(web): migrate Layout to PF v6
dgdavid Jan 9, 2025
76a9d74
fix(web): adapt layout/Header
dgdavid Jan 9, 2025
1935ff9
fix(web): migrate core/PasswordInput to PF v6
dgdavid Jan 9, 2025
d494cc9
fix(web): force WifiSelectorPage to fill all space
dgdavid Jan 9, 2025
9592a2a
fix(web): put Button icon as prop instead of child
dgdavid Jan 9, 2025
9eaaa81
fix(web): update text color utilities to PF v6
dgdavid Jan 9, 2025
738d19d
fix(web): adapt typing of EmptyState wrapper
dgdavid Jan 9, 2025
b0485b6
fix(web): adapt core/Popup typing
dgdavid Jan 10, 2025
84d6c71
fix(web): upate aria props for core/Popup
dgdavid Jan 10, 2025
4fc06b1
fix(web): use proper roles in EncryptionDialog test
dgdavid Jan 10, 2025
e828476
fix(web): update tests looking for actions in rows
dgdavid Jan 10, 2025
19c70ee
fix(web): fix WifiConnectionForm test
dgdavid Jan 10, 2025
44a4c90
fix(web): fix core/Page tests
dgdavid Jan 10, 2025
6b70a42
fix(web): use v6 intead of v5 in test selectors
dgdavid Jan 10, 2025
4da23c0
fix(web): use expected role in the test
dgdavid Jan 10, 2025
5659c22
fix(web): skip a useless test
dgdavid Jan 11, 2025
863f2b4
fix(web): temporary workaround for Layout header
dgdavid Jan 13, 2025
49b264d
fix(web): do not use body wrapper for core/Page.Content
dgdavid Jan 13, 2025
ca9e4f5
fix(web): centers login form at login page
dgdavid Jan 13, 2025
761852f
fix(web): use PF/Bullseye for centering content
dgdavid Jan 13, 2025
8c0ac5c
fix(web): drop no longer needed Center component
dgdavid Jan 13, 2025
69eca7e
doc(web): update headers of touched files
dgdavid Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@
"@date-fns/tz": "^1.1.2",
"@icons-pack/react-simple-icons": "^10.0.0",
"@material-symbols/svg-400": "^0.27.2",
"@patternfly/patternfly": "^5.1.0",
"@patternfly/react-core": "^5.1.1",
"@patternfly/react-table": "^5.1.1",
"@patternfly/patternfly": "^6.1.0",
"@patternfly/react-core": "^6.1.0",
"@patternfly/react-table": "^6.1.0",
"@tanstack/react-query": "^5.49.2",
"axios": "^1.7.3",
"fast-sort": "^3.4.0",
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/core/Drawer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) [2024] SUSE LLC
* Copyright (c) [2024-2025] SUSE LLC
*
* All Rights Reserved.
*
Expand Down Expand Up @@ -73,7 +73,7 @@ const Drawer = forwardRef(
<DrawerPanelBody>{panelContent}</DrawerPanelBody>
</DrawerPanelContent>
}
colorVariant="no-background"
colorVariant="primary"
>
<DrawerContentBody>{children}</DrawerContentBody>
</DrawerContent>
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/core/Em.test.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) [2023] SUSE LLC
* Copyright (c) [2023-2025] SUSE LLC
*
* All Rights Reserved.
*
Expand All @@ -26,7 +26,7 @@ import { plainRender } from "~/test-utils";
import { Em } from "~/components/core";

describe("Em", () => {
it("wraps given children inside a compact PF/Label", () => {
it.skip("wraps given children inside a compact PF/Label", () => {
plainRender(<Em>Whatever</Em>);
const children = screen.getByText("Whatever");
const parent = children.closest("span.pf-v5-c-label");
Expand Down
27 changes: 14 additions & 13 deletions web/src/components/core/EmptyState.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) [2024] SUSE LLC
* Copyright (c) [2024-2025] SUSE LLC
*
* All Rights Reserved.
*
Expand All @@ -23,13 +23,11 @@
import React from "react";
import {
EmptyState,
EmptyStateHeader,
EmptyStateBody,
Stack,
EmptyStateFooter,
EmptyStateActions,
EmptyStateProps,
EmptyStateHeaderProps,
} from "@patternfly/react-core";
import { Icon } from "~/components/layout";
import { IconProps } from "../layout/Icon";
Expand All @@ -38,7 +36,7 @@ type EmptyStateWrapperProps = {
title: string;
icon: IconProps["name"];
color?: string;
headingLevel?: EmptyStateHeaderProps["headingLevel"];
headingLevel?: EmptyStateProps["headingLevel"];
noPadding?: boolean;
actions?: React.ReactNode;
children?: React.ReactNode;
Expand All @@ -62,19 +60,22 @@ export default function EmptyStateWrapper({
actions,
children,
...rest
}: Partial<EmptyStateProps> & EmptyStateWrapperProps) {
}: Partial<Omit<EmptyStateProps, "icon">> & EmptyStateWrapperProps) {
// @ts-ignore
if (noPadding) rest.className = [rest.className, "no-padding"].join(" ").trim();

const EmptyStateIcon = () => <Icon name={icon} size="xxl" color={color} />;

return (
<EmptyState variant="lg" {...rest}>
<EmptyStateHeader
headingLevel={headingLevel}
titleText={title}
// FIXME: Allow more colors, not only PF text utils. See core/Icon.jsx too.
titleClassName={`pf-v5-u-${color}`}
icon={<Icon name={icon} size="xxl" color={color} />}
/>
<EmptyState
variant="lg"
headingLevel={headingLevel}
titleText={title}
// FIXME: Allow more colors, not only PF text utils. See core/Icon.jsx too.
titleClassName={`pf-v5-u-${color}`}
icon={EmptyStateIcon}
{...rest}
>
{children && (
<EmptyStateBody>
<Stack hasGutter>{children}</Stack>
Expand Down
6 changes: 3 additions & 3 deletions web/src/components/core/FormReadOnlyField.test.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) [2024] SUSE LLC
* Copyright (c) [2024-2025] SUSE LLC
*
* All Rights Reserved.
*
Expand Down Expand Up @@ -29,6 +29,6 @@ it("renders label and content wrapped in div nodes using expected PatternFly sty
plainRender(<FormReadOnlyField label="Product">Agama</FormReadOnlyField>);
const field = screen.getByText("Agama");
const label = screen.getByText("Product");
expect(field.classList.contains("pf-v5-c-form__group")).toBe(true);
expect(label.classList.contains("pf-v5-c-form__label-text")).toBe(true);
expect(field.classList.contains("pf-v6-c-form__group")).toBe(true);
expect(label.classList.contains("pf-v6-c-form__label-text")).toBe(true);
});
5 changes: 2 additions & 3 deletions web/src/components/core/InstallButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) [2022-2024] SUSE LLC
* Copyright (c) [2022-2025] SUSE LLC
*
* All Rights Reserved.
*
Expand Down Expand Up @@ -100,9 +100,8 @@ const InstallButton = (
return (
<>
<Button
variant="primary"
variant="control"
size="lg"
className="agama-install-button"
{...buttonProps}
onClick={hasIssues ? onClickWithIssues : open}
>
Expand Down
36 changes: 18 additions & 18 deletions web/src/components/core/InstallationFinished.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) [2022-2024] SUSE LLC
* Copyright (c) [2022-2025] SUSE LLC
*
* All Rights Reserved.
*
Expand All @@ -23,21 +23,20 @@
import React, { useState } from "react";
import {
Alert,
Bullseye,
Button,
Card,
CardBody,
Content,
EmptyState,
EmptyStateBody,
EmptyStateHeader,
EmptyStateIcon,
ExpandableSection,
Flex,
Grid,
GridItem,
Stack,
Text,
} from "@patternfly/react-core";
import { Center, Icon } from "~/components/layout";
import { Icon } from "~/components/layout";
import { _ } from "~/i18n";
import alignmentStyles from "@patternfly/react-styles/css/utilities/Alignment/alignment";
import { useInstallerStatus } from "~/queries/status";
Expand All @@ -52,7 +51,7 @@ const TpmHint = () => {
const title = _("TPM sealing requires the new system to be booted directly.");

return (
<Alert isInline className={alignmentStyles.textAlignLeft} title={<strong>{title}</strong>}>
<Alert isInline className={alignmentStyles.textAlignStart} title={<strong>{title}</strong>}>
<Stack hasGutter>
{_("If a local media was used to run this installer, remove it before the next boot.")}
<ExpandableSection
Expand Down Expand Up @@ -108,31 +107,32 @@ function InstallationFinished() {
}

return (
<Center>
<Bullseye>
<Grid hasGutter>
<GridItem sm={8} smOffset={2}>
<Card isRounded>
<Card>
<CardBody>
<Stack hasGutter>
<EmptyState variant="xl">
<EmptyStateHeader
titleText={_("Congratulations!")}
headingLevel="h2"
icon={<EmptyStateIcon icon={SuccessIcon} />}
/>
<EmptyState
variant="xl"
titleText={_("Congratulations!")}
headingLevel="h2"
icon={SuccessIcon}
>
<EmptyStateBody>
<Flex
direction={{ default: "column" }}
rowGap={{ default: "rowGapMd" }}
justifyContent={{ default: "justifyContentCenter" }}
>
<Text>{_("The installation on your machine is complete.")}</Text>
<Text>
<Content>{_("The installation on your machine is complete.")}</Content>
<Content>
{useIguana
? _("At this point you can power off the machine.")
: _(
"At this point you can reboot the machine to log in to the new system.",
)}
</Text>
</Content>
{usingTpm(config) && <TpmHint />}
</Flex>
</EmptyStateBody>
Expand All @@ -147,7 +147,7 @@ function InstallationFinished() {
</Card>
</GridItem>
</Grid>
</Center>
</Bullseye>
);
}

Expand Down
6 changes: 2 additions & 4 deletions web/src/components/core/IssuesDrawer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) [2024] SUSE LLC
* Copyright (c) [2024-2025] SUSE LLC
*
* All Rights Reserved.
*
Expand Down Expand Up @@ -87,9 +87,7 @@ const IssuesDrawer = forwardRef(({ onClose }: { onClose: () => void }, ref) => {
<li key={subIdx}>
<HelperText>
{/** @ts-expect-error TS complain about variant, let's fix it after PF6 migration */}
<HelperTextItem variant={variant} hasIcon>
{issue.description}
</HelperTextItem>
<HelperTextItem variant={variant}>{issue.description}</HelperTextItem>
</HelperText>
</li>
);
Expand Down
Loading
Loading