geonetwork-ui 2.8.1-dev.5167dd591 → 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.
- package/fesm2022/geonetwork-ui.mjs +27 -11
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/index.d.ts +3 -3
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +11 -2
- package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +9 -3
- package/src/libs/feature/search/src/lib/utils/service/fields.ts +5 -5
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +7 -5
|
@@ -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,
|
|
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.
|
|
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
|
-
|
|
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]) => {
|
|
@@ -26105,7 +26109,12 @@ class ElasticsearchService {
|
|
|
26105
26109
|
must_not: this.mustNotFilters(),
|
|
26106
26110
|
},
|
|
26107
26111
|
},
|
|
26108
|
-
_source: [
|
|
26112
|
+
_source: [
|
|
26113
|
+
'resourceTitleObject',
|
|
26114
|
+
'uuid',
|
|
26115
|
+
'resourceType',
|
|
26116
|
+
'cl_presentationForm',
|
|
26117
|
+
],
|
|
26109
26118
|
from: 0,
|
|
26110
26119
|
size: 20,
|
|
26111
26120
|
};
|
|
@@ -29187,9 +29196,8 @@ class AutocompleteComponent {
|
|
|
29187
29196
|
ngOnChanges(changes) {
|
|
29188
29197
|
const { value } = changes;
|
|
29189
29198
|
if (value) {
|
|
29190
|
-
const previousTextValue = this.displayWithFnInternal(value.previousValue);
|
|
29191
29199
|
const currentTextValue = this.displayWithFnInternal(value.currentValue);
|
|
29192
|
-
if (
|
|
29200
|
+
if (currentTextValue !== this.control.value) {
|
|
29193
29201
|
if (currentTextValue) {
|
|
29194
29202
|
this.searchActive = true;
|
|
29195
29203
|
this.isSearchActive.emit(true);
|
|
@@ -29203,13 +29211,15 @@ class AutocompleteComponent {
|
|
|
29203
29211
|
}
|
|
29204
29212
|
}
|
|
29205
29213
|
ngOnInit() {
|
|
29206
|
-
const newValue$ = merge(of(''), this.inputCleared.pipe(map$1(() => '')), this.control.valueChanges.pipe(filter$1((value) => typeof value === 'string'),
|
|
29214
|
+
const newValue$ = merge(of(''), this.inputCleared.pipe(map$1(() => '')), this.control.valueChanges.pipe(filter$1((value) => typeof value === 'string'), debounceTime(400), distinctUntilChanged()));
|
|
29207
29215
|
const externalValueChange$ = this.control.valueChanges.pipe(filter$1((value) => typeof value === 'object' && value.title), map$1((item) => item.title));
|
|
29208
29216
|
// this observable emits arrays of suggestions loaded using the given action
|
|
29209
29217
|
const suggestionsFromAction = merge(newValue$.pipe(filter$1((value) => value.length >= this.minCharacterCount)), externalValueChange$).pipe(tap$1(() => {
|
|
29210
29218
|
this.searching = true;
|
|
29211
29219
|
this.error = null;
|
|
29212
|
-
}), switchMap$1((value) => this.action(value)),
|
|
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) => {
|
|
29213
29223
|
// forcing the panel to open if there are suggestions
|
|
29214
29224
|
if (suggestions.length > 0 && !this.searchActive) {
|
|
29215
29225
|
this.triggerRef?.openPanel();
|
|
@@ -29270,6 +29280,7 @@ class AutocompleteComponent {
|
|
|
29270
29280
|
}
|
|
29271
29281
|
clear() {
|
|
29272
29282
|
this.inputRef.nativeElement.value = '';
|
|
29283
|
+
this.control.setValue('');
|
|
29273
29284
|
this.searchActive = false;
|
|
29274
29285
|
this.isSearchActive.emit(false);
|
|
29275
29286
|
this.inputCleared.emit();
|
|
@@ -32971,8 +32982,8 @@ class RecordKindField extends SimpleSearchField {
|
|
|
32971
32982
|
};
|
|
32972
32983
|
const presentationFormFilter = {};
|
|
32973
32984
|
if (values.includes('reuse') && !values.includes('dataset')) {
|
|
32974
|
-
|
|
32975
|
-
|
|
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")`;
|
|
32976
32987
|
}
|
|
32977
32988
|
else if (values.includes('dataset') && !values.includes('reuse')) {
|
|
32978
32989
|
presentationFormFilter['mapDigital'] = false;
|
|
@@ -33065,7 +33076,12 @@ class FieldsService {
|
|
|
33065
33076
|
: [fieldValues[fieldName]];
|
|
33066
33077
|
return this.getFiltersForValues(fieldName, values);
|
|
33067
33078
|
});
|
|
33068
|
-
return forkJoin(filtersByField$).pipe(map$1((filters) =>
|
|
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
|
+
}));
|
|
33069
33085
|
}
|
|
33070
33086
|
readFieldValuesFromFilters(filters) {
|
|
33071
33087
|
const fieldValues$ = this.supportedFields.map((fieldName) => this.getValuesForFilters(fieldName, filters).pipe(map$1((values) => ({ [fieldName]: values }))));
|