From 73742444cca5053acab270574e6884f8dfbab4a8 Mon Sep 17 00:00:00 2001 From: Olivia Guyot Date: Mon, 18 Sep 2023 13:24:34 +0200 Subject: [PATCH] geocat: add location filter in search & location input in home page --- apps/datahub/src/app/app.module.ts | 5 + .../home-header/home-header.component.html | 15 +- .../home/home-header/home-header.component.ts | 22 ++- .../elasticsearch.service.spec.ts | 30 ++-- .../elasticsearch/elasticsearch.service.ts | 35 +++-- .../router/src/lib/default/constants.ts | 2 + .../services/router-search.service.spec.ts | 57 +++++++- .../default/services/router-search.service.ts | 21 ++- .../lib/default/state/router.effects.spec.ts | 51 ++++--- .../src/lib/default/state/router.effects.ts | 37 ++++- libs/feature/search/src/index.ts | 4 + .../search/src/lib/feature-search.module.ts | 3 + .../fuzzy-search.component.spec.ts | 3 +- .../fuzzy-search/fuzzy-search.component.ts | 20 ++- .../location-search-result.model.ts | 27 ++++ .../location-search.component.css | 0 .../location-search.component.html | 10 ++ .../location-search.component.spec.ts | 128 ++++++++++++++++++ .../location-search.component.ts | 89 ++++++++++++ .../location-search.service.spec.ts | 118 ++++++++++++++++ .../location-search.service.ts | 44 ++++++ libs/feature/search/src/lib/state/actions.ts | 23 ++++ .../search/src/lib/state/effects.spec.ts | 61 ++++++++- libs/feature/search/src/lib/state/effects.ts | 34 ++++- .../search/src/lib/state/reducer.spec.ts | 27 ++++ libs/feature/search/src/lib/state/reducer.ts | 25 ++++ .../search/src/lib/state/search.facade.ts | 26 ++++ .../feature/search/src/lib/state/selectors.ts | 9 ++ .../lib/utils/service/search.service.spec.ts | 32 +++++ .../src/lib/utils/service/search.service.ts | 11 ++ .../autocomplete/autocomplete.component.html | 2 +- .../autocomplete.component.stories.ts | 19 ++- .../autocomplete/autocomplete.component.ts | 4 +- 33 files changed, 924 insertions(+), 70 deletions(-) create mode 100644 libs/feature/search/src/lib/location-search/location-search-result.model.ts create mode 100644 libs/feature/search/src/lib/location-search/location-search.component.css create mode 100644 libs/feature/search/src/lib/location-search/location-search.component.html create mode 100644 libs/feature/search/src/lib/location-search/location-search.component.spec.ts create mode 100644 libs/feature/search/src/lib/location-search/location-search.component.ts create mode 100644 libs/feature/search/src/lib/location-search/location-search.service.spec.ts create mode 100644 libs/feature/search/src/lib/location-search/location-search.service.ts diff --git a/apps/datahub/src/app/app.module.ts b/apps/datahub/src/app/app.module.ts index 935be29ad..70f8c76d3 100644 --- a/apps/datahub/src/app/app.module.ts +++ b/apps/datahub/src/app/app.module.ts @@ -70,6 +70,7 @@ import { METADATA_LANGUAGE } from '@geonetwork-ui/api/repository' import { BrowserAnimationsModule } from '@angular/platform-browser/animations' import { GN_UI_VERSION } from '@geonetwork-ui/feature/record' import { LOGIN_URL } from '@geonetwork-ui/api/repository/gn4' +import { ORGANIZATIONS_STRATEGY } from '@geonetwork-ui/api/repository/gn4' export const metaReducers: MetaReducer[] = !environment.production ? [] : [] // https://github.com/nrwl/nx/issues/191 @@ -190,6 +191,10 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : [] provide: ORGANIZATION_URL_TOKEN, useValue: `${ROUTER_ROUTE_SEARCH}?${ROUTE_PARAMS.PUBLISHER}=\${name}`, }, + { + provide: ORGANIZATIONS_STRATEGY, + useValue: 'groups', + }, ], bootstrap: [AppComponent], }) diff --git a/apps/datahub/src/app/home/home-header/home-header.component.html b/apps/datahub/src/app/home/home-header/home-header.component.html index a3c0dc80c..6daed33a7 100644 --- a/apps/datahub/src/app/home/home-header/home-header.component.html +++ b/apps/datahub/src/app/home/home-header/home-header.component.html @@ -13,10 +13,17 @@ [style.opacity]="expandRatio" [innerHTML]="'datahub.header.title.html' | translate" > - +
+ + +