geonetwork-ui 2.4.0-dev.8118addf → 2.4.0-dev.825a487d

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 (129) hide show
  1. package/esm2022/libs/api/metadata-converter/src/index.mjs +1 -2
  2. package/esm2022/libs/api/metadata-converter/src/lib/xml-utils.mjs +5 -3
  3. package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +21 -4
  4. package/esm2022/libs/common/domain/src/lib/model/record/contact.model.mjs +28 -1
  5. package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
  6. package/esm2022/libs/feature/editor/src/lib/components/contact-card/contact-card.component.mjs +29 -0
  7. package/esm2022/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.mjs +131 -0
  8. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.mjs +170 -0
  9. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.mjs +3 -3
  10. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.mjs +21 -0
  11. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.mjs +7 -6
  12. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +24 -9
  13. package/esm2022/libs/feature/editor/src/lib/components/record-form/record-form.component.mjs +3 -3
  14. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +19 -3
  15. package/esm2022/libs/feature/map/src/lib/utils/map-utils.service.mjs +10 -4
  16. package/esm2022/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.mjs +3 -3
  17. package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +40 -7
  18. package/esm2022/libs/feature/search/src/lib/state/search.facade.mjs +6 -2
  19. package/esm2022/libs/ui/elements/src/index.mjs +2 -1
  20. package/esm2022/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.mjs +27 -0
  21. package/esm2022/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.mjs +4 -3
  22. package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +2 -2
  23. package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +3 -3
  24. package/esm2022/libs/ui/elements/src/lib/sortable-list/sortable-list.component.mjs +7 -3
  25. package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +19 -5
  26. package/esm2022/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.mjs +3 -3
  27. package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table.component.mjs +3 -3
  28. package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +49 -11
  29. package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +18 -6
  30. package/esm2022/translations/de.json +40 -16
  31. package/esm2022/translations/en.json +33 -9
  32. package/esm2022/translations/es.json +33 -9
  33. package/esm2022/translations/fr.json +43 -19
  34. package/esm2022/translations/it.json +33 -9
  35. package/esm2022/translations/nl.json +33 -9
  36. package/esm2022/translations/pt.json +33 -9
  37. package/fesm2022/geonetwork-ui.mjs +984 -259
  38. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  39. package/libs/api/metadata-converter/src/index.d.ts +0 -1
  40. package/libs/api/metadata-converter/src/index.d.ts.map +1 -1
  41. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +6 -1
  42. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  43. package/libs/common/domain/src/lib/model/record/contact.model.d.ts +1 -0
  44. package/libs/common/domain/src/lib/model/record/contact.model.d.ts.map +1 -1
  45. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +8 -0
  46. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
  47. package/libs/feature/editor/src/lib/components/contact-card/contact-card.component.d.ts +12 -0
  48. package/libs/feature/editor/src/lib/components/contact-card/contact-card.component.d.ts.map +1 -0
  49. package/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.d.ts +27 -0
  50. package/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.d.ts.map +1 -0
  51. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.d.ts +47 -0
  52. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.d.ts.map +1 -0
  53. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts +11 -0
  54. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts.map +1 -0
  55. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.d.ts +3 -1
  56. 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
  57. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +6 -1
  58. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -1
  59. package/libs/feature/editor/src/lib/fields.config.d.ts +2 -0
  60. package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
  61. package/libs/feature/map/src/lib/utils/map-utils.service.d.ts.map +1 -1
  62. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts +11 -3
  63. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
  64. package/libs/feature/search/src/lib/state/search.facade.d.ts +1 -0
  65. package/libs/feature/search/src/lib/state/search.facade.d.ts.map +1 -1
  66. package/libs/ui/elements/src/index.d.ts +1 -0
  67. package/libs/ui/elements/src/index.d.ts.map +1 -1
  68. package/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.d.ts +18 -0
  69. package/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.d.ts.map +1 -0
  70. package/libs/ui/elements/src/lib/sortable-list/sortable-list.component.d.ts +4 -4
  71. package/libs/ui/elements/src/lib/sortable-list/sortable-list.component.d.ts.map +1 -1
  72. package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts +9 -1
  73. package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts.map +1 -1
  74. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts +10 -1
  75. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts.map +1 -1
  76. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +6 -2
  77. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
  78. package/package.json +1 -1
  79. package/src/libs/api/metadata-converter/src/index.ts +0 -1
  80. package/src/libs/api/metadata-converter/src/lib/xml-utils.ts +5 -5
  81. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +24 -4
  82. package/src/libs/common/domain/src/lib/model/record/contact.model.ts +28 -0
  83. package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +10 -0
  84. package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.css +0 -0
  85. package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.html +25 -0
  86. package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.ts +30 -0
  87. package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.html +2 -1
  88. package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.ts +110 -19
  89. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.css +0 -0
  90. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.html +76 -0
  91. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.ts +271 -0
  92. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.html +1 -1
  93. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.css +0 -0
  94. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.html +5 -0
  95. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.ts +22 -0
  96. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.ts +8 -7
  97. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +11 -0
  98. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +18 -1
  99. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.html +1 -1
  100. package/src/libs/feature/editor/src/lib/fields.config.ts +20 -2
  101. package/src/libs/feature/map/src/lib/utils/map-utils.service.ts +8 -3
  102. package/src/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.html +1 -1
  103. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html +2 -1
  104. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +52 -3
  105. package/src/libs/feature/search/src/lib/state/search.facade.ts +6 -0
  106. package/src/libs/ui/elements/src/index.ts +1 -0
  107. package/src/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.css +0 -0
  108. package/src/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.html +12 -0
  109. package/src/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.ts +37 -0
  110. package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.html +4 -1
  111. package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.css +2 -1
  112. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +12 -8
  113. package/src/libs/ui/elements/src/lib/sortable-list/sortable-list.component.html +3 -1
  114. package/src/libs/ui/elements/src/lib/sortable-list/sortable-list.component.ts +8 -4
  115. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +15 -3
  116. package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.html +1 -1
  117. package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.html +1 -0
  118. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.html +10 -1
  119. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.ts +55 -3
  120. package/src/libs/ui/search/src/lib/results-table/results-table.component.html +7 -2
  121. package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +9 -9
  122. package/translations/de.json +40 -16
  123. package/translations/en.json +33 -9
  124. package/translations/es.json +33 -9
  125. package/translations/fr.json +43 -19
  126. package/translations/it.json +33 -9
  127. package/translations/nl.json +33 -9
  128. package/translations/pt.json +33 -9
  129. package/translations/sk.json +33 -9
@@ -0,0 +1,37 @@
1
+ import { ChangeDetectionStrategy, Component, Inject } from '@angular/core'
2
+ import {
3
+ MAT_DIALOG_DATA,
4
+ MatDialogModule,
5
+ MatDialogRef,
6
+ } from '@angular/material/dialog'
7
+ import { ButtonComponent } from '../../../../../../libs/ui/inputs/src'
8
+
9
+ export interface ConfirmationDialogData {
10
+ title: string
11
+ message: string
12
+ confirmText: string
13
+ cancelText: string
14
+ }
15
+
16
+ @Component({
17
+ selector: 'gn-ui-confirmation-dialog',
18
+ templateUrl: './confirmation-dialog.component.html',
19
+ styleUrls: ['./confirmation-dialog.component.css'],
20
+ changeDetection: ChangeDetectionStrategy.OnPush,
21
+ standalone: true,
22
+ imports: [MatDialogModule, ButtonComponent],
23
+ })
24
+ export class ConfirmationDialogComponent {
25
+ constructor(
26
+ public dialogRef: MatDialogRef<ConfirmationDialogComponent>,
27
+ @Inject(MAT_DIALOG_DATA) public data: ConfirmationDialogData
28
+ ) {}
29
+
30
+ onConfirm() {
31
+ this.dialogRef.close(true)
32
+ }
33
+
34
+ onCancel() {
35
+ this.dialogRef.close(false)
36
+ }
37
+ }
@@ -1,5 +1,8 @@
1
1
  <div class="h-full flex flex-col">
2
- <p class="flex-none mb-2 font-medium text-sm text-gray-900">
2
+ <p
3
+ *ngIf="helperText"
4
+ class="flex-none mb-2 font-medium text-sm text-gray-900"
5
+ >
3
6
  {{ helperText }}
4
7
  </p>
5
8
  <div class="flex-1" [hidden]="preview">
@@ -2,9 +2,10 @@
2
2
  :host ::ng-deep .markdown-body {
3
3
  -ms-text-size-adjust: 100%;
4
4
  -webkit-text-size-adjust: 100%;
5
- margin: 0px 0px 1.5rem 0px;
5
+ margin: 0;
6
6
  line-height: 1.5;
7
7
  word-wrap: break-word;
8
+ height: 100%;
8
9
  }
9
10
 
10
11
  /** Emphasis **/
@@ -1,7 +1,7 @@
1
1
  <div class="mb-6 md-description sm:mb-4 sm:pr-16">
2
2
  <gn-ui-content-ghost ghostClass="h-32" [showContent]="fieldReady('abstract')">
3
3
  <gn-ui-max-lines [maxLines]="6" *ngIf="metadata.abstract">
4
- <div>
4
+ <div class="mb-6">
5
5
  <gn-ui-markdown-parser
6
6
  [textContent]="metadata.abstract"
7
7
  ></gn-ui-markdown-parser>
@@ -47,19 +47,23 @@
47
47
  </ng-template>
48
48
  </ng-container>
49
49
  <ng-container *ngIf="legalConstraints.length">
50
- <gn-ui-markdown-parser
51
- *ngFor="let constraint of legalConstraints"
52
- [textContent]="constraint"
53
- >
54
- </gn-ui-markdown-parser>
50
+ <div class="mb-6">
51
+ <gn-ui-markdown-parser
52
+ *ngFor="let constraint of legalConstraints"
53
+ [textContent]="constraint"
54
+ >
55
+ </gn-ui-markdown-parser>
56
+ </div>
55
57
  </ng-container>
56
58
  <ng-container *ngIf="otherConstraints.length">
57
59
  <div gnUiLinkify *ngFor="let constraint of otherConstraints">
58
60
  <h5 translate class="font-medium text-black text-sm mb-[2px] mt-[16px]">
59
61
  record.metadata.otherConstraints
60
62
  </h5>
61
- <gn-ui-markdown-parser [textContent]="constraint">
62
- </gn-ui-markdown-parser>
63
+ <div class="mb-6">
64
+ <gn-ui-markdown-parser [textContent]="constraint">
65
+ </gn-ui-markdown-parser>
66
+ </div>
63
67
  </div>
64
68
  </ng-container>
65
69
 
@@ -12,7 +12,9 @@
12
12
  class="sortable-list flex flex-col gap-3 p-2"
13
13
  (cdkDropListDropped)="drop($event)"
14
14
  >
15
- <ng-container *ngFor="let element of elements; index as index">
15
+ <ng-container
16
+ *ngFor="let element of elements; index as index; trackBy: trackByFn"
17
+ >
16
18
  <div class="sortable-box bg-white flex items-center" cdkDrag>
17
19
  <span
18
20
  cdkDragHandle
@@ -17,9 +17,9 @@ import {
17
17
  import { MatIconModule } from '@angular/material/icon'
18
18
  import { ButtonComponent } from '../../../../../../libs/ui/inputs/src'
19
19
 
20
- type DynamicElement = {
21
- component: Type<any>
22
- inputs: Record<string, any>
20
+ export type DynamicElement = {
21
+ component: Type<unknown>
22
+ inputs: Record<string, unknown>
23
23
  }
24
24
 
25
25
  @Component({
@@ -40,7 +40,7 @@ type DynamicElement = {
40
40
  })
41
41
  export class SortableListComponent {
42
42
  @Input() elements: Array<DynamicElement>
43
- @Input() addOptions: Array<{ buttonLabel: string; eventName: string }>
43
+ @Input() addOptions: Array<{ buttonLabel: string; eventName: string }> = []
44
44
  @Output() elementsChange = new EventEmitter<Array<DynamicElement>>()
45
45
  @Output() add = new EventEmitter<string>()
46
46
 
@@ -53,4 +53,8 @@ export class SortableListComponent {
53
53
  this.elements = this.elements.filter((_, i) => i !== index)
54
54
  this.elementsChange.emit(this.elements)
55
55
  }
56
+
57
+ trackByFn(index: number) {
58
+ return index
59
+ }
56
60
  }
@@ -61,6 +61,7 @@ export class AutocompleteComponent
61
61
  @Input() action: (value: string) => Observable<AutocompleteItem[]>
62
62
  @Input() value?: AutocompleteItem
63
63
  @Input() clearOnSelection = false
64
+ @Input() preventCompleteOnSelection = false
64
65
  @Input() autoFocus = false
65
66
  @Input() minCharacterCount? = 3
66
67
  @Input() allowSubmit = true
@@ -206,13 +207,24 @@ export class AutocompleteComponent
206
207
  this.inputSubmitted.emit(this.inputRef.nativeElement.value)
207
208
  }
208
209
 
210
+ /**
211
+ * This function is triggered when an item is selected in the list of displayed items.
212
+ * If preventCompleteOnSelection is true then the input will be left as entered by the user.
213
+ * If preventCompleteOnSelection is false (by default) then the input will be completed with the item selected by the user.
214
+ * If clearOnSelection is true then the input will be cleared upon selection.
215
+ * @param event
216
+ */
209
217
  handleSelection(event: MatAutocompleteSelectedEvent) {
210
218
  this.cancelEnter = true
211
219
  this.itemSelected.emit(event.option.value)
212
- if (this.clearOnSelection) {
213
- this.lastInputValue$.pipe(first()).subscribe((any) => {
214
- this.inputRef.nativeElement.value = any
220
+ if (this.preventCompleteOnSelection) {
221
+ this.lastInputValue$.pipe(first()).subscribe((lastInputValue) => {
222
+ this.inputRef.nativeElement.value = lastInputValue
215
223
  })
224
+ return
225
+ }
226
+ if (this.clearOnSelection) {
227
+ this.inputRef.nativeElement.value = ''
216
228
  }
217
229
  }
218
230
  }
@@ -12,7 +12,7 @@
12
12
  </span>
13
13
  </div>
14
14
  </div>
15
- <div class="flex-1">
15
+ <div class="flex-1 overflow-y-auto">
16
16
  <ng-content></ng-content>
17
17
  </div>
18
18
  </div>
@@ -30,6 +30,7 @@
30
30
  class="contents text-gray-900 cursor-pointer group"
31
31
  *ngFor="let item of items"
32
32
  (click)="handleRowClick(item)"
33
+ data-cy="table-row"
33
34
  >
34
35
  <div
35
36
  class="relative h-0"
@@ -1,5 +1,5 @@
1
1
  <gn-ui-button
2
- type="outline"
2
+ type="light"
3
3
  [matMenuTriggerFor]="menu"
4
4
  (buttonClick)="openMenu()"
5
5
  data-test="record-menu-button"
@@ -9,9 +9,18 @@
9
9
  <mat-menu #menu="matMenu">
10
10
  <button
11
11
  mat-menu-item
12
+ [disabled]="!canDuplicate"
12
13
  (click)="duplicate.emit()"
13
14
  data-test="record-menu-duplicate-button"
14
15
  >
15
16
  <span translate>record.action.duplicate</span>
16
17
  </button>
18
+ <button
19
+ mat-menu-item
20
+ [disabled]="!canDelete"
21
+ (click)="openDeleteConfirmationDialog()"
22
+ data-test="record-menu-delete-button"
23
+ >
24
+ <span translate>record.action.delete</span>
25
+ </button>
17
26
  </mat-menu>
@@ -1,22 +1,74 @@
1
- import { Component, EventEmitter, Output, ViewChild } from '@angular/core'
1
+ import {
2
+ Component,
3
+ EventEmitter,
4
+ Input,
5
+ Output,
6
+ ViewChild,
7
+ } from '@angular/core'
8
+ import { MatDialog, MatDialogModule } from '@angular/material/dialog'
2
9
  import { MatIconModule } from '@angular/material/icon'
3
10
  import { MatMenuModule, MatMenuTrigger } from '@angular/material/menu'
11
+ import { ConfirmationDialogComponent } from '../../../../../../../libs/ui/elements/src'
4
12
  import { ButtonComponent } from '../../../../../../../libs/ui/inputs/src'
5
- import { TranslateModule } from '@ngx-translate/core'
13
+ import { TranslateModule, TranslateService } from '@ngx-translate/core'
6
14
 
7
15
  @Component({
8
16
  selector: 'gn-ui-action-menu',
9
17
  templateUrl: './action-menu.component.html',
10
18
  styleUrls: ['./action-menu.component.css'],
11
19
  standalone: true,
12
- imports: [MatIconModule, ButtonComponent, MatMenuModule, TranslateModule],
20
+ imports: [
21
+ MatIconModule,
22
+ ButtonComponent,
23
+ MatMenuModule,
24
+ MatDialogModule,
25
+ ConfirmationDialogComponent,
26
+ TranslateModule,
27
+ ],
13
28
  })
14
29
  export class ActionMenuComponent {
30
+ @Input() canDuplicate: boolean
31
+ @Input() canDelete: boolean
15
32
  @Output() duplicate = new EventEmitter<void>()
33
+ @Output() delete = new EventEmitter<void>()
16
34
 
17
35
  @ViewChild(MatMenuTrigger) trigger: MatMenuTrigger
18
36
 
37
+ constructor(
38
+ public dialog: MatDialog,
39
+ private translateService: TranslateService
40
+ ) {}
41
+
19
42
  openMenu() {
20
43
  this.trigger.openMenu()
21
44
  }
45
+
46
+ openDeleteConfirmationDialog() {
47
+ const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
48
+ data: {
49
+ title: this.translateService.instant(
50
+ 'editor.record.delete.confirmation.title'
51
+ ),
52
+ message: this.translateService.instant(
53
+ 'editor.record.delete.confirmation.message'
54
+ ),
55
+ confirmText: this.translateService.instant(
56
+ 'editor.record.delete.confirmation.confirmText'
57
+ ),
58
+ cancelText: this.translateService.instant(
59
+ 'editor.record.delete.confirmation.cancelText'
60
+ ),
61
+ },
62
+ restoreFocus: false,
63
+ })
64
+
65
+ // Manually restore focus to the menu trigger since the element that
66
+ // opens the dialog won't be in the DOM any more when the dialog closes.
67
+ dialogRef.afterClosed().subscribe((confirmed) => {
68
+ this.trigger.focus()
69
+ if (confirmed) {
70
+ this.delete.emit()
71
+ }
72
+ })
73
+ }
22
74
  }
@@ -37,7 +37,7 @@
37
37
  <div class="flex flex-row items-center gap-2 max-w-full">
38
38
  <span class="overflow-hidden text-ellipsis">{{ item.title }}</span>
39
39
  <gn-ui-badge
40
- *ngIf="recordHasDraft(item)"
40
+ *ngIf="hasDraft(item)"
41
41
  [style.--gn-ui-badge-padding]="'0.4em 0.6em'"
42
42
  [style.--gn-ui-badge-text-color]="'#3d2006'"
43
43
  [style.--gn-ui-badge-background-color]="'#ffbc7b'"
@@ -125,7 +125,12 @@
125
125
  <gn-ui-interactive-table-column>
126
126
  <ng-template #header> </ng-template>
127
127
  <ng-template #cell let-item>
128
- <gn-ui-action-menu (duplicate)="handleDuplicate(item)">
128
+ <gn-ui-action-menu
129
+ [canDuplicate]="canDuplicate(item)"
130
+ [canDelete]="canDelete(item)"
131
+ (duplicate)="handleDuplicate(item)"
132
+ (delete)="handleDelete(item)"
133
+ >
129
134
  </gn-ui-action-menu>
130
135
  </ng-template>
131
136
  </gn-ui-interactive-table-column>
@@ -1,13 +1,6 @@
1
1
  import { CommonModule } from '@angular/common'
2
- import {
3
- Component,
4
- EventEmitter,
5
- Input,
6
- Output,
7
- ViewChild,
8
- } from '@angular/core'
2
+ import { Component, EventEmitter, Input, Output } from '@angular/core'
9
3
  import { MatIconModule } from '@angular/material/icon'
10
- import { MatMenuModule, MatMenuTrigger } from '@angular/material/menu'
11
4
  import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
12
5
  import {
13
6
  FieldSort,
@@ -47,12 +40,15 @@ export class ResultsTableComponent {
47
40
  @Input() records: CatalogRecord[] = []
48
41
  @Input() selectedRecordsIdentifiers: string[] = []
49
42
  @Input() sortOrder: SortByField = null
50
- @Input() recordHasDraft: (record: CatalogRecord) => boolean = () => false
43
+ @Input() hasDraft: (record: CatalogRecord) => boolean = () => false
44
+ @Input() canDuplicate: (record: CatalogRecord) => boolean = () => true
45
+ @Input() canDelete: (record: CatalogRecord) => boolean = () => true
51
46
 
52
47
  // emits the column (field) as well as the order
53
48
  @Output() sortByChange = new EventEmitter<[string, 'asc' | 'desc']>()
54
49
  @Output() recordClick = new EventEmitter<CatalogRecord>()
55
50
  @Output() duplicateRecord = new EventEmitter<CatalogRecord>()
51
+ @Output() deleteRecord = new EventEmitter<CatalogRecord>()
56
52
  @Output() recordsSelectedChange = new EventEmitter<
57
53
  [CatalogRecord[], boolean]
58
54
  >()
@@ -103,6 +99,10 @@ export class ResultsTableComponent {
103
99
  this.duplicateRecord.emit(item as CatalogRecord)
104
100
  }
105
101
 
102
+ handleDelete(item: unknown) {
103
+ this.deleteRecord.emit(item as CatalogRecord)
104
+ }
105
+
106
106
  setSortBy(col: string, order: 'asc' | 'desc') {
107
107
  this.sortByChange.emit([col, order])
108
108
  }
@@ -147,6 +147,27 @@
147
147
  "dataset.error.parse": "Die Daten wurden geladen, konnten aber nicht gelesen werden: \"{ info }\"",
148
148
  "dataset.error.unknown": "Die Daten können nicht angezeigt werden: \"{ info }\"",
149
149
  "dataset.error.unsupportedType": "Der folgende Inhaltstyp wird nicht unterstützt: \"{ info }\"",
150
+ "domain.contact.role.author": "",
151
+ "domain.contact.role.collaborator": "",
152
+ "domain.contact.role.contributor": "",
153
+ "domain.contact.role.custodian": "",
154
+ "domain.contact.role.distributor": "",
155
+ "domain.contact.role.editor": "",
156
+ "domain.contact.role.funder": "",
157
+ "domain.contact.role.mediator": "",
158
+ "domain.contact.role.originator": "",
159
+ "domain.contact.role.other": "",
160
+ "domain.contact.role.owner": "",
161
+ "domain.contact.role.point_of_contact": "",
162
+ "domain.contact.role.principal_investigator": "",
163
+ "domain.contact.role.processor": "",
164
+ "domain.contact.role.publisher": "",
165
+ "domain.contact.role.resource_provider": "",
166
+ "domain.contact.role.rights_holder": "",
167
+ "domain.contact.role.sponsor": "",
168
+ "domain.contact.role.stakeholder": "",
169
+ "domain.contact.role.unspecified": "",
170
+ "domain.contact.role.user": "",
150
171
  "domain.record.status.completed": "Abgeschlossen",
151
172
  "domain.record.status.deprecated": "Veraltet",
152
173
  "domain.record.status.ongoing": "Kontinuierliche Aktualisierung",
@@ -165,21 +186,29 @@
165
186
  "downloads.format.unknown": "unbekannt",
166
187
  "downloads.wfs.featuretype.not.found": "Der Layer wurde nicht gefunden",
167
188
  "dropFile": "Datei ablegen",
189
+ "editor.record.delete.confirmation.cancelText": "Stornieren",
190
+ "editor.record.delete.confirmation.confirmText": "Löschen",
191
+ "editor.record.delete.confirmation.message": "Sind Sie sicher, dass Sie diesen Datensatz löschen möchten?",
192
+ "editor.record.delete.confirmation.title": "Datensatz löschen?",
193
+ "editor.record.deleteError.body": "Der Datensatz konnte nicht gelöscht werden:",
194
+ "editor.record.deleteError.closeMessage": "Verstanden",
195
+ "editor.record.deleteError.title": "Fehler beim Löschen des Datensatzes",
196
+ "editor.record.deleteSuccess.body": "",
197
+ "editor.record.deleteSuccess.title": "",
168
198
  "editor.record.form.bottomButtons.comeBackLater": "",
169
199
  "editor.record.form.bottomButtons.next": "",
170
200
  "editor.record.form.bottomButtons.previous": "",
171
- "editor.record.form.field.abstract": "",
201
+ "editor.record.form.field.abstract": "Kurzbeschreibung",
202
+ "editor.record.form.field.contactsForResource.noContact": "",
172
203
  "editor.record.form.field.keywords": "Schlagwörter",
173
204
  "editor.record.form.field.license": "Lizenz",
174
- "editor.record.form.field.recordUpdated": "",
175
- "editor.record.form.field.resourceUpdated": "",
176
- "editor.record.form.field.temporalExtents": "",
177
- "editor.record.form.field.title": "",
178
- "editor.record.form.field.uniqueIdentifier": "",
179
- "editor.record.form.field.updateFrequency": "",
180
- "editor.record.form.abstract": "Kurzbeschreibung",
181
- "editor.record.form.keywords": "Schlüsselwörter",
182
- "editor.record.form.license": "Lizenz",
205
+ "editor.record.form.field.overviews": "",
206
+ "editor.record.form.field.recordUpdated": "Datensatz zuletzt aktualisiert",
207
+ "editor.record.form.field.resourceUpdated": "Letztes Aktualisierungsdatum",
208
+ "editor.record.form.field.temporalExtents": "Zeitlicher Umfang",
209
+ "editor.record.form.field.title": "Metadaten-Titel",
210
+ "editor.record.form.field.uniqueIdentifier": "Eindeutige Kennung (ID)",
211
+ "editor.record.form.field.updateFrequency": "Aktualisierungshäufigkeit",
183
212
  "editor.record.form.license.cc-by": "Creative Commons CC-BY",
184
213
  "editor.record.form.license.cc-by-sa": "Creative Commons CC-BY-SA",
185
214
  "editor.record.form.license.cc-zero": "Creative Commons CC-0",
@@ -205,16 +234,10 @@
205
234
  "editor.record.form.section.dataPointOfContact.label": "",
206
235
  "editor.record.form.section.geographicalCoverage.label": "",
207
236
  "editor.record.form.section.useAndAccessConditions.label": "",
208
- "editor.record.form.metadata.title": "Metadaten-Titel",
209
- "editor.record.form.record.updated": "Datensatz zuletzt aktualisiert",
210
- "editor.record.form.resourceUpdated": "Letztes Aktualisierungsdatum",
211
- "editor.record.form.temporalExtents": "Zeitlicher Umfang",
212
237
  "editor.record.form.temporalExtents.addDate": "Zeitpunkt",
213
238
  "editor.record.form.temporalExtents.addRange": "Zeitraum",
214
239
  "editor.record.form.temporalExtents.date": "Datum",
215
240
  "editor.record.form.temporalExtents.range": "Datumsbereich",
216
- "editor.record.form.unique.identifier": "Eindeutige Kennung (ID)",
217
- "editor.record.form.updateFrequency": "Aktualisierungshäufigkeit",
218
241
  "editor.record.form.updateFrequency.planned": "Die Daten sollten regelmäßig aktualisiert werden.",
219
242
  "editor.record.loadError.body": "Der Datensatz konnte nicht geladen werden:",
220
243
  "editor.record.loadError.closeMessage": "Verstanden",
@@ -306,6 +329,7 @@
306
329
  "pagination.page": "Seite",
307
330
  "pagination.pageOf": "von",
308
331
  "previous": "zurück",
332
+ "record.action.delete": "Löschen",
309
333
  "record.action.download": "Herunterladen",
310
334
  "record.action.duplicate": "",
311
335
  "record.action.view": "Anzeigen",
@@ -147,6 +147,27 @@
147
147
  "dataset.error.parse": "The data was loaded but could not be parsed: \"{ info }\"",
148
148
  "dataset.error.unknown": "The data cannot be displayed: \"{ info }\"",
149
149
  "dataset.error.unsupportedType": "The following content type is unsupported: \"{ info }\"",
150
+ "domain.contact.role.author": "Author",
151
+ "domain.contact.role.collaborator": "Collaborator",
152
+ "domain.contact.role.contributor": "Contributor",
153
+ "domain.contact.role.custodian": "Custodian",
154
+ "domain.contact.role.distributor": "Distributor",
155
+ "domain.contact.role.editor": "Editor",
156
+ "domain.contact.role.funder": "Funder",
157
+ "domain.contact.role.mediator": "Mediator",
158
+ "domain.contact.role.originator": "Originator",
159
+ "domain.contact.role.other": "Other",
160
+ "domain.contact.role.owner": "Owner",
161
+ "domain.contact.role.point_of_contact": "Point of contact",
162
+ "domain.contact.role.principal_investigator": "Principal investigator",
163
+ "domain.contact.role.processor": "Processor",
164
+ "domain.contact.role.publisher": "Publisher",
165
+ "domain.contact.role.resource_provider": "Resource provider",
166
+ "domain.contact.role.rights_holder": "Rights holder",
167
+ "domain.contact.role.sponsor": "Sponsor",
168
+ "domain.contact.role.stakeholder": "Stakeholder",
169
+ "domain.contact.role.unspecified": "Unspecified",
170
+ "domain.contact.role.user": "User",
150
171
  "domain.record.status.completed": "Completed",
151
172
  "domain.record.status.deprecated": "Deprecated",
152
173
  "domain.record.status.ongoing": "On going",
@@ -165,21 +186,29 @@
165
186
  "downloads.format.unknown": "unknown",
166
187
  "downloads.wfs.featuretype.not.found": "The layer was not found",
167
188
  "dropFile": "drop file",
189
+ "editor.record.delete.confirmation.cancelText": "Cancel",
190
+ "editor.record.delete.confirmation.confirmText": "Delete",
191
+ "editor.record.delete.confirmation.message": "Are you sure you want to delete this record?",
192
+ "editor.record.delete.confirmation.title": "Delete record?",
193
+ "editor.record.deleteError.body": "The record could not be deleted:",
194
+ "editor.record.deleteError.closeMessage": "Understood",
195
+ "editor.record.deleteError.title": "Error deleting record",
196
+ "editor.record.deleteSuccess.body": "The record was successfully deleted !",
197
+ "editor.record.deleteSuccess.title": "Delete success",
168
198
  "editor.record.form.bottomButtons.comeBackLater": "Come back later",
169
199
  "editor.record.form.bottomButtons.next": "Next",
170
200
  "editor.record.form.bottomButtons.previous": "Previous",
171
201
  "editor.record.form.field.abstract": "Abstract",
202
+ "editor.record.form.field.contactsForResource.noContact": "Please provide at least one point of contact responsible for the data.",
172
203
  "editor.record.form.field.keywords": "Keywords",
173
204
  "editor.record.form.field.license": "License",
205
+ "editor.record.form.field.overviews": "Overviews",
174
206
  "editor.record.form.field.recordUpdated": "Record Updated",
175
207
  "editor.record.form.field.resourceUpdated": "Resource Updated",
176
208
  "editor.record.form.field.temporalExtents": "Temporal extents",
177
209
  "editor.record.form.field.title": "Metadata title",
178
210
  "editor.record.form.field.uniqueIdentifier": "Unique identifier",
179
211
  "editor.record.form.field.updateFrequency": "Update frequency",
180
- "editor.record.form.abstract": "Abstract",
181
- "editor.record.form.keywords": "Keywords",
182
- "editor.record.form.license": "License",
183
212
  "editor.record.form.license.cc-by": "Creative Commons CC-BY",
184
213
  "editor.record.form.license.cc-by-sa": "Creative Commons CC-BY-SA",
185
214
  "editor.record.form.license.cc-zero": "Creative Commons CC-0",
@@ -205,16 +234,10 @@
205
234
  "editor.record.form.section.dataPointOfContact.label": "Data point of contact",
206
235
  "editor.record.form.section.geographicalCoverage.label": "Geographical coverage",
207
236
  "editor.record.form.section.useAndAccessConditions.label": "Use and access conditions",
208
- "editor.record.form.metadata.title": "Metadata title",
209
- "editor.record.form.record.updated": "Record updated",
210
- "editor.record.form.resourceUpdated": "Last update date",
211
- "editor.record.form.temporalExtents": "Temporal extent",
212
237
  "editor.record.form.temporalExtents.addDate": "Time instant",
213
238
  "editor.record.form.temporalExtents.addRange": "Time period",
214
239
  "editor.record.form.temporalExtents.date": "Date",
215
240
  "editor.record.form.temporalExtents.range": "Date range",
216
- "editor.record.form.unique.identifier": "Unique identifier",
217
- "editor.record.form.updateFrequency": "Update frequency",
218
241
  "editor.record.form.updateFrequency.planned": "The data should be updated regularly.",
219
242
  "editor.record.loadError.body": "The record could not be loaded:",
220
243
  "editor.record.loadError.closeMessage": "Understood",
@@ -306,6 +329,7 @@
306
329
  "pagination.page": "page",
307
330
  "pagination.pageOf": "of",
308
331
  "previous": "previous",
332
+ "record.action.delete": "Delete",
309
333
  "record.action.download": "Download",
310
334
  "record.action.duplicate": "Duplicate",
311
335
  "record.action.view": "View",
@@ -147,6 +147,27 @@
147
147
  "dataset.error.parse": "",
148
148
  "dataset.error.unknown": "",
149
149
  "dataset.error.unsupportedType": "",
150
+ "domain.contact.role.author": "",
151
+ "domain.contact.role.collaborator": "",
152
+ "domain.contact.role.contributor": "",
153
+ "domain.contact.role.custodian": "",
154
+ "domain.contact.role.distributor": "",
155
+ "domain.contact.role.editor": "",
156
+ "domain.contact.role.funder": "",
157
+ "domain.contact.role.mediator": "",
158
+ "domain.contact.role.originator": "",
159
+ "domain.contact.role.other": "",
160
+ "domain.contact.role.owner": "",
161
+ "domain.contact.role.point_of_contact": "",
162
+ "domain.contact.role.principal_investigator": "",
163
+ "domain.contact.role.processor": "",
164
+ "domain.contact.role.publisher": "",
165
+ "domain.contact.role.resource_provider": "",
166
+ "domain.contact.role.rights_holder": "",
167
+ "domain.contact.role.sponsor": "",
168
+ "domain.contact.role.stakeholder": "",
169
+ "domain.contact.role.unspecified": "",
170
+ "domain.contact.role.user": "",
150
171
  "domain.record.status.completed": "",
151
172
  "domain.record.status.deprecated": "",
152
173
  "domain.record.status.ongoing": "",
@@ -165,21 +186,29 @@
165
186
  "downloads.format.unknown": "",
166
187
  "downloads.wfs.featuretype.not.found": "",
167
188
  "dropFile": "",
189
+ "editor.record.delete.confirmation.cancelText": "",
190
+ "editor.record.delete.confirmation.confirmText": "",
191
+ "editor.record.delete.confirmation.message": "",
192
+ "editor.record.delete.confirmation.title": "",
193
+ "editor.record.deleteError.body": "",
194
+ "editor.record.deleteError.closeMessage": "",
195
+ "editor.record.deleteError.title": "",
196
+ "editor.record.deleteSuccess.body": "",
197
+ "editor.record.deleteSuccess.title": "",
168
198
  "editor.record.form.bottomButtons.comeBackLater": "",
169
199
  "editor.record.form.bottomButtons.next": "",
170
200
  "editor.record.form.bottomButtons.previous": "",
171
201
  "editor.record.form.field.abstract": "",
202
+ "editor.record.form.field.contactsForResource.noContact": "",
172
203
  "editor.record.form.field.keywords": "",
173
204
  "editor.record.form.field.license": "",
205
+ "editor.record.form.field.overviews": "",
174
206
  "editor.record.form.field.recordUpdated": "",
175
207
  "editor.record.form.field.resourceUpdated": "",
176
208
  "editor.record.form.field.temporalExtents": "",
177
209
  "editor.record.form.field.title": "",
178
210
  "editor.record.form.field.uniqueIdentifier": "",
179
211
  "editor.record.form.field.updateFrequency": "",
180
- "editor.record.form.abstract": "",
181
- "editor.record.form.keywords": "",
182
- "editor.record.form.license": "",
183
212
  "editor.record.form.license.cc-by": "",
184
213
  "editor.record.form.license.cc-by-sa": "",
185
214
  "editor.record.form.license.cc-zero": "",
@@ -205,16 +234,10 @@
205
234
  "editor.record.form.section.dataPointOfContact.label": "",
206
235
  "editor.record.form.section.geographicalCoverage.label": "",
207
236
  "editor.record.form.section.useAndAccessConditions.label": "",
208
- "editor.record.form.metadata.title": "",
209
- "editor.record.form.record.updated": "",
210
- "editor.record.form.resourceUpdated": "",
211
- "editor.record.form.temporalExtents": "",
212
237
  "editor.record.form.temporalExtents.addDate": "",
213
238
  "editor.record.form.temporalExtents.addRange": "",
214
239
  "editor.record.form.temporalExtents.date": "",
215
240
  "editor.record.form.temporalExtents.range": "",
216
- "editor.record.form.unique.identifier": "",
217
- "editor.record.form.updateFrequency": "",
218
241
  "editor.record.form.updateFrequency.planned": "",
219
242
  "editor.record.loadError.body": "",
220
243
  "editor.record.loadError.closeMessage": "",
@@ -306,6 +329,7 @@
306
329
  "pagination.page": "",
307
330
  "pagination.pageOf": "",
308
331
  "previous": "",
332
+ "record.action.delete": "",
309
333
  "record.action.download": "",
310
334
  "record.action.duplicate": "",
311
335
  "record.action.view": "",