geonetwork-ui 2.8.1-dev.08e3d5c5a → 2.8.1-dev.7b5cb2278

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.
@@ -13,7 +13,7 @@ import * as i4 from '@ngx-translate/core';
13
13
  import { TranslateLoader, TranslateCompiler, TranslateDefaultParser, TranslateParser, TranslateService, provideTranslateService, TranslateDirective, TranslatePipe, TranslateModule } from '@ngx-translate/core';
14
14
  import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler';
15
15
  import { TranslateHttpLoader } from '@ngx-translate/http-loader';
16
- import { map as map$1, shareReplay as shareReplay$1, catchError, tap as tap$1, filter as filter$1, startWith as startWith$1, withLatestFrom, switchMap as switchMap$1, take, mergeMap, delay, distinctUntilChanged, debounceTime, finalize, throttleTime, first as first$1, pairwise as pairwise$1, share, defaultIfEmpty, toArray } from 'rxjs/operators';
16
+ import { map as map$1, shareReplay as shareReplay$1, catchError, tap as tap$1, filter as filter$1, startWith as startWith$1, withLatestFrom, switchMap as switchMap$1, take, mergeMap, delay, debounceTime, distinctUntilChanged, finalize, throttleTime, first as first$1, pairwise as pairwise$1, share, defaultIfEmpty, toArray } from 'rxjs/operators';
17
17
  import { of, map as map$2, lastValueFrom, fromEvent, startWith, shareReplay, filter, pairwise, switchMap, Subject, combineLatest, from, exhaustMap, throwError, forkJoin, takeLast, firstValueFrom, merge, BehaviorSubject, timer, ReplaySubject, Subscription, first, distinctUntilChanged as distinctUntilChanged$1, animationFrameScheduler, debounceTime as debounceTime$1, Observable, buffer, tap as tap$2, combineLatestWith, take as take$1, catchError as catchError$1, takeUntil, EMPTY, mergeMap as mergeMap$1, withLatestFrom as withLatestFrom$1 } from 'rxjs';
18
18
  import { lt, valid, coerce, satisfies, ltr } from 'semver';
19
19
  import chroma from 'chroma-js';
@@ -25511,7 +25511,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
25511
25511
  }] } });
25512
25512
 
25513
25513
  var name = "geonetwork-ui";
25514
- var version = "2.8.1-dev.08e3d5c5a";
25514
+ var version = "2.8.1-dev.7b5cb2278";
25515
25515
  var engines = {
25516
25516
  node: ">=20"
25517
25517
  };
@@ -25925,14 +25925,18 @@ class ElasticsearchService {
25925
25925
  })
25926
25926
  .join(' OR ');
25927
25927
  };
25928
- const queryString = typeof filters === 'string'
25928
+ let queryString = typeof filters === 'string'
25929
25929
  ? filters
25930
25930
  : Object.keys(filters)
25931
+ .filter((fieldname) => fieldname !== 'gn-ui-crossFieldFilter')
25931
25932
  .filter((fieldname) => !isDateRange(filters[fieldname]))
25932
25933
  .filter((fieldname) => filters[fieldname] &&
25933
25934
  JSON.stringify(filters[fieldname]) !== '{}')
25934
25935
  .map((fieldname) => `${fieldname}:(${makeQuery(filters[fieldname])})`)
25935
25936
  .join(' AND ');
25937
+ if (filters['gn-ui-crossFieldFilter']) {
25938
+ queryString = `${queryString} AND (${filters['gn-ui-crossFieldFilter']})`;
25939
+ }
25936
25940
  const queryRange = Object.entries(filters)
25937
25941
  .filter(([, value]) => isDateRange(value))
25938
25942
  .map(([searchField, dateRange]) => {
@@ -29192,9 +29196,8 @@ class AutocompleteComponent {
29192
29196
  ngOnChanges(changes) {
29193
29197
  const { value } = changes;
29194
29198
  if (value) {
29195
- const previousTextValue = this.displayWithFnInternal(value.previousValue);
29196
29199
  const currentTextValue = this.displayWithFnInternal(value.currentValue);
29197
- if (previousTextValue !== currentTextValue) {
29200
+ if (currentTextValue !== this.control.value) {
29198
29201
  if (currentTextValue) {
29199
29202
  this.searchActive = true;
29200
29203
  this.isSearchActive.emit(true);
@@ -29208,13 +29211,15 @@ class AutocompleteComponent {
29208
29211
  }
29209
29212
  }
29210
29213
  ngOnInit() {
29211
- const newValue$ = merge(of(''), this.inputCleared.pipe(map$1(() => '')), this.control.valueChanges.pipe(filter$1((value) => typeof value === 'string'), distinctUntilChanged(), debounceTime(400)));
29214
+ const newValue$ = merge(of(''), this.inputCleared.pipe(map$1(() => '')), this.control.valueChanges.pipe(filter$1((value) => typeof value === 'string'), debounceTime(400), distinctUntilChanged()));
29212
29215
  const externalValueChange$ = this.control.valueChanges.pipe(filter$1((value) => typeof value === 'object' && value.title), map$1((item) => item.title));
29213
29216
  // this observable emits arrays of suggestions loaded using the given action
29214
29217
  const suggestionsFromAction = merge(newValue$.pipe(filter$1((value) => value.length >= this.minCharacterCount)), externalValueChange$).pipe(tap$1(() => {
29215
29218
  this.searching = true;
29216
29219
  this.error = null;
29217
- }), switchMap$1((value) => this.action(value)), tap$1((suggestions) => {
29220
+ }), switchMap$1((value) => this.action(value)), // this can trigger http requests
29221
+ shareReplay$1(1), // share the loaded suggestions to avoid multiple requests
29222
+ tap$1((suggestions) => {
29218
29223
  // forcing the panel to open if there are suggestions
29219
29224
  if (suggestions.length > 0 && !this.searchActive) {
29220
29225
  this.triggerRef?.openPanel();
@@ -29275,6 +29280,7 @@ class AutocompleteComponent {
29275
29280
  }
29276
29281
  clear() {
29277
29282
  this.inputRef.nativeElement.value = '';
29283
+ this.control.setValue('');
29278
29284
  this.searchActive = false;
29279
29285
  this.isSearchActive.emit(false);
29280
29286
  this.inputCleared.emit();
@@ -32976,8 +32982,8 @@ class RecordKindField extends SimpleSearchField {
32976
32982
  };
32977
32983
  const presentationFormFilter = {};
32978
32984
  if (values.includes('reuse') && !values.includes('dataset')) {
32979
- presentationFormFilter['mapDigital'] = true;
32980
- presentationFormFilter['mapHardcopy'] = true;
32985
+ filters['gn-ui-crossFieldFilter'] =
32986
+ `(resourceType:("dataset" OR "document") AND cl_presentationForm.key:("mapDigital" OR "mapHardcopy")) OR resourceType:("application" OR "interactiveMap" OR "map" OR "map/static" OR "map/interactive" OR "map-interactive" OR "map-static" OR "mapDigital" OR "mapHardcopy" OR "staticMap")`;
32981
32987
  }
32982
32988
  else if (values.includes('dataset') && !values.includes('reuse')) {
32983
32989
  presentationFormFilter['mapDigital'] = false;
@@ -33070,7 +33076,12 @@ class FieldsService {
33070
33076
  : [fieldValues[fieldName]];
33071
33077
  return this.getFiltersForValues(fieldName, values);
33072
33078
  });
33073
- return forkJoin(filtersByField$).pipe(map$1((filters) => filters.reduce((prev, curr) => ({ ...prev, ...curr }), {})));
33079
+ return forkJoin(filtersByField$).pipe(map$1((filters) => {
33080
+ if (typeof filters === 'string') {
33081
+ return filters;
33082
+ }
33083
+ return filters.reduce((prev, curr) => ({ ...prev, ...curr }), {});
33084
+ }));
33074
33085
  }
33075
33086
  readFieldValuesFromFilters(filters) {
33076
33087
  const fieldValues$ = this.supportedFields.map((fieldName) => this.getValuesForFilters(fieldName, filters).pipe(map$1((values) => ({ [fieldName]: values }))));