geonetwork-ui 2.4.0-dev.9075aa64 → 2.4.0-dev.9b37393d

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.
Files changed (174) hide show
  1. package/esm2022/libs/api/metadata-converter/src/index.mjs +2 -1
  2. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.mjs +3 -3
  3. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +1 -16
  4. package/esm2022/libs/api/metadata-converter/src/lib/xml-utils.mjs +18 -2
  5. package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +78 -39
  6. package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
  7. package/esm2022/libs/feature/editor/src/index.mjs +2 -1
  8. package/esm2022/libs/feature/editor/src/lib/components/contact-card/contact-card.component.mjs +4 -16
  9. package/esm2022/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.mjs +4 -2
  10. package/esm2022/libs/feature/editor/src/lib/components/import-record/import-record.component.mjs +93 -0
  11. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.mjs +6 -3
  12. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-date-updated/form-field-date-updated.component.mjs +19 -0
  13. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.mjs +23 -10
  14. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.mjs +3 -3
  15. 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
  16. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.mjs +4 -8
  17. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.mjs +10 -7
  18. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.mjs +6 -3
  19. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.mjs +3 -3
  20. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +5 -5
  21. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/index.mjs +2 -2
  22. package/esm2022/libs/feature/editor/src/lib/components/record-form/record-form.component.mjs +3 -3
  23. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +6 -4
  24. package/esm2022/libs/feature/editor/src/lib/models/editor-config.model.mjs +1 -1
  25. package/esm2022/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.mjs +3 -3
  26. package/esm2022/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.mjs +6 -6
  27. package/esm2022/libs/ui/inputs/src/index.mjs +2 -1
  28. package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +7 -4
  29. package/esm2022/libs/ui/inputs/src/lib/badge/badge.component.mjs +5 -3
  30. package/esm2022/libs/ui/inputs/src/lib/button/button.component.mjs +8 -1
  31. package/esm2022/libs/ui/inputs/src/lib/date-picker/date-picker.component.mjs +11 -4
  32. package/esm2022/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.mjs +9 -3
  33. package/esm2022/libs/ui/inputs/src/lib/file-input/file-input.component.mjs +3 -3
  34. package/esm2022/libs/ui/inputs/src/lib/image-input/image-input.component.mjs +3 -3
  35. package/esm2022/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.mjs +3 -3
  36. package/esm2022/libs/ui/inputs/src/lib/url-input/url-input.component.mjs +3 -3
  37. package/esm2022/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.mjs +5 -3
  38. package/esm2022/libs/util/shared/src/lib/services/theme.service.mjs +2 -1
  39. package/esm2022/translations/de.json +9 -0
  40. package/esm2022/translations/en.json +9 -0
  41. package/esm2022/translations/es.json +9 -0
  42. package/esm2022/translations/fr.json +9 -0
  43. package/esm2022/translations/it.json +9 -0
  44. package/esm2022/translations/nl.json +9 -0
  45. package/esm2022/translations/pt.json +9 -0
  46. package/fesm2022/geonetwork-ui.mjs +388 -186
  47. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  48. package/libs/api/metadata-converter/src/index.d.ts +1 -0
  49. package/libs/api/metadata-converter/src/index.d.ts.map +1 -1
  50. package/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.d.ts.map +1 -1
  51. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +0 -1
  52. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
  53. package/libs/api/metadata-converter/src/lib/xml-utils.d.ts +6 -0
  54. package/libs/api/metadata-converter/src/lib/xml-utils.d.ts.map +1 -1
  55. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +12 -7
  56. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  57. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +7 -0
  58. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
  59. package/libs/feature/editor/src/index.d.ts +1 -0
  60. package/libs/feature/editor/src/index.d.ts.map +1 -1
  61. package/libs/feature/editor/src/lib/components/contact-card/contact-card.component.d.ts +1 -5
  62. package/libs/feature/editor/src/lib/components/contact-card/contact-card.component.d.ts.map +1 -1
  63. package/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.d.ts +2 -1
  64. package/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.d.ts.map +1 -1
  65. package/libs/feature/editor/src/lib/components/import-record/import-record.component.d.ts +33 -0
  66. package/libs/feature/editor/src/lib/components/import-record/import-record.component.d.ts.map +1 -0
  67. 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 -1
  68. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-date-updated/form-field-date-updated.component.d.ts +9 -0
  69. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-date-updated/form-field-date-updated.component.d.ts.map +1 -0
  70. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.d.ts +5 -2
  71. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.d.ts.map +1 -1
  72. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.d.ts +1 -3
  73. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.d.ts.map +1 -1
  74. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.d.ts.map +1 -1
  75. 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
  76. package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts +1 -1
  77. package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts.map +1 -1
  78. package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
  79. package/libs/feature/editor/src/lib/models/editor-config.model.d.ts +1 -0
  80. package/libs/feature/editor/src/lib/models/editor-config.model.d.ts.map +1 -1
  81. package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +1 -1
  82. package/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.d.ts +2 -2
  83. package/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.d.ts.map +1 -1
  84. package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +1 -1
  85. package/libs/ui/inputs/src/index.d.ts +1 -0
  86. package/libs/ui/inputs/src/index.d.ts.map +1 -1
  87. package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts.map +1 -1
  88. package/libs/ui/inputs/src/lib/badge/badge.component.d.ts.map +1 -1
  89. package/libs/ui/inputs/src/lib/button/button.component.d.ts +1 -1
  90. package/libs/ui/inputs/src/lib/button/button.component.d.ts.map +1 -1
  91. package/libs/ui/inputs/src/lib/date-picker/date-picker.component.d.ts.map +1 -1
  92. package/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.d.ts.map +1 -1
  93. package/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.d.ts +2 -2
  94. package/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.d.ts.map +1 -1
  95. package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts +1 -1
  96. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +1 -1
  97. package/libs/util/shared/src/lib/services/theme.service.d.ts.map +1 -1
  98. package/package.json +1 -1
  99. package/src/libs/api/metadata-converter/src/index.ts +1 -0
  100. package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +1 -2
  101. package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +0 -27
  102. package/src/libs/api/metadata-converter/src/lib/xml-utils.ts +20 -1
  103. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +132 -68
  104. package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +10 -0
  105. package/src/libs/feature/editor/src/index.ts +1 -0
  106. package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.html +12 -22
  107. package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.ts +1 -13
  108. package/src/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.ts +1 -0
  109. package/src/libs/feature/editor/src/lib/components/import-record/import-record.component.html +43 -0
  110. package/src/libs/feature/editor/src/lib/components/import-record/import-record.component.ts +129 -0
  111. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.css +4 -0
  112. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.html +13 -33
  113. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.ts +2 -0
  114. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-date-updated/form-field-date-updated.component.css +0 -0
  115. package/src/libs/feature/editor/src/lib/components/record-form/form-field/{form-field-resource-updated/form-field-resource-updated.component.ts → form-field-date-updated/form-field-date-updated.component.ts} +4 -4
  116. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.html +3 -2
  117. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.ts +35 -3
  118. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.css +8 -0
  119. 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 -0
  120. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.html +13 -6
  121. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.ts +0 -9
  122. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.html +1 -1
  123. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.ts +16 -5
  124. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.css +4 -0
  125. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.html +2 -1
  126. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.ts +2 -0
  127. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.css +4 -0
  128. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.html +16 -14
  129. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +19 -20
  130. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +2 -2
  131. package/src/libs/feature/editor/src/lib/components/record-form/form-field/index.ts +1 -1
  132. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.html +30 -29
  133. package/src/libs/feature/editor/src/lib/fields.config.ts +5 -3
  134. package/src/libs/feature/editor/src/lib/models/editor-config.model.ts +3 -0
  135. package/src/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.html +1 -0
  136. package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.html +13 -20
  137. package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.ts +1 -1
  138. package/src/libs/ui/inputs/src/index.ts +1 -0
  139. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.css +25 -18
  140. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +38 -24
  141. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +4 -1
  142. package/src/libs/ui/inputs/src/lib/badge/badge.component.html +12 -3
  143. package/src/libs/ui/inputs/src/lib/badge/badge.component.ts +2 -1
  144. package/src/libs/ui/inputs/src/lib/button/button.component.ts +15 -1
  145. package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.css +7 -2
  146. package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.html +13 -6
  147. package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.ts +7 -1
  148. package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.css +7 -2
  149. package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.html +27 -23
  150. package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.ts +7 -1
  151. package/src/libs/ui/inputs/src/lib/file-input/file-input.component.css +4 -0
  152. package/src/libs/ui/inputs/src/lib/file-input/file-input.component.html +6 -2
  153. package/src/libs/ui/inputs/src/lib/image-input/image-input.component.css +4 -0
  154. package/src/libs/ui/inputs/src/lib/image-input/image-input.component.html +29 -21
  155. package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.css +4 -3
  156. package/src/libs/ui/inputs/src/lib/url-input/url-input.component.html +1 -1
  157. package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.html +8 -3
  158. package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.ts +4 -3
  159. package/src/libs/util/shared/src/lib/services/theme.service.ts +1 -0
  160. package/tailwind.base.config.js +1 -0
  161. package/tailwind.base.css +30 -4
  162. package/translations/de.json +9 -0
  163. package/translations/en.json +9 -0
  164. package/translations/es.json +9 -0
  165. package/translations/fr.json +9 -0
  166. package/translations/it.json +9 -0
  167. package/translations/nl.json +9 -0
  168. package/translations/pt.json +9 -0
  169. package/translations/sk.json +9 -0
  170. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.mjs +0 -19
  171. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.d.ts +0 -9
  172. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.d.ts.map +0 -1
  173. /package/src/libs/feature/editor/src/lib/components/{record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.css → import-record/import-record.component.css} +0 -0
  174. /package/src/libs/feature/editor/src/lib/components/record-form/form-field/{form-field-resource-updated/form-field-resource-updated.component.html → form-field-date-updated/form-field-date-updated.component.html} +0 -0
@@ -1,16 +1,10 @@
1
1
  <div class="flex flex-col gap-3">
2
2
  <div class="flex flex-row flex-wrap gap-2" data-test="rolesToPick">
3
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
- >&#8330;</span
11
- >
12
- <span class="font-bold" translate>{{ roleToLabel(role) }}</span>
13
- </div>
4
+ <gn-ui-button type="gray" (buttonClick)="addRoleToDisplay(role)">
5
+ <mat-icon class="material-symbols-outlined text-primary">add</mat-icon>
6
+ &nbsp;
7
+ <span translate>{{ roleToLabel(role) }}</span>
14
8
  </gn-ui-button>
15
9
  </ng-container>
16
10
  </div>
@@ -43,33 +37,19 @@
43
37
  [displayWithFn]="displayWithFn"
44
38
  [minCharacterCount]="1"
45
39
  [clearOnSelection]="true"
40
+ [allowSubmit]="false"
46
41
  >
47
42
  </gn-ui-autocomplete>
48
43
 
49
44
  <ng-container *ngIf="contactsForRessourceByRole.get(role) as contacts">
50
- <ng-container *ngIf="contacts.length > 1">
51
- <gn-ui-sortable-list
52
- [items]="contacts"
53
- (itemsOrderChange)="handleContactsChanged($event)"
54
- [elementTemplate]="contactTemplate"
55
- ></gn-ui-sortable-list>
56
- <ng-template #contactTemplate let-contact>
57
- <div class="flex flex-row items-center gap-2">
58
- <gn-ui-contact-card
59
- [contact]="contact"
60
- [removable]="false"
61
- ></gn-ui-contact-card>
62
- </div>
63
- </ng-template>
64
- </ng-container>
65
- <ng-container *ngIf="contacts.length === 1">
66
- <ng-container *ngFor="let contact of contacts">
67
- <gn-ui-contact-card
68
- [contact]="contact"
69
- (contactRemoved)="removeContact(index)"
70
- ></gn-ui-contact-card>
71
- </ng-container>
72
- </ng-container>
45
+ <gn-ui-sortable-list
46
+ [items]="contacts"
47
+ (itemsOrderChange)="handleContactsChanged($event)"
48
+ [elementTemplate]="contactTemplate"
49
+ ></gn-ui-sortable-list>
50
+ <ng-template #contactTemplate let-contact>
51
+ <gn-ui-contact-card [contact]="contact"></gn-ui-contact-card>
52
+ </ng-template>
73
53
  </ng-container>
74
54
 
75
55
  <hr class="border-t-[#D6D3D1] mt-4 mb-6" *ngIf="!isLast" />
@@ -34,6 +34,7 @@ import {
34
34
  } from 'rxjs'
35
35
  import { map } from 'rxjs/operators'
36
36
  import { ContactCardComponent } from '../../../contact-card/contact-card.component'
37
+ import { MatIconModule } from '@angular/material/icon'
37
38
 
38
39
  @Component({
39
40
  selector: 'gn-ui-form-field-contacts-for-resource',
@@ -50,6 +51,7 @@ import { ContactCardComponent } from '../../../contact-card/contact-card.compone
50
51
  TranslateModule,
51
52
  ContactCardComponent,
52
53
  SortableListComponent,
54
+ MatIconModule,
53
55
  ],
54
56
  })
55
57
  export class FormFieldContactsForResourceComponent
@@ -8,14 +8,14 @@ import {
8
8
  import { DatePickerComponent } from '../../../../../../../../../libs/ui/inputs/src'
9
9
 
10
10
  @Component({
11
- selector: 'gn-ui-form-field-resource-updated',
12
- templateUrl: './form-field-resource-updated.component.html',
13
- styleUrls: ['./form-field-resource-updated.component.css'],
11
+ selector: 'gn-ui-form-field-date-updated',
12
+ templateUrl: './form-field-date-updated.component.html',
13
+ styleUrls: ['./form-field-date-updated.component.css'],
14
14
  changeDetection: ChangeDetectionStrategy.OnPush,
15
15
  standalone: true,
16
16
  imports: [DatePickerComponent],
17
17
  })
18
- export class FormFieldResourceUpdatedComponent {
18
+ export class FormFieldDateUpdatedComponent {
19
19
  @Input() value: Date
20
20
  @Output() valueChange: EventEmitter<Date> = new EventEmitter()
21
21
  }
@@ -1,9 +1,10 @@
1
1
  <div class="flex flex-col gap-3">
2
2
  <gn-ui-generic-keywords
3
- [keywords]="value"
3
+ [keywords]="filteredKeywords"
4
4
  [keywordTypes]="keywordTypes"
5
- [placeholder]="placeholder | translate"
5
+ [placeholder]="'editor.form.keywords.placeholder' | translate"
6
6
  (changedKeywords)="handleKeywordsChange($event)"
7
+ [allowSubmit]="false"
7
8
  >
8
9
  </gn-ui-generic-keywords>
9
10
  </div>
@@ -16,6 +16,10 @@ import { Keyword } from '../../../../../../../../../libs/common/domain/src/lib/m
16
16
  import { GenericKeywordsComponent } from '../../../generic-keywords/generic-keywords.component'
17
17
  import { TranslateModule } from '@ngx-translate/core'
18
18
  import { KeywordType } from '../../../../../../../../../libs/common/domain/src/lib/model/thesaurus'
19
+ import { EditorFacade } from '../../../../+state/editor.facade'
20
+ import { firstValueFrom, map } from 'rxjs'
21
+ import { SPATIAL_SCOPES } from '../../../../fields.config'
22
+ import { all } from 'ol/loadingstrategy'
19
23
 
20
24
  @Component({
21
25
  selector: 'gn-ui-form-field-keywords',
@@ -38,9 +42,37 @@ export class FormFieldKeywordsComponent {
38
42
  @Output() valueChange: EventEmitter<Keyword[]> = new EventEmitter()
39
43
 
40
44
  keywordTypes = ['temporal', 'theme', 'other'] as KeywordType[]
41
- placeholder = 'editor.form.keywords.placeholder'
42
45
 
43
- handleKeywordsChange(keywords: Keyword[]) {
44
- this.valueChange.emit(keywords)
46
+ get filteredKeywords(): Keyword[] {
47
+ return (
48
+ this.value?.filter(
49
+ (keyword) =>
50
+ keyword.type !== 'place' && // filter out place keywords
51
+ !SPATIAL_SCOPES.some(
52
+ (spatialScope) => spatialScope.label === keyword.label
53
+ ) // filter out keywords matching spatialScope keys
54
+ ) || []
55
+ )
56
+ }
57
+
58
+ constructor(private editorFacade: EditorFacade) {}
59
+
60
+ async handleKeywordsChange(keywords: Keyword[]) {
61
+ const filteredKeywords = await firstValueFrom(
62
+ this.editorFacade.record$.pipe(
63
+ map((record) =>
64
+ record.keywords.filter(
65
+ (k) =>
66
+ k.type === 'place' || // get back place keyword
67
+ SPATIAL_SCOPES.some(
68
+ (spatialScope) => spatialScope.label === k.label // get back spatialScope keywords
69
+ )
70
+ )
71
+ )
72
+ )
73
+ )
74
+
75
+ const allKeywords = [...filteredKeywords, ...keywords]
76
+ this.valueChange.emit(allKeywords)
45
77
  }
46
78
  }
@@ -0,0 +1,8 @@
1
+ :host {
2
+ display: grid; /* this is required to be able to size the dropdown */
3
+ }
4
+
5
+ gn-ui-dropdown-selector {
6
+ /* FIXME: this includes the grid gap from the editor form, but there should be no dependency */
7
+ max-width: calc(50% - 16px);
8
+ }
@@ -5,6 +5,7 @@
5
5
  [uploadProgress]="uploadProgress"
6
6
  (urlChange)="handleUrlChange($event)"
7
7
  ></gn-ui-file-input>
8
+ <div class="h-[8px]"></div>
8
9
  <gn-ui-sortable-list
9
10
  [items]="linkResources"
10
11
  (itemsOrderChange)="handleResourcesChange($event)"
@@ -1,20 +1,27 @@
1
1
  <gn-ui-form-field-wrapper [label]="label" [hint]="hint">
2
2
  <gn-ui-button
3
3
  form-field-interaction
4
- [extraClass]="getButtonExtraClass()"
4
+ [type]="preview ? 'black' : 'gray'"
5
+ style="
6
+ --gn-ui-button-padding: 3px 8px;
7
+ --gn-ui-button-font-size: 12px;
8
+ --gn-ui-button-rounded: 20px;
9
+ "
5
10
  (buttonClick)="togglePreview()"
6
11
  >
7
- <span class="material-symbols-outlined mr-1 gn-ui-icon-small">{{
8
- preview ? 'visibility' : 'visibility_off'
9
- }}</span>
12
+ <span
13
+ class="material-symbols-outlined gn-ui-icon-small"
14
+ [ngClass]="{ 'text-primary': !preview }"
15
+ >{{ preview ? 'visibility' : 'visibility_off' }}</span
16
+ >
17
+ &nbsp;
10
18
  {{ preview ? 'WYSIWYG' : 'Markdown' }}
11
19
  </gn-ui-button>
12
20
  <gn-ui-markdown-editor
13
- class="h-full"
14
21
  [preview]="preview"
15
- [helperText]="helperText"
16
22
  [placeholder]="placeholder"
17
23
  [textContent]="value"
18
24
  (textContentChanged)="valueChange.emit($event)"
25
+ textAreaExtraClass="min-h-[100px]"
19
26
  ></gn-ui-markdown-editor>
20
27
  </gn-ui-form-field-wrapper>
@@ -1,11 +1,9 @@
1
1
  import { CommonModule } from '@angular/common'
2
2
  import {
3
3
  ChangeDetectionStrategy,
4
- ChangeDetectorRef,
5
4
  Component,
6
5
  EventEmitter,
7
6
  Input,
8
- OnInit,
9
7
  Output,
10
8
  } from '@angular/core'
11
9
  import { ReactiveFormsModule } from '@angular/forms'
@@ -30,7 +28,6 @@ import { FormFieldWrapperComponent } from '../../../../../../../../../libs/ui/la
30
28
  export class FormFieldRichComponent {
31
29
  @Input() label: string
32
30
  @Input() hint: string
33
- @Input() helperText: string
34
31
  @Input() placeholder = 'Votre texte ici' //TODO: translate
35
32
  @Input() value: string
36
33
 
@@ -38,12 +35,6 @@ export class FormFieldRichComponent {
38
35
 
39
36
  preview = false
40
37
 
41
- getButtonExtraClass() {
42
- return `${
43
- this.preview ? 'text-gray-200 bg-gray-900' : 'text-gray-900 bg-gray-200'
44
- } rounded-[1.25rem] p-[0.375rem] text-xs font-medium w-24`
45
- }
46
-
47
38
  togglePreview() {
48
39
  this.preview = !this.preview
49
40
  }
@@ -13,7 +13,7 @@
13
13
  >
14
14
  </gn-ui-generic-keywords>
15
15
  </div>
16
- <div class="w-full h-96">
16
+ <div class="w-full h-96 mt-2">
17
17
  <gn-ui-form-field-map-container
18
18
  [spatialExtents]="spatialExtents$ | async"
19
19
  ></gn-ui-form-field-map-container>
@@ -175,16 +175,27 @@ export class FormFieldSpatialExtentComponent {
175
175
  ...(thesaurus && { thesaurus }),
176
176
  } as Keyword)
177
177
  )
178
- const notPlaceKeywords = await firstValueFrom(
178
+
179
+ const notPlaceKwAndSpatialScopeKw = await firstValueFrom(
179
180
  this.editorFacade.record$.pipe(
180
- map((record) => record.keywords.filter((k) => k.type !== 'place'))
181
+ map((record) =>
182
+ record.keywords.filter(
183
+ (k) =>
184
+ k.type !== 'place' ||
185
+ SPATIAL_SCOPES.some(
186
+ (spatialScope) => spatialScope.label === k.label // get back spatialScope keywords
187
+ )
188
+ )
189
+ )
181
190
  )
182
191
  )
183
192
 
184
- this.editorFacade.updateRecordField('keywords', [
185
- ...notPlaceKeywords,
193
+ const allKeywords = [
194
+ ...notPlaceKwAndSpatialScopeKw,
186
195
  ...filteredPlaceKeywords,
187
- ])
196
+ ]
197
+
198
+ this.editorFacade.updateRecordField('keywords', allKeywords)
188
199
  this.editorFacade.updateRecordField('spatialExtents', spatialExtents)
189
200
  }
190
201
 
@@ -0,0 +1,4 @@
1
+ :host {
2
+ --gn-ui-button-padding: 8px 8px;
3
+ --gn-ui-button-rounded: 8px;
4
+ }
@@ -1,9 +1,10 @@
1
1
  <div class="flex gap-2 mb-2">
2
2
  <gn-ui-button
3
+ type="gray"
3
4
  *ngFor="let addOption of addOptions$ | async"
4
5
  (buttonClick)="onAdd(addOption.eventName)"
5
6
  >
6
- <span class="material-symbols-outlined gn-ui-icon-small"> add </span>
7
+ <mat-icon class="material-symbols-outlined text-primary">add</mat-icon>
7
8
  &nbsp;{{ addOption.buttonLabel }}</gn-ui-button
8
9
  >
9
10
  </div>
@@ -15,6 +15,7 @@ import {
15
15
  } from '../../../../../../../../../libs/ui/inputs/src'
16
16
  import { TranslateModule, TranslateService } from '@ngx-translate/core'
17
17
  import { combineLatest, map } from 'rxjs'
18
+ import { MatIconModule } from '@angular/material/icon'
18
19
 
19
20
  @Component({
20
21
  selector: 'gn-ui-form-field-temporal-extents',
@@ -29,6 +30,7 @@ import { combineLatest, map } from 'rxjs'
29
30
  DatePickerComponent,
30
31
  DateRangePickerComponent,
31
32
  TranslateModule,
33
+ MatIconModule,
32
34
  ],
33
35
  })
34
36
  export class FormFieldTemporalExtentsComponent {
@@ -0,0 +1,4 @@
1
+ gn-ui-dropdown-selector {
2
+ /* FIXME: this includes the grid gap from the editor form, but there should be no dependency */
3
+ max-width: calc(50% - 16px);
4
+ }
@@ -1,14 +1,16 @@
1
- <gn-ui-check-toggle
2
- [label]="'editor.record.form.updateFrequency.planned' | translate"
3
- [value]="planned"
4
- (toggled)="onPlannedToggled()"
5
- ></gn-ui-check-toggle>
6
- <gn-ui-dropdown-selector
7
- title="updateFrequency"
8
- [showTitle]="false"
9
- [choices]="choices"
10
- [selected]="selectedFrequency"
11
- (selectValue)="onSelectFrequencyValue($event)"
12
- [disabled]="!planned"
13
- >
14
- </gn-ui-dropdown-selector>
1
+ <div class="flex flex-col gap-2">
2
+ <gn-ui-check-toggle
3
+ [label]="'editor.record.form.updateFrequency.planned' | translate"
4
+ [value]="planned"
5
+ (toggled)="onPlannedToggled()"
6
+ ></gn-ui-check-toggle>
7
+ <gn-ui-dropdown-selector
8
+ title="updateFrequency"
9
+ [showTitle]="false"
10
+ [choices]="choices"
11
+ [selected]="selectedFrequency"
12
+ (selectValue)="onSelectFrequencyValue($event)"
13
+ [disabled]="!planned"
14
+ >
15
+ </gn-ui-dropdown-selector>
16
+ </div>
@@ -22,30 +22,31 @@
22
22
  <ng-template #fieldContent>
23
23
  <ng-container [ngSwitch]="model">
24
24
  <ng-container *ngSwitchCase="'title'">
25
- <div class="flex justify-between items-center gap-3">
25
+ <div class="flex flex-row flex-start items-center gap-3 mb-[12px]">
26
26
  <span
27
27
  #titleInput
28
28
  class="grow font-title text-3xl font-normal"
29
29
  [gnUiEditableLabel]="valueAsString"
30
30
  (editableLabelChanged)="valueChange.emit($event)"
31
31
  ></span>
32
- <span
33
- class="material-symbols-outlined gn-ui-icon-small m-2 cursor-pointer"
34
- (click)="focusTitleInput()"
35
- >edit</span
36
- >
37
- <span
38
- class="material-symbols-outlined gn-ui-icon-small m-2"
39
- [matTooltip]="config.hintKey! | translate"
40
- matTooltipPosition="above"
41
- >
42
- help
43
- </span>
32
+ <div class="flex flex-row justify-between">
33
+ <span
34
+ class="material-symbols-outlined gn-ui-icon-small m-2 cursor-pointer"
35
+ (click)="focusTitleInput()"
36
+ >edit</span
37
+ >
38
+ <span
39
+ class="material-symbols-outlined gn-ui-icon-small m-2"
40
+ [matTooltip]="config.hintKey! | translate"
41
+ matTooltipPosition="above"
42
+ >
43
+ help
44
+ </span>
45
+ </div>
44
46
  </div>
45
47
  </ng-container>
46
48
  <ng-container *ngSwitchCase="'abstract'">
47
49
  <gn-ui-form-field-rich
48
- class="h-[8rem]"
49
50
  [label]="config.labelKey! | translate"
50
51
  [hint]="config.hintKey! | translate"
51
52
  [value]="valueAsString"
@@ -68,18 +69,16 @@
68
69
  ></gn-ui-form-field-simple>
69
70
  </ng-container>
70
71
  <ng-container *ngSwitchCase="'resourceUpdated'">
71
- <gn-ui-form-field-resource-updated
72
+ <gn-ui-form-field-date-updated
72
73
  [value]="valueAsDate"
73
74
  (valueChange)="valueChange.emit($event)"
74
- ></gn-ui-form-field-resource-updated>
75
+ ></gn-ui-form-field-date-updated>
75
76
  </ng-container>
76
77
  <ng-container *ngSwitchCase="'recordUpdated'">
77
- <gn-ui-form-field-simple
78
- type="date"
79
- [readonly]="true"
78
+ <gn-ui-form-field-date-updated
80
79
  [value]="valueAsDate"
81
80
  (valueChange)="valueChange.emit($event)"
82
- ></gn-ui-form-field-simple>
81
+ ></gn-ui-form-field-date-updated>
83
82
  </ng-container>
84
83
  <ng-container *ngSwitchCase="'updateFrequency'">
85
84
  <gn-ui-form-field-update-frequency
@@ -25,7 +25,7 @@ import { FormFieldWrapperComponent } from '../../../../../../../../libs/ui/layou
25
25
  import { TranslateModule } from '@ngx-translate/core'
26
26
  import {
27
27
  FormFieldLicenseComponent,
28
- FormFieldResourceUpdatedComponent,
28
+ FormFieldDateUpdatedComponent,
29
29
  FormFieldTemporalExtentsComponent,
30
30
  } from '.'
31
31
  import { FieldModelSpecifier, FormFieldConfig } from '../../../models'
@@ -56,7 +56,7 @@ import { FormFieldOnlineLinkResourcesComponent } from './form-field-online-link-
56
56
  MatTooltipModule,
57
57
  FormFieldWrapperComponent,
58
58
  FormFieldLicenseComponent,
59
- FormFieldResourceUpdatedComponent,
59
+ FormFieldDateUpdatedComponent,
60
60
  FormFieldUpdateFrequencyComponent,
61
61
  FormFieldTemporalExtentsComponent,
62
62
  FormFieldSimpleComponent,
@@ -1,6 +1,6 @@
1
1
  export * from './form-field-keywords/form-field-keywords.component'
2
2
  export * from './form-field-license/form-field-license.component'
3
- export * from './form-field-resource-updated/form-field-resource-updated.component'
3
+ export * from './form-field-date-updated/form-field-date-updated.component'
4
4
  export * from './form-field-temporal-extents/form-field-temporal-extents.component'
5
5
  export * from './form-field-simple/form-field-simple.component'
6
6
  export * from './form-field-file/form-field-file.component'
@@ -1,32 +1,28 @@
1
- <ng-container>
2
- <div class="flex flex-col gap-6 p-8">
3
- <ng-container
4
- *ngFor="
5
- let section of facade.currentSections$ | async;
6
- trackBy: sectionTracker
7
- "
8
- >
9
- <ng-container *ngIf="!section.hidden">
10
- <div class="flex flex-col gap-8 border p-8 rounded-[8px] shadow">
1
+ <div class="flex flex-col gap-6">
2
+ <ng-container
3
+ *ngFor="
4
+ let section of facade.currentSections$ | async;
5
+ trackBy: sectionTracker
6
+ "
7
+ >
8
+ <ng-container *ngIf="!section.hidden">
9
+ <div class="flex flex-col gap-8 border p-8 rounded-[8px] shadow">
10
+ <div
11
+ class="flex flex-col gap-2"
12
+ [ngClass]="section.labelKey ? 'mb-4' : 'hidden'"
13
+ >
11
14
  <div
12
- class="flex flex-col gap-2"
13
- [ngClass]="section.labelKey ? 'mb-4' : 'hidden'"
15
+ *ngIf="section.labelKey"
16
+ class="text-2xl font-title text-main"
17
+ translate
14
18
  >
15
- <div
16
- *ngIf="section.labelKey"
17
- class="text-2xl font-title text-secondary"
18
- translate
19
- >
20
- {{ section.labelKey }}
21
- </div>
22
- <div
23
- *ngIf="section.descriptionKey"
24
- class="text-secondary-lightest"
25
- translate
26
- >
27
- {{ section.descriptionKey }}
28
- </div>
19
+ {{ section.labelKey }}
29
20
  </div>
21
+ <div *ngIf="section.descriptionKey" class="text-gray-800" translate>
22
+ {{ section.descriptionKey }}
23
+ </div>
24
+ </div>
25
+ <div class="grid auto-rows-auto grid-cols-2 gap-[32px]">
30
26
  <ng-container
31
27
  *ngFor="
32
28
  let field of section.fieldsWithValues;
@@ -35,6 +31,11 @@
35
31
  >
36
32
  <ng-container *ngIf="!field.config.hidden">
37
33
  <gn-ui-form-field
34
+ [ngClass]="
35
+ field.config.gridColumnSpan === 1
36
+ ? 'col-span-1'
37
+ : 'col-span-2'
38
+ "
38
39
  [uniqueIdentifier]="recordUniqueIdentifier$ | async"
39
40
  [model]="field.config.model!"
40
41
  [modelSpecifier]="field.config.modelSpecifier!"
@@ -47,7 +48,7 @@
47
48
  </ng-container>
48
49
  </ng-container>
49
50
  </div>
50
- </ng-container>
51
+ </div>
51
52
  </ng-container>
52
- </div>
53
- </ng-container>
53
+ </ng-container>
54
+ </div>
@@ -45,6 +45,7 @@ export const RECORD_RESOURCE_UPDATED_FIELD: EditorField = {
45
45
  formFieldConfig: {
46
46
  labelKey: marker('editor.record.form.field.resourceUpdated'),
47
47
  },
48
+ gridColumnSpan: 1,
48
49
  }
49
50
 
50
51
  export const RECORD_UPDATED_FIELD: EditorField = {
@@ -54,14 +55,15 @@ export const RECORD_UPDATED_FIELD: EditorField = {
54
55
  locked: true,
55
56
  },
56
57
  onSaveProcess: '${dateNow()}',
58
+ gridColumnSpan: 1,
57
59
  }
58
60
 
59
61
  export const RECORD_UPDATE_FREQUENCY_FIELD: EditorField = {
60
62
  model: 'updateFrequency',
61
- formFieldConfig: {
62
- labelKey: marker('editor.record.form.field.updateFrequency'),
63
- },
63
+ formFieldConfig: {},
64
64
  }
65
+ // keeping track of the label to not lose existing translation
66
+ marker('editor.record.form.field.updateFrequency')
65
67
 
66
68
  export const RECORD_TEMPORAL_EXTENTS_FIELD: EditorField = {
67
69
  model: 'temporalExtents',
@@ -32,6 +32,9 @@ export interface EditorField {
32
32
  model?: CatalogRecordKeys
33
33
  modelSpecifier?: FieldModelSpecifier
34
34
 
35
+ // grid column span; if unspecified, full width will be used
36
+ gridColumnSpan?: number
37
+
35
38
  // a hidden field won't show but can still be used to modify the record
36
39
  // FIXME: currently this is redundant with an absence of formFieldConfig but necessary for clarity
37
40
  hidden?: boolean
@@ -8,4 +8,5 @@
8
8
  [value]="searchInputValue$ | async"
9
9
  [preventCompleteOnSelection]="true"
10
10
  [autoFocus]="autoFocus"
11
+ [allowSubmit]="true"
11
12
  ></gn-ui-autocomplete>
@@ -1,21 +1,14 @@
1
- <div class="h-full flex flex-col">
2
- <p
3
- *ngIf="helperText"
4
- class="flex-none mb-2 font-medium text-sm text-gray-900"
5
- >
6
- {{ helperText }}
7
- </p>
8
- <div class="flex-1" [hidden]="preview">
9
- <gn-ui-text-area
10
- [placeholder]="placeholder"
11
- [value]="textContent"
12
- (valueChange)="textContentChangedHandler($event)"
13
- ></gn-ui-text-area>
14
- </div>
15
- <div
16
- class="flex-1 border border-gray-800 rounded overflow-y-scroll"
17
- [hidden]="!preview"
18
- >
19
- <gn-ui-markdown-parser [textContent]="textContent"></gn-ui-markdown-parser>
20
- </div>
1
+ <gn-ui-text-area
2
+ [hidden]="preview"
3
+ [placeholder]="placeholder"
4
+ [value]="textContent"
5
+ [extraClass]="textAreaExtraClass + ' !leading-normal'"
6
+ (valueChange)="textContentChangedHandler($event)"
7
+ ></gn-ui-text-area>
8
+
9
+ <div
10
+ class="gn-ui-text-input border-gray-100 hover:border-gray-100"
11
+ [hidden]="!preview"
12
+ >
13
+ <gn-ui-markdown-parser [textContent]="textContent"></gn-ui-markdown-parser>
21
14
  </div>
@@ -32,9 +32,9 @@ import { MatTooltipModule } from '@angular/material/tooltip'
32
32
  })
33
33
  export class MarkdownEditorComponent {
34
34
  @Input() preview = false
35
- @Input() helperText?: string
36
35
  @Input() placeholder: string
37
36
  @Input() textContent: string
37
+ @Input() textAreaExtraClass = ''
38
38
  @Output() textContentChanged: EventEmitter<string> =
39
39
  new EventEmitter<string>()
40
40