geonetwork-ui 2.11.0-dev.cf22e64cf → 2.11.0-dev.d02d7f3f8
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 +817 -302
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/index.d.ts +177 -46
- package/index.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.ts +2 -0
- package/src/libs/api/metadata-converter/src/lib/fixtures/mel.records.dataset+featurecatalog.ts +395 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +35 -8
- package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +19 -0
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.ts +17 -6
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.ts +110 -0
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.ts +131 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +9 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +2 -1
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/constant.ts +4 -0
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +57 -24
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +82 -35
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +11 -0
- package/src/libs/common/domain/src/lib/model/record/flags.model.ts +1 -0
- package/src/libs/common/domain/src/lib/model/record/index.ts +1 -0
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +14 -18
- package/src/libs/common/domain/src/lib/model/search/aggregation.model.ts +2 -0
- package/src/libs/common/domain/src/lib/platform.service.interface.ts +1 -0
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +20 -1
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +42 -62
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +32 -19
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-constraints/form-field-constraints.component.ts +3 -5
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.ts +2 -2
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-record-flags/form-field-record-flag-component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-record-flags/form-field-record-flag-component.html +18 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-record-flags/form-field-record-flag-component.ts +86 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +100 -88
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +11 -4
- package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts +18 -4
- package/src/libs/feature/editor/src/lib/expressions.ts +67 -0
- package/src/libs/feature/editor/src/lib/fields.config.ts +13 -0
- package/src/libs/feature/editor/src/lib/models/editor-config.model.ts +10 -4
- package/src/libs/feature/record/src/lib/state/mdview.effects.ts +3 -1
- package/src/libs/feature/record/src/lib/state/mdview.facade.ts +1 -1
- package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.html +7 -1
- package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.ts +18 -1
- package/src/libs/feature/search/src/lib/geocoding/geocoding.service.ts +41 -2
- package/src/libs/feature/search/src/lib/location-search/location-search.component.html +11 -1
- package/src/libs/feature/search/src/lib/location-search/location-search.component.ts +77 -3
- package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +50 -4
- package/src/libs/feature/search/src/lib/utils/service/fields.ts +35 -10
- package/src/libs/ui/elements/src/lib/kind-badge/kind-badge.component.html +5 -1
- package/src/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.html +3 -3
- package/src/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.ts +2 -2
- package/src/libs/ui/elements/src/lib/thumbnail/thumbnail.component.html +1 -1
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.css +0 -4
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +2 -2
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +3 -3
- package/src/libs/ui/inputs/src/lib/inline-filter/inline-filter.component.html +6 -11
- package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.ts +2 -1
- package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.html +7 -1
- package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.ts +26 -3
- package/src/libs/ui/search/src/lib/results-hits-number/results-hits-number.component.html +1 -0
- package/src/libs/util/app-config/src/index.ts +1 -0
- package/src/libs/util/app-config/src/lib/app-config.ts +338 -270
- package/src/libs/util/app-config/src/lib/fixtures.ts +21 -0
- package/src/libs/util/app-config/src/lib/model.ts +30 -3
- package/src/libs/util/app-config/src/lib/parse-utils.ts +8 -4
- package/src/libs/util/shared/src/lib/utils/geojson.ts +21 -10
- package/translations/de.json +10 -2
- package/translations/en.json +10 -2
- package/translations/es.json +10 -2
- package/translations/fr.json +11 -3
- package/translations/it.json +10 -2
- package/translations/nl.json +10 -2
- package/translations/pt.json +10 -2
- package/translations/sk.json +10 -2
|
@@ -53,6 +53,15 @@ export class SimpleSearchField implements AbstractSearchField {
|
|
|
53
53
|
// FIXME: this is required to register runtime fields; abstract this as well
|
|
54
54
|
protected esService = this.injector.get(ElasticsearchService)
|
|
55
55
|
|
|
56
|
+
private customIdentifier?: string
|
|
57
|
+
|
|
58
|
+
protected get fieldIdentifier(): string {
|
|
59
|
+
return this.customIdentifier ?? this.esFieldName
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public includeValues: string[] = []
|
|
63
|
+
public excludeValues: string[] = []
|
|
64
|
+
|
|
56
65
|
constructor(
|
|
57
66
|
protected esFieldName: string,
|
|
58
67
|
protected injector: Injector,
|
|
@@ -60,13 +69,24 @@ export class SimpleSearchField implements AbstractSearchField {
|
|
|
60
69
|
protected orderType: 'key' | 'count' = 'key'
|
|
61
70
|
) {}
|
|
62
71
|
|
|
72
|
+
public setFieldIdentifier(fieldIdentifier: string) {
|
|
73
|
+
this.customIdentifier = fieldIdentifier
|
|
74
|
+
this.esService.registerFieldAlias(fieldIdentifier, this.esFieldName)
|
|
75
|
+
}
|
|
76
|
+
|
|
63
77
|
protected getAggregations(): AggregationsParams {
|
|
64
78
|
return {
|
|
65
|
-
[this.
|
|
79
|
+
[this.fieldIdentifier]: {
|
|
66
80
|
type: 'terms',
|
|
67
81
|
field: this.esFieldName,
|
|
68
82
|
limit: 1000,
|
|
69
83
|
sort: [this.order, this.orderType],
|
|
84
|
+
...(this.includeValues?.length && {
|
|
85
|
+
includeValues: this.includeValues,
|
|
86
|
+
}),
|
|
87
|
+
...(this.excludeValues?.length && {
|
|
88
|
+
excludeValues: this.excludeValues,
|
|
89
|
+
}),
|
|
70
90
|
},
|
|
71
91
|
}
|
|
72
92
|
}
|
|
@@ -79,7 +99,7 @@ export class SimpleSearchField implements AbstractSearchField {
|
|
|
79
99
|
return this.repository.aggregate(this.getAggregations()).pipe(
|
|
80
100
|
map(
|
|
81
101
|
(response) =>
|
|
82
|
-
(response[this.
|
|
102
|
+
(response[this.fieldIdentifier] as AggregationBuckets).buckets || []
|
|
83
103
|
),
|
|
84
104
|
switchMap((buckets: TermBucket[]) => {
|
|
85
105
|
const bucketPromises = buckets.map(async (bucket) => ({
|
|
@@ -97,7 +117,7 @@ export class SimpleSearchField implements AbstractSearchField {
|
|
|
97
117
|
// FieldValue[]
|
|
98
118
|
if (this.getType() === 'values') {
|
|
99
119
|
return of({
|
|
100
|
-
[this.
|
|
120
|
+
[this.fieldIdentifier]: (values as FieldValue[]).reduce((acc, val) => {
|
|
101
121
|
const value = val.toString()
|
|
102
122
|
if (value !== '') {
|
|
103
123
|
return { ...acc, [value]: true }
|
|
@@ -108,13 +128,13 @@ export class SimpleSearchField implements AbstractSearchField {
|
|
|
108
128
|
}
|
|
109
129
|
// DateRange
|
|
110
130
|
return of({
|
|
111
|
-
[this.
|
|
131
|
+
[this.fieldIdentifier]: values[0] !== '' ? values[0] : {},
|
|
112
132
|
})
|
|
113
133
|
}
|
|
114
134
|
getValuesForFilter(
|
|
115
135
|
filters: FieldFilters
|
|
116
136
|
): Observable<FieldValue[] | FieldValue | DateRange> {
|
|
117
|
-
const filter = filters[this.
|
|
137
|
+
const filter = filters[this.fieldIdentifier]
|
|
118
138
|
if (!filter) return of([])
|
|
119
139
|
// filter by expression
|
|
120
140
|
if (typeof filter === 'string') {
|
|
@@ -132,6 +152,10 @@ export class SimpleSearchField implements AbstractSearchField {
|
|
|
132
152
|
getType(): FieldType {
|
|
133
153
|
return 'values'
|
|
134
154
|
}
|
|
155
|
+
|
|
156
|
+
clone(): typeof this {
|
|
157
|
+
return Object.create(this)
|
|
158
|
+
}
|
|
135
159
|
}
|
|
136
160
|
|
|
137
161
|
export class TranslatedSearchField extends SimpleSearchField {
|
|
@@ -175,7 +199,8 @@ export class TranslatedSearchField extends SimpleSearchField {
|
|
|
175
199
|
export class MultilingualSearchField extends SimpleSearchField {
|
|
176
200
|
// we're using a getter in case the token value changes over time
|
|
177
201
|
private get searchLanguage() {
|
|
178
|
-
|
|
202
|
+
const language = this.injector.get(METADATA_LANGUAGE, null)
|
|
203
|
+
return typeof language === 'function' ? language() : language
|
|
179
204
|
}
|
|
180
205
|
|
|
181
206
|
constructor(
|
|
@@ -476,12 +501,12 @@ export class BoundingBoxSearchField extends SimpleSearchField {
|
|
|
476
501
|
|
|
477
502
|
getFiltersForValues(values: FieldValue[]): Observable<FieldFilters> {
|
|
478
503
|
return of({
|
|
479
|
-
[this.
|
|
504
|
+
[this.fieldIdentifier]: values.map(Number) as BoundingBox,
|
|
480
505
|
})
|
|
481
506
|
}
|
|
482
507
|
|
|
483
508
|
getValuesForFilter(filters: FieldFilters): Observable<FieldValue[]> {
|
|
484
|
-
const filter = filters[this.
|
|
509
|
+
const filter = filters[this.fieldIdentifier]
|
|
485
510
|
return of(isBoundingBox(filter) ? filter : [])
|
|
486
511
|
}
|
|
487
512
|
|
|
@@ -599,7 +624,7 @@ export class RecordKindField extends SimpleSearchField {
|
|
|
599
624
|
|
|
600
625
|
getFiltersForValues(values: FieldValue[]): Observable<FieldFilters | string> {
|
|
601
626
|
const filters: FieldFilters = {
|
|
602
|
-
[this.
|
|
627
|
+
[this.fieldIdentifier]: values.reduce((acc, value) => {
|
|
603
628
|
if (value === '') return { ...acc, [value]: true }
|
|
604
629
|
|
|
605
630
|
const keysToAdd = this.TYPE_MAPPING[value] || [value]
|
|
@@ -626,7 +651,7 @@ export class RecordKindField extends SimpleSearchField {
|
|
|
626
651
|
}
|
|
627
652
|
|
|
628
653
|
getValuesForFilter(filters: FieldFilters): Observable<FieldValue[]> {
|
|
629
|
-
const filter = filters[this.
|
|
654
|
+
const filter = filters[this.fieldIdentifier]
|
|
630
655
|
if (!filter) return of([])
|
|
631
656
|
|
|
632
657
|
const activeValues = Object.keys(filter).filter((v) => filter[v])
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
@if (kind) {
|
|
2
2
|
<div [class]="badgeClasses" [title]="'record.kind.' + kind | translate">
|
|
3
|
-
<ng-icon
|
|
3
|
+
<ng-icon
|
|
4
|
+
[name]="iconKind"
|
|
5
|
+
[ngClass]="extraClass"
|
|
6
|
+
aria-hidden="true"
|
|
7
|
+
></ng-icon>
|
|
4
8
|
@if (contentTemplate) {
|
|
5
9
|
<ng-container *ngTemplateOutlet="contentTemplate"></ng-container>
|
|
6
10
|
} @else {
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
<ng-template #titleTemplate>
|
|
18
18
|
<div class="px-2">
|
|
19
19
|
<div class="text-lg font-bold">{{ featureType.name }}</div>
|
|
20
|
-
@if (featureType.
|
|
20
|
+
@if (featureType.description) {
|
|
21
21
|
<div class="text-sm">
|
|
22
|
-
{{ featureType.
|
|
22
|
+
{{ featureType.description }}
|
|
23
23
|
</div>
|
|
24
24
|
}
|
|
25
25
|
</div>
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
<ul class="list-disc list-inside mr-4">
|
|
88
88
|
@for (v of row.values; track v) {
|
|
89
89
|
<li>
|
|
90
|
-
{{ v.label || v.
|
|
90
|
+
{{ v.label || v.value }}
|
|
91
91
|
</li>
|
|
92
92
|
}
|
|
93
93
|
</ul>
|
|
@@ -19,7 +19,7 @@ import { iconoirList } from '@ng-icons/iconoir'
|
|
|
19
19
|
marker('feature.catalog.attribute.type')
|
|
20
20
|
marker('feature.catalog.attribute.name')
|
|
21
21
|
marker('feature.catalog.attribute.code')
|
|
22
|
-
marker('feature.catalog.attribute.
|
|
22
|
+
marker('feature.catalog.attribute.description')
|
|
23
23
|
marker('feature.catalog.attribute.values')
|
|
24
24
|
|
|
25
25
|
interface ColumnDefinition {
|
|
@@ -56,7 +56,7 @@ export class FeatureCatalogListComponent {
|
|
|
56
56
|
readonly COLUMNS_DEFAULT: ColumnDefinition[] = [
|
|
57
57
|
{ key: 'type', width: '25%' },
|
|
58
58
|
{ key: 'name', width: '40%' },
|
|
59
|
-
{ key: '
|
|
59
|
+
{ key: 'description', width: 'minmax(0px, 1fr)' },
|
|
60
60
|
]
|
|
61
61
|
|
|
62
62
|
readonly COLUMN_VALUES: ColumnDefinition = {
|
|
@@ -16,10 +16,6 @@ gn-ui-button {
|
|
|
16
16
|
--gn-ui-button-padding: 0;
|
|
17
17
|
font-size: 1em;
|
|
18
18
|
}
|
|
19
|
-
ng-icon.search {
|
|
20
|
-
margin-top: 0.6rem;
|
|
21
|
-
margin-left: 0.6rem;
|
|
22
|
-
}
|
|
23
19
|
gn-ui-button:last-of-type {
|
|
24
20
|
--gn-ui-button-rounded: 0 var(--gn-ui-text-input-rounded, 0.25em)
|
|
25
21
|
var(--gn-ui-text-input-rounded, 0.25em) 0;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<span class="w-full inline-block relative">
|
|
2
2
|
@if (!allowSubmit) {
|
|
3
3
|
<div
|
|
4
|
-
class="absolute inset-y-[--icon-padding] left-[--icon-padding] w-[--icon-width] pointer-events-none"
|
|
4
|
+
class="absolute inset-y-[--icon-padding] left-[--icon-padding] w-[--icon-width] pointer-events-none flex items-center justify-center"
|
|
5
5
|
>
|
|
6
|
-
<ng-icon name="iconoirSearch" class="text-primary
|
|
6
|
+
<ng-icon name="iconoirSearch" class="text-primary"></ng-icon>
|
|
7
7
|
</div>
|
|
8
8
|
}
|
|
9
9
|
<div class="flex flex-row">
|
|
@@ -134,13 +134,13 @@ export class AutocompleteComponent
|
|
|
134
134
|
getExtraClass(): string {
|
|
135
135
|
if (this.allowSubmit) {
|
|
136
136
|
if (this.enterButton) {
|
|
137
|
-
return 'border rounded-lg absolute w-8 h-8 right-[calc(var(--icon-width)+var(--icon-padding))]
|
|
137
|
+
return 'border rounded-lg absolute w-8 h-8 right-[calc(var(--icon-width)+var(--icon-padding))] top-1/2 -translate-y-1/2'
|
|
138
138
|
} else {
|
|
139
|
-
return 'border rounded-lg absolute w-8 h-8 right-[calc(var(--icon-width)+0.25*var(--icon-width))]
|
|
139
|
+
return 'border rounded-lg absolute w-8 h-8 right-[calc(var(--icon-width)+0.25*var(--icon-width))] top-1/2 -translate-y-1/2'
|
|
140
140
|
}
|
|
141
141
|
} else {
|
|
142
142
|
if (!this.enterButton) {
|
|
143
|
-
return 'border rounded-lg absolute w-8 h-8 right-2
|
|
143
|
+
return 'border rounded-lg absolute w-8 h-8 right-2 top-1/2 -translate-y-1/2'
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
return 'border rounded-lg absolute w-8 h-8'
|
|
@@ -1,25 +1,20 @@
|
|
|
1
1
|
<ul class="flex flex-wrap list-none gap-2">
|
|
2
2
|
@for (choice of choices; track choice) {
|
|
3
3
|
<li>
|
|
4
|
-
<
|
|
5
|
-
|
|
4
|
+
<button
|
|
5
|
+
type="button"
|
|
6
6
|
[ngClass]="{
|
|
7
7
|
selected: isSelected(choice),
|
|
8
8
|
}"
|
|
9
|
+
[attr.aria-pressed]="isSelected(choice)"
|
|
10
|
+
[attr.data-cy]="'inlineFilter-' + choice.value"
|
|
11
|
+
(click)="select(choice, !isSelected(choice))"
|
|
9
12
|
>
|
|
10
|
-
<input
|
|
11
|
-
class="hidden"
|
|
12
|
-
type="checkbox"
|
|
13
|
-
#checkBox
|
|
14
|
-
[checked]="isSelected(choice)"
|
|
15
|
-
(change)="select(choice, checkBox.checked)"
|
|
16
|
-
[attr.data-cy]="'inlineFilter-' + choice.value"
|
|
17
|
-
/>
|
|
18
13
|
<ng-container
|
|
19
14
|
*ngTemplateOutlet="itemTemplate; context: { $implicit: choice }"
|
|
20
15
|
>
|
|
21
16
|
</ng-container>
|
|
22
|
-
</
|
|
17
|
+
</button>
|
|
23
18
|
</li>
|
|
24
19
|
}
|
|
25
20
|
</ul>
|
package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.ts
CHANGED
|
@@ -56,7 +56,8 @@ export class SearchFeatureCatalogComponent {
|
|
|
56
56
|
const fuzzyFilter = createFuzzyFilter(searchTerm)
|
|
57
57
|
return (
|
|
58
58
|
fuzzyFilter(featureType.name) ||
|
|
59
|
-
(featureType.
|
|
59
|
+
(featureType.description &&
|
|
60
|
+
fuzzyFilter(featureType.description))
|
|
60
61
|
)
|
|
61
62
|
}
|
|
62
63
|
)
|
package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.html
CHANGED
|
@@ -58,7 +58,12 @@
|
|
|
58
58
|
[class]="
|
|
59
59
|
(hasSelection
|
|
60
60
|
? 'border-b-[1px] border-gray-400 pb-[20px]'
|
|
61
|
-
: 'pb-[12px]') + ' text-black'
|
|
61
|
+
: 'pb-[12px]') + ' text-black flex flex-col gap-[8px]'
|
|
62
|
+
"
|
|
63
|
+
style="
|
|
64
|
+
--gn-ui-text-input-rounded: 8px;
|
|
65
|
+
--gn-ui-text-input-border-size: 1px;
|
|
66
|
+
--gn-ui-text-input-padding: 6px;
|
|
62
67
|
"
|
|
63
68
|
>
|
|
64
69
|
<gn-ui-drag-and-drop-file-input
|
|
@@ -74,6 +79,7 @@
|
|
|
74
79
|
(errorChange)="handleFileError($event)"
|
|
75
80
|
data-cy="importGeojson"
|
|
76
81
|
></gn-ui-drag-and-drop-file-input>
|
|
82
|
+
<ng-content></ng-content>
|
|
77
83
|
</div>
|
|
78
84
|
|
|
79
85
|
@if (hasSelection) {
|
package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.ts
CHANGED
|
@@ -53,6 +53,12 @@ const LABEL_FROM_FILE = marker('search.filters.spatialExtent.bboxFromFile')
|
|
|
53
53
|
const LABEL_FROM_FILE_DELETE = marker(
|
|
54
54
|
'search.filters.spatialExtent.bboxFromFileDelete'
|
|
55
55
|
)
|
|
56
|
+
const LABEL_FROM_LOCATION = marker(
|
|
57
|
+
'search.filters.spatialExtent.bboxFromLocation'
|
|
58
|
+
)
|
|
59
|
+
const LABEL_FROM_LOCATION_DELETE = marker(
|
|
60
|
+
'search.filters.spatialExtent.bboxFromLocationDelete'
|
|
61
|
+
)
|
|
56
62
|
const LABEL_INITIAL = marker('search.filters.spatialExtent.bboxInitial')
|
|
57
63
|
const LABEL_INITIAL_DELETE = marker(
|
|
58
64
|
'search.filters.spatialExtent.bboxInitialDelete'
|
|
@@ -105,6 +111,7 @@ export class SpatialExtentDropdownComponent {
|
|
|
105
111
|
|
|
106
112
|
bbox: BoundingBox | null = null
|
|
107
113
|
fileName = ''
|
|
114
|
+
locationName = ''
|
|
108
115
|
|
|
109
116
|
@ViewChild('overlayOrigin') overlayOrigin: CdkOverlayOrigin
|
|
110
117
|
@ViewChild(CdkConnectedOverlay) overlay: CdkConnectedOverlay
|
|
@@ -138,15 +145,19 @@ export class SpatialExtentDropdownComponent {
|
|
|
138
145
|
}
|
|
139
146
|
|
|
140
147
|
get selectionLabelKey() {
|
|
141
|
-
|
|
148
|
+
if (this.fileName) return LABEL_FROM_FILE
|
|
149
|
+
if (this.locationName) return LABEL_FROM_LOCATION
|
|
150
|
+
return LABEL_INITIAL
|
|
142
151
|
}
|
|
143
152
|
|
|
144
153
|
get selectionDeleteLabelKey() {
|
|
145
|
-
|
|
154
|
+
if (this.fileName) return LABEL_FROM_FILE_DELETE
|
|
155
|
+
if (this.locationName) return LABEL_FROM_LOCATION_DELETE
|
|
156
|
+
return LABEL_INITIAL_DELETE
|
|
146
157
|
}
|
|
147
158
|
|
|
148
159
|
get selectionLabelParams() {
|
|
149
|
-
return { fileName: this.fileName }
|
|
160
|
+
return { fileName: this.fileName, locationName: this.locationName }
|
|
150
161
|
}
|
|
151
162
|
|
|
152
163
|
openOverlay() {
|
|
@@ -186,6 +197,7 @@ export class SpatialExtentDropdownComponent {
|
|
|
186
197
|
}
|
|
187
198
|
this.bbox = bbox
|
|
188
199
|
this.fileName = file.name
|
|
200
|
+
this.locationName = ''
|
|
189
201
|
this.bboxChange.emit(bbox)
|
|
190
202
|
this.cd.markForCheck()
|
|
191
203
|
} catch {
|
|
@@ -194,6 +206,16 @@ export class SpatialExtentDropdownComponent {
|
|
|
194
206
|
}
|
|
195
207
|
}
|
|
196
208
|
|
|
209
|
+
setLocationBbox(bbox: BoundingBox, name: string) {
|
|
210
|
+
this.errorKey = null
|
|
211
|
+
this.bbox = bbox
|
|
212
|
+
this.locationName = name
|
|
213
|
+
this.fileName = ''
|
|
214
|
+
this.fileInput?.clear()
|
|
215
|
+
this.bboxChange.emit(bbox)
|
|
216
|
+
this.cd.markForCheck()
|
|
217
|
+
}
|
|
218
|
+
|
|
197
219
|
handleFileError(error: DragAndDropFileInputError) {
|
|
198
220
|
if (error === 'file-too-large') {
|
|
199
221
|
this.setError(marker('search.filters.spatialExtent.error.fileTooLarge'), {
|
|
@@ -213,6 +235,7 @@ export class SpatialExtentDropdownComponent {
|
|
|
213
235
|
removeSelection(event: Event) {
|
|
214
236
|
this.bbox = null
|
|
215
237
|
this.fileName = ''
|
|
238
|
+
this.locationName = ''
|
|
216
239
|
this.errorKey = null
|
|
217
240
|
this.fileInput?.clear()
|
|
218
241
|
this.bboxChange.emit(null)
|