Skip to content

Commit

Permalink
Merge pull request #76 from ConductionNL/feature/XW-77/publicationTyp…
Browse files Browse the repository at this point in the history
…e-filter

feature/XW-77/publicationType-filter
  • Loading branch information
remko48 authored Sep 18, 2023
2 parents 0088e19 + cccd660 commit a6f3b8d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.container {
align-items: center;
flex-wrap: nowrap;
margin-inline-start: 12px;
}

.button:hover {
Expand Down
4 changes: 2 additions & 2 deletions pwa/src/context/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ export interface IFiltersContext {
_search: string | undefined;
"Ontvangstdatum[after]": string | undefined;
"Ontvangstdatum[before]": string | undefined;
publicationType: string | undefined;
Categorie: string | undefined;
}

export const defaultFiltersContext: IFiltersContext = {
_search: "",
"Ontvangstdatum[after]": undefined,
"Ontvangstdatum[before]": undefined,
publicationType: undefined,
Categorie: undefined,
};

export const useFiltersContext = () => {
Expand Down
8 changes: 4 additions & 4 deletions pwa/src/templates/templateParts/filters/FiltersTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const FiltersTemplate: React.FC<FiltersTemplateProps> = ({ isLoading }) =
_search: data.title,
"Ontvangstdatum[after]": data.year?.after,
"Ontvangstdatum[before]": data.year?.before,
publicationType: data.publicationType?.value,
Categorie: data.category?.value,
});
};

Expand All @@ -58,9 +58,9 @@ export const FiltersTemplate: React.FC<FiltersTemplateProps> = ({ isLoading }) =

<SelectSingle
options={TEMP_PUBLICATION_TYPES}
name="publicationType"
placeholder="Publicatietype"
defaultValue={TEMP_PUBLICATION_TYPES.find((option) => option.value === filters.publicationType)}
name="category"
placeholder="Onderwerp"
defaultValue={TEMP_PUBLICATION_TYPES.find((option) => option.value === filters.Categorie)}
isClearable
{...{ register, errors, control }}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export const TableResultsTemplate: React.FC<TableResultsTemplateProps> = ({ requ
<Table className={styles.table}>
<TableHeader className={styles.tableHeader}>
<TableRow>
<TableHeaderCell>Name</TableHeaderCell>
<TableHeaderCell>Woo-verzoek</TableHeaderCell>
<TableHeaderCell>Onderwerp</TableHeaderCell>
<TableHeaderCell>Ontvangstdatum</TableHeaderCell>
<TableHeaderCell>Besluitdatum</TableHeaderCell>
<TableHeaderCell>Besluit</TableHeaderCell>
Expand All @@ -33,6 +34,7 @@ export const TableResultsTemplate: React.FC<TableResultsTemplateProps> = ({ requ
{requests.map((request) => (
<TableRow className={styles.tableRow} key={request.id} onClick={() => navigate(request.id)}>
<TableCell>{request.Titel}</TableCell>
<TableCell>{request.Categorie ?? "-"}</TableCell>
<TableCell>{translateDate(i18n.language, request.Ontvangstdatum) ?? "-"}</TableCell>
<TableCell>{translateDate(i18n.language, request.Besluitdatum) ?? "-"}</TableCell>
<TableCell>{request.Besluit !== "" ? request.Besluit : "Geen besluit beschikbaar"}</TableCell>
Expand Down

0 comments on commit a6f3b8d

Please sign in to comment.