Accessibility fixes for Home/Provider Info page (#2899)

This commit is contained in:
agagancarczyk 2022-07-05 12:41:56 +01:00 committed by GitHub
parent 0929ff03ce
commit b3299e7194
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
import React, { Fragment, useMemo, useState } from "react";
import React, { useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { ExpandableSection, PageSection } from "@patternfly/react-core";
import {
@ -12,6 +12,7 @@ import {
import { useServerInfo } from "../context/server-info/ServerInfoProvider";
import { TableToolbar } from "../components/table-toolbar/TableToolbar";
import { isDefined } from "../utils/isDefined";
export const ProviderInfo = () => {
const { t } = useTranslation("dashboard");
@ -55,18 +56,19 @@ export const ProviderInfo = () => {
<Td>{name}</Td>
<Td>
<ul>
{Object.entries(providers).map(
([key, { operationalInfo }]) => (
<Fragment key={key}>
<li>{key}</li>
{operationalInfo && (
{Object.entries(providers).map(([key]) => (
<li key={key}>{key}</li>
))}
</ul>
{Object.entries(providers)
.map(([key, { operationalInfo }]) =>
operationalInfo ? (
<ExpandableSection
key={key}
isExpanded={open.includes(key)}
onToggle={() => toggleOpen(key)}
toggleText={
open.includes(key)
? t("showLess")
: t("showMore")
open.includes(key) ? t("showLess") : t("showMore")
}
>
<TableComposable borders={false}>
@ -82,11 +84,9 @@ export const ProviderInfo = () => {
</Tbody>
</TableComposable>
</ExpandableSection>
)}
</Fragment>
) : null
)
)}
</ul>
.filter(isDefined)}
</Td>
</Tr>
))}