geonetwork-ui 2.2.0-dev.4db0b597 → 2.2.0-dev.54d2ced0
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/esm2022/libs/api/metadata-converter/src/lib/gn4/atomic-operations.mjs +27 -1
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +49 -58
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.mjs +5 -4
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.mjs +14 -0
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/converter.mjs +20 -17
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +52 -23
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +52 -32
- package/esm2022/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.mjs +10 -3
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.mjs +14 -5
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +33 -8
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
- package/esm2022/libs/feature/map/src/lib/map-context/map-context.service.mjs +9 -1
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.mjs +41 -26
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +11 -9
- package/esm2022/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +35 -22
- package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +3 -4
- package/esm2022/libs/ui/elements/src/lib/record-api-form/record-api-form.component.mjs +8 -5
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +4 -4
- package/esm2022/libs/ui/inputs/src/lib/button/button.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/text-area/text-area.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +6 -6
- package/esm2022/translations/de.json +3 -2
- package/esm2022/translations/en.json +5 -4
- package/esm2022/translations/es.json +3 -2
- package/esm2022/translations/fr.json +5 -4
- package/esm2022/translations/it.json +5 -4
- package/esm2022/translations/nl.json +3 -2
- package/esm2022/translations/pt.json +3 -2
- package/fesm2022/geonetwork-ui.mjs +406 -239
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts +2 -0
- package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts +0 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +3 -5
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.d.ts +3 -0
- package/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/iso19139/converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +6 -6
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +4 -3
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +9 -2
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +18 -12
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.d.ts +1 -0
- package/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts +1 -0
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.d.ts +21 -8
- package/libs/feature/search/src/lib/utils/service/fields.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.d.ts +1 -1
- package/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts +10 -6
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +3 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +13 -13
- package/libs/ui/inputs/src/lib/button/button.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/button/button.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/text-area/text-area.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/text-area/text-area.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +40 -40
- package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts +1 -1
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/generic.records.ts +61 -8
- package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +55 -9
- package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +225 -24
- package/src/libs/api/metadata-converter/src/lib/gn4/atomic-operations.ts +29 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +80 -73
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.ts +4 -3
- package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +3 -5
- package/src/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.ts +16 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/converter.ts +24 -21
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +115 -62
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +169 -95
- package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.ts +22 -2
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.ts +15 -4
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +47 -8
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +21 -14
- package/src/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.ts +1 -0
- package/src/libs/common/domain/src/lib/platform.service.interface.ts +1 -4
- package/src/libs/common/fixtures/src/lib/gn4/groups.fixtures.ts +1 -1
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +50 -10
- package/src/libs/feature/map/src/lib/map-context/map-context.service.ts +10 -0
- package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +21 -16
- package/src/libs/feature/search/src/lib/utils/service/fields.ts +43 -34
- package/src/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.html +1 -1
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.css +5 -0
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.html +39 -0
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.ts +58 -0
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.css +2 -2
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.ts +1 -0
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +50 -23
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +37 -15
- package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.ts +2 -3
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.html +4 -4
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.ts +11 -3
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +1 -1
- package/src/libs/ui/inputs/src/lib/button/button.component.ts +1 -0
- package/src/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.css +3 -0
- package/src/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.html +1 -1
- package/src/libs/ui/inputs/src/lib/text-area/text-area.component.ts +1 -0
- package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +2 -2
- package/tailwind.base.config.js +3 -0
- package/tailwind.base.css +2 -2
- package/translations/de.json +3 -2
- package/translations/en.json +5 -4
- package/translations/es.json +3 -2
- package/translations/fr.json +5 -4
- package/translations/it.json +5 -4
- package/translations/nl.json +3 -2
- package/translations/pt.json +3 -2
- package/translations/sk.json +3 -2
|
@@ -69,8 +69,24 @@ Cette section contient des *caractères internationaux* (ainsi que des "caractè
|
|
|
69
69
|
url: new URL('http://my-org.net/two.png'),
|
|
70
70
|
},
|
|
71
71
|
],
|
|
72
|
-
keywords: [
|
|
73
|
-
|
|
72
|
+
keywords: [
|
|
73
|
+
{
|
|
74
|
+
thesaurus: { id: 'geonetwork.thesaurus.local' },
|
|
75
|
+
type: 'other',
|
|
76
|
+
label: 'international',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
thesaurus: { id: 'geonetwork.thesaurus.local' },
|
|
80
|
+
type: 'other',
|
|
81
|
+
label: 'test',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
thesaurus: { id: 'geonetwork.thesaurus.local' },
|
|
85
|
+
type: 'other',
|
|
86
|
+
label: '_another_keyword_',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
topics: ['testData', 'exampleData'],
|
|
74
90
|
spatialRepresentation: 'grid',
|
|
75
91
|
distributions: [
|
|
76
92
|
{
|
|
@@ -115,7 +131,7 @@ As such, **it is not very interesting at all.**`,
|
|
|
115
131
|
url: new URL('https://data.rennesmetropole.fr/pages/licence/'),
|
|
116
132
|
},
|
|
117
133
|
],
|
|
118
|
-
|
|
134
|
+
legalConstraints: [
|
|
119
135
|
{
|
|
120
136
|
text: "Dataset access isn't possible since it does not really exist",
|
|
121
137
|
type: 'other',
|
|
@@ -125,6 +141,8 @@ As such, **it is not very interesting at all.**`,
|
|
|
125
141
|
type: 'security',
|
|
126
142
|
},
|
|
127
143
|
],
|
|
144
|
+
securityConstraints: [],
|
|
145
|
+
otherConstraints: [],
|
|
128
146
|
spatialExtents: [],
|
|
129
147
|
temporalExtents: [],
|
|
130
148
|
updateFrequency: {
|
|
@@ -168,13 +186,33 @@ Malgré l'attention portée à la création de ces données, il est rappelé que
|
|
|
168
186
|
},
|
|
169
187
|
],
|
|
170
188
|
keywords: [
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
189
|
+
{
|
|
190
|
+
thesaurus: { id: 'geonetwork.thesaurus.local' },
|
|
191
|
+
type: 'other',
|
|
192
|
+
label: 'planification',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
thesaurus: { id: 'geonetwork.thesaurus.local' },
|
|
196
|
+
type: 'other',
|
|
197
|
+
label: 'PLU',
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
thesaurus: { id: 'geonetwork.thesaurus.local' },
|
|
201
|
+
type: 'other',
|
|
202
|
+
label: "Plan local d'urbanisme",
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
thesaurus: { id: 'geonetwork.thesaurus.local' },
|
|
206
|
+
type: 'other',
|
|
207
|
+
label: 'données ouvertes',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
thesaurus: { id: 'geonetwork.thesaurus.local' },
|
|
211
|
+
type: 'other',
|
|
212
|
+
label: 'Avrigny*60036',
|
|
213
|
+
},
|
|
176
214
|
],
|
|
177
|
-
|
|
215
|
+
topics: ['Usage des sols', "document d'urbanisme"],
|
|
178
216
|
spatialRepresentation: 'vector',
|
|
179
217
|
distributions: [
|
|
180
218
|
{
|
|
@@ -189,7 +227,9 @@ Malgré l'attention portée à la création de ces données, il est rappelé que
|
|
|
189
227
|
],
|
|
190
228
|
lineage: `Document d’urbanisme numérisé conformément aux prescriptions nationales du CNIG par le Service d'Information Géographique de l'Agglomération de la Région de Compiègne.
|
|
191
229
|
Ce lot de données produit en 2019, a été numérisé à partir du PCI Vecteur de 2019 et contrôlé par le Service d'Information Géographique de l'Agglomération de la Région de Compiègne.`,
|
|
192
|
-
|
|
230
|
+
legalConstraints: [],
|
|
231
|
+
securityConstraints: [],
|
|
232
|
+
otherConstraints: [],
|
|
193
233
|
useLimitations: ["Aucune condition ne s'applique", 'Licence Ouverte 2.0'],
|
|
194
234
|
licenses: [
|
|
195
235
|
{
|
|
@@ -58,6 +58,8 @@ export class MapContextService {
|
|
|
58
58
|
): Map {
|
|
59
59
|
if (mapConfig) {
|
|
60
60
|
mapContext = this.mergeMapConfigWithContext(mapContext, mapConfig)
|
|
61
|
+
} else {
|
|
62
|
+
mapContext.layers = this.addDefaultBaselayerContext(mapContext.layers)
|
|
61
63
|
}
|
|
62
64
|
if (
|
|
63
65
|
!mapContext.view?.extent &&
|
|
@@ -179,6 +181,14 @@ export class MapContextService {
|
|
|
179
181
|
return view
|
|
180
182
|
}
|
|
181
183
|
|
|
184
|
+
addDefaultBaselayerContext(
|
|
185
|
+
layers: MapContextLayerModel[]
|
|
186
|
+
): MapContextLayerModel[] {
|
|
187
|
+
return layers.includes(DEFAULT_BASELAYER_CONTEXT)
|
|
188
|
+
? layers
|
|
189
|
+
: [DEFAULT_BASELAYER_CONTEXT, ...layers]
|
|
190
|
+
}
|
|
191
|
+
|
|
182
192
|
mergeMapConfigWithContext(
|
|
183
193
|
mapContext: MapContextModel,
|
|
184
194
|
mapConfig: MapConfig
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
FieldValue,
|
|
5
5
|
FullTextSearchField,
|
|
6
6
|
IsSpatialSearchField,
|
|
7
|
-
KeySearchField,
|
|
8
7
|
LicenseSearchField,
|
|
8
|
+
MultilingualSearchField,
|
|
9
9
|
OrganizationSearchField,
|
|
10
10
|
OwnerSearchField,
|
|
11
11
|
SimpleSearchField,
|
|
12
|
-
|
|
12
|
+
TranslatedSearchField,
|
|
13
13
|
} from './fields'
|
|
14
14
|
import { forkJoin, Observable, of } from 'rxjs'
|
|
15
15
|
import { map } from 'rxjs/operators'
|
|
@@ -21,6 +21,7 @@ export type FieldValues = Record<string, FieldValue[] | FieldValue>
|
|
|
21
21
|
|
|
22
22
|
marker('search.filters.format')
|
|
23
23
|
marker('search.filters.inspireKeyword')
|
|
24
|
+
marker('search.filters.keyword')
|
|
24
25
|
marker('search.filters.isSpatial')
|
|
25
26
|
marker('search.filters.license')
|
|
26
27
|
marker('search.filters.publicationYear')
|
|
@@ -37,29 +38,33 @@ marker('search.filters.contact')
|
|
|
37
38
|
export class FieldsService {
|
|
38
39
|
private fields = {
|
|
39
40
|
publisher: new OrganizationSearchField(this.injector),
|
|
40
|
-
format: new SimpleSearchField('format', 'asc'
|
|
41
|
-
resourceType: new
|
|
42
|
-
|
|
41
|
+
format: new SimpleSearchField('format', this.injector, 'asc'),
|
|
42
|
+
resourceType: new TranslatedSearchField(
|
|
43
|
+
'resourceType',
|
|
44
|
+
this.injector,
|
|
45
|
+
'asc'
|
|
46
|
+
),
|
|
47
|
+
representationType: new TranslatedSearchField(
|
|
43
48
|
'cl_spatialRepresentationType.key',
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
this.injector,
|
|
50
|
+
'asc'
|
|
46
51
|
),
|
|
47
52
|
publicationYear: new SimpleSearchField(
|
|
48
53
|
'publicationYearForResource',
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
this.injector,
|
|
55
|
+
'desc'
|
|
51
56
|
),
|
|
52
|
-
topic: new
|
|
53
|
-
inspireKeyword: new
|
|
57
|
+
topic: new TranslatedSearchField('cl_topic.key', this.injector, 'asc'),
|
|
58
|
+
inspireKeyword: new TranslatedSearchField(
|
|
54
59
|
'th_httpinspireeceuropaeutheme-theme.link',
|
|
55
|
-
|
|
56
|
-
'asc'
|
|
57
|
-
this.injector
|
|
60
|
+
this.injector,
|
|
61
|
+
'asc'
|
|
58
62
|
),
|
|
63
|
+
keyword: new MultilingualSearchField('tag', this.injector, 'desc', 'count'),
|
|
59
64
|
documentStandard: new SimpleSearchField(
|
|
60
65
|
'documentStandard',
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
this.injector,
|
|
67
|
+
'asc'
|
|
63
68
|
),
|
|
64
69
|
isSpatial: new IsSpatialSearchField(this.injector),
|
|
65
70
|
q: new FullTextSearchField(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { firstValueFrom, Observable, of, switchMap
|
|
2
|
-
import {
|
|
1
|
+
import { firstValueFrom, Observable, of, switchMap } from 'rxjs'
|
|
2
|
+
import { map } from 'rxjs/operators'
|
|
3
3
|
import { Injector } from '@angular/core'
|
|
4
4
|
import { TranslateService } from '@ngx-translate/core'
|
|
5
5
|
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
@@ -13,7 +13,10 @@ import {
|
|
|
13
13
|
FieldFilters,
|
|
14
14
|
TermBucket,
|
|
15
15
|
} from '../../../../../../../libs/common/domain/src/lib/model/search'
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
ElasticsearchService,
|
|
18
|
+
METADATA_LANGUAGE,
|
|
19
|
+
} from '../../../../../../../libs/api/repository/src'
|
|
17
20
|
import { LangService } from '../../../../../../../libs/util/i18n/src'
|
|
18
21
|
|
|
19
22
|
export type FieldValue = string | number
|
|
@@ -36,8 +39,9 @@ export class SimpleSearchField implements AbstractSearchField {
|
|
|
36
39
|
|
|
37
40
|
constructor(
|
|
38
41
|
protected esFieldName: string,
|
|
42
|
+
protected injector: Injector,
|
|
39
43
|
protected order: 'asc' | 'desc' = 'asc',
|
|
40
|
-
protected
|
|
44
|
+
protected orderType: 'key' | 'count' = 'key'
|
|
41
45
|
) {}
|
|
42
46
|
|
|
43
47
|
protected getAggregations(): AggregationsParams {
|
|
@@ -46,13 +50,13 @@ export class SimpleSearchField implements AbstractSearchField {
|
|
|
46
50
|
type: 'terms',
|
|
47
51
|
field: this.esFieldName,
|
|
48
52
|
limit: 1000,
|
|
49
|
-
sort: [this.order,
|
|
53
|
+
sort: [this.order, this.orderType],
|
|
50
54
|
},
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
protected async getBucketLabel(bucket: TermBucket): Promise<string> {
|
|
55
|
-
return bucket.term
|
|
59
|
+
return bucket.term.toString()
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
getAvailableValues(): Observable<FieldAvailableValue[]> {
|
|
@@ -88,9 +92,18 @@ export class SimpleSearchField implements AbstractSearchField {
|
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
94
|
|
|
91
|
-
export class
|
|
95
|
+
export class TranslatedSearchField extends SimpleSearchField {
|
|
92
96
|
protected platformService = this.injector.get(PlatformServiceInterface)
|
|
93
97
|
|
|
98
|
+
constructor(
|
|
99
|
+
protected esFieldName: string,
|
|
100
|
+
protected injector: Injector,
|
|
101
|
+
protected order: 'asc' | 'desc' = 'asc',
|
|
102
|
+
protected orderType: 'key' | 'count' = 'key'
|
|
103
|
+
) {
|
|
104
|
+
super(esFieldName, injector, order, orderType)
|
|
105
|
+
}
|
|
106
|
+
|
|
94
107
|
protected async getTranslation(key: string) {
|
|
95
108
|
return firstValueFrom(this.platformService.translateKey(key))
|
|
96
109
|
}
|
|
@@ -100,6 +113,7 @@ export class KeySearchField extends SimpleSearchField {
|
|
|
100
113
|
}
|
|
101
114
|
|
|
102
115
|
getAvailableValues(): Observable<FieldAvailableValue[]> {
|
|
116
|
+
if (this.orderType === 'count') return super.getAvailableValues()
|
|
103
117
|
// sort values by alphabetical order
|
|
104
118
|
return super
|
|
105
119
|
.getAvailableValues()
|
|
@@ -111,34 +125,29 @@ export class KeySearchField extends SimpleSearchField {
|
|
|
111
125
|
}
|
|
112
126
|
}
|
|
113
127
|
|
|
114
|
-
|
|
128
|
+
/**
|
|
129
|
+
* This search field will either target the `.default` field, or a specific `.langxyz` field according
|
|
130
|
+
* to the defined METADATA_LANGUAGE token
|
|
131
|
+
* The provided ES field name should not include any prefix such as `.langeng`
|
|
132
|
+
*/
|
|
133
|
+
export class MultilingualSearchField extends SimpleSearchField {
|
|
115
134
|
private langService = this.injector.get(LangService)
|
|
116
|
-
private
|
|
117
|
-
.getThesaurusByLang(this.thesaurusName, this.langService.iso3)
|
|
118
|
-
.pipe(
|
|
119
|
-
catchError(() => {
|
|
120
|
-
console.warn('Error while loading thesaurus language package')
|
|
121
|
-
return of([])
|
|
122
|
-
}),
|
|
123
|
-
shareReplay(1)
|
|
124
|
-
)
|
|
135
|
+
private searchLanguage = this.injector.get(METADATA_LANGUAGE, null)
|
|
125
136
|
|
|
126
137
|
constructor(
|
|
127
|
-
esFieldName: string,
|
|
128
|
-
protected
|
|
129
|
-
order: 'asc' | 'desc' = 'asc',
|
|
130
|
-
|
|
138
|
+
protected esFieldName: string,
|
|
139
|
+
protected injector: Injector,
|
|
140
|
+
protected order: 'asc' | 'desc' = 'asc',
|
|
141
|
+
protected orderType: 'key' | 'count' = 'key'
|
|
131
142
|
) {
|
|
132
|
-
super(esFieldName, order,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
this.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
)
|
|
141
|
-
)
|
|
143
|
+
super(esFieldName, injector, order, orderType)
|
|
144
|
+
// note: we're excluding the metadata language "current" value because that would produce
|
|
145
|
+
// permalinks that might not work for different users
|
|
146
|
+
if (this.searchLanguage && this.searchLanguage !== 'current') {
|
|
147
|
+
this.esFieldName += `.lang${this.searchLanguage}`
|
|
148
|
+
} else {
|
|
149
|
+
this.esFieldName += '.default'
|
|
150
|
+
}
|
|
142
151
|
}
|
|
143
152
|
}
|
|
144
153
|
|
|
@@ -163,7 +172,7 @@ export class IsSpatialSearchField extends SimpleSearchField {
|
|
|
163
172
|
private translateService = this.injector.get(TranslateService)
|
|
164
173
|
|
|
165
174
|
constructor(injector: Injector) {
|
|
166
|
-
super('isSpatial', 'asc'
|
|
175
|
+
super('isSpatial', injector, 'asc')
|
|
167
176
|
this.esService.registerRuntimeField(
|
|
168
177
|
'isSpatial',
|
|
169
178
|
`String result = 'no';
|
|
@@ -223,7 +232,7 @@ export class LicenseSearchField extends SimpleSearchField {
|
|
|
223
232
|
private translateService = this.injector.get(TranslateService)
|
|
224
233
|
|
|
225
234
|
constructor(injector: Injector) {
|
|
226
|
-
super('license', 'asc'
|
|
235
|
+
super('license', injector, 'asc')
|
|
227
236
|
this.esService.registerRuntimeField(
|
|
228
237
|
'license',
|
|
229
238
|
`String raw = '';
|
|
@@ -330,7 +339,7 @@ export class OrganizationSearchField implements AbstractSearchField {
|
|
|
330
339
|
}
|
|
331
340
|
export class OwnerSearchField extends SimpleSearchField {
|
|
332
341
|
constructor(injector: Injector) {
|
|
333
|
-
super('owner', 'asc'
|
|
342
|
+
super('owner', injector, 'asc')
|
|
334
343
|
}
|
|
335
344
|
|
|
336
345
|
getAvailableValues(): Observable<FieldAvailableValue[]> {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<div class="h-full flex flex-col">
|
|
2
|
+
<div class="flex-none w-full flex flex-row items-center">
|
|
3
|
+
<p class="flex-none font-bold">{{ label }}</p>
|
|
4
|
+
<div class="flex-1 flex justify-end items-center">
|
|
5
|
+
<gn-ui-button
|
|
6
|
+
[extraClass]="getButtonExtraClass()"
|
|
7
|
+
(buttonClick)="togglePreview()"
|
|
8
|
+
>
|
|
9
|
+
<span class="material-symbols-outlined mr-1 icon-small">{{
|
|
10
|
+
preview ? 'visibility' : 'visibility_off'
|
|
11
|
+
}}</span>
|
|
12
|
+
{{ preview ? 'WYSIWYG' : 'Markdown' }}
|
|
13
|
+
</gn-ui-button>
|
|
14
|
+
<span
|
|
15
|
+
class="material-symbols-outlined m-2 icon-small"
|
|
16
|
+
[matTooltip]="tooltip"
|
|
17
|
+
matTooltipPosition="above"
|
|
18
|
+
>
|
|
19
|
+
help
|
|
20
|
+
</span>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<p class="flex-none mb-2 font-medium text-sm text-gray-900">
|
|
24
|
+
{{ helperText }}
|
|
25
|
+
</p>
|
|
26
|
+
<div class="flex-1" [hidden]="preview">
|
|
27
|
+
<gn-ui-text-area
|
|
28
|
+
[placeholder]="placeholder"
|
|
29
|
+
[value]="textContent"
|
|
30
|
+
(valueChange)="textContentChangedHandler($event)"
|
|
31
|
+
></gn-ui-text-area>
|
|
32
|
+
</div>
|
|
33
|
+
<div
|
|
34
|
+
class="flex-1 border border-gray-800 rounded overflow-y-scroll"
|
|
35
|
+
[hidden]="!preview"
|
|
36
|
+
>
|
|
37
|
+
<gn-ui-markdown-parser [textContent]="textContent"></gn-ui-markdown-parser>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common'
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
EventEmitter,
|
|
6
|
+
Input,
|
|
7
|
+
Output,
|
|
8
|
+
} from '@angular/core'
|
|
9
|
+
import { FormsModule } from '@angular/forms'
|
|
10
|
+
import { MarkdownParserComponent } from '../markdown-parser/markdown-parser.component'
|
|
11
|
+
import { TranslateModule } from '@ngx-translate/core'
|
|
12
|
+
import { ButtonComponent, TextAreaComponent } from '../../../../../../libs/ui/inputs/src'
|
|
13
|
+
import { MatIconModule } from '@angular/material/icon'
|
|
14
|
+
import { MatTooltipModule } from '@angular/material/tooltip'
|
|
15
|
+
|
|
16
|
+
@Component({
|
|
17
|
+
selector: 'gn-ui-markdown-editor',
|
|
18
|
+
templateUrl: './markdown-editor.component.html',
|
|
19
|
+
styleUrls: ['./markdown-editor.component.css'],
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
standalone: true,
|
|
22
|
+
imports: [
|
|
23
|
+
CommonModule,
|
|
24
|
+
FormsModule,
|
|
25
|
+
MatIconModule,
|
|
26
|
+
MatTooltipModule,
|
|
27
|
+
ButtonComponent,
|
|
28
|
+
TextAreaComponent,
|
|
29
|
+
MarkdownParserComponent,
|
|
30
|
+
TranslateModule,
|
|
31
|
+
],
|
|
32
|
+
})
|
|
33
|
+
export class MarkdownEditorComponent {
|
|
34
|
+
@Input() label: string
|
|
35
|
+
@Input() tooltip?: string
|
|
36
|
+
@Input() helperText?: string
|
|
37
|
+
@Input() placeholder: string
|
|
38
|
+
@Input() textContent: string
|
|
39
|
+
@Output() textContentChanged: EventEmitter<string> =
|
|
40
|
+
new EventEmitter<string>()
|
|
41
|
+
|
|
42
|
+
preview = false
|
|
43
|
+
|
|
44
|
+
getButtonExtraClass() {
|
|
45
|
+
return `${
|
|
46
|
+
this.preview ? 'text-gray-200 bg-gray-900' : 'text-gray-900 bg-gray-200'
|
|
47
|
+
} rounded-[1.25rem] p-[0.375rem] text-xs font-medium w-24`
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
togglePreview() {
|
|
51
|
+
this.preview = !this.preview
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
textContentChangedHandler(textContent: string) {
|
|
55
|
+
this.textContent = textContent
|
|
56
|
+
this.textContentChanged.emit(this.textContent)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -74,12 +74,12 @@
|
|
|
74
74
|
margin-top: 0;
|
|
75
75
|
margin-bottom: 10px;
|
|
76
76
|
color: var(--color-primary) !important;
|
|
77
|
-
text-decoration: none
|
|
78
|
-
@apply font-bold;
|
|
77
|
+
text-decoration: none;
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
:host ::ng-deep .markdown-body p > a:hover {
|
|
82
81
|
color: var(--color-primary-darker) !important;
|
|
82
|
+
@apply underline;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/** Blockquotes **/
|
|
@@ -6,6 +6,7 @@ import { marked } from 'marked'
|
|
|
6
6
|
templateUrl: './markdown-parser.component.html',
|
|
7
7
|
styleUrls: ['./markdown-parser.component.css'],
|
|
8
8
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
+
standalone: true,
|
|
9
10
|
})
|
|
10
11
|
export class MarkdownParserComponent {
|
|
11
12
|
@Input() textContent: string
|
|
@@ -10,6 +10,50 @@
|
|
|
10
10
|
</gn-ui-content-ghost>
|
|
11
11
|
</div>
|
|
12
12
|
|
|
13
|
+
<gn-ui-expandable-panel [title]="'record.metadata.usage' | translate">
|
|
14
|
+
<div class="flex flex-col gap-[10px] mr-4 py-[12px] rounded text-gray-900">
|
|
15
|
+
<ng-container *ngFor="let license of licenses">
|
|
16
|
+
<div *ngIf="license.url; else noUrl" class="text-primary">
|
|
17
|
+
<a
|
|
18
|
+
[href]="license.url"
|
|
19
|
+
target="_blank"
|
|
20
|
+
class="cursor-pointer hover:underline transition-all"
|
|
21
|
+
>
|
|
22
|
+
{{ license.text }}
|
|
23
|
+
<mat-icon
|
|
24
|
+
class="material-symbols-outlined !w-[12px] !h-[12px] !text-[12px] opacity-75 shrink-0"
|
|
25
|
+
>open_in_new</mat-icon
|
|
26
|
+
>
|
|
27
|
+
</a>
|
|
28
|
+
</div>
|
|
29
|
+
<ng-template #noUrl>
|
|
30
|
+
<div class="text-primary" gnUiLinkify>
|
|
31
|
+
{{ license.text }}
|
|
32
|
+
</div>
|
|
33
|
+
</ng-template>
|
|
34
|
+
</ng-container>
|
|
35
|
+
<ng-container *ngIf="legalConstraints.length">
|
|
36
|
+
<gn-ui-markdown-parser
|
|
37
|
+
*ngFor="let constraint of legalConstraints"
|
|
38
|
+
[textContent]="constraint"
|
|
39
|
+
>
|
|
40
|
+
</gn-ui-markdown-parser>
|
|
41
|
+
</ng-container>
|
|
42
|
+
<ng-container *ngIf="otherConstraints.length">
|
|
43
|
+
<div gnUiLinkify *ngFor="let constraint of otherConstraints">
|
|
44
|
+
<h5 translate class="font-medium text-black text-sm mb-[2px] mt-[16px]">
|
|
45
|
+
record.metadata.otherConstraints
|
|
46
|
+
</h5>
|
|
47
|
+
<gn-ui-markdown-parser [textContent]="constraint">
|
|
48
|
+
</gn-ui-markdown-parser>
|
|
49
|
+
</div>
|
|
50
|
+
</ng-container>
|
|
51
|
+
|
|
52
|
+
<span class="noUsage" *ngIf="!hasUsage">
|
|
53
|
+
{{ 'record.metadata.noUsage' | translate }}
|
|
54
|
+
</span>
|
|
55
|
+
</div>
|
|
56
|
+
</gn-ui-expandable-panel>
|
|
13
57
|
<gn-ui-expandable-panel
|
|
14
58
|
class="metadata-origin"
|
|
15
59
|
*ngIf="
|
|
@@ -22,7 +66,7 @@
|
|
|
22
66
|
>
|
|
23
67
|
<p
|
|
24
68
|
*ngIf="metadata.lineage"
|
|
25
|
-
class="mb-5 pt-4 whitespace-pre-line break-words"
|
|
69
|
+
class="mb-5 pt-4 whitespace-pre-line break-words text-gray-900"
|
|
26
70
|
gnUiLinkify
|
|
27
71
|
>
|
|
28
72
|
{{ metadata.lineage }}
|
|
@@ -54,23 +98,6 @@
|
|
|
54
98
|
</div>
|
|
55
99
|
</div>
|
|
56
100
|
</gn-ui-expandable-panel>
|
|
57
|
-
<gn-ui-expandable-panel [title]="'record.metadata.usage' | translate">
|
|
58
|
-
<div class="py-4 px-6 rounded bg-gray-100 text-gray-700 flex flex-wrap gap-2">
|
|
59
|
-
<gn-ui-badge *ngIf="metadata.extras?.isOpenData">
|
|
60
|
-
<span translate>record.metadata.isOpenData</span>
|
|
61
|
-
</gn-ui-badge>
|
|
62
|
-
<span
|
|
63
|
-
class="text-primary font-medium"
|
|
64
|
-
*ngFor="let usage of usages"
|
|
65
|
-
gnUiLinkify
|
|
66
|
-
>
|
|
67
|
-
{{ usage }}
|
|
68
|
-
</span>
|
|
69
|
-
<span class="text-primary font-medium noUsage" *ngIf="!hasUsage">
|
|
70
|
-
{{ 'record.metadata.noUsage' | translate }}
|
|
71
|
-
</span>
|
|
72
|
-
</div>
|
|
73
|
-
</gn-ui-expandable-panel>
|
|
74
101
|
<gn-ui-expandable-panel
|
|
75
102
|
*ngIf="metadata.landingPage"
|
|
76
103
|
[title]="'record.metadata.details' | translate"
|
|
@@ -109,13 +136,13 @@
|
|
|
109
136
|
</p>
|
|
110
137
|
</div>
|
|
111
138
|
</div>
|
|
112
|
-
<div *ngIf="metadata.
|
|
113
|
-
<p class="text-sm mb-1" translate>record.metadata.
|
|
139
|
+
<div *ngIf="metadata.topics?.length">
|
|
140
|
+
<p class="text-sm mb-1" translate>record.metadata.topics</p>
|
|
114
141
|
<div class="sm:pb-4 sm:pr-16">
|
|
115
142
|
<gn-ui-badge
|
|
116
143
|
class="inline-block mr-2 lowercase"
|
|
117
|
-
*ngFor="let
|
|
118
|
-
>{{
|
|
144
|
+
*ngFor="let topic of metadata.topics"
|
|
145
|
+
>{{ topic }}</gn-ui-badge
|
|
119
146
|
>
|
|
120
147
|
</div>
|
|
121
148
|
</div>
|
|
@@ -127,7 +154,7 @@
|
|
|
127
154
|
(click)="onKeywordClick(keyword)"
|
|
128
155
|
[clickable]="true"
|
|
129
156
|
*ngFor="let keyword of metadata.keywords"
|
|
130
|
-
>{{ keyword }}</gn-ui-badge
|
|
157
|
+
>{{ keyword.label }}</gn-ui-badge
|
|
131
158
|
>
|
|
132
159
|
</div>
|
|
133
160
|
</div>
|
|
@@ -5,7 +5,10 @@ import {
|
|
|
5
5
|
Input,
|
|
6
6
|
Output,
|
|
7
7
|
} from '@angular/core'
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
DatasetRecord,
|
|
10
|
+
Keyword,
|
|
11
|
+
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
9
12
|
|
|
10
13
|
@Component({
|
|
11
14
|
selector: 'gn-ui-metadata-info',
|
|
@@ -16,24 +19,48 @@ import { DatasetRecord } from '../../../../../../libs/common/domain/src/lib/mode
|
|
|
16
19
|
export class MetadataInfoComponent {
|
|
17
20
|
@Input() metadata: Partial<DatasetRecord>
|
|
18
21
|
@Input() incomplete: boolean
|
|
19
|
-
@Output() keyword = new EventEmitter<
|
|
22
|
+
@Output() keyword = new EventEmitter<Keyword>()
|
|
20
23
|
updatedTimes: number
|
|
21
24
|
|
|
22
25
|
get hasUsage() {
|
|
23
26
|
return (
|
|
24
27
|
this.metadata.extras?.isOpenData === true ||
|
|
25
|
-
this.metadata.
|
|
26
|
-
|
|
28
|
+
(this.metadata.legalConstraints?.length > 0 &&
|
|
29
|
+
this.legalConstraints.length > 0) ||
|
|
30
|
+
(this.metadata.otherConstraints?.length > 0 &&
|
|
31
|
+
this.otherConstraints.length > 0) ||
|
|
32
|
+
(this.metadata.licenses?.length > 0 && this.licenses.length > 0)
|
|
27
33
|
)
|
|
28
34
|
}
|
|
29
35
|
|
|
30
|
-
get
|
|
36
|
+
get legalConstraints() {
|
|
37
|
+
let array = []
|
|
38
|
+
if (this.metadata.legalConstraints?.length) {
|
|
39
|
+
array = array.concat(
|
|
40
|
+
this.metadata.legalConstraints.filter((c) => c.text).map((c) => c.text)
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
return array
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
get otherConstraints() {
|
|
31
47
|
let array = []
|
|
32
|
-
if (this.metadata.
|
|
33
|
-
array = array.concat(
|
|
48
|
+
if (this.metadata.otherConstraints?.length) {
|
|
49
|
+
array = array.concat(
|
|
50
|
+
this.metadata.otherConstraints.filter((c) => c.text).map((c) => c.text)
|
|
51
|
+
)
|
|
34
52
|
}
|
|
35
|
-
|
|
36
|
-
|
|
53
|
+
return array
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
get licenses(): { text: string; url: string }[] {
|
|
57
|
+
let array = []
|
|
58
|
+
if (this.metadata.licenses?.length) {
|
|
59
|
+
array = array.concat(
|
|
60
|
+
this.metadata.licenses
|
|
61
|
+
.filter((c) => c.text)
|
|
62
|
+
.map((c) => ({ text: c.text, url: c.url }))
|
|
63
|
+
)
|
|
37
64
|
}
|
|
38
65
|
return array
|
|
39
66
|
}
|
|
@@ -53,12 +80,7 @@ export class MetadataInfoComponent {
|
|
|
53
80
|
return !this.incomplete || propName in this.metadata
|
|
54
81
|
}
|
|
55
82
|
|
|
56
|
-
onKeywordClick(keyword:
|
|
83
|
+
onKeywordClick(keyword: Keyword) {
|
|
57
84
|
this.keyword.emit(keyword)
|
|
58
85
|
}
|
|
59
|
-
|
|
60
|
-
copyText() {
|
|
61
|
-
navigator.clipboard.writeText(this.metadata.uniqueIdentifier)
|
|
62
|
-
;(event.target as HTMLElement).blur()
|
|
63
|
-
}
|
|
64
86
|
}
|