Skip to content

Commit

Permalink
Class name updater
Browse files Browse the repository at this point in the history
`npx @patternfly/class-name-updater ./pkg --v6 --fix`
  • Loading branch information
Venefilyn committed Feb 20, 2025
1 parent 5151d9f commit b3ccf56
Show file tree
Hide file tree
Showing 76 changed files with 440 additions and 439 deletions.
2 changes: 1 addition & 1 deletion pkg/apps/application-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const ApplicationList = ({ metainfo_db, appProgress, appProgressTitle, ac
<Page id="list-page" data-packages-checked={dataPackagesInstalled !== null} className='no-masthead-sidebar'>
<PageSection hasBodyWrapper={false} >
<Flex alignItems={{ default: 'alignItemsCenter' }}>
<h2 className="pf-v5-u-font-size-3xl">{_("Applications")}</h2>
<h2 className="pf-v6-u-font-size-3xl">{_("Applications")}</h2>
<FlexItem align={{ default: 'alignRight' }}>
<Flex alignItems={{ default: 'alignItemsCenter' }} spacer={{ default: 'spacerXs' }}>
<FlexItem>
Expand Down
4 changes: 2 additions & 2 deletions pkg/apps/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
margin-inline-end: 10px;
}

.app-list .pf-v5-c-data-list__item-action button {
.app-list .pf-v6-c-data-list__item-action button {
min-inline-size: 6rem;
}

.app-list .pf-v5-c-data-list__item-content {
.app-list .pf-v6-c-data-list__item-content {
/* Vertically align application info to the center */
align-items: center;
}
Expand Down
26 changes: 13 additions & 13 deletions pkg/kdump/kdump-view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,14 @@ export class KdumpPage extends React.Component {
if (target.type === "local") {
verifyMessage = fmt_to_fragments(
' ' + _("Results of the crash will be stored in $0 as $1, if kdump is properly configured."),
<span className="pf-v5-u-font-family-monospace-vf">{path}</span>,
<span className="pf-v5-u-font-family-monospace-vf">vmcore</span>);
<span className="pf-v6-u-font-family-monospace-vf">{path}</span>,
<span className="pf-v6-u-font-family-monospace-vf">vmcore</span>);
} else if (target.type === "ssh" || target.type == "nfs") {
verifyMessage = fmt_to_fragments(
' ' + _("Results of the crash will be copied through $0 to $1 as $2, if kdump is properly configured."),
<span className="pf-v5-u-font-family-monospace-vf">{target.type === "ssh" ? "SSH" : "NFS"}</span>,
<span className="pf-v5-u-font-family-monospace-vf">{path}</span>,
<span className="pf-v5-u-font-family-monospace-vf">vmcore</span>);
<span className="pf-v6-u-font-family-monospace-vf">{target.type === "ssh" ? "SSH" : "NFS"}</span>,
<span className="pf-v6-u-font-family-monospace-vf">{path}</span>,
<span className="pf-v6-u-font-family-monospace-vf">vmcore</span>);
}
}

Expand Down Expand Up @@ -562,28 +562,28 @@ ${enableCrashKernel}
if (this.props.reservedMemory == 0) {
alertMessage = fmt_to_fragments(
_("Kernel did not boot with the $0 setting"),
<span className="pf-v5-u-font-family-monospace-vf">crashkernel</span>
<span className="pf-v6-u-font-family-monospace-vf">crashkernel</span>
);
alertDetail = fmt_to_fragments(
_("Reserve memory at boot time by setting a '$0' option on the kernel command line. For example, append '$1' to $2 in $3 or use your distribution's kernel argument editor."),
<span className="pf-v5-u-font-family-monospace-vf">crashkernel</span>,
<span className="pf-v5-u-font-family-monospace-vf">crashkernel=512M</span>,
<span className="pf-v5-u-font-family-monospace-vf">GRUB_CMDLINE_LINUX</span>,
<span className="pf-v5-u-font-family-monospace-vf">/etc/default/grub</span>
<span className="pf-v6-u-font-family-monospace-vf">crashkernel</span>,
<span className="pf-v6-u-font-family-monospace-vf">crashkernel=512M</span>,
<span className="pf-v6-u-font-family-monospace-vf">GRUB_CMDLINE_LINUX</span>,
<span className="pf-v6-u-font-family-monospace-vf">/etc/default/grub</span>
);
} else if (this.props.kdumpStatus.state == "failed") {
alertMessage = (
<>
{_("Service has an error")}
<Button variant="link" isInline className="pf-v5-u-ml-sm" onClick={this.handleServiceDetailsClick}>{_("more details")}</Button>
<Button variant="link" isInline className="pf-v6-u-ml-sm" onClick={this.handleServiceDetailsClick}>{_("more details")}</Button>
</>
);
}
} else {
alertMessage = _("Kdump service is not installed.");
alertDetail = fmt_to_fragments(
_("Install the $0 package."),
<span className="pf-v5-u-font-family-monospace-vf">kexec-tools</span>
<span className="pf-v6-u-font-family-monospace-vf">kexec-tools</span>
);
}
}
Expand All @@ -605,7 +605,7 @@ ${enableCrashKernel}

{alertMessage &&
<Alert variant='danger'
className="pf-v5-u-mb-md"
className="pf-v6-u-mb-md"
isLiveRegion={this.props.isLiveRegion}
isInline
title={alertMessage}>
Expand Down
2 changes: 1 addition & 1 deletion pkg/kdump/kdump.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}

// error details
#kdump-settings-dialog .pf-v5-c-code-block__pre {
#kdump-settings-dialog .pf-v6-c-code-block__pre {
max-block-size: 200px;
overflow-y: auto;
}
2 changes: 1 addition & 1 deletion pkg/lib/cockpit-components-empty-state.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.pf-v5-c-empty-state .pf-v5-c-button.pf-m-primary.slim {
.pf-v6-c-empty-state .pf-v6-c-button.pf-m-primary.slim {
margin: 0;
}
2 changes: 1 addition & 1 deletion pkg/lib/cockpit-components-firewalld-request.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const FirewalldRequest = ({ service, title, pageSection }) => {
return null;
} else {
alert = (
<Alert isInline variant="info" title={title} className="pf-v5-u-box-shadow-sm">
<Alert isInline variant="info" title={title} className="pf-v6-u-box-shadow-sm">
<Toolbar className="ct-alert-toolbar">
<ToolbarContent>
<ToolbarGroup>
Expand Down
2 changes: 1 addition & 1 deletion pkg/lib/cockpit-components-listing-panel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class ListingPanel extends React.Component {

return (
<div className="ct-listing-panel">
{listingDetail && <div className="ct-listing-panel-actions pf-v5-c-tabs">
{listingDetail && <div className="ct-listing-panel-actions pf-v6-c-tabs">
{listingDetail}
</div>}
{this.props.tabRenderers.length && <Tabs activeKey={this.state.activeTab} className="ct-listing-panel-tabs" mountOnEnter onSelect={this.handleTabClick}>
Expand Down
6 changes: 3 additions & 3 deletions pkg/lib/cockpit-components-listing-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
order: 1;
}

.pf-v5-c-tab-content {
.pf-v6-c-tab-content {
order: 3;
flex-basis: 100%;
}
Expand Down Expand Up @@ -47,7 +47,7 @@
}

.ct-table {
> tbody > .pf-v5-c-table__expandable-row {
> tbody > .pf-v6-c-table__expandable-row {
// Don't scroll table's expanded contents vertically.
// Instead, rely on page scrolling.
// Important for mobile; also useful for desktop.
Expand All @@ -61,7 +61,7 @@

@media not all and (prefers-reduced-motion: reduce) {
// Add expansion animations when prefers-reduced isn't enabled
.ct-table .pf-v5-c-table__expandable-row-content {
.ct-table .pf-v6-c-table__expandable-row-content {
// Animation ends at or before 2/3 in most cases; so we extend by 1.5 to compensate
animation: ctListingPanelShow calc(var(--pf-v5-global--TransitionDuration) * 1.5) var(--pf-v5-global--TimingFunction);
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/lib/cockpit-components-logs-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
padding-inline: 0;
}

.cockpit-log-panel .pf-v5-c-card__header-main > .pf-v5-c-card__title > .pf-v5-c-card__title-text {
.cockpit-log-panel .pf-v6-c-card__header-main > .pf-v6-c-card__title > .pf-v6-c-card__title-text {
padding: 0;
font-weight: normal;
font-size: var(--pf-v5-global--FontSize--2xl);
Expand Down
2 changes: 1 addition & 1 deletion pkg/lib/cockpit-components-modifications.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
color: var(--pf-v5-global--success-color--100);
}

.pf-v5-c-card.modifications-table .pf-v5-c-card__header {
.pf-v6-c-card.modifications-table .pf-v6-c-card__header {
justify-content: space-between;
}
12 changes: 6 additions & 6 deletions pkg/lib/cockpit-components-password.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ export const PasswordFormFields = ({
let messageColor;
if (passwordStrength > 66) {
variant = "success";
messageColor = "pf-v5-u-success-color-200";
messageColor = "pf-v6-u-success-color-200";
message = _("Strong password");
} else if (passwordStrength > 33) {
variant = "warning";
messageColor = "pf-v5-u-warning-color-200";
messageColor = "pf-v6-u-warning-color-200";
message = _("Acceptable password");
} else {
variant = "danger";
messageColor = "pf-v5-u-danger-color-200";
messageColor = "pf-v6-u-danger-color-200";
message = _("Weak password");
}

Expand All @@ -118,7 +118,7 @@ export const PasswordFormFields = ({
labelHelp={password_label_info &&
<Popover bodyContent={password_label_info}>
<button onClick={e => e.preventDefault()}
className="pf-v5-c-form__group-label-help">
className="pf-v6-c-form__group-label-help">
<HelpIcon />
</button>
</Popover>
Expand All @@ -143,15 +143,15 @@ export const PasswordFormFields = ({
{passwordStrengthValue >= 0 && <Flex spaceItems={{ default: 'spaceItemsSm' }}>
<FlexItem>
<Progress id={idPrefix + "-meter"}
className={"pf-v5-u-pt-xs ct-password-strength-meter " + variant}
className={"pf-v6-u-pt-xs ct-password-strength-meter " + variant}
title={_("password quality")}
size={ProgressSize.sm}
measureLocation={ProgressMeasureLocation.none}
variant={variant}
value={passwordStrengthValue} />
</FlexItem>
<FlexItem>
<div id={idPrefix + "-password-meter-message"} className={"pf-v5-c-form__helper-text " + messageColor} aria-live="polite">{passwordMessage}</div>
<div id={idPrefix + "-password-meter-message"} className={"pf-v6-c-form__helper-text " + messageColor} aria-live="polite">{passwordMessage}</div>
</FlexItem>
</Flex>}
{error_password && <FormHelperText>
Expand Down
2 changes: 1 addition & 1 deletion pkg/lib/cockpit-components-password.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
grid-gap: var(--pf-v5-global--spacer--xs);
inline-size: var(--pf-v5-global--spacer--2xl);

.pf-v5-c-progress__description, .pf-v5-c-progress__status {
.pf-v6-c-progress__description, .pf-v6-c-progress__status {
display: none;
}
}
2 changes: 1 addition & 1 deletion pkg/lib/cockpit-components-select.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.ct-select-header .pf-v5-c-menu__item-main {
.ct-select-header .pf-v6-c-menu__item-main {
color: var(--pf-v5-c-menu__group-title--Color);
font-size: var(--pf-v5-c-menu__group-title--FontSize);
}
6 changes: 3 additions & 3 deletions pkg/lib/cockpit-components-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.ct-table {
&.pf-m-compact {
> thead, > tbody {
> tr:not(.pf-v5-c-table__expandable-row) {
> tr:not(.pf-v6-c-table__expandable-row) {
// We actually want the normal font size for our lists
--pf-v5-c-table-cell--FontSize: var(--pf-v5-global--FontSize--md);
}
Expand Down Expand Up @@ -60,7 +60,7 @@
}

// Fix toggle button alignment
.pf-v5-c-table__toggle {
.pf-v6-c-table__toggle {
// Workaround: Chrome sometimes oddly expands the table,
// unless a width is set. (This affects panels the most, but not only.)
// As the width is smaller than the contents, and this is a table,
Expand All @@ -83,7 +83,7 @@
}

// Special handling for rows with errors
.pf-v5-c-table tbody tr:first-child.error {
.pf-v6-c-table tbody tr:first-child.error {
&, tbody.pf-m-expanded > & {
background-color: var(--ct-color-list-critical-bg) !important; /* keep red background when expanded */
border-block-start: 1px solid var(--ct-color-list-critical-border);
Expand Down
2 changes: 1 addition & 1 deletion pkg/lib/cockpit-components-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export const ListingTable = ({
setExpanded({ ...expanded, [rowKey]: !expanded[rowKey] });
}
}} />
: <Td className="pf-v5-c-table__toggle" />)
: <Td className="pf-v6-c-table__toggle" />)
: null
}
{onSelect &&
Expand Down
4 changes: 2 additions & 2 deletions pkg/lib/cockpit-components-truncate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export const Truncate = ({
content: string,
}) => {
return (
<span className="pf-v5-c-truncate ct-no-truncate-min-width" {...props}>
<span className="pf-v5-c-truncate__start">
<span className="pf-v6-c-truncate ct-no-truncate-min-width" {...props}>
<span className="pf-v6-c-truncate__start">
{content}
</span>
</span>
Expand Down
8 changes: 4 additions & 4 deletions pkg/lib/cockpit-connect-ssh.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ const UnknownHostDialog = ({ host, error, dialogResult }: {
body = <>
<Alert variant='danger' isInline title={_("Changed keys are often the result of an operating system reinstallation. However, an unexpected change may indicate a third-party attempt to intercept your connection.")} />
<p>{_("To ensure that your connection is not intercepted by a malicious third-party, please verify the host key fingerprint:")}</p>
<ClipboardCopy isReadOnly hoverTip={_("Copy")} clickTip={_("Copied")} className="hostkey-fingerprint pf-v5-u-font-family-monospace">{host_fp}</ClipboardCopy>
<ClipboardCopy isReadOnly hoverTip={_("Copy")} clickTip={_("Copied")} className="hostkey-fingerprint pf-v6-u-font-family-monospace">{host_fp}</ClipboardCopy>
<p className="hostkey-type">({key_type})</p>
<p>{cockpit.format(_("To verify a fingerprint, run the following on $0 while physically sitting at the machine or through a trusted network:"), address.address)}</p>
<ClipboardCopy isReadOnly hoverTip={_("Copy")} clickTip={_("Copied")} className="hostkey-verify-help-cmds pf-v5-u-font-family-monospace">{scan_cmd}</ClipboardCopy>
<ClipboardCopy isReadOnly hoverTip={_("Copy")} clickTip={_("Copied")} className="hostkey-verify-help-cmds pf-v6-u-font-family-monospace">{scan_cmd}</ClipboardCopy>
<p>{_("The resulting fingerprint is fine to share via public methods, including email.")}</p>
<p>{_("If the fingerprint matches, click 'Trust and add host'. Otherwise, do not connect and contact your administrator.")}</p>
</>;
Expand All @@ -150,9 +150,9 @@ const UnknownHostDialog = ({ host, error, dialogResult }: {
isExpanded={verifyExpanded}
onToggle={(_ev, value) => setVerifyExpanded(value) }>
<div>{_("Run this command over a trusted network or physically on the remote machine:")}</div>
<ClipboardCopy isReadOnly hoverTip={_("Copy")} clickTip={_("Copied")} className="hostkey-verify-help hostkey-verify-help-cmds pf-v5-u-font-family-monospace">{scan_cmd}</ClipboardCopy>
<ClipboardCopy isReadOnly hoverTip={_("Copy")} clickTip={_("Copied")} className="hostkey-verify-help hostkey-verify-help-cmds pf-v6-u-font-family-monospace">{scan_cmd}</ClipboardCopy>
<div>{_("The fingerprint should match:")} {fingerprint_help}</div>
<ClipboardCopy isReadOnly hoverTip={_("Copy")} clickTip={_("Copied")} className="hostkey-verify-help hostkey-fingerprint pf-v5-u-font-family-monospace">{host_fp}</ClipboardCopy>
<ClipboardCopy isReadOnly hoverTip={_("Copy")} clickTip={_("Copied")} className="hostkey-verify-help hostkey-fingerprint pf-v6-u-font-family-monospace">{host_fp}</ClipboardCopy>
</ExpandableSection>
</>;
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/lib/context-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/* Move the menu under the mouse */
transform: translate(calc(-1 * var(--pf-v5-global--spacer--sm)), calc(-1 * var(--pf-v5-global--spacer--sm)));

&Option .pf-v5-c-menu__item-text {
&Option .pf-v6-c-menu__item-text {
display: flex;
gap: var(--pf-v5-global--spacer--sm);
justify-content: space-between;
Expand Down
22 changes: 11 additions & 11 deletions pkg/lib/ct-card.scss
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
@use "_global-variables.scss" as *;

/* Rely on the margin from the Card for spacing */
.ct-card.pf-v5-c-card .table {
.ct-card.pf-v6-c-card .table {
margin-block-end: 0;
}

// FIXME: Once PF4 provides a property for removing padding: https://github.com/patternfly/patternfly-react/issues/5606
.ct-card.pf-v5-c-card .pf-v5-c-card__body.contains-list {
.ct-card.pf-v6-c-card .pf-v6-c-card__body.contains-list {
padding-inline: 0;
padding-block-end: 0;

> .pf-v5-c-table > :last-child > tr:last-child {
> .pf-v6-c-table > :last-child > tr:last-child {
border-block-end: none;
}

// Remove excess padding from compact tables toggles
// And adjust the padding to left align the toggles with the card header
> .pf-v5-c-table {
.pf-v5-c-table__toggle {
> .pf-v6-c-table {
.pf-v6-c-table__toggle {
padding-inline-start: 0;

> .pf-v5-c-button {
> .pf-v6-c-button {
padding-inline-start: var(--pf-v5-global--spacer--lg);
}
}
}
}

.ct-card.pf-v5-c-card .pf-v5-c-card__title-text {
.ct-card.pf-v6-c-card .pf-v6-c-card__title-text {
font-weight: normal;
font-size: var(--pf-v5-global--FontSize--2xl);
}

// Remove excess top padding from top-level empty state in cards,
// as card headers already add enough space
.ct-card > .pf-v5-c-card__body > .pf-v5-c-empty-state {
.ct-card > .pf-v6-c-card__body > .pf-v6-c-empty-state {
--pf-v5-c-empty-state__body--MarginTop: 0;
padding-block: 0 var(--pf-v5-global--spacer--md);
}
Expand All @@ -43,7 +43,7 @@
--ct-grid-columns: 2;
--pf-v5-l-gallery--GridTemplateColumns: repeat(var(--ct-grid-columns), 1fr);

> .pf-v5-c-card:not(.ct-card-info) {
> .pf-v6-c-card:not(.ct-card-info) {
// Extend all non-info cards to be full width;
// let ct-card-info fit 1 column of the grid
grid-column: 1 / -1;
Expand All @@ -57,7 +57,7 @@

// Remove redundant padding from embedded toolbars (handled by header)
// Toolbars in card headers are not a common scenario so no need to upstream this
.ct-card.pf-v5-c-card .pf-v5-c-toolbar,
.ct-card.pf-v5-c-card .pf-v5-c-toolbar__content {
.ct-card.pf-v6-c-card .pf-v6-c-toolbar,
.ct-card.pf-v6-c-card .pf-v6-c-toolbar__content {
padding: 0;
}
Loading

0 comments on commit b3ccf56

Please sign in to comment.