From cceaba970374487f5bd58cb5bd48529fffc11f03 Mon Sep 17 00:00:00 2001 From: volubyl Date: Thu, 20 Apr 2023 09:01:18 +0200 Subject: [PATCH] Highilght filter when active --- client/src/app.css | 4 + client/src/constants.ts | 2 +- client/src/definitions/datasetFilters.ts | 5 +- .../DatasetListItem/DatasetListItem.svelte | 2 +- .../src/lib/components/Header/Header.svelte | 6 +- .../SearchFilter/SearchFilterSkeleton.svelte | 16 ++- .../SearchFilter/TextSearchFilter.svelte | 6 +- .../components/SearchForm/SearchForm.svelte | 1 + .../SearchableComboBox/Basic.svelte | 133 ++++++++++++------ client/src/lib/util/datasetFilters.test.ts | 65 ++++++++- client/src/lib/util/datasetFilters.ts | 57 +++++++- client/src/routes/(app)/fiches/[id]/+page.ts | 4 +- .../routes/(app)/fiches/search/+page.svelte | 54 +++++-- .../src/routes/(app)/fiches/search/+page.ts | 2 +- .../(app)/fiches/search/_FilterPanel.svelte | 23 +-- client/src/tests/e2e/a11y.spec.ts | 11 ++ client/src/tests/e2e/contribuer.spec.ts | 2 +- client/src/tests/e2e/datapass.spec.ts | 4 +- client/src/tests/e2e/details.spec.ts | 4 +- client/src/tests/e2e/edit.spec.ts | 2 +- client/src/tests/e2e/home.spec.ts | 2 +- client/src/tests/e2e/login.spec.ts | 2 +- client/src/tests/e2e/search.spec.ts | 20 +-- client/src/tests/e2e/static.spec.ts | 8 +- server/api/app.py | 2 +- 25 files changed, 319 insertions(+), 118 deletions(-) diff --git a/client/src/app.css b/client/src/app.css index 8dc32bfa..e67f9ab0 100644 --- a/client/src/app.css +++ b/client/src/app.css @@ -7,6 +7,10 @@ mark { background-color: var(--background-contrast-info); } +.bottom_line { + border-bottom: 1px solid var(--border-default-grey); +} + :root { /* Breakpoints in DSFR. This is for reference only. The @media CSS spec does not diff --git a/client/src/constants.ts b/client/src/constants.ts index a6243f2b..92fe74d9 100644 --- a/client/src/constants.ts +++ b/client/src/constants.ts @@ -4,7 +4,7 @@ import type { } from "./definitions/datasets"; import type { TrustedHtml } from "./lib/util/html"; -export const SITE_TITLE = "catalogue.data.gouv.fr"; +export const SITE_TITLE = "Catalogue"; export const SITE_DESCRIPTION = "Un service pour aider les administrations à créer, gérer et ouvrir leurs catalogues."; diff --git a/client/src/definitions/datasetFilters.ts b/client/src/definitions/datasetFilters.ts index 52f7803c..85d2f5fd 100644 --- a/client/src/definitions/datasetFilters.ts +++ b/client/src/definitions/datasetFilters.ts @@ -26,7 +26,8 @@ export type DatasetFiltersValue = { license: string | null; extraFieldValues: ExtraFieldValue[] | null; }; -type BasicMap = { +export type BasicMap = { + id?: string; key: string; value: string | number; }; @@ -39,7 +40,7 @@ export type ActiveDatasetFiltersMap = { technicalSource?: BasicMap; tagId?: BasicMap; license?: BasicMap; - extraFieldValues?: BasicMap; + extraFieldValues?: BasicMap[]; }; export type DatasetFiltersOptions = { diff --git a/client/src/lib/components/DatasetListItem/DatasetListItem.svelte b/client/src/lib/components/DatasetListItem/DatasetListItem.svelte index 592a7f75..b108ca55 100644 --- a/client/src/lib/components/DatasetListItem/DatasetListItem.svelte +++ b/client/src/lib/components/DatasetListItem/DatasetListItem.svelte @@ -33,7 +33,7 @@ data-test-id="dataset-list-item" class="item" href={paths.datasetDetail({ id: dataset.id })} - title="Consulter cette fiche de données" + title={`Consulter la fiche de données ${dataset.catalogRecord.organization.name} : ${dataset.title}`} >