geonetwork-ui 2.4.1-dev.7a0dc5e3f → 2.4.1-dev.9ee0df3df
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/utils/update-frequency.mapper.mjs +6 -62
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +19 -1
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +27 -1
- 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 +45 -9
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.mjs +12 -3
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.mjs +2 -2
- 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-update-frequency/form-field-update-frequency.component.mjs +36 -60
- 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/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 +2 -2
- 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/translations/de.json +23 -11
- package/esm2022/translations/en.json +19 -7
- package/esm2022/translations/es.json +23 -11
- package/esm2022/translations/fr.json +23 -11
- package/esm2022/translations/it.json +23 -11
- package/esm2022/translations/nl.json +23 -11
- package/esm2022/translations/pt.json +23 -11
- package/fesm2022/geonetwork-ui.mjs +922 -835
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/utils/update-frequency.mapper.d.ts.map +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 +2 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts +11 -2
- 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-online-resources/form-field-online-resources.component.d.ts +4 -0
- 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-update-frequency/form-field-update-frequency.component.d.ts +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/fields.config.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/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/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/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/iso19139/utils/update-frequency.mapper.ts +9 -62
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +18 -0
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +29 -7
- 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 +31 -6
- package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.ts +47 -2
- 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 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.html +3 -7
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.ts +10 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.ts +1 -1
- 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-update-frequency/form-field-update-frequency.component.ts +46 -74
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +1 -1
- 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/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/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/translations/de.json +23 -11
- package/translations/en.json +19 -7
- package/translations/es.json +23 -11
- package/translations/fr.json +23 -11
- package/translations/it.json +23 -11
- package/translations/nl.json +23 -11
- package/translations/pt.json +23 -11
- package/translations/sk.json +23 -11
- 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/src/libs/api/metadata-converter/src/lib/dcat-ap/utils/update-frequency.mapper.ts +0 -67
- /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
|
@@ -2,8 +2,10 @@ import { CommonModule } from '@angular/common'
|
|
|
2
2
|
import {
|
|
3
3
|
ChangeDetectionStrategy,
|
|
4
4
|
Component,
|
|
5
|
+
EventEmitter,
|
|
5
6
|
Input,
|
|
6
7
|
OnChanges,
|
|
8
|
+
Output,
|
|
7
9
|
} from '@angular/core'
|
|
8
10
|
import { FormsModule } from '@angular/forms'
|
|
9
11
|
import { MatRadioModule } from '@angular/material/radio'
|
|
@@ -13,8 +15,18 @@ import {
|
|
|
13
15
|
DatasetServiceDistribution,
|
|
14
16
|
ServiceProtocol,
|
|
15
17
|
} from '../../../../../../../libs/common/domain/src/lib/model/record'
|
|
16
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
ButtonComponent,
|
|
20
|
+
TextInputComponent,
|
|
21
|
+
UrlInputComponent,
|
|
22
|
+
} from '../../../../../../../libs/ui/inputs/src'
|
|
17
23
|
import { TranslateModule } from '@ngx-translate/core'
|
|
24
|
+
import {
|
|
25
|
+
NgIconComponent,
|
|
26
|
+
provideIcons,
|
|
27
|
+
provideNgIconsConfig,
|
|
28
|
+
} from '@ng-icons/core'
|
|
29
|
+
import { iconoirCloudUpload } from '@ng-icons/iconoir'
|
|
18
30
|
|
|
19
31
|
@Component({
|
|
20
32
|
selector: 'gn-ui-online-service-resource-input',
|
|
@@ -23,20 +35,35 @@ import { TranslateModule } from '@ngx-translate/core'
|
|
|
23
35
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
36
|
standalone: true,
|
|
25
37
|
imports: [
|
|
38
|
+
ButtonComponent,
|
|
26
39
|
CommonModule,
|
|
40
|
+
FormsModule,
|
|
27
41
|
MatTooltipModule,
|
|
28
42
|
MatRadioModule,
|
|
29
|
-
|
|
43
|
+
NgIconComponent,
|
|
30
44
|
TextInputComponent,
|
|
31
45
|
TranslateModule,
|
|
46
|
+
UrlInputComponent,
|
|
47
|
+
],
|
|
48
|
+
providers: [
|
|
49
|
+
provideIcons({ iconoirCloudUpload }),
|
|
50
|
+
provideNgIconsConfig({
|
|
51
|
+
size: '1.5em',
|
|
52
|
+
}),
|
|
32
53
|
],
|
|
33
54
|
})
|
|
34
55
|
export class OnlineServiceResourceInputComponent implements OnChanges {
|
|
35
56
|
@Input() service: Omit<DatasetServiceDistribution, 'url'>
|
|
36
57
|
@Input() protocolHint?: string
|
|
37
58
|
@Input() disabled? = false
|
|
59
|
+
@Output() urlChange: EventEmitter<string> = new EventEmitter()
|
|
60
|
+
@Output() identifierSubmit: EventEmitter<{
|
|
61
|
+
url: string
|
|
62
|
+
identifier: string
|
|
63
|
+
}> = new EventEmitter()
|
|
38
64
|
|
|
39
65
|
selectedProtocol: ServiceProtocol
|
|
66
|
+
url: string
|
|
40
67
|
|
|
41
68
|
protocolOptions: {
|
|
42
69
|
label: string
|
|
@@ -78,4 +105,22 @@ export class OnlineServiceResourceInputComponent implements OnChanges {
|
|
|
78
105
|
(option) => option.value === this.service.accessServiceProtocol
|
|
79
106
|
)?.value ?? 'other'
|
|
80
107
|
}
|
|
108
|
+
|
|
109
|
+
handleUrlChange(url: string) {
|
|
110
|
+
this.url = url
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
submitIdentifier(identifier: string) {
|
|
114
|
+
if (!identifier) return
|
|
115
|
+
this.identifierSubmit.emit({ url: this.url, identifier })
|
|
116
|
+
this.service.identifierInService = null
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
getIdentifierPlaceholder(): string {
|
|
120
|
+
const baseKey =
|
|
121
|
+
'editor.record.form.field.onlineResource.edit.identifier.placeholder'
|
|
122
|
+
return this.service.accessServiceProtocol === 'wps'
|
|
123
|
+
? `${baseKey}.wps`
|
|
124
|
+
: baseKey
|
|
125
|
+
}
|
|
81
126
|
}
|
|
@@ -23,13 +23,9 @@
|
|
|
23
23
|
<gn-ui-online-service-resource-input
|
|
24
24
|
[service]="newService"
|
|
25
25
|
[disabled]="disabled$ | async"
|
|
26
|
+
(urlChange)="handleServiceUrlChange($event)"
|
|
27
|
+
(identifierSubmit)="handleIdentifierSubmit($event)"
|
|
26
28
|
></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
29
|
</div>
|
|
34
30
|
<div class="h-[8px]"></div>
|
|
35
31
|
<gn-ui-sortable-list
|
|
@@ -73,7 +69,7 @@
|
|
|
73
69
|
class="w-full"
|
|
74
70
|
[disabled]="true"
|
|
75
71
|
[value]="onlineResource.url"
|
|
76
|
-
[
|
|
72
|
+
[showValidateButton]="false"
|
|
77
73
|
></gn-ui-url-input>
|
|
78
74
|
</div>
|
|
79
75
|
</ng-template>
|
|
@@ -174,6 +174,16 @@ export class FormFieldOnlineResourcesComponent {
|
|
|
174
174
|
])
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
handleIdentifierSubmit(payload: { url: string; identifier: string }) {
|
|
178
|
+
this.valueChange.emit([
|
|
179
|
+
...this.allResources,
|
|
180
|
+
{
|
|
181
|
+
...this.newService,
|
|
182
|
+
url: new URL(payload.url),
|
|
183
|
+
},
|
|
184
|
+
])
|
|
185
|
+
}
|
|
186
|
+
|
|
177
187
|
handleServiceModify(
|
|
178
188
|
oldService: DatasetServiceDistribution,
|
|
179
189
|
newService: DatasetServiceDistribution
|
|
@@ -8,7 +8,7 @@ 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'
|
|
@@ -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>
|
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
} from '@angular/core'
|
|
9
9
|
import {
|
|
10
10
|
UpdateFrequency,
|
|
11
|
+
UpdateFrequencyCode,
|
|
12
|
+
updateFrequencyCodeValues,
|
|
11
13
|
UpdateFrequencyCustom,
|
|
12
14
|
} from '../../../../../../../../../libs/common/domain/src/lib/model/record'
|
|
13
15
|
import {
|
|
@@ -18,6 +20,10 @@ import {
|
|
|
18
20
|
import { TranslateModule, TranslateService } from '@ngx-translate/core'
|
|
19
21
|
import { firstValueFrom } from 'rxjs'
|
|
20
22
|
|
|
23
|
+
const initialListValues = updateFrequencyCodeValues.filter(
|
|
24
|
+
(code) => !['unknown', 'notPlanned', 'asNeeded', 'irregular'].includes(code)
|
|
25
|
+
)
|
|
26
|
+
|
|
21
27
|
@Component({
|
|
22
28
|
selector: 'gn-ui-form-field-update-frequency',
|
|
23
29
|
templateUrl: './form-field-update-frequency.component.html',
|
|
@@ -33,20 +39,39 @@ export class FormFieldUpdateFrequencyComponent implements OnInit {
|
|
|
33
39
|
protected choices: DropdownChoice[] = []
|
|
34
40
|
|
|
35
41
|
get planned() {
|
|
36
|
-
return
|
|
42
|
+
return this.value && this.value !== 'notPlanned' && this.value !== 'unknown'
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
constructor(private translateService: TranslateService) {}
|
|
40
46
|
|
|
41
47
|
async ngOnInit() {
|
|
42
48
|
this.choices = await this.getInitialChoices()
|
|
49
|
+
if (!this.planned) {
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
if (
|
|
53
|
+
typeof this.value === 'string' &&
|
|
54
|
+
!this.choices.map((choice) => choice.value).includes(this.value)
|
|
55
|
+
) {
|
|
56
|
+
this.choices = [
|
|
57
|
+
{
|
|
58
|
+
value: this.value,
|
|
59
|
+
label: await firstValueFrom(
|
|
60
|
+
this.translateService.get(
|
|
61
|
+
`domain.record.updateFrequency.${this.value}`
|
|
62
|
+
)
|
|
63
|
+
),
|
|
64
|
+
},
|
|
65
|
+
...this.choices,
|
|
66
|
+
]
|
|
67
|
+
}
|
|
43
68
|
if (typeof this.value === 'string') {
|
|
44
69
|
return
|
|
45
70
|
}
|
|
46
71
|
const updatedTimes = this.value.updatedTimes
|
|
47
72
|
const per = this.value.per
|
|
48
73
|
// the update frequency is not in the list; make it appear there
|
|
49
|
-
if (updatedTimes
|
|
74
|
+
if (updatedTimes) {
|
|
50
75
|
this.choices = [
|
|
51
76
|
{
|
|
52
77
|
value: `${per}.${updatedTimes}`,
|
|
@@ -65,90 +90,37 @@ export class FormFieldUpdateFrequencyComponent implements OnInit {
|
|
|
65
90
|
if (this.planned) {
|
|
66
91
|
this.valueChange.emit('notPlanned')
|
|
67
92
|
} else {
|
|
68
|
-
this.valueChange.emit(
|
|
93
|
+
this.valueChange.emit(this.choices[0].value as UpdateFrequencyCode)
|
|
69
94
|
}
|
|
70
95
|
}
|
|
71
96
|
|
|
72
97
|
get selectedFrequency(): string {
|
|
73
|
-
if (!this.value
|
|
98
|
+
if (!this.value) return null
|
|
99
|
+
if (typeof this.value === 'string') return this.value
|
|
74
100
|
const { updatedTimes, per } = this.value
|
|
75
101
|
return `${per}.${updatedTimes}`
|
|
76
102
|
}
|
|
77
103
|
|
|
78
|
-
onSelectFrequencyValue(value:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
104
|
+
onSelectFrequencyValue(value: string) {
|
|
105
|
+
if (!value.includes('.')) {
|
|
106
|
+
this.valueChange.emit(value as UpdateFrequencyCode)
|
|
107
|
+
} else {
|
|
108
|
+
const split = (value as string).split('.')
|
|
109
|
+
this.valueChange.emit({
|
|
110
|
+
updatedTimes: Number(split[1]),
|
|
111
|
+
per: split[0] as UpdateFrequencyCustom['per'],
|
|
112
|
+
})
|
|
113
|
+
}
|
|
84
114
|
}
|
|
85
115
|
|
|
86
116
|
private async getInitialChoices() {
|
|
87
|
-
return
|
|
88
|
-
{
|
|
89
|
-
value
|
|
90
|
-
label: await firstValueFrom(
|
|
91
|
-
this.translateService.get('domain.record.updateFrequency.day', {
|
|
92
|
-
count: 1,
|
|
93
|
-
})
|
|
94
|
-
),
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
value: 'day.2',
|
|
98
|
-
label: await firstValueFrom(
|
|
99
|
-
this.translateService.get('domain.record.updateFrequency.day', {
|
|
100
|
-
count: 2,
|
|
101
|
-
})
|
|
102
|
-
),
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
value: 'week.1',
|
|
106
|
-
label: await firstValueFrom(
|
|
107
|
-
this.translateService.get('domain.record.updateFrequency.week', {
|
|
108
|
-
count: 1,
|
|
109
|
-
})
|
|
110
|
-
),
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
value: 'week.2',
|
|
114
|
-
label: await firstValueFrom(
|
|
115
|
-
this.translateService.get('domain.record.updateFrequency.week', {
|
|
116
|
-
count: 2,
|
|
117
|
-
})
|
|
118
|
-
),
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
value: 'month.1',
|
|
122
|
-
label: await firstValueFrom(
|
|
123
|
-
this.translateService.get('domain.record.updateFrequency.month', {
|
|
124
|
-
count: 1,
|
|
125
|
-
})
|
|
126
|
-
),
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
value: 'month.2',
|
|
130
|
-
label: await firstValueFrom(
|
|
131
|
-
this.translateService.get('domain.record.updateFrequency.month', {
|
|
132
|
-
count: 2,
|
|
133
|
-
})
|
|
134
|
-
),
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
value: 'year.1',
|
|
138
|
-
label: await firstValueFrom(
|
|
139
|
-
this.translateService.get('domain.record.updateFrequency.year', {
|
|
140
|
-
count: 1,
|
|
141
|
-
})
|
|
142
|
-
),
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
value: 'year.2',
|
|
117
|
+
return Promise.all(
|
|
118
|
+
initialListValues.map(async (value) => ({
|
|
119
|
+
value,
|
|
146
120
|
label: await firstValueFrom(
|
|
147
|
-
this.translateService.get(
|
|
148
|
-
count: 2,
|
|
149
|
-
})
|
|
121
|
+
this.translateService.get(`domain.record.updateFrequency.${value}`)
|
|
150
122
|
),
|
|
151
|
-
}
|
|
152
|
-
|
|
123
|
+
}))
|
|
124
|
+
)
|
|
153
125
|
}
|
|
154
126
|
}
|
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
|
|
@@ -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,
|
|
@@ -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({
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core'
|
|
2
1
|
import { CommonModule, NgOptimizedImage } from '@angular/common'
|
|
3
|
-
import {
|
|
2
|
+
import { NgModule } from '@angular/core'
|
|
3
|
+
import { FormsModule } from '@angular/forms'
|
|
4
4
|
import { MatTooltipModule } from '@angular/material/tooltip'
|
|
5
|
-
import {
|
|
6
|
-
import { PopoverComponent, UiWidgetsModule } from '../../../../../libs/ui/widgets/src'
|
|
7
|
-
import { MaxLinesComponent, UiLayoutModule } from '../../../../../libs/ui/layout/src'
|
|
8
|
-
import { TranslateModule } from '@ngx-translate/core'
|
|
9
|
-
import { ThumbnailComponent } from './thumbnail/thumbnail.component'
|
|
5
|
+
import { RouterModule } from '@angular/router'
|
|
10
6
|
import {
|
|
11
7
|
BadgeComponent,
|
|
12
8
|
TextInputComponent,
|
|
13
9
|
UiInputsModule,
|
|
14
10
|
} from '../../../../../libs/ui/inputs/src'
|
|
15
|
-
import {
|
|
11
|
+
import { MaxLinesComponent, UiLayoutModule } from '../../../../../libs/ui/layout/src'
|
|
12
|
+
import { PopoverComponent, UiWidgetsModule } from '../../../../../libs/ui/widgets/src'
|
|
13
|
+
import { UtilSharedModule } from '../../../../../libs/util/shared/src'
|
|
14
|
+
import { provideNgIconsConfig } from '@ng-icons/core'
|
|
15
|
+
import { TranslateModule } from '@ngx-translate/core'
|
|
16
16
|
import { AvatarComponent } from './avatar/avatar.component'
|
|
17
|
-
import {
|
|
17
|
+
import { ImageInputComponent } from './image-input/image-input.component'
|
|
18
18
|
import { MarkdownParserComponent } from './markdown-parser/markdown-parser.component'
|
|
19
|
+
import { ThumbnailComponent } from './thumbnail/thumbnail.component'
|
|
19
20
|
import { TimeSincePipe } from './user-feedback-item/time-since.pipe'
|
|
20
|
-
import {
|
|
21
|
+
import { UserPreviewComponent } from './user-preview/user-preview.component'
|
|
21
22
|
|
|
22
23
|
@NgModule({
|
|
23
24
|
imports: [
|
|
@@ -38,6 +39,7 @@ import { provideNgIconsConfig } from '@ng-icons/core'
|
|
|
38
39
|
BadgeComponent,
|
|
39
40
|
MaxLinesComponent,
|
|
40
41
|
TextInputComponent,
|
|
42
|
+
ImageInputComponent,
|
|
41
43
|
],
|
|
42
44
|
providers: [
|
|
43
45
|
provideNgIconsConfig({
|
|
@@ -50,6 +52,7 @@ import { provideNgIconsConfig } from '@ng-icons/core'
|
|
|
50
52
|
AvatarComponent,
|
|
51
53
|
UserPreviewComponent,
|
|
52
54
|
MarkdownParserComponent,
|
|
55
|
+
ImageInputComponent,
|
|
53
56
|
],
|
|
54
57
|
})
|
|
55
58
|
export class UiElementsModule {}
|
|
@@ -6,23 +6,22 @@ export * from './lib/checkbox/checkbox.component'
|
|
|
6
6
|
export * from './lib/chips-input/chips-input.component'
|
|
7
7
|
export * from './lib/copy-text-button/copy-text-button.component'
|
|
8
8
|
export * from './lib/date-picker/date-picker.component'
|
|
9
|
-
export * from './lib/date-range-picker/date-range-picker.component'
|
|
10
9
|
export * from './lib/date-range-dropdown/date-range-dropdown.component'
|
|
10
|
+
export * from './lib/date-range-picker/date-range-picker.component'
|
|
11
11
|
export * from './lib/drag-and-drop-file-input/drag-and-drop-file-input.component'
|
|
12
12
|
export * from './lib/dropdown-multiselect/dropdown-multiselect.component'
|
|
13
13
|
export * from './lib/dropdown-multiselect/dropdown-multiselect.model'
|
|
14
14
|
export * from './lib/dropdown-selector/dropdown-selector.component'
|
|
15
15
|
export * from './lib/dropdown-selector/dropdown-selector.model'
|
|
16
16
|
export * from './lib/editable-label/editable-label.directive'
|
|
17
|
+
export * from './lib/file-input/file-input.component'
|
|
18
|
+
export * from './lib/files-drop/files-drop.directive'
|
|
17
19
|
export * from './lib/navigation-button/navigation-button.component'
|
|
18
20
|
export * from './lib/search-input/search-input.component'
|
|
19
21
|
export * from './lib/star-toggle/star-toggle.component'
|
|
22
|
+
export * from './lib/switch-toggle/switch-toggle.component'
|
|
20
23
|
export * from './lib/text-area/text-area.component'
|
|
21
24
|
export * from './lib/text-input/text-input.component'
|
|
22
25
|
export * from './lib/ui-inputs.module'
|
|
23
26
|
export * from './lib/url-input/url-input.component'
|
|
24
27
|
export * from './lib/viewport-intersector/viewport-intersector.component'
|
|
25
|
-
export * from './lib/switch-toggle/switch-toggle.component'
|
|
26
|
-
export * from './lib/file-input/file-input.component'
|
|
27
|
-
export * from './lib/image-input/image-input.component'
|
|
28
|
-
export * from './lib/url-input/url-input.component'
|
|
@@ -62,9 +62,10 @@ export class ButtonComponent {
|
|
|
62
62
|
return `${this.btnClass} ${this.extraClass}`
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
handleClick(event:
|
|
65
|
+
handleClick(event: MouseEvent) {
|
|
66
66
|
this.buttonClick.emit()
|
|
67
67
|
event.preventDefault()
|
|
68
|
+
;(event.currentTarget as HTMLElement).blur()
|
|
68
69
|
propagateToDocumentOnly(event)
|
|
69
70
|
}
|
|
70
71
|
}
|