Skip to content

Commit

Permalink
all: Use <CardTitle component="h2"... for cards
Browse files Browse the repository at this point in the history
  • Loading branch information
KKoukiou authored May 3, 2023
1 parent 61f5fad commit 4770704
Show file tree
Hide file tree
Showing 22 changed files with 31 additions and 77 deletions.
3 changes: 1 addition & 2 deletions pkg/lib/cockpit-components-modifications.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { Card, CardBody, CardHeader, CardTitle } from "@patternfly/react-core/di
import { DataList, DataListCell, DataListItem, DataListItemCells, DataListItemRow } from "@patternfly/react-core/dist/esm/components/DataList/index.js";
import { Modal } from "@patternfly/react-core/dist/esm/components/Modal/index.js";
import { Tab, Tabs } from "@patternfly/react-core/dist/esm/components/Tabs/index.js";
import { Text, TextVariants } from "@patternfly/react-core/dist/esm/components/Text/index.js";
import { TextArea } from "@patternfly/react-core/dist/esm/components/TextArea/index.js";
import { CheckIcon, CopyIcon, ExternalLinkAltIcon, OutlinedQuestionCircleIcon } from '@patternfly/react-icons';

Expand Down Expand Up @@ -158,7 +157,7 @@ export class Modifications extends React.Component {
<ModificationsExportDialog show={this.state.showDialog} shell={this.props.shell} ansible={this.props.ansible} onClose={ () => this.setState({ showDialog: false }) } />
<Card className="modifications-table">
<CardHeader>
<CardTitle><Text component={TextVariants.h2}>{this.props.title}</Text></CardTitle>
<CardTitle component="h2">{this.props.title}</CardTitle>
{ !emptyRow &&
<Button variant="secondary" onClick={() => this.setState({ showDialog: true }) }>
{_("View automation script")}
Expand Down
4 changes: 1 addition & 3 deletions pkg/networkmanager/network-interface-members.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { Button } from "@patternfly/react-core/dist/esm/components/Button/index.
import { Card, CardHeader, CardTitle } from '@patternfly/react-core/dist/esm/components/Card/index.js';
import { Dropdown, DropdownItem, DropdownToggle } from '@patternfly/react-core/dist/esm/deprecated/components/Dropdown/index.js';
import { Switch } from "@patternfly/react-core/dist/esm/components/Switch/index.js";
import { Text, TextVariants } from "@patternfly/react-core/dist/esm/components/Text/index.js";
import { MinusIcon } from '@patternfly/react-icons';

import { ListingTable } from "cockpit-components-table.jsx";
Expand Down Expand Up @@ -204,8 +203,7 @@ export const NetworkInterfaceMembers = ({
return (
<Card id="network-interface-members" className="network-interface-members">
<CardHeader actions={{ actions: add_btn }}>
<CardTitle><Text component={TextVariants.h2}>{_("Interface members")}</Text></CardTitle>

<CardTitle component="h2">{_("Interface members")}</CardTitle>
</CardHeader>
<ListingTable aria-label={_("Interface members")}
className="networking-interface-members"
Expand Down
8 changes: 3 additions & 5 deletions pkg/networkmanager/network-main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core/di
import { Flex } from "@patternfly/react-core/dist/esm/layouts/Flex/index.js";
import { Gallery } from "@patternfly/react-core/dist/esm/layouts/Gallery/index.js";
import { Page, PageSection, PageSectionVariants } from "@patternfly/react-core/dist/esm/components/Page/index.js";
import { Text, TextVariants } from "@patternfly/react-core/dist/esm/components/Text/index.js";

import { FirewallSwitch } from "./firewall-switch.jsx";
import { ListingTable } from "cockpit-components-table.jsx";
Expand Down Expand Up @@ -162,10 +161,9 @@ export const NetworkPage = ({ privileged, operationInProgress, usage_monitor, pl
</Button></>,
}}>
<Flex alignItems={{ default: 'alignItemsCenter' }}>
<CardTitle><Text component={TextVariants.h2}>{_("Firewall")}</Text></CardTitle>
<CardTitle component="h2">{_("Firewall")}</CardTitle>
<FirewallSwitch firewall={firewall} />
</Flex>

</CardHeader>
<CardBody>
<Button variant="link"
Expand All @@ -178,7 +176,7 @@ export const NetworkPage = ({ privileged, operationInProgress, usage_monitor, pl
</Card>}
<Card id="networking-interfaces">
<CardHeader actions={{ actions }}>
<CardTitle><Text component={TextVariants.h2}>{_("Interfaces")}</Text></CardTitle>
<CardTitle component="h2">{_("Interfaces")}</CardTitle>
</CardHeader>
<ListingTable aria-label={_("Managed interfaces")}
variant='compact'
Expand All @@ -193,7 +191,7 @@ export const NetworkPage = ({ privileged, operationInProgress, usage_monitor, pl
{unmanaged.length > 0 &&
<Card id="networking-unmanaged-interfaces">
<CardHeader>
<CardTitle><Text component={TextVariants.h2}>{_("Unmanaged interfaces")}</Text></CardTitle>
<CardTitle component="h2">{_("Unmanaged interfaces")}</CardTitle>
</CardHeader>
<ListingTable aria-label={_("Unmanaged interfaces")}
variant='compact'
Expand Down
2 changes: 1 addition & 1 deletion pkg/packagekit/updates.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ class CardsPage extends React.Component {
return (
<Card key={card.id} className={card.className} id={card.id}>
<CardHeader actions={{ actions: card.actions }}>
<CardTitle><h2>{card.title}</h2></CardTitle>
<CardTitle component="h2">{card.title}</CardTitle>
</CardHeader>
<CardBody className={card.containsList ? "contains-list" : null}>
{card.body}
Expand Down
3 changes: 1 addition & 2 deletions pkg/selinux/setroubleshoot-view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { Flex, FlexItem } from "@patternfly/react-core/dist/esm/layouts/Flex/ind
import { Page, PageSection, PageSectionVariants } from "@patternfly/react-core/dist/esm/components/Page/index.js";
import { Switch } from "@patternfly/react-core/dist/esm/components/Switch/index.js";
import { Stack, StackItem } from "@patternfly/react-core/dist/esm/layouts/Stack/index.js";
import { Text, TextVariants } from "@patternfly/react-core/dist/esm/components/Text/index.js";
import { TextArea } from "@patternfly/react-core/dist/esm/components/TextArea/index.js";
import { ExclamationCircleIcon, ExclamationTriangleIcon, InfoCircleIcon } from "@patternfly/react-icons";

Expand Down Expand Up @@ -403,7 +402,7 @@ export class SETroubleshootPage extends React.Component {
const troubleshooting = (
<Card>
<CardHeader actions={{ actions }}>
<CardTitle><Text component={TextVariants.h2}>{title}</Text></CardTitle>
<CardTitle component="h2">{title}</CardTitle>
</CardHeader>
<CardBody className="contains-list">
{!emptyState
Expand Down
6 changes: 1 addition & 5 deletions pkg/sosreport/sosreport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { Form, FormGroup } from "@patternfly/react-core/dist/esm/components/Form
import { InputGroup } from "@patternfly/react-core/dist/esm/components/InputGroup/index.js";
import { TextInput } from "@patternfly/react-core/dist/esm/components/TextInput/index.js";
import { Checkbox } from "@patternfly/react-core/dist/esm/components/Checkbox/index.js";
import { Text, TextVariants } from "@patternfly/react-core/dist/esm/components/Text/index.js";
import { EyeIcon, EyeSlashIcon } from '@patternfly/react-icons';

import { EmptyStatePanel } from "cockpit-components-empty-state.jsx";
Expand Down Expand Up @@ -492,10 +491,7 @@ const SOSBody = () => {
{_("Run report")}
</Button>,
}}>
<CardTitle>
<Text component={TextVariants.h2}>{_("Reports")}</Text>
</CardTitle>

<CardTitle component="h2">{_("Reports")}</CardTitle>
</CardHeader>
<CardBody className="contains-list">
<ListingTable emptyCaption={_("No system reports.")}
Expand Down
3 changes: 1 addition & 2 deletions pkg/storaged/block-details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import cockpit from "cockpit";
import React from "react";

import { Card, CardBody, CardTitle } from "@patternfly/react-core/dist/esm/components/Card/index.js";
import { Text, TextVariants } from "@patternfly/react-core/dist/esm/components/Text/index.js";
import { DescriptionList, DescriptionListDescription, DescriptionListGroup, DescriptionListTerm } from "@patternfly/react-core/dist/esm/components/DescriptionList/index.js";

import * as utils from "./utils.js";
Expand All @@ -36,7 +35,7 @@ export class BlockDetails extends React.Component {

const header = (
<Card>
<CardTitle><Text component={TextVariants.h2}>{_("Block")}</Text></CardTitle>
<CardTitle component="h2">{_("Block")}</CardTitle>
<CardBody>
<DescriptionList className="pf-m-horizontal-on-sm">
<DescriptionListGroup>
Expand Down
7 changes: 2 additions & 5 deletions pkg/storaged/content-views.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import * as utils from "./utils.js";
import React from "react";
import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core/dist/esm/components/Card/index.js';
import { Spinner } from "@patternfly/react-core/dist/esm/components/Spinner/index.js";
import { Text, TextVariants } from "@patternfly/react-core/dist/esm/components/Text/index.js";
import {
DropdownSeparator
} from '@patternfly/react-core/dist/esm/deprecated/components/Dropdown/index.js';
Expand Down Expand Up @@ -756,8 +755,7 @@ const BlockContent = ({ client, block, allow_partitions }) => {
return (
<Card>
<CardHeader actions={{ actions: format_disk_btn }}>
<CardTitle><Text component={TextVariants.h2}>{title}</Text></CardTitle>

<CardTitle component="h2">{title}</CardTitle>
</CardHeader>
<CardBody className="contains-list">
<ListingTable rows={ block_rows(client, block) }
Expand Down Expand Up @@ -1021,8 +1019,7 @@ export class VGroup extends React.Component {
return (
<Card>
<CardHeader actions={{ actions: new_volume_link }}>
<CardTitle><Text component={TextVariants.h2}>{_("Logical volumes")}</Text></CardTitle>

<CardTitle component="h2">{_("Logical volumes")}</CardTitle>
</CardHeader>
<CardBody className="contains-list">
<ListingTable emptyCaption={_("No logical volumes")}
Expand Down
3 changes: 1 addition & 2 deletions pkg/storaged/crypto-keyslots.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,7 @@ export class CryptoKeyslots extends React.Component {
</StorageButton>
</>,
}}>

<CardTitle><Text component={TextVariants.h2}>{_("Keys")}</Text></CardTitle>
<CardTitle component="h2">{_("Keys")}</CardTitle>
</CardHeader>
<CardBody className="contains-list">
<DataList isCompact className="crypto-keyslots-list" aria-label={_("Keys")}>
Expand Down
3 changes: 1 addition & 2 deletions pkg/storaged/drive-details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import cockpit from "cockpit";
import React from "react";

import { Card, CardBody, CardTitle } from "@patternfly/react-core/dist/esm/components/Card/index.js";
import { Text, TextVariants } from "@patternfly/react-core/dist/esm/components/Text/index.js";
import { DescriptionList, DescriptionListDescription, DescriptionListGroup, DescriptionListTerm } from "@patternfly/react-core/dist/esm/components/DescriptionList/index.js";
import { Flex } from "@patternfly/react-core/dist/esm/layouts/Flex/index.js";

Expand Down Expand Up @@ -73,7 +72,7 @@ export class DriveDetails extends React.Component {

const header = (
<Card>
<CardTitle><Text component={TextVariants.h2}>{_("Drive")}</Text></CardTitle>
<CardTitle component="h2">{_("Drive")}</CardTitle>
<CardBody>
<DescriptionList className="pf-m-horizontal-on-sm">
<DriveDetailsRow title={_("storage", "Model")} value={drive.Model} />
Expand Down
3 changes: 1 addition & 2 deletions pkg/storaged/jobs-panel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import React from "react";

import { Card, CardBody, CardTitle } from "@patternfly/react-core/dist/esm/components/Card/index.js";
import { DataList, DataListCell, DataListItem, DataListItemCells, DataListItemRow } from "@patternfly/react-core/dist/esm/components/DataList/index.js";
import { Text, TextVariants } from "@patternfly/react-core/dist/esm/components/Text/index.js";

import { StorageButton } from "./storage-controls.jsx";
import { block_name, mdraid_name, lvol_name, format_delay } from "./utils.js";
Expand Down Expand Up @@ -200,7 +199,7 @@ export class JobsPanel extends React.Component {

return (
<Card className="detail-jobs">
<CardTitle><Text component={TextVariants.h2}>{_("Jobs")}</Text></CardTitle>
<CardTitle component="h2">{_("Jobs")}</CardTitle>
<CardBody className="contains-list">
<DataList isCompact aria-label={_("Jobs")}>
{ jobs.map((p) => <JobRow key={p} client={client} job={client.jobs[p]} now={server_now} />) }
Expand Down
3 changes: 1 addition & 2 deletions pkg/storaged/mdraid-details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import cockpit from "cockpit";
import React from "react";
import { Alert } from "@patternfly/react-core/dist/esm/components/Alert/index.js";
import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core/dist/esm/components/Card/index.js';
import { Text, TextVariants } from "@patternfly/react-core/dist/esm/components/Text/index.js";
import { DescriptionList, DescriptionListDescription, DescriptionListGroup, DescriptionListTerm } from "@patternfly/react-core/dist/esm/components/DescriptionList/index.js";
import { MinusIcon, PlusIcon } from "@patternfly/react-icons";
import * as utils from "./utils.js";
Expand Down Expand Up @@ -316,7 +315,7 @@ export class MDRaidDetails extends React.Component {
<StorageButton kind="danger" onClick={delete_dialog}>{_("Delete")}</StorageButton>
</>,
}}>
<CardTitle><Text component={TextVariants.h2}>{ cockpit.format(_("RAID device $0"), utils.mdraid_name(mdraid)) }</Text></CardTitle>
<CardTitle component="h2">{ cockpit.format(_("RAID device $0"), utils.mdraid_name(mdraid)) }</CardTitle>
</CardHeader>
<CardBody>
<DescriptionList className="pf-m-horizontal-on-sm">
Expand Down
6 changes: 1 addition & 5 deletions pkg/storaged/nfs-details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import cockpit from "cockpit";
import React from "react";
import { Alert } from "@patternfly/react-core/dist/esm/components/Alert/index.js";
import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core/dist/esm/components/Card/index.js';
import { Text, TextVariants } from "@patternfly/react-core/dist/esm/components/Text/index.js";
import { DescriptionList, DescriptionListDescription, DescriptionListGroup, DescriptionListTerm } from "@patternfly/react-core/dist/esm/components/DescriptionList/index.js";
import {
dialog_open, TextInput, ComboBox, CheckBoxes,
Expand Down Expand Up @@ -301,10 +300,7 @@ export class NFSDetails extends React.Component {
}
</>,
}}>
<CardTitle>
<Text component={TextVariants.h2}>{entry.fields[0]}</Text>
</CardTitle>

<CardTitle component="h2">{entry.fields[0]}</CardTitle>
</CardHeader>
<CardBody>
<DescriptionList className="pf-m-horizontal-on-sm">
Expand Down
4 changes: 1 addition & 3 deletions pkg/storaged/optional-panel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import React from "react";

import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core/dist/esm/components/Card/index.js';
import { EmptyState, EmptyStateBody, EmptyStateVariant } from "@patternfly/react-core/dist/esm/components/EmptyState/index.js";
import { Text, TextVariants } from "@patternfly/react-core/dist/esm/components/Text/index.js";

import { install_dialog } from "cockpit-components-install-dialog.jsx";
import { StorageButton } from "./storage-controls.jsx";
Expand Down Expand Up @@ -107,8 +106,7 @@ export class OptionalPanel extends React.Component {
return (
<Card className={className} id={id}>
<CardHeader actions={{ actions: heading_right }}>
<CardTitle><Text component={TextVariants.h2}>{title}</Text></CardTitle>

<CardTitle component="h2">{title}</CardTitle>
</CardHeader>
<CardBody className="contains-list">
{ feature_enabled
Expand Down
14 changes: 5 additions & 9 deletions pkg/storaged/stratis-details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import cockpit from "cockpit";
import React from "react";

import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core/dist/esm/components/Card/index.js';
import { Text, TextVariants } from "@patternfly/react-core/dist/esm/components/Text/index.js";
import { DescriptionList, DescriptionListDescription, DescriptionListGroup, DescriptionListTerm } from "@patternfly/react-core/dist/esm/components/DescriptionList/index.js";
import { List, ListItem } from "@patternfly/react-core/dist/esm/components/List/index.js";
import { PlusIcon, ExclamationTriangleIcon } from "@patternfly/react-icons";
Expand Down Expand Up @@ -438,10 +437,8 @@ export const StratisPoolDetails = ({ client, pool }) => {
</>
),
}}>
<CardTitle>
<Text component={TextVariants.h2}>
{fmt_to_fragments((pool.Encrypted ? _("Encrypted Stratis pool $0") : _("Stratis pool $0")), <b>{pool.Name}</b>)}
</Text>
<CardTitle component="h2">
{fmt_to_fragments((pool.Encrypted ? _("Encrypted Stratis pool $0") : _("Stratis pool $0")), <b>{pool.Name}</b>)}
</CardTitle>
</CardHeader>
<CardBody>
Expand Down Expand Up @@ -689,7 +686,7 @@ export const StratisPoolDetails = ({ client, pool }) => {
const content = (
<Card>
<CardHeader actions={{ actions: <><StorageButton onClick={create_fs}>{_("Create new filesystem")}</StorageButton></> }}>
<CardTitle><Text component={TextVariants.h2}>{_("Filesystems")}</Text></CardTitle>
<CardTitle component="h2">{_("Filesystems")}</CardTitle>

</CardHeader>
<CardBody className="contains-list">
Expand Down Expand Up @@ -806,8 +803,7 @@ export const StratisStoppedPoolDetails = ({ client, uuid }) => {
const header = (
<Card>
<CardHeader actions={{ actions: <><StorageButton kind="primary" onClick={start}>{_("Start")}</StorageButton></> }}>
<CardTitle><Text component={TextVariants.h2}>{_("Stopped Stratis pool")}</Text></CardTitle>

<CardTitle component="h2">{_("Stopped Stratis pool")}</CardTitle>
</CardHeader>
<CardBody>
<DescriptionList className="pf-m-horizontal-on-sm">
Expand All @@ -823,7 +819,7 @@ export const StratisStoppedPoolDetails = ({ client, uuid }) => {
const content = (
<Card>
<CardHeader>
<CardTitle><Text component={TextVariants.h2}>{_("Filesystems")}</Text></CardTitle>
<CardTitle component="h2">{_("Filesystems")}</CardTitle>
</CardHeader>
<CardBody className="contains-list">
<ListingTable emptyCaption={_("Start pool to see filesystems.")}
Expand Down
Loading

0 comments on commit 4770704

Please sign in to comment.