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

feature/XW-77/publicationType-filter #76

Merged
merged 1 commit into from
Sep 18, 2023
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
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
Loading