geonetwork-ui 2.4.0-dev.00c93bef → 2.4.0-dev.42a43a29

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 (51) hide show
  1. package/esm2022/libs/api/metadata-converter/src/index.mjs +2 -1
  2. package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +12 -1
  3. package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
  4. package/esm2022/libs/data-access/gn4/src/openapi/api/records.api.service.mjs +2 -6
  5. package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +9 -3
  6. package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +29 -0
  7. package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +15 -7
  8. package/esm2022/translations/de.json +1 -0
  9. package/esm2022/translations/en.json +1 -0
  10. package/esm2022/translations/es.json +1 -0
  11. package/esm2022/translations/fr.json +1 -0
  12. package/esm2022/translations/it.json +1 -0
  13. package/esm2022/translations/nl.json +1 -0
  14. package/esm2022/translations/pt.json +1 -0
  15. package/fesm2022/geonetwork-ui.mjs +64 -15
  16. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  17. package/libs/api/metadata-converter/src/index.d.ts +1 -0
  18. package/libs/api/metadata-converter/src/index.d.ts.map +1 -1
  19. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +1 -0
  20. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  21. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +9 -0
  22. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
  23. package/libs/data-access/gn4/src/openapi/api/records.api.service.d.ts.map +1 -1
  24. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts +3 -1
  25. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
  26. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts +11 -0
  27. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts.map +1 -0
  28. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +4 -2
  29. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/src/libs/api/metadata-converter/src/index.ts +1 -0
  32. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +20 -0
  33. package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +12 -0
  34. package/src/libs/data-access/gn4/src/openapi/api/records.api.service.ts +1 -5
  35. package/src/libs/data-access/gn4/src/spec.yaml +0 -8
  36. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html +1 -0
  37. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +5 -0
  38. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.css +0 -0
  39. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.html +17 -0
  40. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.ts +22 -0
  41. package/src/libs/ui/search/src/lib/results-table/results-table.component.html +9 -0
  42. package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +26 -12
  43. package/tailwind.base.css +2 -1
  44. package/translations/de.json +1 -0
  45. package/translations/en.json +1 -0
  46. package/translations/es.json +1 -0
  47. package/translations/fr.json +1 -0
  48. package/translations/it.json +1 -0
  49. package/translations/nl.json +1 -0
  50. package/translations/pt.json +1 -0
  51. package/translations/sk.json +1 -0
@@ -30,6 +30,18 @@ export abstract class RecordsRepositoryInterface {
30
30
  uniqueIdentifier: string
31
31
  ): Observable<[CatalogRecord, string, boolean] | null>
32
32
 
33
+ /**
34
+ * This emits once:
35
+ * - record object with a new unique identifier and suffixed title
36
+ * - serialized representation of the record as text
37
+ * - false, as the duplicated record is always a draft
38
+ * @param uniqueIdentifier
39
+ * @returns Observable<[CatalogRecord, string, false] | null>
40
+ */
41
+ abstract openRecordForDuplication(
42
+ uniqueIdentifier: string
43
+ ): Observable<[CatalogRecord, string, false] | null>
44
+
33
45
  /**
34
46
  * @param record
35
47
  * @param referenceRecordSource
@@ -7201,11 +7201,7 @@ export class RecordsApiService {
7201
7201
  }
7202
7202
 
7203
7203
  // to determine the Content-Type header
7204
- const consumes: string[] = [
7205
- 'application/xml',
7206
- 'application/json',
7207
- 'application/x-www-form-urlencoded',
7208
- ]
7204
+ const consumes: string[] = ['application/xml']
7209
7205
  const httpContentTypeSelected: string | undefined =
7210
7206
  this.configuration.selectHeaderContentType(consumes)
7211
7207
  if (httpContentTypeSelected !== undefined) {
@@ -1832,14 +1832,6 @@ paths:
1832
1832
  schema:
1833
1833
  type: string
1834
1834
  description: XML fragment.
1835
- application/json:
1836
- schema:
1837
- type: string
1838
- description: XML fragment.
1839
- application/x-www-form-urlencoded:
1840
- schema:
1841
- type: string
1842
- description: XML fragment.
1843
1835
  responses:
1844
1836
  default:
1845
1837
  description: default response
@@ -4,6 +4,7 @@
4
4
  [selectedRecordsIdentifiers]="selectedRecords$ | async"
5
5
  [sortOrder]="sortBy$ | async"
6
6
  (recordClick)="handleRecordClick($event)"
7
+ (duplicateRecord)="handleDuplicateRecord($event)"
7
8
  (recordsSelectedChange)="handleRecordsSelectedChange($event[0], $event[1])"
8
9
  (sortByChange)="handleSortByChange($event[0], $event[1])"
9
10
  ></gn-ui-results-table>
@@ -16,6 +16,7 @@ import { CommonModule } from '@angular/common'
16
16
  })
17
17
  export class ResultsTableContainerComponent {
18
18
  @Output() recordClick = new EventEmitter<CatalogRecord>()
19
+ @Output() duplicateRecord = new EventEmitter<CatalogRecord>()
19
20
 
20
21
  records$ = this.searchFacade.results$
21
22
  selectedRecords$ = this.selectionService.selectedRecordsIdentifiers$
@@ -35,6 +36,10 @@ export class ResultsTableContainerComponent {
35
36
  this.recordClick.emit(item as CatalogRecord)
36
37
  }
37
38
 
39
+ handleDuplicateRecord(item: unknown) {
40
+ this.duplicateRecord.emit(item as CatalogRecord)
41
+ }
42
+
38
43
  handleSortByChange(col: string, order: 'asc' | 'desc') {
39
44
  this.searchService.setSortBy([order, col])
40
45
  }
@@ -0,0 +1,17 @@
1
+ <gn-ui-button
2
+ type="outline"
3
+ [matMenuTriggerFor]="menu"
4
+ (buttonClick)="openMenu()"
5
+ data-test="record-menu-button"
6
+ >
7
+ <mat-icon class="material-symbols-outlined">more_vert</mat-icon>
8
+ </gn-ui-button>
9
+ <mat-menu #menu="matMenu">
10
+ <button
11
+ mat-menu-item
12
+ (click)="duplicate.emit()"
13
+ data-test="record-menu-duplicate-button"
14
+ >
15
+ <span translate>record.action.duplicate</span>
16
+ </button>
17
+ </mat-menu>
@@ -0,0 +1,22 @@
1
+ import { Component, EventEmitter, Output, ViewChild } from '@angular/core'
2
+ import { MatIconModule } from '@angular/material/icon'
3
+ import { MatMenuModule, MatMenuTrigger } from '@angular/material/menu'
4
+ import { ButtonComponent } from '../../../../../../../libs/ui/inputs/src'
5
+ import { TranslateModule } from '@ngx-translate/core'
6
+
7
+ @Component({
8
+ selector: 'gn-ui-action-menu',
9
+ templateUrl: './action-menu.component.html',
10
+ styleUrls: ['./action-menu.component.css'],
11
+ standalone: true,
12
+ imports: [MatIconModule, ButtonComponent, MatMenuModule, TranslateModule],
13
+ })
14
+ export class ActionMenuComponent {
15
+ @Output() duplicate = new EventEmitter<void>()
16
+
17
+ @ViewChild(MatMenuTrigger) trigger: MatMenuTrigger
18
+
19
+ openMenu() {
20
+ this.trigger.openMenu()
21
+ }
22
+ }
@@ -120,4 +120,13 @@
120
120
  {{ dateToString(item.recordUpdated) }}
121
121
  </ng-template>
122
122
  </gn-ui-interactive-table-column>
123
+
124
+ <!-- ACTION MENU COLUMN -->
125
+ <gn-ui-interactive-table-column>
126
+ <ng-template #header> </ng-template>
127
+ <ng-template #cell let-item>
128
+ <gn-ui-action-menu (duplicate)="handleDuplicate(item)">
129
+ </gn-ui-action-menu>
130
+ </ng-template>
131
+ </gn-ui-interactive-table-column>
123
132
  </gn-ui-interactive-table>
@@ -1,23 +1,31 @@
1
- import { Component, EventEmitter, Input, Output } from '@angular/core'
1
+ import { CommonModule } from '@angular/common'
2
+ import {
3
+ Component,
4
+ EventEmitter,
5
+ Input,
6
+ Output,
7
+ ViewChild,
8
+ } from '@angular/core'
9
+ import { MatIconModule } from '@angular/material/icon'
10
+ import { MatMenuModule, MatMenuTrigger } from '@angular/material/menu'
2
11
  import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
3
12
  import {
4
- FileFormat,
5
- getBadgeColor,
6
- getFileFormat,
7
- getFormatPriority,
8
- } from '../../../../../../libs/util/shared/src'
13
+ FieldSort,
14
+ SortByField,
15
+ } from '../../../../../../libs/common/domain/src/lib/model/search'
9
16
  import { BadgeComponent, UiInputsModule } from '../../../../../../libs/ui/inputs/src'
10
17
  import {
11
18
  InteractiveTableColumnComponent,
12
19
  InteractiveTableComponent,
13
20
  } from '../../../../../../libs/ui/layout/src'
14
- import { MatIconModule } from '@angular/material/icon'
15
- import { TranslateModule } from '@ngx-translate/core'
16
- import { CommonModule } from '@angular/common'
17
21
  import {
18
- FieldSort,
19
- SortByField,
20
- } from '../../../../../../libs/common/domain/src/lib/model/search'
22
+ FileFormat,
23
+ getBadgeColor,
24
+ getFileFormat,
25
+ getFormatPriority,
26
+ } from '../../../../../../libs/util/shared/src'
27
+ import { TranslateModule } from '@ngx-translate/core'
28
+ import { ActionMenuComponent } from './action-menu/action-menu.component'
21
29
 
22
30
  @Component({
23
31
  selector: 'gn-ui-results-table',
@@ -32,6 +40,7 @@ import {
32
40
  MatIconModule,
33
41
  TranslateModule,
34
42
  BadgeComponent,
43
+ ActionMenuComponent,
35
44
  ],
36
45
  })
37
46
  export class ResultsTableComponent {
@@ -43,6 +52,7 @@ export class ResultsTableComponent {
43
52
  // emits the column (field) as well as the order
44
53
  @Output() sortByChange = new EventEmitter<[string, 'asc' | 'desc']>()
45
54
  @Output() recordClick = new EventEmitter<CatalogRecord>()
55
+ @Output() duplicateRecord = new EventEmitter<CatalogRecord>()
46
56
  @Output() recordsSelectedChange = new EventEmitter<
47
57
  [CatalogRecord[], boolean]
48
58
  >()
@@ -89,6 +99,10 @@ export class ResultsTableComponent {
89
99
  this.recordClick.emit(item as CatalogRecord)
90
100
  }
91
101
 
102
+ handleDuplicate(item: unknown) {
103
+ this.duplicateRecord.emit(item as CatalogRecord)
104
+ }
105
+
92
106
  setSortBy(col: string, order: 'asc' | 'desc') {
93
107
  this.sortByChange.emit([col, order])
94
108
  }
package/tailwind.base.css CHANGED
@@ -115,7 +115,8 @@
115
115
  --padding: var(--gn-ui-badge-padding, 0.375em 0.75em);
116
116
  --text-color: var(--gn-ui-badge-text-color, var(--color-gray-50));
117
117
  --background-color: var(--gn-ui-badge-background-color, black);
118
- @apply inline-block opacity-70 p-[--padding] rounded-[--rounded]
118
+ --opacity: var(--gn-ui-badge-opacity, 0.7);
119
+ @apply inline-block opacity-[--opacity] p-[--padding] rounded-[--rounded]
119
120
  font-medium text-[length:0.875em] leading-none text-[color:--text-color] bg-[color:--background-color];
120
121
  }
121
122
  /* makes sure icons will not make the badges grow vertically; also make size proportional */
@@ -307,6 +307,7 @@
307
307
  "pagination.pageOf": "von",
308
308
  "previous": "zurück",
309
309
  "record.action.download": "Herunterladen",
310
+ "record.action.duplicate": "",
310
311
  "record.action.view": "Anzeigen",
311
312
  "record.externalViewer.open": "In externem Kartenviewer öffnen",
312
313
  "record.metadata.about": "Beschreibung",
@@ -307,6 +307,7 @@
307
307
  "pagination.pageOf": "of",
308
308
  "previous": "previous",
309
309
  "record.action.download": "Download",
310
+ "record.action.duplicate": "Duplicate",
310
311
  "record.action.view": "View",
311
312
  "record.externalViewer.open": "Open in the external map viewer",
312
313
  "record.metadata.about": "Description",
@@ -307,6 +307,7 @@
307
307
  "pagination.pageOf": "",
308
308
  "previous": "",
309
309
  "record.action.download": "",
310
+ "record.action.duplicate": "",
310
311
  "record.action.view": "",
311
312
  "record.externalViewer.open": "",
312
313
  "record.metadata.about": "",
@@ -307,6 +307,7 @@
307
307
  "pagination.pageOf": "sur",
308
308
  "previous": "précédent",
309
309
  "record.action.download": "Télécharger",
310
+ "record.action.duplicate": "Dupliquer",
310
311
  "record.action.view": "Voir",
311
312
  "record.externalViewer.open": "Ouvrir dans le visualiseur externe",
312
313
  "record.metadata.about": "Description",
@@ -307,6 +307,7 @@
307
307
  "pagination.pageOf": "di",
308
308
  "previous": "precedente",
309
309
  "record.action.download": "Scarica",
310
+ "record.action.duplicate": "",
310
311
  "record.action.view": "Visualizza",
311
312
  "record.externalViewer.open": "Apri nell'visualizzatore esterno",
312
313
  "record.metadata.about": "Descrizione",
@@ -307,6 +307,7 @@
307
307
  "pagination.pageOf": "",
308
308
  "previous": "",
309
309
  "record.action.download": "",
310
+ "record.action.duplicate": "",
310
311
  "record.action.view": "",
311
312
  "record.externalViewer.open": "",
312
313
  "record.metadata.about": "",
@@ -307,6 +307,7 @@
307
307
  "pagination.pageOf": "",
308
308
  "previous": "",
309
309
  "record.action.download": "",
310
+ "record.action.duplicate": "",
310
311
  "record.action.view": "",
311
312
  "record.externalViewer.open": "",
312
313
  "record.metadata.about": "",
@@ -307,6 +307,7 @@
307
307
  "pagination.pageOf": "z",
308
308
  "previous": "predchádzajúci",
309
309
  "record.action.download": "Stiahnuť",
310
+ "record.action.duplicate": "",
310
311
  "record.action.view": "Zobraziť",
311
312
  "record.externalViewer.open": "Otvoriť v externom mapovom prehliadači",
312
313
  "record.metadata.about": "O",