geonetwork-ui 2.2.0-dev.95b40cd8 → 2.2.0-dev.9f0a89f5
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 +8 -8
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.mjs +2 -2
- 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 +7 -9
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +30 -8
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +31 -14
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.mjs +3 -3
- 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 +7 -7
- package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +2 -2
- package/esm2022/libs/ui/elements/src/lib/thumbnail/thumbnail.component.mjs +3 -3
- 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 +1 -1
- package/esm2022/translations/en.json +1 -1
- package/esm2022/translations/es.json +1 -1
- package/esm2022/translations/fr.json +1 -1
- package/esm2022/translations/it.json +1 -1
- package/esm2022/translations/nl.json +1 -1
- package/esm2022/translations/pt.json +1 -1
- package/fesm2022/geonetwork-ui.mjs +152 -77
- 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.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 +2 -3
- 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 +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +13 -2
- package/libs/common/domain/src/lib/model/record/metadata.model.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 +3 -3
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.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 +55 -2
- package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +50 -6
- package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +203 -20
- 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 +11 -8
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.ts +1 -1
- 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 +5 -9
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +53 -19
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +78 -36
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +16 -3
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +44 -8
- package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.html +3 -4
- 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.ts +1 -0
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +6 -6
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +6 -3
- package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.ts +1 -1
- package/src/libs/ui/elements/src/lib/thumbnail/thumbnail.component.html +2 -2
- 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 +1 -1
- package/translations/en.json +1 -1
- package/translations/es.json +1 -1
- package/translations/fr.json +1 -1
- package/translations/it.json +1 -1
- package/translations/nl.json +1 -1
- package/translations/pt.json +1 -1
- package/translations/sk.json +1 -1
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
DatasetRecord,
|
|
6
6
|
DatasetServiceDistribution,
|
|
7
7
|
Individual,
|
|
8
|
+
Keyword,
|
|
9
|
+
KeywordThesaurus,
|
|
8
10
|
RecordStatus,
|
|
9
11
|
Role,
|
|
10
12
|
ServiceEndpoint,
|
|
@@ -25,6 +27,7 @@ import {
|
|
|
25
27
|
findNestedElement,
|
|
26
28
|
findNestedElements,
|
|
27
29
|
readAttribute,
|
|
30
|
+
readText,
|
|
28
31
|
removeAllChildren,
|
|
29
32
|
removeChildren,
|
|
30
33
|
removeChildrenByName,
|
|
@@ -326,47 +329,78 @@ function appendCitationDate(date, type: 'revision' | 'creation') {
|
|
|
326
329
|
)
|
|
327
330
|
}
|
|
328
331
|
|
|
329
|
-
function removeKeywords(
|
|
330
|
-
return removeChildren(
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
332
|
+
function removeKeywords() {
|
|
333
|
+
return removeChildren(pipe(findNestedElements('gmd:descriptiveKeywords')))
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// returns a <gmd:thesaurusName> element
|
|
337
|
+
function createThesaurus(thesaurus: KeywordThesaurus) {
|
|
338
|
+
return pipe(
|
|
339
|
+
createElement('gmd:thesaurusName'),
|
|
340
|
+
createChild('gmd:CI_Citation'),
|
|
341
|
+
appendChildren(
|
|
342
|
+
pipe(
|
|
343
|
+
createElement('gmd:title'),
|
|
344
|
+
writeCharacterString(thesaurus.name || thesaurus.id)
|
|
345
|
+
),
|
|
346
|
+
pipe(
|
|
347
|
+
createElement('gmd:identifier'),
|
|
348
|
+
createChild('gmd:MD_Identifier'),
|
|
349
|
+
appendChildren(
|
|
350
|
+
pipe(
|
|
351
|
+
createElement('gmd:code'),
|
|
352
|
+
thesaurus.url
|
|
353
|
+
? writeAnchor(thesaurus.url, thesaurus.id)
|
|
354
|
+
: writeCharacterString(thesaurus.id)
|
|
355
|
+
)
|
|
343
356
|
)
|
|
344
357
|
)
|
|
345
358
|
)
|
|
346
359
|
)
|
|
347
360
|
}
|
|
348
361
|
|
|
349
|
-
function appendKeywords(keywords:
|
|
362
|
+
function appendKeywords(keywords: Keyword[]) {
|
|
363
|
+
const keywordsByThesaurus: Keyword[][] = keywords.reduce((acc, keyword) => {
|
|
364
|
+
const thesaurusId = keyword.thesaurus?.id
|
|
365
|
+
const type = keyword.type
|
|
366
|
+
let existingGroup = acc.find((group) =>
|
|
367
|
+
group[0].thesaurus
|
|
368
|
+
? group[0].thesaurus.id === thesaurusId
|
|
369
|
+
: group[0].type === type
|
|
370
|
+
)
|
|
371
|
+
if (!existingGroup) {
|
|
372
|
+
existingGroup = []
|
|
373
|
+
acc.push(existingGroup)
|
|
374
|
+
}
|
|
375
|
+
existingGroup.push(keyword)
|
|
376
|
+
return acc
|
|
377
|
+
}, [])
|
|
350
378
|
return appendChildren(
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
379
|
+
...keywordsByThesaurus.map((keywords) =>
|
|
380
|
+
pipe(
|
|
381
|
+
createElement('gmd:descriptiveKeywords'),
|
|
382
|
+
createChild('gmd:MD_Keywords'),
|
|
383
|
+
appendChildren(
|
|
384
|
+
pipe(
|
|
385
|
+
createElement('gmd:type'),
|
|
386
|
+
createChild('gmd:MD_KeywordTypeCode'),
|
|
387
|
+
addAttribute(
|
|
388
|
+
'codeList',
|
|
389
|
+
'http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_KeywordTypeCode'
|
|
390
|
+
),
|
|
391
|
+
addAttribute('codeListValue', keywords[0].type)
|
|
392
|
+
)
|
|
393
|
+
),
|
|
394
|
+
keywords[0].thesaurus
|
|
395
|
+
? appendChildren(createThesaurus(keywords[0].thesaurus))
|
|
396
|
+
: noop,
|
|
397
|
+
appendChildren(
|
|
398
|
+
...keywords.map((keyword) =>
|
|
356
399
|
pipe(
|
|
357
|
-
createElement('gmd:
|
|
358
|
-
|
|
359
|
-
addAttribute(
|
|
360
|
-
'codeList',
|
|
361
|
-
'http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_KeywordTypeCode'
|
|
362
|
-
),
|
|
363
|
-
addAttribute('codeListValue', type)
|
|
400
|
+
createElement('gmd:keyword'),
|
|
401
|
+
writeCharacterString(keyword.label)
|
|
364
402
|
)
|
|
365
403
|
)
|
|
366
|
-
: noop,
|
|
367
|
-
appendChildren(
|
|
368
|
-
...keywords.map((keyword) =>
|
|
369
|
-
pipe(createElement('gmd:keyword'), writeCharacterString(keyword))
|
|
370
404
|
)
|
|
371
405
|
)
|
|
372
406
|
)
|
|
@@ -740,16 +774,24 @@ export function writeContacts(record: CatalogRecord, rootEl: XmlElement) {
|
|
|
740
774
|
export function writeKeywords(record: CatalogRecord, rootEl: XmlElement) {
|
|
741
775
|
pipe(
|
|
742
776
|
findOrCreateIdentification(),
|
|
743
|
-
removeKeywords(
|
|
744
|
-
appendKeywords(record.keywords
|
|
777
|
+
removeKeywords(),
|
|
778
|
+
appendKeywords(record.keywords)
|
|
745
779
|
)(rootEl)
|
|
746
780
|
}
|
|
747
781
|
|
|
748
|
-
export function
|
|
782
|
+
export function writeTopics(record: CatalogRecord, rootEl: XmlElement) {
|
|
749
783
|
pipe(
|
|
750
784
|
findOrCreateIdentification(),
|
|
751
|
-
|
|
752
|
-
|
|
785
|
+
removeChildrenByName('gmd:topicCategory'),
|
|
786
|
+
appendChildren(
|
|
787
|
+
...record.topics.map((topic) =>
|
|
788
|
+
pipe(
|
|
789
|
+
createElement('gmd:topicCategory'),
|
|
790
|
+
createChild('gmd:MD_TopicCategoryCode'),
|
|
791
|
+
setTextContent(topic)
|
|
792
|
+
)
|
|
793
|
+
)
|
|
794
|
+
)
|
|
753
795
|
)(rootEl)
|
|
754
796
|
}
|
|
755
797
|
|
|
@@ -60,6 +60,20 @@ export type SpatialRepresentationType =
|
|
|
60
60
|
| 'table'
|
|
61
61
|
| 'point'
|
|
62
62
|
|
|
63
|
+
export type KeywordType = 'place' | 'temporal' | 'theme' | 'other'
|
|
64
|
+
|
|
65
|
+
export type KeywordThesaurus = {
|
|
66
|
+
id: string
|
|
67
|
+
name?: string
|
|
68
|
+
url?: URL
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface Keyword {
|
|
72
|
+
label: string
|
|
73
|
+
type: KeywordType
|
|
74
|
+
thesaurus?: KeywordThesaurus
|
|
75
|
+
}
|
|
76
|
+
|
|
63
77
|
export interface BaseRecord {
|
|
64
78
|
uniqueIdentifier: Uuid
|
|
65
79
|
ownerOrganization: Organization
|
|
@@ -69,8 +83,8 @@ export interface BaseRecord {
|
|
|
69
83
|
recordCreated?: Date
|
|
70
84
|
recordUpdated: Date
|
|
71
85
|
kind: RecordKind
|
|
72
|
-
|
|
73
|
-
keywords: Array<
|
|
86
|
+
topics: Array<string> // TODO: handle codelists
|
|
87
|
+
keywords: Array<Keyword>
|
|
74
88
|
licenses: Array<Constraint>
|
|
75
89
|
legalConstraints: Array<Constraint>
|
|
76
90
|
securityConstraints: Array<Constraint>
|
|
@@ -80,7 +94,6 @@ export interface BaseRecord {
|
|
|
80
94
|
landingPage?: URL
|
|
81
95
|
updateFrequency?: UpdateFrequency
|
|
82
96
|
|
|
83
|
-
// to add: iso19139.topicCategory
|
|
84
97
|
// to add: canonical url
|
|
85
98
|
// to add: source catalog (??)
|
|
86
99
|
// to add: is open data ?
|
|
@@ -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
|
{
|
|
@@ -170,13 +186,33 @@ Malgré l'attention portée à la création de ces données, il est rappelé que
|
|
|
170
186
|
},
|
|
171
187
|
],
|
|
172
188
|
keywords: [
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
+
},
|
|
178
214
|
],
|
|
179
|
-
|
|
215
|
+
topics: ['Usage des sols', "document d'urbanisme"],
|
|
180
216
|
spatialRepresentation: 'vector',
|
|
181
217
|
distributions: [
|
|
182
218
|
{
|
package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.html
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<div class="flex flex-row
|
|
1
|
+
<div class="flex flex-row items-center">
|
|
2
2
|
<span
|
|
3
|
-
class="align-text-top mr-1.5
|
|
3
|
+
class="align-text-top mr-1.5 favorite-count"
|
|
4
4
|
*ngIf="hasFavoriteCount && displayCount"
|
|
5
5
|
>{{ favoriteCount }}</span
|
|
6
6
|
>
|
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
[toggled]="isFavorite$ | async"
|
|
9
9
|
(newValue)="toggleFavorite($event)"
|
|
10
10
|
[disabled]="loading || (isAnonymous$ | async)"
|
|
11
|
-
class="mt-1"
|
|
12
11
|
></gn-ui-star-toggle>
|
|
13
12
|
<span
|
|
14
|
-
class="align-text-top ml-1.5 favorite-count
|
|
13
|
+
class="align-text-top ml-1.5 favorite-count"
|
|
15
14
|
*ngIf="!displayCount"
|
|
16
15
|
translate="datahub.record.addToFavorites"
|
|
17
16
|
></span>
|
|
@@ -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
|
+
}
|
|
@@ -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
|
|
@@ -136,13 +136,13 @@
|
|
|
136
136
|
</p>
|
|
137
137
|
</div>
|
|
138
138
|
</div>
|
|
139
|
-
<div *ngIf="metadata.
|
|
140
|
-
<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>
|
|
141
141
|
<div class="sm:pb-4 sm:pr-16">
|
|
142
142
|
<gn-ui-badge
|
|
143
|
-
class="inline-block mr-2 lowercase"
|
|
144
|
-
*ngFor="let
|
|
145
|
-
>{{
|
|
143
|
+
class="inline-block mr-2 mb-2 lowercase"
|
|
144
|
+
*ngFor="let topic of metadata.topics"
|
|
145
|
+
>{{ topic }}</gn-ui-badge
|
|
146
146
|
>
|
|
147
147
|
</div>
|
|
148
148
|
</div>
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
(click)="onKeywordClick(keyword)"
|
|
155
155
|
[clickable]="true"
|
|
156
156
|
*ngFor="let keyword of metadata.keywords"
|
|
157
|
-
>{{ keyword }}</gn-ui-badge
|
|
157
|
+
>{{ keyword.label }}</gn-ui-badge
|
|
158
158
|
>
|
|
159
159
|
</div>
|
|
160
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,7 +19,7 @@ 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() {
|
|
@@ -77,7 +80,7 @@ export class MetadataInfoComponent {
|
|
|
77
80
|
return !this.incomplete || propName in this.metadata
|
|
78
81
|
}
|
|
79
82
|
|
|
80
|
-
onKeywordClick(keyword:
|
|
83
|
+
onKeywordClick(keyword: Keyword) {
|
|
81
84
|
this.keyword.emit(keyword)
|
|
82
85
|
}
|
|
83
86
|
}
|
|
@@ -55,7 +55,7 @@ export class MetadataQualityComponent implements OnChanges {
|
|
|
55
55
|
this.items = []
|
|
56
56
|
this.add('title', !!this.metadata?.title)
|
|
57
57
|
this.add('description', !!this.metadata?.abstract)
|
|
58
|
-
this.add('topic', this.metadata?.
|
|
58
|
+
this.add('topic', this.metadata?.topics?.length > 0)
|
|
59
59
|
this.add('keywords', this.metadata?.keywords?.length > 0)
|
|
60
60
|
this.add('legalConstraints', this.metadata?.legalConstraints?.length > 0)
|
|
61
61
|
this.add('organisation', !!contact?.organization)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<div
|
|
2
2
|
#containerElement
|
|
3
|
-
class="h-full w-full relative shrink-0 overflow-hidden flex items-center"
|
|
3
|
+
class="h-full w-full relative shrink-0 overflow-hidden flex items-center justify-center"
|
|
4
4
|
[ngClass]="isPlaceholder ? 'bg-gray-100' : 'bg-white'"
|
|
5
5
|
[attr.data-cy-is-placeholder]="isPlaceholder.toString()"
|
|
6
6
|
>
|
|
7
7
|
<img
|
|
8
8
|
#imageElement
|
|
9
9
|
class="relative w-full object-center"
|
|
10
|
-
[ngClass]="imgFit === 'contain' ? 'h-4/5' : 'h-full'"
|
|
10
|
+
[ngClass]="imgFit === 'contain' ? 'h-4/5 w-4/5' : 'h-full'"
|
|
11
11
|
[ngStyle]="{ objectFit: imgFit }"
|
|
12
12
|
alt="thumbnail"
|
|
13
13
|
loading="lazy"
|
|
@@ -45,6 +45,7 @@ import { ImageOverlayPreviewComponent } from './image-overlay-preview/image-over
|
|
|
45
45
|
UiInputsModule,
|
|
46
46
|
FormsModule,
|
|
47
47
|
NgOptimizedImage,
|
|
48
|
+
MarkdownParserComponent,
|
|
48
49
|
],
|
|
49
50
|
declarations: [
|
|
50
51
|
MetadataInfoComponent,
|
|
@@ -67,7 +68,6 @@ import { ImageOverlayPreviewComponent } from './image-overlay-preview/image-over
|
|
|
67
68
|
PaginationButtonsComponent,
|
|
68
69
|
MaxLinesComponent,
|
|
69
70
|
RecordApiFormComponent,
|
|
70
|
-
MarkdownParserComponent,
|
|
71
71
|
ImageOverlayPreviewComponent,
|
|
72
72
|
],
|
|
73
73
|
exports: [
|
|
@@ -12,6 +12,7 @@ import { propagateToDocumentOnly } from '../../../../../../libs/util/shared/src'
|
|
|
12
12
|
templateUrl: './button.component.html',
|
|
13
13
|
styleUrls: ['./button.component.css'],
|
|
14
14
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
15
|
+
standalone: true,
|
|
15
16
|
})
|
|
16
17
|
export class ButtonComponent {
|
|
17
18
|
private btnClass: string
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<button
|
|
2
|
-
class="group flex items-center justify-center gap-1 backdrop-blur p-1 bg-primary-opacity-30
|
|
2
|
+
class="group flex items-center justify-center gap-1 backdrop-blur p-1 bg-primary-opacity-30 rounded content-center"
|
|
3
3
|
>
|
|
4
4
|
<mat-icon class="material-symbols-outlined align-middle w-[18px]">{{
|
|
5
5
|
icon
|
|
@@ -12,6 +12,7 @@ import { distinctUntilChanged } from 'rxjs/operators'
|
|
|
12
12
|
selector: 'gn-ui-text-area',
|
|
13
13
|
templateUrl: './text-area.component.html',
|
|
14
14
|
styleUrls: ['./text-area.component.css'],
|
|
15
|
+
standalone: true,
|
|
15
16
|
})
|
|
16
17
|
export class TextAreaComponent implements AfterViewInit {
|
|
17
18
|
@Input() value = ''
|
|
@@ -47,10 +47,8 @@ import { EditableLabelDirective } from './editable-label/editable-label.directiv
|
|
|
47
47
|
declarations: [
|
|
48
48
|
DropdownSelectorComponent,
|
|
49
49
|
AutocompleteComponent,
|
|
50
|
-
ButtonComponent,
|
|
51
50
|
TextInputComponent,
|
|
52
51
|
DragAndDropFileInputComponent,
|
|
53
|
-
TextAreaComponent,
|
|
54
52
|
ChipsInputComponent,
|
|
55
53
|
NavigationButtonComponent,
|
|
56
54
|
StarToggleComponent,
|
|
@@ -89,6 +87,8 @@ import { EditableLabelDirective } from './editable-label/editable-label.directiv
|
|
|
89
87
|
MatDatepickerModule,
|
|
90
88
|
MatNativeDateModule,
|
|
91
89
|
EditableLabelDirective,
|
|
90
|
+
TextAreaComponent,
|
|
91
|
+
ButtonComponent,
|
|
92
92
|
],
|
|
93
93
|
exports: [
|
|
94
94
|
DropdownSelectorComponent,
|
package/tailwind.base.config.js
CHANGED
|
@@ -52,6 +52,9 @@ module.exports = {
|
|
|
52
52
|
'var(--font-family-title, ui-serif, Georgia, Cambria, "Times New Roman", Times, serif)', // alias for serif
|
|
53
53
|
mono: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
|
|
54
54
|
},
|
|
55
|
+
fontWeight: {
|
|
56
|
+
title: '600',
|
|
57
|
+
},
|
|
55
58
|
fontSize: {
|
|
56
59
|
13: '13px',
|
|
57
60
|
21: [
|
package/tailwind.base.css
CHANGED
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
|
|
32
32
|
.btn-outline {
|
|
33
33
|
@apply btn text-main
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
bg-transparent hover:text-primary-darker focus:text-primary-darker active:text-primary-black
|
|
35
|
+
border border-gray-300 hover:border-primary-lighter focus:border-primary-lighter focus:ring-4 focus:ring-primary-lightest active:border-primary-darker;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.btn-light {
|
package/translations/de.json
CHANGED
|
@@ -255,8 +255,8 @@
|
|
|
255
255
|
"record.metadata.related": "Ähnliche Datensätze",
|
|
256
256
|
"record.metadata.sheet": "Weitere Informationen verfügbar unter:",
|
|
257
257
|
"record.metadata.status": "",
|
|
258
|
-
"record.metadata.themes": "Kategorien",
|
|
259
258
|
"record.metadata.title": "Titel",
|
|
259
|
+
"record.metadata.topics": "Kategorien",
|
|
260
260
|
"record.metadata.type": "Geographischer Datensatz",
|
|
261
261
|
"record.metadata.uniqueId": "Eindeutige Kennung",
|
|
262
262
|
"record.metadata.updateFrequency": "Aktualisierungsfrequenz der Daten",
|
package/translations/en.json
CHANGED
|
@@ -255,8 +255,8 @@
|
|
|
255
255
|
"record.metadata.related": "Related records",
|
|
256
256
|
"record.metadata.sheet": "Original metadata",
|
|
257
257
|
"record.metadata.status": "Status",
|
|
258
|
-
"record.metadata.themes": "Categories",
|
|
259
258
|
"record.metadata.title": "Title",
|
|
259
|
+
"record.metadata.topics": "Categories",
|
|
260
260
|
"record.metadata.type": "Geographical dataset",
|
|
261
261
|
"record.metadata.uniqueId": "Unique Identifier",
|
|
262
262
|
"record.metadata.updateFrequency": "Data Update Frequency",
|
package/translations/es.json
CHANGED
|
@@ -255,8 +255,8 @@
|
|
|
255
255
|
"record.metadata.related": "",
|
|
256
256
|
"record.metadata.sheet": "",
|
|
257
257
|
"record.metadata.status": "",
|
|
258
|
-
"record.metadata.themes": "",
|
|
259
258
|
"record.metadata.title": "",
|
|
259
|
+
"record.metadata.topics": "",
|
|
260
260
|
"record.metadata.type": "",
|
|
261
261
|
"record.metadata.uniqueId": "",
|
|
262
262
|
"record.metadata.updateFrequency": "",
|
package/translations/fr.json
CHANGED
|
@@ -255,8 +255,8 @@
|
|
|
255
255
|
"record.metadata.related": "Voir aussi",
|
|
256
256
|
"record.metadata.sheet": "Fiche de métadonnées d'origine",
|
|
257
257
|
"record.metadata.status": "",
|
|
258
|
-
"record.metadata.themes": "Catégories",
|
|
259
258
|
"record.metadata.title": "Titre",
|
|
259
|
+
"record.metadata.topics": "Catégories",
|
|
260
260
|
"record.metadata.type": "Donnée géographique",
|
|
261
261
|
"record.metadata.uniqueId": "Identificateur de ressource unique",
|
|
262
262
|
"record.metadata.updateFrequency": "Fréquence de mise à jour des données",
|
package/translations/it.json
CHANGED
|
@@ -255,8 +255,8 @@
|
|
|
255
255
|
"record.metadata.related": "Vedi anche",
|
|
256
256
|
"record.metadata.sheet": "Origine del metadata",
|
|
257
257
|
"record.metadata.status": "",
|
|
258
|
-
"record.metadata.themes": "Categorie",
|
|
259
258
|
"record.metadata.title": "Titolo",
|
|
259
|
+
"record.metadata.topics": "Categorie",
|
|
260
260
|
"record.metadata.type": "Dati geografici",
|
|
261
261
|
"record.metadata.uniqueId": "Identificatore unico di risorsa",
|
|
262
262
|
"record.metadata.updateFrequency": "Frequenza di aggiornamento dei dati",
|
package/translations/nl.json
CHANGED
|
@@ -255,8 +255,8 @@
|
|
|
255
255
|
"record.metadata.related": "",
|
|
256
256
|
"record.metadata.sheet": "",
|
|
257
257
|
"record.metadata.status": "",
|
|
258
|
-
"record.metadata.themes": "",
|
|
259
258
|
"record.metadata.title": "",
|
|
259
|
+
"record.metadata.topics": "",
|
|
260
260
|
"record.metadata.type": "",
|
|
261
261
|
"record.metadata.uniqueId": "",
|
|
262
262
|
"record.metadata.updateFrequency": "",
|