Skip to content

Commit

Permalink
added category and municipality to table
Browse files Browse the repository at this point in the history
  • Loading branch information
remko48 committed Nov 28, 2023
1 parent 42fd9d2 commit ef2dcf1
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,19 @@
grid-gap: 24px;
grid-template-columns: 1fr 1fr 1fr;
}

td {
width: min-content;
}

.categoryAndMunicipality {
text-wrap: nowrap;
}

.test {
display: -webkit-box;
-webkit-line-clamp: 5;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from "react";
import * as styles from "./TableResultsTemplate.module.css";
import clsx from "clsx";
import {
Table,
TableHeader,
Expand Down Expand Up @@ -32,6 +33,17 @@ export const TableResultsTemplate: React.FC<TableResultsTemplateProps> = ({ requ
<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>
Expand All @@ -44,15 +56,42 @@ export const TableResultsTemplate: React.FC<TableResultsTemplateProps> = ({ requ
tabIndex={0}
aria-label={`${request.titel}, ${
request.publicatiedatum ? translateDate(i18n.language, request.publicatiedatum) : t("N/A")
}, ${request.samenvatting}`}
} ${
window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true"
? `,${request.embedded?.behandelendBestuursorgaan?.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>
<TableCell>{request.samenvatting ?? t("No summary 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.embedded?.behandelendBestuursorgaan?.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.test}>{request.samenvatting ?? t("No summary available")}</div>
</TableCell>
</TableRow>
))}
</TableBody>
Expand Down
3 changes: 3 additions & 0 deletions pwa/src/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const en = {
Page: "Page",
Jumbotron: "Jumbotron",
Limit: "Limit",
Municipality: "Municipality",
"Jumbotron card": "Jumbotron card",
"N/A": "N/A",
"Details page": "Details page",
Expand Down Expand Up @@ -56,4 +57,6 @@ export const en = {
"Select result limit": "Select result limit",
"Scroll table to the left": "Scroll table to the left",
"Scroll table to the right": "Scroll table to the right",
"No category available": "No category available",
"No municipality available": "No municipality available",
};
3 changes: 3 additions & 0 deletions pwa/src/translations/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const nl = {
Page: "Pagina",
Jumbotron: "Jumbotron",
Limit: "Limiet",
Municipality: "Gemeente",
"Jumbotron card": "Jumbotron tegel",
"N/A": "N.v.t",
"Details page": "Detailpagina",
Expand Down Expand Up @@ -56,4 +57,6 @@ export const nl = {
"Select result limit": "Selecteer resultaten limiet",
"Scroll table to the left": "Scroll tabel naar links",
"Scroll table to the right": "Scroll tabel naar rechts",
"No category available": "Geen categorie beschikbaar",
"No municipality available": "Geen gemeente beschikbaar",
};

0 comments on commit ef2dcf1

Please sign in to comment.