geonetwork-ui 2.4.1-dev.73bac9979 → 2.4.1-dev.89bb09dfa
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/gn4.converter.mjs +4 -3
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +5 -2
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
- package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +27 -16
- 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 +7 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.actions.mjs +3 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.effects.mjs +18 -14
- package/esm2022/libs/feature/editor/src/lib/+state/editor.facade.mjs +15 -5
- package/esm2022/libs/feature/editor/src/lib/+state/editor.reducer.mjs +10 -4
- package/esm2022/libs/feature/editor/src/lib/+state/editor.selectors.mjs +6 -5
- package/esm2022/libs/feature/editor/src/lib/components/constraint-card/constraint-card.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/components/import-record/import-record.component.mjs +2 -2
- package/esm2022/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.mjs +95 -12
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.mjs +36 -23
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.mjs +7 -12
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.mjs +17 -12
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.mjs +7 -13
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +3 -3
- 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 +11 -15
- package/esm2022/libs/feature/editor/src/lib/services/editor.service.mjs +9 -5
- package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +3 -4
- package/esm2022/libs/ui/dataviz/src/lib/figure/figure.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/index.mjs +3 -2
- package/esm2022/libs/ui/elements/src/lib/image-input/image-input.component.mjs +213 -0
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +19 -13
- package/esm2022/libs/ui/inputs/src/index.mjs +5 -6
- package/esm2022/libs/ui/inputs/src/lib/button/button.component.mjs +2 -1
- package/esm2022/libs/ui/inputs/src/lib/file-input/file-input.component.mjs +5 -5
- package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +19 -25
- package/esm2022/libs/ui/inputs/src/lib/url-input/url-input.component.mjs +6 -6
- package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table.component.mjs +9 -4
- package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +10 -10
- package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +40 -1
- package/esm2022/translations/de.json +32 -6
- package/esm2022/translations/en.json +16 -9
- package/esm2022/translations/es.json +30 -4
- package/esm2022/translations/fr.json +16 -9
- package/esm2022/translations/it.json +246 -218
- package/esm2022/translations/nl.json +30 -4
- package/esm2022/translations/pt.json +30 -4
- package/fesm2022/geonetwork-ui.mjs +1473 -1144
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.converter.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 +1 -0
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +4 -3
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +4 -3
- 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 +3 -0
- package/libs/data-access/gn4/src/openapi/api/records.api.service.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.actions.d.ts +10 -2
- package/libs/feature/editor/src/lib/+state/editor.actions.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.effects.d.ts +6 -2
- package/libs/feature/editor/src/lib/+state/editor.effects.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts +5 -2
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts +2 -1
- package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts +2 -1
- package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts +24 -4
- package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.d.ts +4 -4
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.d.ts +1 -4
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.d.ts +6 -5
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts +1 -4
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/services/editor.service.d.ts +1 -1
- package/libs/feature/editor/src/lib/services/editor.service.d.ts.map +1 -1
- package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts +0 -1
- package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
- package/libs/ui/elements/src/index.d.ts +2 -1
- package/libs/ui/elements/src/index.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/image-input/image-input.component.d.ts.map +1 -0
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +2 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
- package/libs/ui/inputs/src/index.d.ts +4 -5
- package/libs/ui/inputs/src/index.d.ts.map +1 -1
- 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/file-input/file-input.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/file-input/file-input.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +6 -7
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/url-input/url-input.component.d.ts +2 -2
- package/libs/ui/inputs/src/lib/url-input/url-input.component.d.ts.map +1 -1
- package/libs/ui/layout/src/lib/interactive-table/interactive-table.component.d.ts +2 -1
- package/libs/ui/layout/src/lib/interactive-table/interactive-table.component.d.ts.map +1 -1
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +3 -3
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
- package/libs/util/shared/src/lib/links/link-utils.d.ts +2 -1
- package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.converter.ts +4 -3
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +8 -1
- package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +1 -0
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +53 -27
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +5 -4
- package/src/libs/common/fixtures/src/lib/elasticsearch/full-response.fixtures.ts +2 -2
- package/src/libs/common/fixtures/src/lib/elasticsearch/search-responses.fixtures.ts +16 -16
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +163 -0
- package/src/libs/data-access/gn4/src/openapi/api/records.api.service.ts +24 -4
- package/src/libs/feature/editor/src/lib/+state/editor.actions.ts +10 -1
- package/src/libs/feature/editor/src/lib/+state/editor.effects.ts +57 -31
- package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +15 -9
- package/src/libs/feature/editor/src/lib/+state/editor.reducer.ts +18 -12
- package/src/libs/feature/editor/src/lib/+state/editor.selectors.ts +13 -8
- package/src/libs/feature/editor/src/lib/components/constraint-card/constraint-card.component.html +1 -1
- package/src/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.html +1 -1
- package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.html +62 -6
- package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.ts +108 -4
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.html +1 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.ts +31 -19
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.html +1 -10
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.ts +1 -7
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.html +12 -25
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.ts +15 -10
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.html +0 -9
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.ts +3 -9
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.html +6 -6
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +3 -3
- package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.html +3 -6
- package/src/libs/feature/editor/src/lib/fields.config.ts +10 -14
- package/src/libs/feature/editor/src/lib/services/editor.service.ts +18 -16
- package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html +0 -1
- package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +0 -3
- package/src/libs/ui/dataviz/src/lib/figure/figure.component.html +1 -0
- package/src/libs/ui/elements/src/index.ts +2 -1
- package/src/libs/ui/{inputs → elements}/src/lib/image-input/image-input.component.html +4 -19
- package/src/libs/ui/{inputs → elements}/src/lib/image-input/image-input.component.ts +13 -9
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +13 -10
- package/src/libs/ui/inputs/src/index.ts +4 -5
- package/src/libs/ui/inputs/src/lib/button/button.component.ts +2 -1
- package/src/libs/ui/inputs/src/lib/file-input/file-input.component.ts +1 -1
- package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +22 -25
- package/src/libs/ui/inputs/src/lib/url-input/url-input.component.html +5 -3
- package/src/libs/ui/inputs/src/lib/url-input/url-input.component.ts +1 -1
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.html +12 -1
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.ts +4 -6
- package/src/libs/ui/search/src/lib/results-table/results-table.component.html +23 -6
- package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +6 -6
- package/src/libs/util/shared/src/lib/links/link-utils.ts +51 -1
- package/tailwind.base.config.js +2 -0
- package/translations/de.json +32 -6
- package/translations/en.json +16 -9
- package/translations/es.json +30 -4
- package/translations/fr.json +16 -9
- package/translations/it.json +246 -218
- package/translations/nl.json +30 -4
- package/translations/pt.json +30 -4
- package/translations/sk.json +30 -4
- package/esm2022/libs/ui/inputs/src/lib/image-input/image-input.component.mjs +0 -214
- package/libs/ui/inputs/src/lib/image-input/image-input.component.d.ts.map +0 -1
- /package/libs/ui/{inputs → elements}/src/lib/image-input/image-input.component.d.ts +0 -0
- /package/src/libs/ui/{inputs → elements}/src/lib/image-input/image-input.component.css +0 -0
|
@@ -26,35 +26,47 @@ type Licence = {
|
|
|
26
26
|
})
|
|
27
27
|
export class FormFieldLicenseComponent implements OnInit {
|
|
28
28
|
@Input() label: string
|
|
29
|
-
@Input()
|
|
30
|
-
@Output()
|
|
29
|
+
@Input() recordLicences: Constraint[] = []
|
|
30
|
+
@Output() recordLicencesChange: EventEmitter<Constraint[]> =
|
|
31
31
|
new EventEmitter()
|
|
32
32
|
|
|
33
|
+
choices: Licence[] = AVAILABLE_LICENSES.map((license) => ({
|
|
34
|
+
label: marker(`editor.record.form.license.${license}`),
|
|
35
|
+
value: license,
|
|
36
|
+
}))
|
|
37
|
+
|
|
33
38
|
selectedLicence: string
|
|
34
39
|
|
|
35
40
|
ngOnInit(): void {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.selectedLicence = this.licenceOptions[0].value // cannot select 'etalab' as default as this would toggle the OpenData Toggle
|
|
45
|
-
this.recordConstraintsChange.emit([{ text: this.selectedLicence }])
|
|
41
|
+
if (this.recordLicences.length === 0) {
|
|
42
|
+
this.selectedLicence = 'unknown'
|
|
43
|
+
} else {
|
|
44
|
+
this.selectedLicence = this.recordLicences.find((constraint) => {
|
|
45
|
+
return this.choices.find((licence) => {
|
|
46
|
+
return licence.value === constraint.text
|
|
47
|
+
})
|
|
48
|
+
})?.text
|
|
46
49
|
}
|
|
47
|
-
}
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
if (this.selectedLicence === undefined) {
|
|
52
|
+
this.choices = [
|
|
53
|
+
{
|
|
54
|
+
value: this.recordLicences[0].text,
|
|
55
|
+
label: this.recordLicences[0].text,
|
|
56
|
+
},
|
|
57
|
+
...this.choices,
|
|
58
|
+
]
|
|
59
|
+
this.selectedLicence = this.recordLicences[0].text
|
|
60
|
+
}
|
|
54
61
|
}
|
|
55
62
|
|
|
56
63
|
handleLicenceSelection(licenceValue: string) {
|
|
57
64
|
this.selectedLicence = licenceValue
|
|
58
|
-
|
|
65
|
+
if (licenceValue === 'unknown') {
|
|
66
|
+
this.recordLicencesChange.emit([])
|
|
67
|
+
return
|
|
68
|
+
} else {
|
|
69
|
+
this.recordLicencesChange.emit([{ text: licenceValue }])
|
|
70
|
+
}
|
|
59
71
|
}
|
|
60
72
|
}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
(uploadCancel)="handleUploadCancel()"
|
|
6
6
|
[uploadProgress]="uploadProgress"
|
|
7
7
|
(urlChange)="handleUrlChange($event)"
|
|
8
|
-
[disabled]="disabled$ | async"
|
|
9
8
|
></gn-ui-file-input>
|
|
10
9
|
<div class="h-[8px]"></div>
|
|
11
10
|
<gn-ui-sortable-list
|
|
@@ -42,17 +41,9 @@
|
|
|
42
41
|
class="w-full"
|
|
43
42
|
[disabled]="true"
|
|
44
43
|
[value]="onlineResource.url"
|
|
45
|
-
[showUploadButton]="false"
|
|
46
44
|
[disabled]="disabled$ | async"
|
|
45
|
+
[showValidateButton]="false"
|
|
47
46
|
></gn-ui-url-input>
|
|
48
47
|
</div>
|
|
49
48
|
</ng-template>
|
|
50
|
-
<div
|
|
51
|
-
*ngIf="disabled$ | async"
|
|
52
|
-
class="p-4 text-sm border border-primary bg-primary-lightest rounded-lg"
|
|
53
|
-
translate
|
|
54
|
-
data-test="disabled-message"
|
|
55
|
-
>
|
|
56
|
-
editor.record.form.field.draft.only.disabled
|
|
57
|
-
</div>
|
|
58
49
|
</div>
|
|
@@ -30,7 +30,6 @@ import { PlatformServiceInterface } from '../../../../../../../../../libs/common
|
|
|
30
30
|
import { map, Subscription } from 'rxjs'
|
|
31
31
|
import { MatDialog } from '@angular/material/dialog'
|
|
32
32
|
import { MAX_UPLOAD_SIZE_MB } from '../../../../fields.config'
|
|
33
|
-
import { EditorFacade } from '../../../../+state/editor.facade'
|
|
34
33
|
|
|
35
34
|
@Component({
|
|
36
35
|
selector: 'gn-ui-form-field-online-link-resources',
|
|
@@ -69,17 +68,12 @@ export class FormFieldOnlineLinkResourcesComponent {
|
|
|
69
68
|
|
|
70
69
|
protected MAX_UPLOAD_SIZE_MB = MAX_UPLOAD_SIZE_MB
|
|
71
70
|
|
|
72
|
-
disabled$ = this.editorFacade.alreadySavedOnce$.pipe(
|
|
73
|
-
map((alreadySavedOnce) => !alreadySavedOnce)
|
|
74
|
-
)
|
|
75
|
-
|
|
76
71
|
constructor(
|
|
77
72
|
private notificationsService: NotificationsService,
|
|
78
73
|
private translateService: TranslateService,
|
|
79
74
|
private platformService: PlatformServiceInterface,
|
|
80
75
|
private cd: ChangeDetectorRef,
|
|
81
|
-
private dialog: MatDialog
|
|
82
|
-
private editorFacade: EditorFacade
|
|
76
|
+
private dialog: MatDialog
|
|
83
77
|
) {}
|
|
84
78
|
|
|
85
79
|
handleFileChange(file: File) {
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
(selectedValue)="onSelectedTypeChange($event.value)"
|
|
5
5
|
extraClasses="grow text-sm"
|
|
6
6
|
data-cy="online-resources-type"
|
|
7
|
-
[disabled]="disabled$ | async"
|
|
8
7
|
></gn-ui-switch-toggle>
|
|
9
8
|
<div class="h-[8px]"></div>
|
|
10
9
|
<gn-ui-file-input
|
|
@@ -14,7 +13,6 @@
|
|
|
14
13
|
(uploadCancel)="handleUploadCancel()"
|
|
15
14
|
[uploadProgress]="uploadProgress"
|
|
16
15
|
(urlChange)="handleDownloadUrlChange($event)"
|
|
17
|
-
[disabled]="disabled$ | async"
|
|
18
16
|
></gn-ui-file-input>
|
|
19
17
|
<div
|
|
20
18
|
*ngIf="selectedType === 'service'"
|
|
@@ -23,13 +21,8 @@
|
|
|
23
21
|
<gn-ui-online-service-resource-input
|
|
24
22
|
[service]="newService"
|
|
25
23
|
[disabled]="disabled$ | async"
|
|
24
|
+
(identifierSubmit)="handleIdentifierSubmit($event)"
|
|
26
25
|
></gn-ui-online-service-resource-input>
|
|
27
|
-
<span class="w-full border-b border-gray-300"></span>
|
|
28
|
-
<gn-ui-url-input
|
|
29
|
-
class="w-full"
|
|
30
|
-
(uploadClick)="handleServiceUrlChange($event)"
|
|
31
|
-
[disabled]="disabled$ | async"
|
|
32
|
-
></gn-ui-url-input>
|
|
33
26
|
</div>
|
|
34
27
|
<div class="h-[8px]"></div>
|
|
35
28
|
<gn-ui-sortable-list
|
|
@@ -61,28 +54,22 @@
|
|
|
61
54
|
[(value)]="onlineResource.description"
|
|
62
55
|
></gn-ui-text-area>
|
|
63
56
|
</div>
|
|
64
|
-
<ng-container *ngIf="onlineResource.type === 'service'">
|
|
57
|
+
<ng-container *ngIf="onlineResource.type === 'service'; else urlInput">
|
|
65
58
|
<span class="w-full border-b border-gray-300"></span>
|
|
66
59
|
<gn-ui-online-service-resource-input
|
|
67
60
|
[service]="onlineResource"
|
|
68
|
-
[
|
|
61
|
+
[modifyMode]="true"
|
|
69
62
|
></gn-ui-online-service-resource-input>
|
|
70
63
|
</ng-container>
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
64
|
+
<ng-template #urlInput>
|
|
65
|
+
<span class="w-full border-b border-gray-300"></span>
|
|
66
|
+
<gn-ui-url-input
|
|
67
|
+
class="w-full"
|
|
68
|
+
[disabled]="true"
|
|
69
|
+
[value]="onlineResource.url"
|
|
70
|
+
[showValidateButton]="false"
|
|
71
|
+
></gn-ui-url-input>
|
|
72
|
+
</ng-template>
|
|
78
73
|
</div>
|
|
79
74
|
</ng-template>
|
|
80
|
-
<div
|
|
81
|
-
*ngIf="disabled$ | async"
|
|
82
|
-
class="p-4 text-sm border border-primary bg-primary-lightest rounded-lg"
|
|
83
|
-
translate
|
|
84
|
-
data-test="disabled-message"
|
|
85
|
-
>
|
|
86
|
-
editor.record.form.field.draft.only.disabled
|
|
87
|
-
</div>
|
|
88
75
|
</div>
|
|
@@ -32,11 +32,10 @@ import {
|
|
|
32
32
|
SortableListComponent,
|
|
33
33
|
} from '../../../../../../../../../libs/ui/layout/src'
|
|
34
34
|
import { TranslateModule, TranslateService } from '@ngx-translate/core'
|
|
35
|
-
import {
|
|
35
|
+
import { Subscription } from 'rxjs'
|
|
36
36
|
import { MAX_UPLOAD_SIZE_MB } from '../../../../fields.config'
|
|
37
37
|
import { OnlineResourceCardComponent } from '../../../online-resource-card/online-resource-card.component'
|
|
38
38
|
import { OnlineServiceResourceInputComponent } from '../../../online-service-resource-input/online-service-resource-input.component'
|
|
39
|
-
import { EditorFacade } from '../../../../+state/editor.facade'
|
|
40
39
|
|
|
41
40
|
type OnlineNotLinkResource =
|
|
42
41
|
| DatasetDownloadDistribution
|
|
@@ -93,25 +92,21 @@ export class FormFieldOnlineResourcesComponent {
|
|
|
93
92
|
notLinkResources: OnlineNotLinkResource[] = []
|
|
94
93
|
uploadProgress = undefined
|
|
95
94
|
uploadSubscription: Subscription = null
|
|
96
|
-
newService = {
|
|
95
|
+
newService = <DatasetServiceDistribution>{
|
|
97
96
|
type: 'service',
|
|
98
97
|
accessServiceProtocol: 'ogcFeatures',
|
|
99
98
|
identifierInService: '',
|
|
100
|
-
|
|
99
|
+
url: undefined,
|
|
100
|
+
}
|
|
101
101
|
|
|
102
102
|
protected MAX_UPLOAD_SIZE_MB = MAX_UPLOAD_SIZE_MB
|
|
103
103
|
|
|
104
|
-
disabled$ = this.editorFacade.alreadySavedOnce$.pipe(
|
|
105
|
-
map((alreadySavedOnce) => !alreadySavedOnce)
|
|
106
|
-
)
|
|
107
|
-
|
|
108
104
|
constructor(
|
|
109
105
|
private notificationsService: NotificationsService,
|
|
110
106
|
private translateService: TranslateService,
|
|
111
107
|
private platformService: PlatformServiceInterface,
|
|
112
108
|
private cd: ChangeDetectorRef,
|
|
113
|
-
private dialog: MatDialog
|
|
114
|
-
private editorFacade: EditorFacade
|
|
109
|
+
private dialog: MatDialog
|
|
115
110
|
) {}
|
|
116
111
|
|
|
117
112
|
onSelectedTypeChange(selectedType: unknown) {
|
|
@@ -174,6 +169,16 @@ export class FormFieldOnlineResourcesComponent {
|
|
|
174
169
|
])
|
|
175
170
|
}
|
|
176
171
|
|
|
172
|
+
handleIdentifierSubmit(payload: { url: string; identifier: string }) {
|
|
173
|
+
this.valueChange.emit([
|
|
174
|
+
...this.allResources,
|
|
175
|
+
{
|
|
176
|
+
...this.newService,
|
|
177
|
+
url: new URL(payload.url),
|
|
178
|
+
},
|
|
179
|
+
])
|
|
180
|
+
}
|
|
181
|
+
|
|
177
182
|
handleServiceModify(
|
|
178
183
|
oldService: DatasetServiceDistribution,
|
|
179
184
|
newService: DatasetServiceDistribution
|
|
@@ -9,14 +9,5 @@
|
|
|
9
9
|
(delete)="handleDelete()"
|
|
10
10
|
[uploadProgress]="uploadProgress"
|
|
11
11
|
(uploadCancel)="handleUploadCancel()"
|
|
12
|
-
[disabled]="disabled$ | async"
|
|
13
12
|
></gn-ui-image-input>
|
|
14
|
-
<div
|
|
15
|
-
*ngIf="disabled$ | async"
|
|
16
|
-
class="p-4 text-sm border border-primary bg-primary-lightest rounded-lg"
|
|
17
|
-
translate
|
|
18
|
-
data-test="disabled-message"
|
|
19
|
-
>
|
|
20
|
-
editor.record.form.field.draft.only.disabled
|
|
21
|
-
</div>
|
|
22
13
|
</div>
|
|
@@ -8,13 +8,12 @@ import {
|
|
|
8
8
|
Output,
|
|
9
9
|
} from '@angular/core'
|
|
10
10
|
import { GraphicOverview } from '../../../../../../../../../libs/common/domain/src/lib/model/record'
|
|
11
|
-
import { ImageInputComponent } from '../../../../../../../../../libs/ui/
|
|
11
|
+
import { ImageInputComponent } from '../../../../../../../../../libs/ui/elements/src'
|
|
12
12
|
import { PlatformServiceInterface } from '../../../../../../../../../libs/common/domain/src/lib/platform.service.interface'
|
|
13
13
|
import { NotificationsService } from '../../../../../../../../../libs/feature/notifications/src'
|
|
14
14
|
import { TranslateModule, TranslateService } from '@ngx-translate/core'
|
|
15
|
-
import {
|
|
15
|
+
import { Subscription } from 'rxjs'
|
|
16
16
|
import { MAX_UPLOAD_SIZE_MB } from '../../../../fields.config'
|
|
17
|
-
import { EditorFacade } from '../../../../+state/editor.facade'
|
|
18
17
|
|
|
19
18
|
@Component({
|
|
20
19
|
selector: 'gn-ui-form-field-overviews',
|
|
@@ -30,10 +29,6 @@ export class FormFieldOverviewsComponent {
|
|
|
30
29
|
@Output() valueChange: EventEmitter<Array<GraphicOverview>> =
|
|
31
30
|
new EventEmitter()
|
|
32
31
|
|
|
33
|
-
disabled$ = this.editorFacade.alreadySavedOnce$.pipe(
|
|
34
|
-
map((alreadySavedOnce) => !alreadySavedOnce)
|
|
35
|
-
)
|
|
36
|
-
|
|
37
32
|
uploadProgress = undefined
|
|
38
33
|
uploadSubscription: Subscription = null
|
|
39
34
|
|
|
@@ -52,8 +47,7 @@ export class FormFieldOverviewsComponent {
|
|
|
52
47
|
private platformService: PlatformServiceInterface,
|
|
53
48
|
private notificationsService: NotificationsService,
|
|
54
49
|
private translateService: TranslateService,
|
|
55
|
-
private cd: ChangeDetectorRef
|
|
56
|
-
private editorFacade: EditorFacade
|
|
50
|
+
private cd: ChangeDetectorRef
|
|
57
51
|
) {}
|
|
58
52
|
|
|
59
53
|
handleFileChange(file: File) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="flex flex-col gap-
|
|
1
|
+
<div class="flex flex-col gap-3">
|
|
2
2
|
<gn-ui-generic-keywords
|
|
3
3
|
[placeholder]="'Search for place keywords'"
|
|
4
4
|
[keywords]="shownKeywords$ | async"
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
(addedKeyword)="handleKeywordAdd($event)"
|
|
8
8
|
>
|
|
9
9
|
</gn-ui-generic-keywords>
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
<div class="w-full h-96 mt-2">
|
|
11
|
+
<gn-ui-form-field-map-container
|
|
12
|
+
[spatialExtents]="spatialExtents$ | async"
|
|
13
|
+
></gn-ui-form-field-map-container>
|
|
14
|
+
</div>
|
|
15
15
|
</div>
|
package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
#autosize="cdkTextareaAutosize"
|
|
31
31
|
cdkAutosizeMinRows="1"
|
|
32
32
|
data-test="recordTitleInput"
|
|
33
|
-
class="grow font-title text-3xl font-normal overflow-hidden"
|
|
33
|
+
class="grow font-title text-3xl font-normal overflow-hidden text-black/80"
|
|
34
34
|
(change)="valueChange.emit($event.target.value)"
|
|
35
35
|
[placeholder]="
|
|
36
36
|
'editor.record.form.field.title.placeholder' | translate
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
<ng-container *ngSwitchCase="'licenses'">
|
|
113
113
|
<gn-ui-form-field-license
|
|
114
114
|
[label]="config.labelKey! | translate"
|
|
115
|
-
[
|
|
116
|
-
(
|
|
115
|
+
[recordLicences]="valueAsConstraints"
|
|
116
|
+
(recordLicencesChange)="valueChange.emit($event)"
|
|
117
117
|
></gn-ui-form-field-license>
|
|
118
118
|
</ng-container>
|
|
119
119
|
|
|
@@ -6,14 +6,11 @@
|
|
|
6
6
|
"
|
|
7
7
|
>
|
|
8
8
|
<ng-container *ngIf="!section.hidden">
|
|
9
|
-
<div class="flex flex-col gap-
|
|
10
|
-
<div
|
|
11
|
-
class="flex flex-col gap-2"
|
|
12
|
-
[ngClass]="section.labelKey ? 'mb-4' : 'hidden'"
|
|
13
|
-
>
|
|
9
|
+
<div class="flex flex-col gap-6 border p-8 rounded-[8px] shadow">
|
|
10
|
+
<div class="flex flex-col gap-2">
|
|
14
11
|
<div
|
|
15
12
|
*ngIf="section.labelKey"
|
|
16
|
-
class="text-2xl font-title text-
|
|
13
|
+
class="text-2xl font-title text-black"
|
|
17
14
|
translate
|
|
18
15
|
>
|
|
19
16
|
{{ section.labelKey }}
|
|
@@ -61,9 +61,7 @@ export const RECORD_LICENSE_FIELD: EditorField = {
|
|
|
61
61
|
|
|
62
62
|
export const RECORD_KEYWORDS_FIELD: EditorField = {
|
|
63
63
|
model: 'keywords',
|
|
64
|
-
formFieldConfig: {
|
|
65
|
-
labelKey: marker('editor.record.form.field.keywords'),
|
|
66
|
-
},
|
|
64
|
+
formFieldConfig: {},
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
export const RECORD_RESOURCE_CREATED_FIELD: EditorField = {
|
|
@@ -156,25 +154,19 @@ export const RECORD_SPATIAL_TOGGLE_FIELD: EditorField = {
|
|
|
156
154
|
|
|
157
155
|
export const RECORD_SPATIAL_EXTENTS_FIELD: EditorField = {
|
|
158
156
|
model: 'spatialExtents',
|
|
159
|
-
formFieldConfig: {
|
|
160
|
-
labelKey: marker('editor.record.form.field.spatialExtents'),
|
|
161
|
-
},
|
|
157
|
+
formFieldConfig: {},
|
|
162
158
|
}
|
|
163
159
|
|
|
164
160
|
export const RECORD_ONLINE_RESOURCES: EditorField = {
|
|
165
161
|
model: 'onlineResources',
|
|
166
162
|
modelSpecifier: 'onlineResourceType:!link',
|
|
167
|
-
formFieldConfig: {
|
|
168
|
-
labelKey: marker('editor.record.form.field.onlineResources'),
|
|
169
|
-
},
|
|
163
|
+
formFieldConfig: {},
|
|
170
164
|
}
|
|
171
165
|
|
|
172
166
|
export const RECORD_ONLINE_LINK_RESOURCES: EditorField = {
|
|
173
167
|
model: 'onlineResources',
|
|
174
168
|
modelSpecifier: 'onlineResourceType:link',
|
|
175
|
-
formFieldConfig: {
|
|
176
|
-
labelKey: marker('editor.record.form.field.onlineLinkResources'),
|
|
177
|
-
},
|
|
169
|
+
formFieldConfig: {},
|
|
178
170
|
}
|
|
179
171
|
|
|
180
172
|
/************************************************************
|
|
@@ -273,7 +265,12 @@ export const DEFAULT_CONFIGURATION: EditorConfig = {
|
|
|
273
265
|
pages: [
|
|
274
266
|
{
|
|
275
267
|
labelKey: marker('editor.record.form.page.description'),
|
|
276
|
-
sections: [
|
|
268
|
+
sections: [
|
|
269
|
+
TITLE_SECTION,
|
|
270
|
+
ABOUT_SECTION,
|
|
271
|
+
CLASSIFICATION_SECTION,
|
|
272
|
+
GEOGRAPHICAL_COVERAGE_SECTION,
|
|
273
|
+
],
|
|
277
274
|
},
|
|
278
275
|
{
|
|
279
276
|
labelKey: marker('editor.record.form.page.ressources'),
|
|
@@ -282,7 +279,6 @@ export const DEFAULT_CONFIGURATION: EditorConfig = {
|
|
|
282
279
|
{
|
|
283
280
|
labelKey: marker('editor.record.form.page.accessAndContact'),
|
|
284
281
|
sections: [
|
|
285
|
-
CLASSIFICATION_SECTION,
|
|
286
282
|
USE_AND_ACCESS_CONDITIONS_SECTION,
|
|
287
283
|
DATA_MANAGERS_SECTION,
|
|
288
284
|
METADATA_POINT_OF_CONTACT_SECTION,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core'
|
|
2
|
-
import { Observable, switchMap } from 'rxjs'
|
|
2
|
+
import { forkJoin, Observable, of, switchMap } from 'rxjs'
|
|
3
3
|
import { map, tap } from 'rxjs/operators'
|
|
4
4
|
import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
5
5
|
import { EditorConfig } from '../models/'
|
|
@@ -16,8 +16,7 @@ export class EditorService {
|
|
|
16
16
|
saveRecord(
|
|
17
17
|
record: CatalogRecord,
|
|
18
18
|
recordSource: string,
|
|
19
|
-
fieldsConfig: EditorConfig
|
|
20
|
-
generateNewUniqueIdentifier = false
|
|
19
|
+
fieldsConfig: EditorConfig
|
|
21
20
|
): Observable<[CatalogRecord, string]> {
|
|
22
21
|
const savedRecord = { ...record }
|
|
23
22
|
|
|
@@ -35,22 +34,25 @@ export class EditorService {
|
|
|
35
34
|
})
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
|
-
|
|
39
|
-
// if
|
|
40
|
-
if (
|
|
37
|
+
let publishToAll = true
|
|
38
|
+
// if the record is new, generate a new unique identifier and pass publishToAll as false
|
|
39
|
+
if (!record.uniqueIdentifier) {
|
|
41
40
|
savedRecord.uniqueIdentifier = null
|
|
41
|
+
publishToAll = false
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
return this.recordsRepository
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
return this.recordsRepository
|
|
45
|
+
.saveRecord(savedRecord, recordSource, publishToAll)
|
|
46
|
+
.pipe(
|
|
47
|
+
switchMap((uniqueIdentifier) =>
|
|
48
|
+
this.recordsRepository.openRecordForEdition(uniqueIdentifier)
|
|
49
|
+
),
|
|
50
|
+
tap(() => {
|
|
51
|
+
// if saving was successful, the original draft can be discarded
|
|
52
|
+
this.recordsRepository.clearRecordDraft(record.uniqueIdentifier)
|
|
53
|
+
}),
|
|
54
|
+
map(([record, recordSource]) => [record, recordSource])
|
|
55
|
+
)
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
// emits and completes once saving is done
|
|
@@ -38,9 +38,6 @@ export class ResultsTableContainerComponent implements OnDestroy {
|
|
|
38
38
|
hasDraft = (record: CatalogRecord): boolean =>
|
|
39
39
|
this.recordsRepository.recordHasDraft(record.uniqueIdentifier)
|
|
40
40
|
|
|
41
|
-
isUnsavedDraft = (record: CatalogRecord): boolean =>
|
|
42
|
-
this.recordsRepository.isRecordNotYetSaved(record.uniqueIdentifier)
|
|
43
|
-
|
|
44
41
|
constructor(
|
|
45
42
|
protected searchFacade: SearchFacade,
|
|
46
43
|
private searchService: SearchService,
|
|
@@ -5,6 +5,7 @@ export * from './lib/content-ghost/content-ghost.component'
|
|
|
5
5
|
export * from './lib/download-item/download-item.component'
|
|
6
6
|
export * from './lib/downloads-list/downloads-list.component'
|
|
7
7
|
export * from './lib/error/error.component'
|
|
8
|
+
export * from './lib/image-input/image-input.component'
|
|
8
9
|
export * from './lib/image-overlay-preview/image-overlay-preview.component'
|
|
9
10
|
export * from './lib/link-card/link-card.component'
|
|
10
11
|
export * from './lib/markdown-editor/markdown-editor.component'
|
|
@@ -19,5 +20,5 @@ export * from './lib/record-api-form/record-api-form.component'
|
|
|
19
20
|
export * from './lib/related-record-card/related-record-card.component'
|
|
20
21
|
export * from './lib/thumbnail/thumbnail.component'
|
|
21
22
|
export * from './lib/ui-elements.module'
|
|
22
|
-
export * from './lib/user-preview/user-preview.component'
|
|
23
23
|
export * from './lib/user-feedback-item/user-feedback-item.component'
|
|
24
|
+
export * from './lib/user-preview/user-preview.component'
|
|
@@ -2,31 +2,16 @@
|
|
|
2
2
|
</ng-container>
|
|
3
3
|
|
|
4
4
|
<ng-template #withImage>
|
|
5
|
-
<div class="w-
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
class="w-full object-cover border-2 border-gray-300 rounded-lg h-[172px]"
|
|
9
|
-
[alt]="altText"
|
|
10
|
-
loading="lazy"
|
|
11
|
-
[src]="previewUrl"
|
|
12
|
-
/>
|
|
13
|
-
<gn-ui-button
|
|
14
|
-
type="outline"
|
|
15
|
-
style="--gn-ui-button-height: 40px; --gn-ui-button-width: 40px"
|
|
16
|
-
extraClass="absolute right-2 bottom-2 invisible group-hover:visible bg-background"
|
|
17
|
-
(buttonClick)="handleDelete()"
|
|
18
|
-
[disabled]="disabled"
|
|
19
|
-
>
|
|
20
|
-
<ng-icon name="iconoirBin"></ng-icon>
|
|
21
|
-
</gn-ui-button>
|
|
22
|
-
</div>
|
|
5
|
+
<div class="w-80 h-full flex flex-col gap-2">
|
|
6
|
+
<gn-ui-image-overlay-preview class="h-48" [imageUrl]="previewUrl">
|
|
7
|
+
</gn-ui-image-overlay-preview>
|
|
23
8
|
<gn-ui-text-input
|
|
24
9
|
*ngIf="showAltTextInput"
|
|
25
10
|
[placeholder]="'input.image.altTextPlaceholder' | translate"
|
|
26
11
|
[value]="altText ?? ''"
|
|
27
12
|
(valueChange)="handleAltTextChange($event)"
|
|
28
13
|
extraClass="gn-ui-editor-textarea"
|
|
29
|
-
[disabled]="
|
|
14
|
+
[disabled]="true"
|
|
30
15
|
></gn-ui-text-input>
|
|
31
16
|
<div class="flex flex-row gap-2 mt-2">
|
|
32
17
|
<gn-ui-button type="gray" (buttonClick)="handleDelete()">
|
|
@@ -9,27 +9,30 @@ import {
|
|
|
9
9
|
Output,
|
|
10
10
|
} from '@angular/core'
|
|
11
11
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'
|
|
12
|
-
import { downgradeImage, megabytesToBytes } from '../../../../../../libs/util/shared/src'
|
|
13
|
-
import { firstValueFrom } from 'rxjs'
|
|
14
|
-
import { ButtonComponent } from '../button/button.component'
|
|
15
|
-
import { FilesDropDirective } from '../files-drop/files-drop.directive'
|
|
16
|
-
import { TranslateModule } from '@ngx-translate/core'
|
|
17
12
|
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
18
|
-
import {
|
|
19
|
-
|
|
13
|
+
import {
|
|
14
|
+
ButtonComponent,
|
|
15
|
+
FilesDropDirective,
|
|
16
|
+
TextInputComponent,
|
|
17
|
+
UrlInputComponent,
|
|
18
|
+
} from '../../../../../../libs/ui/inputs/src'
|
|
19
|
+
import { downgradeImage, megabytesToBytes } from '../../../../../../libs/util/shared/src'
|
|
20
20
|
import {
|
|
21
21
|
NgIconComponent,
|
|
22
22
|
provideIcons,
|
|
23
23
|
provideNgIconsConfig,
|
|
24
24
|
} from '@ng-icons/core'
|
|
25
25
|
import {
|
|
26
|
+
iconoirBin,
|
|
26
27
|
iconoirFramePlusIn,
|
|
28
|
+
iconoirLink,
|
|
27
29
|
iconoirMediaImage,
|
|
28
30
|
iconoirMediaImageXmark,
|
|
29
|
-
iconoirBin,
|
|
30
31
|
iconoirPlus,
|
|
31
|
-
iconoirLink,
|
|
32
32
|
} from '@ng-icons/iconoir'
|
|
33
|
+
import { TranslateModule } from '@ngx-translate/core'
|
|
34
|
+
import { firstValueFrom } from 'rxjs'
|
|
35
|
+
import { ImageOverlayPreviewComponent } from '../image-overlay-preview/image-overlay-preview.component'
|
|
33
36
|
|
|
34
37
|
@Component({
|
|
35
38
|
selector: 'gn-ui-image-input',
|
|
@@ -46,6 +49,7 @@ import {
|
|
|
46
49
|
UrlInputComponent,
|
|
47
50
|
TextInputComponent,
|
|
48
51
|
NgIconComponent,
|
|
52
|
+
ImageOverlayPreviewComponent,
|
|
49
53
|
],
|
|
50
54
|
providers: [
|
|
51
55
|
provideIcons({
|