Skip to content

Commit

Permalink
Merge pull request #268 from ConductionNL/feature/WOO-56/WCAG-siteimp…
Browse files Browse the repository at this point in the history
…rove

feature/WOO-56/WCAG-siteimprove
  • Loading branch information
remko48 authored Feb 13, 2024
2 parents 0e2736e + 042b46c commit 1ecf6a4
Showing 1 changed file with 59 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,72 +28,75 @@ export const TableResultsTemplate: React.FC<TableResultsTemplateProps> = ({ requ
scrollRightButton: t("Scroll table to the right"),
}}
>
<Table className={styles.table} role="region" aria-label={t("Woo Request")}>
<TableHeader className={styles.tableHeader}>
<TableRow>
<TableHeaderCell>{t("Subject")}</TableHeaderCell>
<TableHeaderCell>{t("Publication date")}</TableHeaderCell>
{(window.sessionStorage.getItem("SHOW_CATEGORY") === "true" ||
window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true") && (
<>
{window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" && (
<TableHeaderCell>{t("Municipality")}</TableHeaderCell>
)}
{window.sessionStorage.getItem("SHOW_CATEGORY") === "true" && (
<TableHeaderCell>{t("Category")}</TableHeaderCell>
)}
</>
)}
<TableHeaderCell>{t("Summary")}</TableHeaderCell>
</TableRow>
</TableHeader>
<TableBody className={styles.tableBody}>
{requests.map((request) => (
<TableRow
className={styles.tableRow}
key={request._id}
onClick={() => navigate(request._id)}
tabIndex={0}
aria-label={`${request.titel}, ${
request.publicatiedatum ? translateDate(i18n.language, request.publicatiedatum) : t("N/A")
} ${
window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" ? `,${request.organisatie?.naam}` : ""
} ${window.sessionStorage.getItem("SHOW_CATEGORY") === "true" ? `, ${request.categorie}` : ""}, ${
request.samenvatting
}`}
>
<TableCell>{request.titel ?? t("No subject available")}</TableCell>
<TableCell>
{request.publicatiedatum
? translateDate(i18n.language, request.publicatiedatum)
: t("No publication date available")}
</TableCell>
<div role="region" aria-label={t("Woo Request")}>
<Table className={styles.table}>
<TableHeader className={styles.tableHeader}>
<TableRow>
<TableHeaderCell>{t("Subject")}</TableHeaderCell>
<TableHeaderCell>{t("Publication date")}</TableHeaderCell>
{(window.sessionStorage.getItem("SHOW_CATEGORY") === "true" ||
window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true") && (
<>
{window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" && (
<TableCell className={styles.categoryAndMunicipality}>
{request.organisatie?.naam ?? t("No municipality available")}
</TableCell>
<TableHeaderCell>{t("Municipality")}</TableHeaderCell>
)}
{window.sessionStorage.getItem("SHOW_CATEGORY") === "true" && (
<TableCell
className={clsx(
window.sessionStorage.getItem("SHOW_ORGANIZATION") !== "true" && styles.categoryAndMunicipality,
)}
>
{request.categorie ?? t("No category available")}
</TableCell>
<TableHeaderCell>{t("Category")}</TableHeaderCell>
)}
</>
)}
<TableCell>
<div className={styles.description}>{request.samenvatting ?? t("No summary available")}</div>
</TableCell>
<TableHeaderCell>{t("Summary")}</TableHeaderCell>
</TableRow>
))}
</TableBody>
</Table>
</TableHeader>
<TableBody className={styles.tableBody}>
{requests.map((request) => (
<TableRow
className={styles.tableRow}
key={request._id}
onClick={() => navigate(request._id)}
tabIndex={0}
aria-label={`${request.titel}, ${
request.publicatiedatum ? translateDate(i18n.language, request.publicatiedatum) : t("N/A")
} ${
window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" ? `,${request.organisatie?.naam}` : ""
} ${window.sessionStorage.getItem("SHOW_CATEGORY") === "true" ? `, ${request.categorie}` : ""}, ${
request.samenvatting ?? t("No summary available")
}`}
>
<TableCell>{request.titel ?? t("No subject available")}</TableCell>
<TableCell>
{request.publicatiedatum
? translateDate(i18n.language, request.publicatiedatum)
: t("No publication date available")}
</TableCell>
{(window.sessionStorage.getItem("SHOW_CATEGORY") === "true" ||
window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true") && (
<>
{window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" && (
<TableCell className={styles.categoryAndMunicipality}>
{request.organisatie?.naam ?? t("No municipality available")}
</TableCell>
)}
{window.sessionStorage.getItem("SHOW_CATEGORY") === "true" && (
<TableCell
className={clsx(
window.sessionStorage.getItem("SHOW_ORGANIZATION") !== "true" &&
styles.categoryAndMunicipality,
)}
>
{request.categorie ?? t("No category available")}
</TableCell>
)}
</>
)}
<TableCell>
<div className={styles.description}>{request.samenvatting ?? t("No summary available")}</div>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</div>
</HorizontalOverflowWrapper>
);
};

0 comments on commit 1ecf6a4

Please sign in to comment.