geonetwork-ui 2.4.0-dev.db93b4c4 → 2.4.0-dev.dd042cec
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/iso19139/iso19139.converter.mjs +5 -5
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +30 -2
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/utils/geometry.mjs +31 -0
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +23 -1
- package/esm2022/libs/api/metadata-converter/src/lib/xml-utils.mjs +10 -3
- package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +31 -3
- package/esm2022/libs/common/domain/src/lib/model/record/contact.model.mjs +28 -1
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
- package/esm2022/libs/data-access/gn4/src/openapi/api/records.api.service.mjs +2 -6
- package/esm2022/libs/feature/editor/src/lib/components/contact-card/contact-card.component.mjs +29 -0
- package/esm2022/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.mjs +131 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.mjs +170 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-open-data/form-field-open-data.component.mjs +47 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.mjs +21 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.mjs +7 -6
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +33 -9
- package/esm2022/libs/feature/editor/src/lib/components/record-form/record-form.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +30 -3
- package/esm2022/libs/feature/map/src/lib/utils/map-utils.service.mjs +10 -5
- package/esm2022/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.mjs +3 -3
- package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +46 -7
- package/esm2022/libs/feature/search/src/lib/state/search.facade.mjs +6 -2
- package/esm2022/libs/ui/elements/src/index.mjs +2 -1
- package/esm2022/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.mjs +27 -0
- package/esm2022/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.mjs +4 -3
- package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +2 -2
- package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +5 -11
- package/esm2022/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/sortable-list/sortable-list.component.mjs +7 -3
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +5 -2
- package/esm2022/libs/ui/elements/src/lib/user-preview/user-preview.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +19 -5
- package/esm2022/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.mjs +3 -3
- package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table.component.mjs +3 -3
- package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +67 -0
- package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +28 -8
- package/esm2022/libs/ui/widgets/src/index.mjs +2 -1
- package/esm2022/libs/ui/widgets/src/lib/popover/popover.component.mjs +68 -0
- package/esm2022/translations/de.json +44 -17
- package/esm2022/translations/en.json +37 -10
- package/esm2022/translations/es.json +36 -9
- package/esm2022/translations/fr.json +47 -20
- package/esm2022/translations/it.json +37 -10
- package/esm2022/translations/nl.json +36 -9
- package/esm2022/translations/pt.json +36 -9
- package/fesm2022/geonetwork-ui.mjs +1266 -279
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +8 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/utils/geometry.d.ts +5 -0
- package/libs/api/metadata-converter/src/lib/iso19139/utils/geometry.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +3 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/xml-utils.d.ts +1 -0
- package/libs/api/metadata-converter/src/lib/xml-utils.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +7 -1
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/contact.model.d.ts +1 -0
- package/libs/common/domain/src/lib/model/record/contact.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +2 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +17 -0
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
- package/libs/data-access/gn4/src/openapi/api/records.api.service.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/contact-card/contact-card.component.d.ts +12 -0
- package/libs/feature/editor/src/lib/components/contact-card/contact-card.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.d.ts +27 -0
- package/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.d.ts +47 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-open-data/form-field-open-data.component.d.ts +17 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-open-data/form-field-open-data.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts +11 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.d.ts +3 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +9 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/fields.config.d.ts +7 -0
- package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
- package/libs/feature/map/src/lib/utils/map-utils.service.d.ts.map +1 -1
- package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts +14 -4
- package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/state/search.facade.d.ts +1 -0
- package/libs/feature/search/src/lib/state/search.facade.d.ts.map +1 -1
- package/libs/ui/elements/src/index.d.ts +1 -0
- package/libs/ui/elements/src/index.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.d.ts +18 -0
- package/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.d.ts.map +1 -0
- package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +1 -1
- package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts +0 -3
- 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 +1 -1
- package/libs/ui/elements/src/lib/sortable-list/sortable-list.component.d.ts +4 -4
- package/libs/ui/elements/src/lib/sortable-list/sortable-list.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +7 -6
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts +9 -1
- package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts.map +1 -1
- package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts +20 -0
- package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts.map +1 -0
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +9 -3
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
- package/libs/ui/widgets/src/index.d.ts +1 -0
- package/libs/ui/widgets/src/index.d.ts.map +1 -1
- package/libs/ui/widgets/src/lib/popover/popover.component.d.ts +19 -0
- package/libs/ui/widgets/src/lib/popover/popover.component.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +5 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +37 -12
- package/src/libs/api/metadata-converter/src/lib/fixtures/metawal.records.ts +5 -1
- package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +4 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +72 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/utils/geometry.ts +39 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +70 -1
- package/src/libs/api/metadata-converter/src/lib/xml-utils.ts +13 -5
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +42 -2
- package/src/libs/common/domain/src/lib/model/record/contact.model.ts +28 -0
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +2 -1
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +22 -0
- package/src/libs/data-access/gn4/src/openapi/api/records.api.service.ts +1 -5
- package/src/libs/data-access/gn4/src/spec.yaml +0 -8
- package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.html +25 -0
- package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.ts +30 -0
- package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.html +2 -1
- package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.ts +110 -19
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.html +76 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.ts +271 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.html +1 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-open-data/form-field-open-data.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-open-data/form-field-open-data.component.html +6 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-open-data/form-field-open-data.component.ts +59 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.html +5 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.ts +22 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.ts +8 -7
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +18 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +30 -1
- package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.html +1 -1
- package/src/libs/feature/editor/src/lib/fields.config.ts +32 -2
- package/src/libs/feature/map/src/lib/utils/map-utils.service.ts +8 -4
- package/src/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.html +1 -1
- package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html +3 -1
- package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +57 -3
- package/src/libs/feature/search/src/lib/state/search.facade.ts +6 -0
- package/src/libs/ui/elements/src/index.ts +1 -0
- package/src/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.css +0 -0
- package/src/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.html +12 -0
- package/src/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.ts +37 -0
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.html +4 -1
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.css +2 -1
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +12 -8
- package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.html +14 -20
- package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.ts +0 -10
- package/src/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.html +1 -1
- package/src/libs/ui/elements/src/lib/sortable-list/sortable-list.component.html +3 -1
- package/src/libs/ui/elements/src/lib/sortable-list/sortable-list.component.ts +8 -4
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +2 -1
- package/src/libs/ui/elements/src/lib/user-preview/user-preview.component.html +1 -1
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +15 -3
- package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.html +1 -1
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.html +1 -0
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.css +0 -0
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.html +26 -0
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.ts +74 -0
- package/src/libs/ui/search/src/lib/results-table/results-table.component.html +15 -1
- package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +26 -12
- package/src/libs/ui/widgets/src/index.ts +1 -0
- package/src/libs/ui/widgets/src/lib/popover/popover.component.css +0 -0
- package/src/libs/ui/widgets/src/lib/popover/popover.component.html +3 -0
- package/src/libs/ui/widgets/src/lib/popover/popover.component.ts +85 -0
- package/tailwind.base.css +2 -1
- package/translations/de.json +44 -17
- package/translations/en.json +37 -10
- package/translations/es.json +36 -9
- package/translations/fr.json +47 -20
- package/translations/it.json +37 -10
- package/translations/nl.json +36 -9
- package/translations/pt.json +36 -9
- package/translations/sk.json +37 -10
package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.ts
CHANGED
|
@@ -2,12 +2,18 @@ import {
|
|
|
2
2
|
ChangeDetectionStrategy,
|
|
3
3
|
ChangeDetectorRef,
|
|
4
4
|
Component,
|
|
5
|
+
EventEmitter,
|
|
5
6
|
Input,
|
|
7
|
+
OnChanges,
|
|
6
8
|
OnInit,
|
|
9
|
+
Output,
|
|
10
|
+
SimpleChanges,
|
|
7
11
|
} from '@angular/core'
|
|
8
12
|
import { CommonModule } from '@angular/common'
|
|
9
13
|
import { RecordsApiService } from '../../../../../../../libs/data-access/gn4/src'
|
|
10
14
|
import { UiInputsModule } from '../../../../../../../libs/ui/inputs/src'
|
|
15
|
+
import { FormControl } from '@angular/forms'
|
|
16
|
+
import { GraphicOverview } from '../../../../../../../libs/common/domain/src/lib/model/record'
|
|
11
17
|
|
|
12
18
|
@Component({
|
|
13
19
|
selector: 'gn-ui-overview-upload',
|
|
@@ -17,9 +23,13 @@ import { UiInputsModule } from '../../../../../../../libs/ui/inputs/src'
|
|
|
17
23
|
styleUrls: ['./overview-upload.component.css'],
|
|
18
24
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
19
25
|
})
|
|
20
|
-
export class OverviewUploadComponent implements OnInit {
|
|
26
|
+
export class OverviewUploadComponent implements OnInit, OnChanges {
|
|
21
27
|
@Input() metadataUuid: string
|
|
28
|
+
@Input() formControl!: FormControl
|
|
29
|
+
@Output() overviewChange = new EventEmitter<GraphicOverview | null>()
|
|
30
|
+
@Output() altTextChange: EventEmitter<string> = new EventEmitter()
|
|
22
31
|
|
|
32
|
+
resourceAltText: string
|
|
23
33
|
resourceFileName: string
|
|
24
34
|
resourceUrl: string
|
|
25
35
|
|
|
@@ -29,42 +39,123 @@ export class OverviewUploadComponent implements OnInit {
|
|
|
29
39
|
) {}
|
|
30
40
|
|
|
31
41
|
ngOnInit(): void {
|
|
32
|
-
this.recordsApiService
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
this.recordsApiService.getAllResources(this.metadataUuid).subscribe({
|
|
43
|
+
next: (resources) => {
|
|
44
|
+
if (resources && resources.length > 0) {
|
|
45
|
+
this.resourceUrl = resources[0].url
|
|
46
|
+
this.resourceFileName = resources[0].filename
|
|
47
|
+
if (!this.resourceAltText) {
|
|
48
|
+
this.resourceAltText = this.resourceFileName
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
this.resourceUrl = ''
|
|
52
|
+
this.resourceAltText = ''
|
|
53
|
+
this.resourceFileName = ''
|
|
54
|
+
}
|
|
55
|
+
|
|
37
56
|
this.cd.markForCheck()
|
|
38
|
-
}
|
|
57
|
+
},
|
|
58
|
+
error: this.errorHandle,
|
|
59
|
+
})
|
|
39
60
|
}
|
|
40
61
|
|
|
41
62
|
handleFileChange(file: File) {
|
|
42
63
|
this.recordsApiService
|
|
43
64
|
.putResource(this.metadataUuid, file, 'public')
|
|
44
|
-
.subscribe(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
65
|
+
.subscribe({
|
|
66
|
+
next: (resource) => {
|
|
67
|
+
this.resourceUrl = resource.url
|
|
68
|
+
this.resourceAltText = resource.filename
|
|
69
|
+
|
|
70
|
+
this.overviewChange.emit({
|
|
71
|
+
url: new URL(resource.url),
|
|
72
|
+
description: resource.filename,
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
this.cd.markForCheck()
|
|
76
|
+
},
|
|
77
|
+
error: this.errorHandle,
|
|
48
78
|
})
|
|
49
79
|
}
|
|
50
80
|
|
|
51
81
|
handleUrlChange(url: string) {
|
|
52
82
|
this.recordsApiService
|
|
53
83
|
.putResourceFromURL(this.metadataUuid, url, 'public')
|
|
54
|
-
.subscribe(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
84
|
+
.subscribe({
|
|
85
|
+
next: (resource) => {
|
|
86
|
+
this.resourceUrl = resource.url
|
|
87
|
+
this.resourceAltText = resource.filename
|
|
88
|
+
|
|
89
|
+
this.overviewChange.emit({
|
|
90
|
+
url: new URL(resource.url),
|
|
91
|
+
description: resource.filename,
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
this.cd.markForCheck()
|
|
95
|
+
},
|
|
96
|
+
error: this.errorHandle,
|
|
58
97
|
})
|
|
59
98
|
}
|
|
60
99
|
|
|
100
|
+
handleAltTextChange(newAltText: string) {
|
|
101
|
+
this.resourceAltText = newAltText
|
|
102
|
+
|
|
103
|
+
this.overviewChange.emit({
|
|
104
|
+
url: new URL(this.resourceUrl),
|
|
105
|
+
description: this.resourceAltText,
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
this.cd.markForCheck()
|
|
109
|
+
}
|
|
110
|
+
|
|
61
111
|
handleDelete() {
|
|
112
|
+
//this.formControl.markAsDirty()
|
|
62
113
|
this.recordsApiService
|
|
63
114
|
.delResource(this.metadataUuid, this.resourceFileName)
|
|
64
|
-
.subscribe(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
115
|
+
.subscribe({
|
|
116
|
+
next: () => {
|
|
117
|
+
this.resourceAltText = ''
|
|
118
|
+
this.resourceUrl = ''
|
|
119
|
+
|
|
120
|
+
this.overviewChange.emit(null)
|
|
121
|
+
|
|
122
|
+
this.cd.markForCheck()
|
|
123
|
+
},
|
|
124
|
+
error: this.errorHandle,
|
|
68
125
|
})
|
|
69
126
|
}
|
|
127
|
+
|
|
128
|
+
private errorHandle = (error: never) => {
|
|
129
|
+
console.error(error)
|
|
130
|
+
|
|
131
|
+
this.resourceUrl = ''
|
|
132
|
+
this.resourceAltText = ''
|
|
133
|
+
this.resourceFileName = ''
|
|
134
|
+
|
|
135
|
+
this.overviewChange.emit(null)
|
|
136
|
+
|
|
137
|
+
this.cd.markForCheck()
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
141
|
+
const overviewChanges = changes['formControl']
|
|
142
|
+
if (
|
|
143
|
+
overviewChanges &&
|
|
144
|
+
overviewChanges.currentValue !== overviewChanges.previousValue
|
|
145
|
+
) {
|
|
146
|
+
let overview: GraphicOverview
|
|
147
|
+
if (
|
|
148
|
+
overviewChanges.currentValue.value &&
|
|
149
|
+
overviewChanges.currentValue.value.length > 0
|
|
150
|
+
) {
|
|
151
|
+
overview = overviewChanges.currentValue.value[0] as GraphicOverview
|
|
152
|
+
} else {
|
|
153
|
+
return
|
|
154
|
+
}
|
|
155
|
+
if (overview.description) {
|
|
156
|
+
this.resourceAltText = overview.description
|
|
157
|
+
this.cd.markForCheck()
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
70
161
|
}
|
|
File without changes
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<div class="flex flex-col gap-3">
|
|
2
|
+
<div class="flex flex-row flex-wrap gap-2" data-test="rolesToPick">
|
|
3
|
+
<ng-container *ngFor="let role of rolesToPick">
|
|
4
|
+
<gn-ui-button
|
|
5
|
+
extraClass="px-2 py-1.5"
|
|
6
|
+
(buttonClick)="addRoleToDisplay(role)"
|
|
7
|
+
>
|
|
8
|
+
<div class="flex flex-row gap-1 items-center">
|
|
9
|
+
<span class="text-primary text-[20px] leading-[0] font-bold pb-[5px]"
|
|
10
|
+
>₊</span
|
|
11
|
+
>
|
|
12
|
+
<span class="font-bold" translate>{{ roleToLabel(role) }}</span>
|
|
13
|
+
</div>
|
|
14
|
+
</gn-ui-button>
|
|
15
|
+
</ng-container>
|
|
16
|
+
</div>
|
|
17
|
+
<div
|
|
18
|
+
class="mt-8"
|
|
19
|
+
*ngIf="
|
|
20
|
+
roleSectionsToDisplay && roleSectionsToDisplay.length > 0;
|
|
21
|
+
else noContact
|
|
22
|
+
"
|
|
23
|
+
data-test="displayedRoles"
|
|
24
|
+
>
|
|
25
|
+
<div
|
|
26
|
+
*ngFor="
|
|
27
|
+
let role of roleSectionsToDisplay;
|
|
28
|
+
let index = index;
|
|
29
|
+
let isLast = last
|
|
30
|
+
"
|
|
31
|
+
class="flex flex-col gap-4"
|
|
32
|
+
>
|
|
33
|
+
<div class="flex flex-row justify-between">
|
|
34
|
+
<span class="font-bold text-base" translate>{{
|
|
35
|
+
roleToLabel(role)
|
|
36
|
+
}}</span>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<gn-ui-autocomplete
|
|
40
|
+
[placeholder]="'Choose a contact'"
|
|
41
|
+
[action]="autoCompleteAction"
|
|
42
|
+
(itemSelected)="addContact($event, role)"
|
|
43
|
+
[displayWithFn]="displayWithFn"
|
|
44
|
+
[minCharacterCount]="1"
|
|
45
|
+
[clearOnSelection]="true"
|
|
46
|
+
>
|
|
47
|
+
</gn-ui-autocomplete>
|
|
48
|
+
|
|
49
|
+
<ng-container *ngIf="contactsForRessourceByRole.get(role) as contacts">
|
|
50
|
+
<ng-container *ngIf="contacts.length > 1">
|
|
51
|
+
<gn-ui-sortable-list
|
|
52
|
+
[elements]="contactsAsDynElemByRole.get(role)"
|
|
53
|
+
(elementsChange)="handleContactsChanged($event)"
|
|
54
|
+
></gn-ui-sortable-list>
|
|
55
|
+
</ng-container>
|
|
56
|
+
<ng-container *ngIf="contacts.length === 1">
|
|
57
|
+
<ng-container *ngFor="let contact of contacts">
|
|
58
|
+
<gn-ui-contact-card
|
|
59
|
+
[contact]="contact"
|
|
60
|
+
(contactRemoved)="removeContact(index)"
|
|
61
|
+
></gn-ui-contact-card> </ng-container
|
|
62
|
+
></ng-container>
|
|
63
|
+
</ng-container>
|
|
64
|
+
|
|
65
|
+
<hr class="border-t-[#D6D3D1] mt-4 mb-6" *ngIf="!isLast" />
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<ng-template #noContact>
|
|
69
|
+
<div
|
|
70
|
+
class="p-4 border border-primary bg-primary-lightest rounded-lg"
|
|
71
|
+
translate
|
|
72
|
+
>
|
|
73
|
+
editor.record.form.field.contactsForResource.noContact
|
|
74
|
+
</div>
|
|
75
|
+
</ng-template>
|
|
76
|
+
</div>
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common'
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
ChangeDetectorRef,
|
|
5
|
+
Component,
|
|
6
|
+
Input,
|
|
7
|
+
OnDestroy,
|
|
8
|
+
OnInit,
|
|
9
|
+
} from '@angular/core'
|
|
10
|
+
import { FormControl } from '@angular/forms'
|
|
11
|
+
import {
|
|
12
|
+
AutocompleteComponent,
|
|
13
|
+
DropdownSelectorComponent,
|
|
14
|
+
UiInputsModule,
|
|
15
|
+
} from '../../../../../../../../../libs/ui/inputs/src'
|
|
16
|
+
import { UiWidgetsModule } from '../../../../../../../../../libs/ui/widgets/src'
|
|
17
|
+
import {
|
|
18
|
+
Individual,
|
|
19
|
+
Organization,
|
|
20
|
+
Role,
|
|
21
|
+
RoleLabels,
|
|
22
|
+
} from '../../../../../../../../../libs/common/domain/src/lib/model/record'
|
|
23
|
+
import { TranslateModule } from '@ngx-translate/core'
|
|
24
|
+
import {
|
|
25
|
+
debounceTime,
|
|
26
|
+
distinctUntilChanged,
|
|
27
|
+
firstValueFrom,
|
|
28
|
+
Observable,
|
|
29
|
+
Subscription,
|
|
30
|
+
switchMap,
|
|
31
|
+
} from 'rxjs'
|
|
32
|
+
import { UserModel } from '../../../../../../../../../libs/common/domain/src/lib/model/user'
|
|
33
|
+
import { PlatformServiceInterface } from '../../../../../../../../../libs/common/domain/src/lib/platform.service.interface'
|
|
34
|
+
import { OrganizationsServiceInterface } from '../../../../../../../../../libs/common/domain/src/lib/organizations.service.interface'
|
|
35
|
+
import { ContactCardComponent } from '../../../contact-card/contact-card.component'
|
|
36
|
+
import {
|
|
37
|
+
DynamicElement,
|
|
38
|
+
SortableListComponent,
|
|
39
|
+
} from '../../../../../../../../../libs/ui/elements/src'
|
|
40
|
+
import { createFuzzyFilter } from '../../../../../../../../../libs/util/shared/src'
|
|
41
|
+
import { map } from 'rxjs/operators'
|
|
42
|
+
|
|
43
|
+
@Component({
|
|
44
|
+
selector: 'gn-ui-form-field-contacts-for-resource',
|
|
45
|
+
templateUrl: './form-field-contacts-for-resource.component.html',
|
|
46
|
+
styleUrls: ['./form-field-contacts-for-resource.component.css'],
|
|
47
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
48
|
+
standalone: true,
|
|
49
|
+
imports: [
|
|
50
|
+
DropdownSelectorComponent,
|
|
51
|
+
UiInputsModule,
|
|
52
|
+
CommonModule,
|
|
53
|
+
UiWidgetsModule,
|
|
54
|
+
AutocompleteComponent,
|
|
55
|
+
TranslateModule,
|
|
56
|
+
ContactCardComponent,
|
|
57
|
+
SortableListComponent,
|
|
58
|
+
],
|
|
59
|
+
})
|
|
60
|
+
export class FormFieldContactsForResourceComponent
|
|
61
|
+
implements OnInit, OnDestroy
|
|
62
|
+
{
|
|
63
|
+
@Input() control: FormControl<Individual[]>
|
|
64
|
+
|
|
65
|
+
subscription: Subscription = new Subscription()
|
|
66
|
+
|
|
67
|
+
allUsers$: Observable<UserModel[]>
|
|
68
|
+
|
|
69
|
+
contactsForRessourceByRole: Map<Role, Individual[]> = new Map()
|
|
70
|
+
|
|
71
|
+
contactsAsDynElemByRole: Map<Role, DynamicElement[]> = new Map()
|
|
72
|
+
|
|
73
|
+
rolesToPick: Role[] = [
|
|
74
|
+
'resource_provider',
|
|
75
|
+
'custodian',
|
|
76
|
+
'owner',
|
|
77
|
+
'point_of_contact',
|
|
78
|
+
'author',
|
|
79
|
+
]
|
|
80
|
+
|
|
81
|
+
roleSectionsToDisplay: Role[] = []
|
|
82
|
+
|
|
83
|
+
allOrganizations: Map<string, Organization> = new Map()
|
|
84
|
+
|
|
85
|
+
constructor(
|
|
86
|
+
private platformServiceInterface: PlatformServiceInterface,
|
|
87
|
+
private organizationsServiceInterface: OrganizationsServiceInterface,
|
|
88
|
+
private changeDetectorRef: ChangeDetectorRef
|
|
89
|
+
) {
|
|
90
|
+
this.allUsers$ = this.platformServiceInterface.getUsers()
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async ngOnInit(): Promise<void> {
|
|
94
|
+
this.allOrganizations = new Map<string, Organization>(
|
|
95
|
+
(
|
|
96
|
+
await firstValueFrom(this.organizationsServiceInterface.organisations$)
|
|
97
|
+
).map((organization) => [organization.name, organization])
|
|
98
|
+
)
|
|
99
|
+
this.updateContactsForRessource()
|
|
100
|
+
this.manageRoleSectionsToDisplay(this.control.value)
|
|
101
|
+
this.filterRolesToPick()
|
|
102
|
+
|
|
103
|
+
this.changeDetectorRef.markForCheck()
|
|
104
|
+
|
|
105
|
+
this.subscription.add(
|
|
106
|
+
this.control.valueChanges.subscribe((contactsForResource) => {
|
|
107
|
+
this.updateContactsForRessource()
|
|
108
|
+
this.manageRoleSectionsToDisplay(contactsForResource)
|
|
109
|
+
this.filterRolesToPick()
|
|
110
|
+
|
|
111
|
+
this.changeDetectorRef.markForCheck()
|
|
112
|
+
})
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
addRoleToDisplay(roleToAdd: string) {
|
|
117
|
+
this.roleSectionsToDisplay.push(roleToAdd)
|
|
118
|
+
this.filterRolesToPick()
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
filterRolesToPick() {
|
|
122
|
+
this.rolesToPick = this.rolesToPick.filter(
|
|
123
|
+
(role) => !this.roleSectionsToDisplay.includes(role)
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
updateContactsForRessource() {
|
|
128
|
+
this.contactsForRessourceByRole = this.control.value.reduce(
|
|
129
|
+
(acc, contact) => {
|
|
130
|
+
const completeOrganization = this.allOrganizations.get(
|
|
131
|
+
contact.organization.name
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
const updatedContact = {
|
|
135
|
+
...contact,
|
|
136
|
+
organization:
|
|
137
|
+
completeOrganization ??
|
|
138
|
+
({ name: contact.organization.name } as Organization),
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (!acc.has(contact.role)) {
|
|
142
|
+
acc.set(contact.role, [])
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
acc.get(contact.role).push(updatedContact)
|
|
146
|
+
|
|
147
|
+
return acc
|
|
148
|
+
},
|
|
149
|
+
new Map<Role, Individual[]>()
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
this.contactsAsDynElemByRole = this.control.value.reduce((acc, contact) => {
|
|
153
|
+
const completeOrganization = this.allOrganizations.get(
|
|
154
|
+
contact.organization.name
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
const updatedContact = {
|
|
158
|
+
...contact,
|
|
159
|
+
organization:
|
|
160
|
+
completeOrganization ??
|
|
161
|
+
({ name: contact.organization.name } as Organization),
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const contactAsDynElem = {
|
|
165
|
+
component: ContactCardComponent,
|
|
166
|
+
inputs: {
|
|
167
|
+
contact: updatedContact,
|
|
168
|
+
removable: false,
|
|
169
|
+
},
|
|
170
|
+
} as DynamicElement
|
|
171
|
+
|
|
172
|
+
if (!acc.has(contact.role)) {
|
|
173
|
+
acc.set(contact.role, [])
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
acc.get(contact.role).push(contactAsDynElem)
|
|
177
|
+
|
|
178
|
+
return acc
|
|
179
|
+
}, new Map<Role, DynamicElement[]>())
|
|
180
|
+
|
|
181
|
+
this.changeDetectorRef.markForCheck()
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
manageRoleSectionsToDisplay(contactsForResource: Individual[]) {
|
|
185
|
+
const roles = contactsForResource.map(
|
|
186
|
+
(contact: Individual) => contact.role
|
|
187
|
+
) as Role[]
|
|
188
|
+
|
|
189
|
+
roles.forEach((role: Role) => {
|
|
190
|
+
if (!this.roleSectionsToDisplay.includes(role)) {
|
|
191
|
+
this.roleSectionsToDisplay.push(role)
|
|
192
|
+
}
|
|
193
|
+
})
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
removeContact(index: number) {
|
|
197
|
+
const newContactsforRessource = this.control.value.filter(
|
|
198
|
+
(_, i) => i !== index
|
|
199
|
+
)
|
|
200
|
+
this.control.setValue(newContactsforRessource)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
handleContactsChanged(event: DynamicElement[]) {
|
|
204
|
+
const newContactsOrdered = event.map(
|
|
205
|
+
(contactAsDynElem) => contactAsDynElem.inputs['contact']
|
|
206
|
+
) as Individual[]
|
|
207
|
+
|
|
208
|
+
const role = newContactsOrdered[0].role
|
|
209
|
+
|
|
210
|
+
this.contactsForRessourceByRole.set(role, newContactsOrdered)
|
|
211
|
+
|
|
212
|
+
const newControlValue = Array.from(
|
|
213
|
+
this.contactsForRessourceByRole.values()
|
|
214
|
+
).flat()
|
|
215
|
+
|
|
216
|
+
this.control.setValue(newControlValue)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
protected roleToLabel(role: string): string {
|
|
220
|
+
return RoleLabels.get(role)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* gn-ui-autocomplete
|
|
225
|
+
*/
|
|
226
|
+
displayWithFn: (user: UserModel) => string = (user) =>
|
|
227
|
+
`${user.name} ${user.surname} ${
|
|
228
|
+
user.organisation ? `(${user.organisation})` : ''
|
|
229
|
+
}`
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* gn-ui-autocomplete
|
|
233
|
+
*/
|
|
234
|
+
autoCompleteAction = (query: string) => {
|
|
235
|
+
const fuzzyFilter = createFuzzyFilter(query)
|
|
236
|
+
return this.allUsers$.pipe(
|
|
237
|
+
switchMap((users) => [
|
|
238
|
+
users.filter((user) => fuzzyFilter(user.username)),
|
|
239
|
+
]),
|
|
240
|
+
map((results) => results.slice(0, 10)),
|
|
241
|
+
debounceTime(300),
|
|
242
|
+
distinctUntilChanged()
|
|
243
|
+
)
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* gn-ui-autocomplete
|
|
248
|
+
*/
|
|
249
|
+
addContact(contact: UserModel, role: string) {
|
|
250
|
+
const newContactsForRessource = {
|
|
251
|
+
firstName: contact.name ?? '',
|
|
252
|
+
lastName: contact.surname ?? '',
|
|
253
|
+
organization:
|
|
254
|
+
this.allOrganizations.get(contact.organisation) ??
|
|
255
|
+
({ name: contact.organisation } as Organization),
|
|
256
|
+
email: contact.email ?? '',
|
|
257
|
+
role,
|
|
258
|
+
address: '',
|
|
259
|
+
phone: '',
|
|
260
|
+
position: '',
|
|
261
|
+
} as Individual
|
|
262
|
+
|
|
263
|
+
const newControlValue = [...this.control.value, newContactsForRessource]
|
|
264
|
+
|
|
265
|
+
this.control.setValue(newControlValue)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
ngOnDestroy(): void {
|
|
269
|
+
this.subscription.unsubscribe()
|
|
270
|
+
}
|
|
271
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
EventEmitter,
|
|
5
|
+
Input,
|
|
6
|
+
OnChanges,
|
|
7
|
+
OnInit,
|
|
8
|
+
Output,
|
|
9
|
+
SimpleChanges,
|
|
10
|
+
} from '@angular/core'
|
|
11
|
+
import { FormControl } from '@angular/forms'
|
|
12
|
+
import { CheckToggleComponent } from '../../../../../../../../../libs/ui/inputs/src'
|
|
13
|
+
import { TranslateModule } from '@ngx-translate/core'
|
|
14
|
+
import { OPEN_DATA_LICENSES } from './../../../../fields.config'
|
|
15
|
+
import { Subscription } from 'rxjs'
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'gn-ui-form-field-open-data',
|
|
19
|
+
templateUrl: './form-field-open-data.component.html',
|
|
20
|
+
styleUrls: ['./form-field-open-data.component.css'],
|
|
21
|
+
standalone: true,
|
|
22
|
+
imports: [CheckToggleComponent, TranslateModule],
|
|
23
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
|
+
})
|
|
25
|
+
export class FormFieldOpenDataComponent implements OnInit {
|
|
26
|
+
@Input() control: FormControl
|
|
27
|
+
value = false
|
|
28
|
+
@Output() visibilityChange = new EventEmitter<boolean>()
|
|
29
|
+
subscription: Subscription
|
|
30
|
+
|
|
31
|
+
get config() {
|
|
32
|
+
return OPEN_DATA_LICENSES
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
ngOnInit() {
|
|
36
|
+
this.initToggle()
|
|
37
|
+
this.subscription = new Subscription()
|
|
38
|
+
|
|
39
|
+
this.subscription.add(
|
|
40
|
+
this.control.valueChanges.subscribe((value) => {
|
|
41
|
+
this.value = this.config.includes(value[0].text)
|
|
42
|
+
this.visibilityChange.emit(this.value)
|
|
43
|
+
})
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
initToggle() {
|
|
48
|
+
this.value = this.config.includes(this.control.value[0].text)
|
|
49
|
+
this.visibilityChange.emit(this.value)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
onOpenDataToggled(boolean) {
|
|
53
|
+
if (boolean) {
|
|
54
|
+
this.control.setValue([{ text: this.config[0] }])
|
|
55
|
+
}
|
|
56
|
+
this.value = !this.value
|
|
57
|
+
this.visibilityChange.emit(boolean)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common'
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
|
3
|
+
import { OverviewUploadComponent } from '../../../overview-upload/overview-upload.component'
|
|
4
|
+
import { FormControl } from '@angular/forms'
|
|
5
|
+
import { GraphicOverview } from '../../../../../../../../../libs/common/domain/src/lib/model/record'
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'gn-ui-form-field-overviews',
|
|
9
|
+
templateUrl: './form-field-overviews.component.html',
|
|
10
|
+
styleUrls: ['./form-field-overviews.component.css'],
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [CommonModule, OverviewUploadComponent],
|
|
14
|
+
})
|
|
15
|
+
export class FormFieldOverviewsComponent {
|
|
16
|
+
@Input() metadataUuid: string
|
|
17
|
+
@Input() control!: FormControl
|
|
18
|
+
|
|
19
|
+
handleOverviewChange(overView: GraphicOverview | null) {
|
|
20
|
+
this.control.setValue(overView ? [overView] : [])
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -62,9 +62,9 @@ export class FormFieldTemporalExtentsComponent implements OnInit, OnDestroy {
|
|
|
62
62
|
)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
onElementsChange(elements:
|
|
65
|
+
onElementsChange(elements: { inputs: Record<string, unknown> }[]) {
|
|
66
66
|
this.array.clear({ emitEvent: false })
|
|
67
|
-
elements.forEach((e
|
|
67
|
+
elements.forEach((e, i) =>
|
|
68
68
|
this.array.push(e.inputs.control, {
|
|
69
69
|
emitEvent: i === elements.length - 1,
|
|
70
70
|
})
|
|
@@ -95,7 +95,7 @@ export class FormFieldTemporalExtentsComponent implements OnInit, OnDestroy {
|
|
|
95
95
|
|
|
96
96
|
private resetValueFromInput(value) {
|
|
97
97
|
this.array.clear({ emitEvent: false })
|
|
98
|
-
|
|
98
|
+
let newElements = []
|
|
99
99
|
value.forEach((v: any) => {
|
|
100
100
|
if ('start' in v && 'end' in v) {
|
|
101
101
|
const rangeControl = new FormControl({
|
|
@@ -103,8 +103,8 @@ export class FormFieldTemporalExtentsComponent implements OnInit, OnDestroy {
|
|
|
103
103
|
end: v.end,
|
|
104
104
|
})
|
|
105
105
|
this.array.push(rangeControl, { emitEvent: false })
|
|
106
|
-
|
|
107
|
-
...
|
|
106
|
+
newElements = [
|
|
107
|
+
...newElements,
|
|
108
108
|
{
|
|
109
109
|
component: FormFieldTemporalExtentsRangeComponent,
|
|
110
110
|
inputs: {
|
|
@@ -115,8 +115,8 @@ export class FormFieldTemporalExtentsComponent implements OnInit, OnDestroy {
|
|
|
115
115
|
} else {
|
|
116
116
|
const dateControl = new FormControl({ start: v.start })
|
|
117
117
|
this.array.push(dateControl, { emitEvent: false })
|
|
118
|
-
|
|
119
|
-
...
|
|
118
|
+
newElements = [
|
|
119
|
+
...newElements,
|
|
120
120
|
{
|
|
121
121
|
component: FormFieldTemporalExtentsDateComponent,
|
|
122
122
|
inputs: {
|
|
@@ -126,5 +126,6 @@ export class FormFieldTemporalExtentsComponent implements OnInit, OnDestroy {
|
|
|
126
126
|
]
|
|
127
127
|
}
|
|
128
128
|
})
|
|
129
|
+
this.elements = newElements
|
|
129
130
|
}
|
|
130
131
|
}
|