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

patternfly: Give empty "Th" elements a aria-label attribute #1635

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/components/networks/networkList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class NetworkList extends React.Component {
{ title: _("Connection"), props: { width: 15 } },
{ title: _("Forwarding mode"), props: { width: 15 } },
{ title: _("State"), props: { width: 20 } },
{ title: "", props: { width: 20 } },
{ title: "", props: { width: 20, "aria-label": _("Actions") } },
]}
emptyCaption={_("No network is defined on this host")}
rows={networks
Expand Down
2 changes: 1 addition & 1 deletion src/components/storagePools/storagePoolList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class StoragePoolList extends React.Component {
{ title: _("Size"), props: { width: 40 } },
{ title: _("Connection"), props: { width: 15 } },
{ title: _("State"), props: { width: 15 } },
{ title: "", props: { width: 15 } },
{ title: "", props: { width: 15, "aria-label": _("Actions") } },
]}
emptyCaption={_("No storage pool is defined on this host")}
rows={storagePools
Expand Down
2 changes: 1 addition & 1 deletion src/components/vm/disks/vmDisksCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const VmDisksCard = ({ vm, vms, disks, renderCapacity, supportedDiskBusTy
if (renderAdditional)
columnTitles.push(_("Additional"));

columnTitles.push('');
columnTitles.push({ title: '', props: { "aria-label": _("Actions") } });
}

const rows = disks.map(disk => {
Expand Down
5 changes: 4 additions & 1 deletion src/components/vm/hostdevs/hostDevAdd.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ const DevRow = ({ idPrefix, type, selectableDevices, setSelectableDevices }) =>
className="vm-device-table"
aria-label={_("Table of selectable host devices")}>
<Thead>
<Tr><Th />{[_("Product"), _("Vendor"), _("Location")].map(col => <Th key={col}>{col}</Th>)}</Tr>
<Tr>
<Th aria-label={_("Row select")} />
{[_("Product"), _("Vendor"), _("Location")].map(col => <Th key={col}>{col}</Th>)}
</Tr>
</Thead>
<Tbody>
{selectableDevices.map((dev, rowIndex) => {
Expand Down
3 changes: 2 additions & 1 deletion src/components/vm/nics/vmNicsCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ export class VmNetworkTab extends React.Component {
},
{
name: "",
aria: _("Actions"),
value: (network, networkId) => {
const isUp = network.state === 'up';
const nicPersistent = !!vm.inactiveXML.interfaces.filter(iface => iface.mac == network.mac).length;
Expand Down Expand Up @@ -527,7 +528,7 @@ export class VmNetworkTab extends React.Component {
let networkId = 1;
detailMap = detailMap.filter(d => !d.hidden);

const columnTitles = detailMap.map(target => target.name);
const columnTitles = detailMap.map(target => ({ title: target.name, props: { "aria-label": target.aria } }));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aria can be null here right? So we should probably not pass an aria-label which is null.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's undefined. There will be no "aria-label" attribute when aria is undefined (or null, actually).

const sortIfaces = (a, b) => {
if (a.type !== b.type)
return a.type > b.type ? 1 : -1;
Expand Down
6 changes: 5 additions & 1 deletion src/components/vm/snapshots/vmSnapshotsCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export class VmSnapshotsCard extends React.Component {
},
{
name: "",
aria: _("Actions"),
value: (snap, snapId) => {
const revertSnapshotHelper = () => {
const revertDialogProps = {
Expand Down Expand Up @@ -210,7 +211,10 @@ export class VmSnapshotsCard extends React.Component {

detailMap = detailMap.filter(d => !d.hidden);

const columnTitles = detailMap.map(target => ({ title: target.name, props: { width: 15 } }));
const columnTitles = detailMap.map(target => ({
title: target.name,
props: { width: 15, "aria-label": target.aria }
}));
let rows = [];
if (vm.snapshots) {
rows = vm.snapshots.sort((a, b) => ((b.creationTime - a.creationTime) || (a.name.localeCompare(b.name)))).map((target, snapId) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/vms/hostvmslist.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const HostVmsList = ({ vms, config, ui, storagePools, actions, networks, onAddEr
{ title: _("Name"), header: true, props: { width: 25 } },
{ title: _("Connection"), props: { width: 25 } },
{ title: _("State"), props: { width: 25 } },
{ title: "", props: { width: 25 } },
{ title: "", props: { width: 25, "aria-label": _("Actions") } },
]}
emptyCaption={_("No VM is running or defined on this host")}
rows={ combinedVmsFiltered
Expand Down