geonetwork-ui 2.9.0-dev.6da5cd143 → 2.9.0-dev.b403ccb12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25517,7 +25517,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
25517
25517
  }] } });
25518
25518
 
25519
25519
  var name = "geonetwork-ui";
25520
- var version = "2.9.0-dev.6da5cd143";
25520
+ var version = "2.9.0-dev.b403ccb12";
25521
25521
  var engines = {
25522
25522
  node: ">=20"
25523
25523
  };
@@ -32020,7 +32020,10 @@ function reducerSearch(state, action) {
32020
32020
  },
32021
32021
  };
32022
32022
  }
32023
+ // From router.effects
32024
+ // From home - fuzzy-search - search.service
32023
32025
  case SET_FILTERS: {
32026
+ console.log('reducerSearch - SET_FILTERS', action.payload);
32024
32027
  return {
32025
32028
  ...state,
32026
32029
  params: {
@@ -32041,6 +32044,7 @@ function reducerSearch(state, action) {
32041
32044
  },
32042
32045
  };
32043
32046
  }
32047
+ // From results WC
32044
32048
  case SET_SEARCH: {
32045
32049
  return {
32046
32050
  ...state,
@@ -32550,10 +32554,12 @@ class SearchService {
32550
32554
  this.facade = inject(SearchFacade);
32551
32555
  }
32552
32556
  setSortAndFilters(filters, sort) {
32557
+ console.log('SearchService - setSortAndFilters', { filters, sort });
32553
32558
  this.setFilters(filters);
32554
32559
  this.setSortBy(sort);
32555
32560
  }
32556
32561
  updateFilters(params) {
32562
+ console.log('SearchService - updateFilters', params);
32557
32563
  this.facade.searchFilters$
32558
32564
  .pipe(first$1(), map$1((filters) => ({ ...filters, ...params })))
32559
32565
  .subscribe((filters) => this.facade.setFilters(filters));
@@ -36156,6 +36162,7 @@ class FuzzySearchComponent {
36156
36162
  this.inputSubmitted.emit(any);
36157
36163
  }
36158
36164
  else {
36165
+ console.log('FuzzySearchComponent - handleInputSubmission', any);
36159
36166
  this.searchService.updateFilters({ any });
36160
36167
  }
36161
36168
  }
@@ -39157,7 +39164,7 @@ class ChartViewComponent {
39157
39164
  this.changeDetector.detectChanges();
39158
39165
  }
39159
39166
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ChartViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
39160
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ChartViewComponent, isStandalone: true, selector: "gn-ui-chart-view", inputs: { featureCatalog: "featureCatalog", cacheActive: "cacheActive", link: "link", aggregation: "aggregation", xProperty: "xProperty", yProperty: "yProperty", chartType: "chartType", userChartConfig: "userChartConfig" }, outputs: { chartConfig$: "chartConfig$" }, ngImport: i0, template: "<div class=\"w-full h-full flex flex-col\">\n <div\n class=\"flex flex-col space-y-2 sm:flex-row sm:space-y-0 sm:space-x-2 justify-between text-[13px]\"\n >\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"typeChoices\"\n [extraBtnClass]=\"'secondary min-w-full'\"\n (selectValue)=\"chartType$.next($event)\"\n [selected]=\"chartType$.value\"\n [title]=\"'chart.dropdown.type' | translate\"\n ></gn-ui-dropdown-selector>\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"xChoices$ | async\"\n [extraBtnClass]=\"'secondary min-w-full'\"\n (selectValue)=\"xProperty$.next($event)\"\n [selected]=\"xProperty$.value\"\n [title]=\"'chart.dropdown.xProperty' | translate\"\n ></gn-ui-dropdown-selector>\n @if (yChoices$ | async; as yChoices) {\n @if (!isCountAggregation) {\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"yChoices\"\n (selectValue)=\"yProperty$.next($event)\"\n [selected]=\"yProperty$.value\"\n [title]=\"'chart.dropdown.yProperty' | translate\"\n class=\"select-y-prop\"\n ></gn-ui-dropdown-selector>\n }\n }\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"aggregationChoices\"\n class=\"aggregation-choices\"\n (selectValue)=\"aggregation$.next($event)\"\n [selected]=\"aggregation$.value\"\n [title]=\"'chart.dropdown.aggregation' | translate\"\n ></gn-ui-dropdown-selector>\n </div>\n <div\n class=\"relative h-full mt-2 bg-white border border-gray-300 rounded-lg overflow-hidden\"\n >\n @if (!error) {\n <gn-ui-chart\n [data]=\"chartData$ | async\"\n [type]=\"chartType$.value\"\n [prettyLabel]=\"prettyLabel$ | async\"\n [labelProperty]=\"labelProperty\"\n [valueProperty]=\"valueProperty\"\n ></gn-ui-chart>\n }\n @if (loading) {\n <gn-ui-loading-mask\n class=\"absolute inset-0\"\n [message]=\"'chart.loading.data' | translate\"\n ></gn-ui-loading-mask>\n }\n @if (error) {\n <gn-ui-popup-alert\n type=\"warning\"\n icon=\"matErrorOutlineOutline\"\n class=\"absolute m-2 inset-0\"\n >\n <span>{{ error }}</span>\n </gn-ui-popup-alert>\n }\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: DropdownSelectorComponent, selector: "gn-ui-dropdown-selector", inputs: ["title", "showTitle", "ariaName", "choices", "selected", "maxRows", "extraBtnClass", "minWidth", "disabled"], outputs: ["selectValue"] }, { kind: "component", type: ChartComponent, selector: "gn-ui-chart", inputs: ["data", "labelProperty", "prettyLabel", "valueProperty", "secondaryValueProperty", "type"] }, { kind: "component", type: LoadingMaskComponent, selector: "gn-ui-loading-mask", inputs: ["message"] }, { kind: "component", type: PopupAlertComponent, selector: "gn-ui-popup-alert", inputs: ["icon", "type", "position"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
39167
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ChartViewComponent, isStandalone: true, selector: "gn-ui-chart-view", inputs: { featureCatalog: "featureCatalog", cacheActive: "cacheActive", link: "link", aggregation: "aggregation", xProperty: "xProperty", yProperty: "yProperty", chartType: "chartType", userChartConfig: "userChartConfig" }, outputs: { chartConfig$: "chartConfig$" }, ngImport: i0, template: "<div class=\"w-full h-full flex flex-col\">\n <div\n class=\"flex flex-col space-y-2 sm:flex-row sm:space-y-0 sm:space-x-2 justify-between text-[13px]\"\n >\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"typeChoices\"\n [extraBtnClass]=\"'secondary min-w-full'\"\n (selectValue)=\"chartType$.next($event)\"\n [selected]=\"chartType$.value\"\n [title]=\"'chart.dropdown.type' | translate\"\n ></gn-ui-dropdown-selector>\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"xChoices$ | async\"\n [extraBtnClass]=\"'secondary min-w-full'\"\n (selectValue)=\"xProperty$.next($event)\"\n [selected]=\"xProperty$.value\"\n [title]=\"'chart.dropdown.xProperty' | translate\"\n ></gn-ui-dropdown-selector>\n @if (yChoices$ | async; as yChoices) {\n <gn-ui-dropdown-selector\n class=\"basis-1/4 select-y-prop\"\n [choices]=\"yChoices\"\n [disabled]=\"isCountAggregation\"\n (selectValue)=\"yProperty$.next($event)\"\n [selected]=\"yProperty$.value\"\n [title]=\"'chart.dropdown.yProperty' | translate\"\n ></gn-ui-dropdown-selector>\n }\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"aggregationChoices\"\n class=\"aggregation-choices\"\n (selectValue)=\"aggregation$.next($event)\"\n [selected]=\"aggregation$.value\"\n [title]=\"'chart.dropdown.aggregation' | translate\"\n ></gn-ui-dropdown-selector>\n </div>\n <div\n class=\"relative h-full mt-2 bg-white border border-gray-300 rounded-lg overflow-hidden\"\n >\n @if (!error) {\n <gn-ui-chart\n [data]=\"chartData$ | async\"\n [type]=\"chartType$.value\"\n [prettyLabel]=\"prettyLabel$ | async\"\n [labelProperty]=\"labelProperty\"\n [valueProperty]=\"valueProperty\"\n ></gn-ui-chart>\n }\n @if (loading) {\n <gn-ui-loading-mask\n class=\"absolute inset-0\"\n [message]=\"'chart.loading.data' | translate\"\n ></gn-ui-loading-mask>\n }\n @if (error) {\n <gn-ui-popup-alert\n type=\"warning\"\n icon=\"matErrorOutlineOutline\"\n class=\"absolute m-2 inset-0\"\n >\n <span>{{ error }}</span>\n </gn-ui-popup-alert>\n }\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: DropdownSelectorComponent, selector: "gn-ui-dropdown-selector", inputs: ["title", "showTitle", "ariaName", "choices", "selected", "maxRows", "extraBtnClass", "minWidth", "disabled"], outputs: ["selectValue"] }, { kind: "component", type: ChartComponent, selector: "gn-ui-chart", inputs: ["data", "labelProperty", "prettyLabel", "valueProperty", "secondaryValueProperty", "type"] }, { kind: "component", type: LoadingMaskComponent, selector: "gn-ui-loading-mask", inputs: ["message"] }, { kind: "component", type: PopupAlertComponent, selector: "gn-ui-popup-alert", inputs: ["icon", "type", "position"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
39161
39168
  }
39162
39169
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ChartViewComponent, decorators: [{
39163
39170
  type: Component,
@@ -39168,7 +39175,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
39168
39175
  LoadingMaskComponent,
39169
39176
  PopupAlertComponent,
39170
39177
  TranslatePipe,
39171
- ], standalone: true, template: "<div class=\"w-full h-full flex flex-col\">\n <div\n class=\"flex flex-col space-y-2 sm:flex-row sm:space-y-0 sm:space-x-2 justify-between text-[13px]\"\n >\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"typeChoices\"\n [extraBtnClass]=\"'secondary min-w-full'\"\n (selectValue)=\"chartType$.next($event)\"\n [selected]=\"chartType$.value\"\n [title]=\"'chart.dropdown.type' | translate\"\n ></gn-ui-dropdown-selector>\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"xChoices$ | async\"\n [extraBtnClass]=\"'secondary min-w-full'\"\n (selectValue)=\"xProperty$.next($event)\"\n [selected]=\"xProperty$.value\"\n [title]=\"'chart.dropdown.xProperty' | translate\"\n ></gn-ui-dropdown-selector>\n @if (yChoices$ | async; as yChoices) {\n @if (!isCountAggregation) {\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"yChoices\"\n (selectValue)=\"yProperty$.next($event)\"\n [selected]=\"yProperty$.value\"\n [title]=\"'chart.dropdown.yProperty' | translate\"\n class=\"select-y-prop\"\n ></gn-ui-dropdown-selector>\n }\n }\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"aggregationChoices\"\n class=\"aggregation-choices\"\n (selectValue)=\"aggregation$.next($event)\"\n [selected]=\"aggregation$.value\"\n [title]=\"'chart.dropdown.aggregation' | translate\"\n ></gn-ui-dropdown-selector>\n </div>\n <div\n class=\"relative h-full mt-2 bg-white border border-gray-300 rounded-lg overflow-hidden\"\n >\n @if (!error) {\n <gn-ui-chart\n [data]=\"chartData$ | async\"\n [type]=\"chartType$.value\"\n [prettyLabel]=\"prettyLabel$ | async\"\n [labelProperty]=\"labelProperty\"\n [valueProperty]=\"valueProperty\"\n ></gn-ui-chart>\n }\n @if (loading) {\n <gn-ui-loading-mask\n class=\"absolute inset-0\"\n [message]=\"'chart.loading.data' | translate\"\n ></gn-ui-loading-mask>\n }\n @if (error) {\n <gn-ui-popup-alert\n type=\"warning\"\n icon=\"matErrorOutlineOutline\"\n class=\"absolute m-2 inset-0\"\n >\n <span>{{ error }}</span>\n </gn-ui-popup-alert>\n }\n </div>\n</div>\n" }]
39178
+ ], standalone: true, template: "<div class=\"w-full h-full flex flex-col\">\n <div\n class=\"flex flex-col space-y-2 sm:flex-row sm:space-y-0 sm:space-x-2 justify-between text-[13px]\"\n >\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"typeChoices\"\n [extraBtnClass]=\"'secondary min-w-full'\"\n (selectValue)=\"chartType$.next($event)\"\n [selected]=\"chartType$.value\"\n [title]=\"'chart.dropdown.type' | translate\"\n ></gn-ui-dropdown-selector>\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"xChoices$ | async\"\n [extraBtnClass]=\"'secondary min-w-full'\"\n (selectValue)=\"xProperty$.next($event)\"\n [selected]=\"xProperty$.value\"\n [title]=\"'chart.dropdown.xProperty' | translate\"\n ></gn-ui-dropdown-selector>\n @if (yChoices$ | async; as yChoices) {\n <gn-ui-dropdown-selector\n class=\"basis-1/4 select-y-prop\"\n [choices]=\"yChoices\"\n [disabled]=\"isCountAggregation\"\n (selectValue)=\"yProperty$.next($event)\"\n [selected]=\"yProperty$.value\"\n [title]=\"'chart.dropdown.yProperty' | translate\"\n ></gn-ui-dropdown-selector>\n }\n <gn-ui-dropdown-selector\n class=\"basis-1/4\"\n [choices]=\"aggregationChoices\"\n class=\"aggregation-choices\"\n (selectValue)=\"aggregation$.next($event)\"\n [selected]=\"aggregation$.value\"\n [title]=\"'chart.dropdown.aggregation' | translate\"\n ></gn-ui-dropdown-selector>\n </div>\n <div\n class=\"relative h-full mt-2 bg-white border border-gray-300 rounded-lg overflow-hidden\"\n >\n @if (!error) {\n <gn-ui-chart\n [data]=\"chartData$ | async\"\n [type]=\"chartType$.value\"\n [prettyLabel]=\"prettyLabel$ | async\"\n [labelProperty]=\"labelProperty\"\n [valueProperty]=\"valueProperty\"\n ></gn-ui-chart>\n }\n @if (loading) {\n <gn-ui-loading-mask\n class=\"absolute inset-0\"\n [message]=\"'chart.loading.data' | translate\"\n ></gn-ui-loading-mask>\n }\n @if (error) {\n <gn-ui-popup-alert\n type=\"warning\"\n icon=\"matErrorOutlineOutline\"\n class=\"absolute m-2 inset-0\"\n >\n <span>{{ error }}</span>\n </gn-ui-popup-alert>\n }\n </div>\n</div>\n" }]
39172
39179
  }], propDecorators: { featureCatalog: [{
39173
39180
  type: Input
39174
39181
  }], cacheActive: [{
@@ -44333,6 +44340,7 @@ class RouterFacade {
44333
44340
  });
44334
44341
  }
44335
44342
  updateSearch(query) {
44343
+ console.log('RouterFacade - updateSearch', query);
44336
44344
  this.go({
44337
44345
  path: this.routerService.getSearchRoute(),
44338
44346
  ...(query && { query: flattenQueryParams(query) }),
@@ -44340,6 +44348,7 @@ class RouterFacade {
44340
44348
  });
44341
44349
  }
44342
44350
  setSearch(query) {
44351
+ console.log('RouterFacade - setSearch', query);
44343
44352
  this.go({
44344
44353
  path: this.routerService.getSearchRoute(),
44345
44354
  ...(query && { query: flattenQueryParams(query) }),
@@ -44379,6 +44388,12 @@ class RouterEffects {
44379
44388
  this.syncSearchState$ = createEffect(() => this.facade.searchParams$.pipe(mergeMap((searchParams) => this.fieldsService
44380
44389
  .buildFiltersFromFieldValues(searchParams)
44381
44390
  .pipe(map$1((filters) => [searchParams, filters]))), startWith([null, {}]), pairwise(), map$1(([[oldParams, oldFilters], [newParams, newFilters]]) => {
44391
+ console.log('RouterEffects - syncSearchState', {
44392
+ oldParams,
44393
+ newParams,
44394
+ oldFilters,
44395
+ newFilters,
44396
+ });
44382
44397
  let sortBy = ROUTE_PARAMS.SORT in newParams
44383
44398
  ? sortByFromString(newParams[ROUTE_PARAMS.SORT])
44384
44399
  : this.routerService.getDefaultSort();
@@ -44416,6 +44431,23 @@ class RouterEffects {
44416
44431
  }
44417
44432
  return of(...actions);
44418
44433
  })));
44434
+ /**
44435
+ * This effect is needed because on the page load, the search params from the URL are
44436
+ * directly applied to the underlying search facade; this means that it doesn't go
44437
+ * through the RouterSearchService which makes sure that a relevancy sort is applied
44438
+ * whenever there's a full text search criteria set.
44439
+ */
44440
+ this.applyInitialRelevancySort$ = createEffect(() => this.facade.searchParams$.pipe(take(1), tap$1((filters) => {
44441
+ const relevancySort = sortByToString(SortByEnum.RELEVANCY);
44442
+ if (filters['q'] &&
44443
+ (!Array.isArray(filters['q']) || filters['q'].length > 0) &&
44444
+ !filters[ROUTE_PARAMS.SORT]) {
44445
+ this.facade.updateSearch({
44446
+ ...filters,
44447
+ [ROUTE_PARAMS.SORT]: relevancySort,
44448
+ });
44449
+ }
44450
+ })), { dispatch: false });
44419
44451
  /**
44420
44452
  * This effect will load the metadata when a navigation to
44421
44453
  * a metadata record happens
@@ -44506,6 +44538,7 @@ class RouterSearchService {
44506
44538
  this.fieldsService = inject(FieldsService);
44507
44539
  }
44508
44540
  setSortAndFilters(filters, sortBy) {
44541
+ console.log('RouterSearchService - setSortAndFilters', { filters, sortBy });
44509
44542
  this.fieldsService
44510
44543
  .readFieldValuesFromFilters(filters)
44511
44544
  .subscribe((values) => {
@@ -44516,17 +44549,27 @@ class RouterSearchService {
44516
44549
  });
44517
44550
  }
44518
44551
  async setFilters(newFilters) {
44519
- const sortBy = await firstValueFrom(this.searchFacade.sortBy$);
44552
+ let sortBy = await firstValueFrom(this.searchFacade.sortBy$);
44520
44553
  const fieldSearchParams = await firstValueFrom(this.fieldsService.readFieldValuesFromFilters(newFilters));
44554
+ // apply relevancy sort if a full text criteria is given
44555
+ sortBy = newFilters['any'] ? SortByEnum.RELEVANCY : sortBy;
44521
44556
  this.facade.setSearch({
44522
44557
  ...fieldSearchParams,
44523
44558
  [ROUTE_PARAMS.SORT]: sortBy ? sortByToString(sortBy) : undefined,
44524
44559
  });
44525
44560
  }
44526
44561
  async updateFilters(newFilters) {
44562
+ console.log('RouterSearchService - updateFilters', newFilters);
44527
44563
  const currentFilters = await firstValueFrom(this.searchFacade.searchFilters$);
44528
44564
  const updatedFilters = { ...currentFilters, ...newFilters };
44529
- const newParams = await firstValueFrom(this.fieldsService.readFieldValuesFromFilters(updatedFilters));
44565
+ let newParams = await firstValueFrom(this.fieldsService.readFieldValuesFromFilters(updatedFilters));
44566
+ if (newFilters['any']) {
44567
+ newParams = {
44568
+ ...newParams,
44569
+ [ROUTE_PARAMS.SORT]: sortByToString(SortByEnum.RELEVANCY),
44570
+ };
44571
+ }
44572
+ console.log('RouterSearchService - updateFilters - newParams', newParams);
44530
44573
  this.facade.updateSearch(newParams);
44531
44574
  }
44532
44575
  setSortBy(sortBy) {