geonetwork-ui 2.4.1-dev.89bb09dfa → 2.4.1-dev.9ee0df3df

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.converter.mjs +3 -4
  2. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +2 -5
  3. package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
  4. package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +16 -27
  5. package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
  6. package/esm2022/libs/data-access/gn4/src/openapi/api/records.api.service.mjs +1 -7
  7. package/esm2022/libs/feature/editor/src/lib/+state/editor.actions.mjs +1 -3
  8. package/esm2022/libs/feature/editor/src/lib/+state/editor.effects.mjs +14 -18
  9. package/esm2022/libs/feature/editor/src/lib/+state/editor.facade.mjs +5 -15
  10. package/esm2022/libs/feature/editor/src/lib/+state/editor.reducer.mjs +4 -10
  11. package/esm2022/libs/feature/editor/src/lib/+state/editor.selectors.mjs +5 -6
  12. package/esm2022/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.mjs +10 -57
  13. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.mjs +23 -36
  14. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.mjs +12 -7
  15. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.mjs +12 -8
  16. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.mjs +12 -6
  17. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +3 -3
  18. package/esm2022/libs/feature/editor/src/lib/services/editor.service.mjs +5 -9
  19. package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +4 -3
  20. package/esm2022/libs/ui/dataviz/src/lib/figure/figure.component.mjs +3 -3
  21. package/esm2022/libs/ui/inputs/src/lib/file-input/file-input.component.mjs +4 -4
  22. package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table.component.mjs +4 -9
  23. package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +10 -10
  24. package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +1 -40
  25. package/esm2022/translations/de.json +6 -29
  26. package/esm2022/translations/en.json +9 -13
  27. package/esm2022/translations/es.json +4 -27
  28. package/esm2022/translations/fr.json +9 -13
  29. package/esm2022/translations/it.json +218 -243
  30. package/esm2022/translations/nl.json +4 -27
  31. package/esm2022/translations/pt.json +4 -27
  32. package/fesm2022/geonetwork-ui.mjs +616 -883
  33. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  34. package/libs/api/metadata-converter/src/lib/gn4/gn4.converter.d.ts.map +1 -1
  35. package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
  36. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +0 -1
  37. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
  38. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +3 -4
  39. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  40. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +3 -4
  41. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
  42. package/libs/data-access/gn4/src/openapi/api/records.api.service.d.ts +0 -3
  43. package/libs/data-access/gn4/src/openapi/api/records.api.service.d.ts.map +1 -1
  44. package/libs/feature/editor/src/lib/+state/editor.actions.d.ts +2 -10
  45. package/libs/feature/editor/src/lib/+state/editor.actions.d.ts.map +1 -1
  46. package/libs/feature/editor/src/lib/+state/editor.effects.d.ts +2 -6
  47. package/libs/feature/editor/src/lib/+state/editor.effects.d.ts.map +1 -1
  48. package/libs/feature/editor/src/lib/+state/editor.facade.d.ts +2 -5
  49. package/libs/feature/editor/src/lib/+state/editor.facade.d.ts.map +1 -1
  50. package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts +1 -2
  51. package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts.map +1 -1
  52. package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts +1 -2
  53. package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts.map +1 -1
  54. package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts +5 -16
  55. package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts.map +1 -1
  56. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.d.ts +4 -4
  57. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.d.ts.map +1 -1
  58. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.d.ts +4 -1
  59. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.d.ts.map +1 -1
  60. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.d.ts +5 -2
  61. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.d.ts.map +1 -1
  62. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts +4 -1
  63. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts.map +1 -1
  64. package/libs/feature/editor/src/lib/services/editor.service.d.ts +1 -1
  65. package/libs/feature/editor/src/lib/services/editor.service.d.ts.map +1 -1
  66. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts +1 -0
  67. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
  68. package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +1 -1
  69. package/libs/ui/inputs/src/lib/file-input/file-input.component.d.ts +1 -1
  70. package/libs/ui/inputs/src/lib/file-input/file-input.component.d.ts.map +1 -1
  71. package/libs/ui/layout/src/lib/interactive-table/interactive-table.component.d.ts +1 -2
  72. package/libs/ui/layout/src/lib/interactive-table/interactive-table.component.d.ts.map +1 -1
  73. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +3 -3
  74. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
  75. package/libs/util/shared/src/lib/links/link-utils.d.ts +1 -2
  76. package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
  77. package/package.json +1 -1
  78. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.converter.ts +3 -4
  79. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +1 -8
  80. package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +0 -1
  81. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +27 -53
  82. package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +4 -5
  83. package/src/libs/common/fixtures/src/lib/elasticsearch/full-response.fixtures.ts +2 -2
  84. package/src/libs/common/fixtures/src/lib/elasticsearch/search-responses.fixtures.ts +16 -16
  85. package/src/libs/common/fixtures/src/lib/records.fixtures.ts +0 -163
  86. package/src/libs/data-access/gn4/src/openapi/api/records.api.service.ts +4 -24
  87. package/src/libs/feature/editor/src/lib/+state/editor.actions.ts +1 -10
  88. package/src/libs/feature/editor/src/lib/+state/editor.effects.ts +31 -57
  89. package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +9 -15
  90. package/src/libs/feature/editor/src/lib/+state/editor.reducer.ts +12 -18
  91. package/src/libs/feature/editor/src/lib/+state/editor.selectors.ts +8 -13
  92. package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.html +7 -38
  93. package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.ts +3 -62
  94. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.html +1 -1
  95. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.ts +19 -31
  96. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.html +10 -1
  97. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.ts +7 -1
  98. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.html +20 -11
  99. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.ts +10 -5
  100. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.html +9 -0
  101. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.ts +8 -2
  102. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +2 -2
  103. package/src/libs/feature/editor/src/lib/services/editor.service.ts +16 -18
  104. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html +1 -0
  105. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +3 -0
  106. package/src/libs/ui/dataviz/src/lib/figure/figure.component.html +0 -1
  107. package/src/libs/ui/inputs/src/lib/file-input/file-input.component.ts +1 -1
  108. package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.html +1 -12
  109. package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.ts +6 -4
  110. package/src/libs/ui/search/src/lib/results-table/results-table.component.html +6 -23
  111. package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +6 -6
  112. package/src/libs/util/shared/src/lib/links/link-utils.ts +1 -51
  113. package/tailwind.base.config.js +0 -2
  114. package/translations/de.json +6 -29
  115. package/translations/en.json +9 -13
  116. package/translations/es.json +4 -27
  117. package/translations/fr.json +9 -13
  118. package/translations/it.json +218 -243
  119. package/translations/nl.json +4 -27
  120. package/translations/pt.json +4 -27
  121. package/translations/sk.json +4 -27
@@ -32,10 +32,11 @@ import {
32
32
  SortableListComponent,
33
33
  } from '../../../../../../../../../libs/ui/layout/src'
34
34
  import { TranslateModule, TranslateService } from '@ngx-translate/core'
35
- import { Subscription } from 'rxjs'
35
+ import { map, Subscription } from 'rxjs'
36
36
  import { MAX_UPLOAD_SIZE_MB } from '../../../../fields.config'
37
37
  import { OnlineResourceCardComponent } from '../../../online-resource-card/online-resource-card.component'
38
38
  import { OnlineServiceResourceInputComponent } from '../../../online-service-resource-input/online-service-resource-input.component'
39
+ import { EditorFacade } from '../../../../+state/editor.facade'
39
40
 
40
41
  type OnlineNotLinkResource =
41
42
  | DatasetDownloadDistribution
@@ -92,21 +93,25 @@ export class FormFieldOnlineResourcesComponent {
92
93
  notLinkResources: OnlineNotLinkResource[] = []
93
94
  uploadProgress = undefined
94
95
  uploadSubscription: Subscription = null
95
- newService = <DatasetServiceDistribution>{
96
+ newService = {
96
97
  type: 'service',
97
98
  accessServiceProtocol: 'ogcFeatures',
98
99
  identifierInService: '',
99
- url: undefined,
100
- }
100
+ } as Omit<DatasetServiceDistribution, 'url'>
101
101
 
102
102
  protected MAX_UPLOAD_SIZE_MB = MAX_UPLOAD_SIZE_MB
103
103
 
104
+ disabled$ = this.editorFacade.alreadySavedOnce$.pipe(
105
+ map((alreadySavedOnce) => !alreadySavedOnce)
106
+ )
107
+
104
108
  constructor(
105
109
  private notificationsService: NotificationsService,
106
110
  private translateService: TranslateService,
107
111
  private platformService: PlatformServiceInterface,
108
112
  private cd: ChangeDetectorRef,
109
- private dialog: MatDialog
113
+ private dialog: MatDialog,
114
+ private editorFacade: EditorFacade
110
115
  ) {}
111
116
 
112
117
  onSelectedTypeChange(selectedType: unknown) {
@@ -9,5 +9,14 @@
9
9
  (delete)="handleDelete()"
10
10
  [uploadProgress]="uploadProgress"
11
11
  (uploadCancel)="handleUploadCancel()"
12
+ [disabled]="disabled$ | async"
12
13
  ></gn-ui-image-input>
14
+ <div
15
+ *ngIf="disabled$ | async"
16
+ class="p-4 text-sm border border-primary bg-primary-lightest rounded-lg"
17
+ translate
18
+ data-test="disabled-message"
19
+ >
20
+ editor.record.form.field.draft.only.disabled
21
+ </div>
13
22
  </div>
@@ -12,8 +12,9 @@ import { ImageInputComponent } from '../../../../../../../../../libs/ui/elements
12
12
  import { PlatformServiceInterface } from '../../../../../../../../../libs/common/domain/src/lib/platform.service.interface'
13
13
  import { NotificationsService } from '../../../../../../../../../libs/feature/notifications/src'
14
14
  import { TranslateModule, TranslateService } from '@ngx-translate/core'
15
- import { Subscription } from 'rxjs'
15
+ import { map, Subscription } from 'rxjs'
16
16
  import { MAX_UPLOAD_SIZE_MB } from '../../../../fields.config'
17
+ import { EditorFacade } from '../../../../+state/editor.facade'
17
18
 
18
19
  @Component({
19
20
  selector: 'gn-ui-form-field-overviews',
@@ -29,6 +30,10 @@ export class FormFieldOverviewsComponent {
29
30
  @Output() valueChange: EventEmitter<Array<GraphicOverview>> =
30
31
  new EventEmitter()
31
32
 
33
+ disabled$ = this.editorFacade.alreadySavedOnce$.pipe(
34
+ map((alreadySavedOnce) => !alreadySavedOnce)
35
+ )
36
+
32
37
  uploadProgress = undefined
33
38
  uploadSubscription: Subscription = null
34
39
 
@@ -47,7 +52,8 @@ export class FormFieldOverviewsComponent {
47
52
  private platformService: PlatformServiceInterface,
48
53
  private notificationsService: NotificationsService,
49
54
  private translateService: TranslateService,
50
- private cd: ChangeDetectorRef
55
+ private cd: ChangeDetectorRef,
56
+ private editorFacade: EditorFacade
51
57
  ) {}
52
58
 
53
59
  handleFileChange(file: File) {
@@ -112,8 +112,8 @@
112
112
  <ng-container *ngSwitchCase="'licenses'">
113
113
  <gn-ui-form-field-license
114
114
  [label]="config.labelKey! | translate"
115
- [recordLicences]="valueAsConstraints"
116
- (recordLicencesChange)="valueChange.emit($event)"
115
+ [recordConstraints]="valueAsConstraints"
116
+ (recordConstraintsChange)="valueChange.emit($event)"
117
117
  ></gn-ui-form-field-license>
118
118
  </ng-container>
119
119
 
@@ -1,5 +1,5 @@
1
1
  import { Injectable } from '@angular/core'
2
- import { forkJoin, Observable, of, switchMap } from 'rxjs'
2
+ import { Observable, switchMap } from 'rxjs'
3
3
  import { map, tap } from 'rxjs/operators'
4
4
  import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
5
5
  import { EditorConfig } from '../models/'
@@ -16,7 +16,8 @@ export class EditorService {
16
16
  saveRecord(
17
17
  record: CatalogRecord,
18
18
  recordSource: string,
19
- fieldsConfig: EditorConfig
19
+ fieldsConfig: EditorConfig,
20
+ generateNewUniqueIdentifier = false
20
21
  ): Observable<[CatalogRecord, string]> {
21
22
  const savedRecord = { ...record }
22
23
 
@@ -34,25 +35,22 @@ export class EditorService {
34
35
  })
35
36
  }
36
37
  }
37
- let publishToAll = true
38
- // if the record is new, generate a new unique identifier and pass publishToAll as false
39
- if (!record.uniqueIdentifier) {
38
+
39
+ // if we want a new unique identifier, clear the existing one
40
+ if (generateNewUniqueIdentifier) {
40
41
  savedRecord.uniqueIdentifier = null
41
- publishToAll = false
42
42
  }
43
43
 
44
- return this.recordsRepository
45
- .saveRecord(savedRecord, recordSource, publishToAll)
46
- .pipe(
47
- switchMap((uniqueIdentifier) =>
48
- this.recordsRepository.openRecordForEdition(uniqueIdentifier)
49
- ),
50
- tap(() => {
51
- // if saving was successful, the original draft can be discarded
52
- this.recordsRepository.clearRecordDraft(record.uniqueIdentifier)
53
- }),
54
- map(([record, recordSource]) => [record, recordSource])
55
- )
44
+ return this.recordsRepository.saveRecord(savedRecord, recordSource).pipe(
45
+ switchMap((uniqueIdentifier) =>
46
+ this.recordsRepository.openRecordForEdition(uniqueIdentifier)
47
+ ),
48
+ tap(() => {
49
+ // if saving was successful, the original draft can be discarded
50
+ this.recordsRepository.clearRecordDraft(record.uniqueIdentifier)
51
+ }),
52
+ map(([record, recordSource]) => [record, recordSource])
53
+ )
56
54
  }
57
55
 
58
56
  // emits and completes once saving is done
@@ -4,6 +4,7 @@
4
4
  [hasDraft]="hasDraft"
5
5
  [selectedRecordsIdentifiers]="selectedRecords$ | async"
6
6
  [sortOrder]="sortBy$ | async"
7
+ [isUnsavedDraft]="isUnsavedDraft"
7
8
  [canDelete]="canDelete"
8
9
  [canDuplicate]="canDuplicate"
9
10
  (recordClick)="handleRecordClick($event)"
@@ -38,6 +38,9 @@ export class ResultsTableContainerComponent implements OnDestroy {
38
38
  hasDraft = (record: CatalogRecord): boolean =>
39
39
  this.recordsRepository.recordHasDraft(record.uniqueIdentifier)
40
40
 
41
+ isUnsavedDraft = (record: CatalogRecord): boolean =>
42
+ this.recordsRepository.isRecordNotYetSaved(record.uniqueIdentifier)
43
+
41
44
  constructor(
42
45
  protected searchFacade: SearchFacade,
43
46
  private searchService: SearchService,
@@ -10,7 +10,6 @@
10
10
  "
11
11
  >
12
12
  <div
13
- data-test="icon-container"
14
13
  class="{{ bgClass }} {{
15
14
  textClass
16
15
  }} text-[1.875em] rounded-full mr-[0.55em] flex justify-center items-center w-[2.2em] h-[2.2em] shrink-0"
@@ -48,10 +48,10 @@ import { iconoirCloudUpload, iconoirFramePlusIn } from '@ng-icons/iconoir'
48
48
  export class FileInputComponent {
49
49
  @Input() maxSizeMB: number
50
50
  @Input() uploadProgress?: number
51
+ @Input() disabled? = false
51
52
  @Output() fileChange: EventEmitter<File> = new EventEmitter()
52
53
  @Output() urlChange: EventEmitter<string> = new EventEmitter()
53
54
  @Output() uploadCancel: EventEmitter<void> = new EventEmitter()
54
- @Input() disabled? = false
55
55
 
56
56
  dragFilesOver = false
57
57
 
@@ -31,11 +31,6 @@
31
31
  *ngFor="let item of items"
32
32
  (click)="handleRowClick(item)"
33
33
  data-cy="table-row"
34
- [title]="
35
- !item.extras?.edit && !isDraftPage
36
- ? ('editor.record.lock.reason' | translate)
37
- : ''
38
- "
39
34
  >
40
35
  <div
41
36
  class="relative h-0"
@@ -49,13 +44,7 @@
49
44
  </div>
50
45
  <ng-container *ngFor="let column of columns">
51
46
  <div
52
- class="table-row-cell px-3 py-1.5 flex items-center bg-white transition-colors duration-75 truncate border-b border-gray-200"
53
- [ngClass]="{
54
- 'text-purple-light cursor-default':
55
- !item.extras?.edit && !isDraftPage,
56
- 'group-hover:text-main group-hover:bg-gray-50':
57
- item.extras?.edit || isDraftPage,
58
- }"
47
+ class="table-row-cell px-3 py-1.5 flex items-center bg-white transition-colors duration-75 truncate group-hover:text-main group-hover:bg-gray-50 border-b border-gray-200"
59
48
  >
60
49
  <ng-container
61
50
  *ngTemplateOutlet="column.cell; context: { $implicit: item }"
@@ -9,9 +9,12 @@ import {
9
9
  } from '@angular/core'
10
10
  import { InteractiveTableColumnComponent } from './interactive-table-column/interactive-table-column.component'
11
11
  import { CommonModule } from '@angular/common'
12
- import { NgIconComponent, provideIcons } from '@ng-icons/core'
12
+ import {
13
+ NgIconComponent,
14
+ provideIcons,
15
+ provideNgIconsConfig,
16
+ } from '@ng-icons/core'
13
17
  import { iconoirNavArrowDown, iconoirNavArrowUp } from '@ng-icons/iconoir'
14
- import { TranslateModule } from '@ngx-translate/core'
15
18
 
16
19
  @Component({
17
20
  selector: 'gn-ui-interactive-table',
@@ -19,7 +22,7 @@ import { TranslateModule } from '@ngx-translate/core'
19
22
  styleUrls: ['./interactive-table.component.css'],
20
23
  changeDetection: ChangeDetectionStrategy.OnPush,
21
24
  standalone: true,
22
- imports: [CommonModule, NgIconComponent, TranslateModule],
25
+ imports: [CommonModule, InteractiveTableColumnComponent, NgIconComponent],
23
26
  providers: [provideIcons({ iconoirNavArrowDown, iconoirNavArrowUp })],
24
27
  })
25
28
  export class InteractiveTableComponent {
@@ -27,7 +30,6 @@ export class InteractiveTableComponent {
27
30
  columns: QueryList<InteractiveTableColumnComponent>
28
31
 
29
32
  @Input() items: unknown[] = []
30
- @Input() isDraftPage = false
31
33
  @Output() itemClick = new EventEmitter<unknown>()
32
34
 
33
35
  get gridStyle() {
@@ -1,18 +1,11 @@
1
1
  <gn-ui-interactive-table
2
2
  [items]="records"
3
- [isDraftPage]="isDraftPage"
4
3
  (itemClick)="handleRecordClick($event)"
5
4
  >
6
5
  <!-- SELECTED COLUMN -->
7
6
  <gn-ui-interactive-table-column [width]="'3rem'">
8
- <ng-template #cell let-item let-i="index">
9
- <ng-icon
10
- name="iconoirLock"
11
- class="text-purple"
12
- *ngIf="!item.extras?.edit && !isDraftPage"
13
- ></ng-icon>
7
+ <ng-template #cell let-item>
14
8
  <gn-ui-checkbox
15
- *ngIf="item.extras?.edit || isDraftPage"
16
9
  [checked]="isChecked(item)"
17
10
  (changed)="handleRecordSelectedChange($event, item)"
18
11
  class="-m-2"
@@ -109,9 +102,9 @@
109
102
  <ng-template #cell let-item>
110
103
  <span class="text-xs">
111
104
  {{
112
- (item.extras?.['isPublishedToAll']
113
- ? 'record.metadata.status.published'
114
- : 'record.metadata.status.notPublished'
105
+ (isUnsavedDraft(item)
106
+ ? 'record.metadata.status.notPublished'
107
+ : 'record.metadata.status.published'
115
108
  ) | translate
116
109
  }}</span
117
110
  >
@@ -130,11 +123,7 @@
130
123
  </ng-template>
131
124
  <ng-template #cell let-item>
132
125
  <div class="flex text-left w-full text-xs">
133
- {{
134
- item.extras?.['isPublishedToAll']
135
- ? dateToString(item.recordUpdated)
136
- : '-'
137
- }}
126
+ {{ isUnsavedDraft(item) ? '-' : dateToString(item.recordUpdated) }}
138
127
  </div>
139
128
  </ng-template>
140
129
  </gn-ui-interactive-table-column>
@@ -149,14 +138,8 @@
149
138
  (buttonClick)="openActionMenu(item, template)"
150
139
  type="light"
151
140
  data-test="record-menu-button"
152
- [disabled]="!item.extras?.edit && !isDraftPage"
153
141
  >
154
- <ng-icon
155
- [ngClass]="{
156
- 'text-purple-light': !item.extras?.edit && !isDraftPage,
157
- }"
158
- name="matMoreVert"
159
- ></ng-icon>
142
+ <ng-icon name="matMoreVert"></ng-icon>
160
143
  </gn-ui-button>
161
144
  <ng-template #template>
162
145
  <gn-ui-action-menu
@@ -30,7 +30,7 @@ import {
30
30
  import { TranslateModule } from '@ngx-translate/core'
31
31
  import { ActionMenuComponent } from './action-menu/action-menu.component'
32
32
  import { NgIconComponent, provideIcons } from '@ng-icons/core'
33
- import { iconoirUser, iconoirLock } from '@ng-icons/iconoir'
33
+ import { iconoirUser } from '@ng-icons/iconoir'
34
34
  import {
35
35
  CdkConnectedOverlay,
36
36
  CdkOverlayOrigin,
@@ -55,8 +55,9 @@ import { matMoreVert } from '@ng-icons/material-icons/baseline'
55
55
  ActionMenuComponent,
56
56
  NgIconComponent,
57
57
  CdkOverlayOrigin,
58
+ CdkConnectedOverlay,
58
59
  ],
59
- providers: [provideIcons({ iconoirUser, iconoirLock, matMoreVert })],
60
+ providers: [provideIcons({ iconoirUser, matMoreVert })],
60
61
  })
61
62
  export class ResultsTableComponent {
62
63
  @Input() records: CatalogRecord[] = []
@@ -64,8 +65,8 @@ export class ResultsTableComponent {
64
65
  @Input() sortOrder: SortByField = null
65
66
  @Input() hasDraft: (record: CatalogRecord) => boolean = () => false
66
67
  @Input() canDuplicate: (record: CatalogRecord) => boolean = () => true
68
+ @Input() isUnsavedDraft: (record: CatalogRecord) => boolean = () => true
67
69
  @Input() canDelete: (record: CatalogRecord) => boolean = () => true
68
- @Input() isDraftPage = false
69
70
 
70
71
  // emits the column (field) as well as the order
71
72
  @Output() sortByChange = new EventEmitter<[string, 'asc' | 'desc']>()
@@ -169,9 +170,8 @@ export class ResultsTableComponent {
169
170
  return getBadgeColor(format)
170
171
  }
171
172
 
172
- handleRecordClick(item: CatalogRecord) {
173
- if (item?.extras?.edit || this.isDraftPage)
174
- this.recordClick.emit(item as CatalogRecord)
173
+ handleRecordClick(item: unknown) {
174
+ this.recordClick.emit(item as CatalogRecord)
175
175
  }
176
176
 
177
177
  handleDuplicate(item: unknown) {
@@ -1,14 +1,5 @@
1
1
  import { marker } from '@biesbjerg/ngx-translate-extract-marker'
2
- import {
3
- DatasetOnlineResource,
4
- ServiceProtocol,
5
- } from '../../../../../../libs/common/domain/src/lib/model/record'
6
- import {
7
- OgcApiEndpoint,
8
- WfsEndpoint,
9
- WmsEndpoint,
10
- WmtsEndpoint,
11
- } from '@camptocamp/ogc-client'
2
+ import { DatasetOnlineResource } from '../../../../../../libs/common/domain/src/lib/model/record'
12
3
 
13
4
  marker('downloads.wfs.featuretype.not.found')
14
5
 
@@ -251,47 +242,6 @@ export function getLinkLabel(link: DatasetOnlineResource): string {
251
242
  return format ? `${label} (${format})` : label
252
243
  }
253
244
 
254
- export async function getLayers(url: string, serviceProtocol: ServiceProtocol) {
255
- switch (serviceProtocol) {
256
- case 'ogcFeatures': {
257
- const layers = await new OgcApiEndpoint(url).allCollections
258
- return layers
259
- }
260
- case 'wfs': {
261
- const endpointWfs = new WfsEndpoint(url)
262
- await endpointWfs.isReady()
263
- return endpointWfs.getFeatureTypes()
264
- }
265
- case 'wms': {
266
- const endpointWms = new WmsEndpoint(url)
267
- await endpointWms.isReady()
268
- return endpointWms
269
- .getLayers()
270
- .flatMap(wmsLayerFlatten)
271
- .filter((l) => l.name)
272
- }
273
- case 'wmts': {
274
- const endpointWmts = new WmtsEndpoint(url)
275
- await endpointWmts.isReady()
276
- return endpointWmts.getLayers()
277
- }
278
- default:
279
- return undefined
280
- }
281
- }
282
-
283
- function wmsLayerFlatten(layerFull) {
284
- const layer = {
285
- title: layerFull.title,
286
- name: layerFull.name,
287
- abstract: layerFull.abstract,
288
- }
289
-
290
- return 'children' in layerFull && Array.isArray(layerFull.children)
291
- ? [layer, ...layerFull.children.flatMap(wmsLayerFlatten)]
292
- : [layer]
293
- }
294
-
295
245
  export function getMimeTypeForFormat(format: FileFormat): string | null {
296
246
  return format in FORMATS ? FORMATS[format.toLowerCase()].mimeTypes[0] : null
297
247
  }
@@ -44,8 +44,6 @@ module.exports = {
44
44
  800: '#8a2c0d',
45
45
  900: '#73230d',
46
46
  },
47
- purple: '#9747FF',
48
- 'purple-light': '#DDC3FF',
49
47
  },
50
48
  fontFamily: {
51
49
  sans: 'var(--font-family-main, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji")',
@@ -139,7 +139,6 @@
139
139
  "datahub.search.back": "Zurück",
140
140
  "datahub.search.filter.all": "Alle",
141
141
  "datahub.search.filter.generatedByAPI": "Generiert durch eine API",
142
- "datahub.search.filter.generatedByWfs": "",
143
142
  "datahub.search.filter.others": "Andere",
144
143
  "dataset.error.http": "Die Daten konnten aufgrund eines HTTP-Fehlers nicht geladen werden: \"{ info }\"",
145
144
  "dataset.error.network": "Die Daten konnten aufgrund eines Netzwerkfehlers oder CORS-Beschränkungen nicht geladen werden: \"{ info }\"",
@@ -205,9 +204,6 @@
205
204
  "editor.record.deleteError.title": "Fehler beim Löschen des Datensatzes",
206
205
  "editor.record.deleteSuccess.body": "",
207
206
  "editor.record.deleteSuccess.title": "",
208
- "editor.record.error.back": "",
209
- "editor.record.error.explanation": "",
210
- "editor.record.error.message": "",
211
207
  "editor.record.form.bottomButtons.comeBackLater": "",
212
208
  "editor.record.form.bottomButtons.next": "",
213
209
  "editor.record.form.bottomButtons.previous": "",
@@ -229,6 +225,7 @@
229
225
  "editor.record.form.field.constraintsShortcuts": "",
230
226
  "editor.record.form.field.contacts.noContact": "",
231
227
  "editor.record.form.field.contactsForResource.noContact": "",
228
+ "editor.record.form.field.draft.only.disabled": "Dieses Feld wird aktiviert, sobald die Daten veröffentlicht wurden.",
232
229
  "editor.record.form.field.keywords": "Schlagwörter",
233
230
  "editor.record.form.field.legalConstraints": "Rechtliche Einschränkung",
234
231
  "editor.record.form.field.license": "Lizenz",
@@ -238,10 +235,8 @@
238
235
  "editor.record.form.field.onlineResource.dialogTitle": "",
239
236
  "editor.record.form.field.onlineResource.edit.description": "",
240
237
  "editor.record.form.field.onlineResource.edit.protocol": "",
241
- "editor.record.form.field.onlineResource.edit.identifier.error": "Schichten konnten nicht vom Protokoll abgerufen werden",
242
238
  "editor.record.form.field.onlineResource.edit.identifier.placeholder": "Ebenenname",
243
239
  "editor.record.form.field.onlineResource.edit.identifier.placeholder.wps": "Prozessname",
244
- "editor.record.form.field.onlineResource.edit.identifier.select.label": "Wählen Sie eine Ebene",
245
240
  "editor.record.form.field.onlineResource.edit.identifier.submit": "Link zum Dienst",
246
241
  "editor.record.form.field.onlineResource.edit.title": "",
247
242
  "editor.record.form.field.onlineResource.fileSize": "",
@@ -300,7 +295,6 @@
300
295
  "editor.record.loadError.body": "Der Datensatz konnte nicht geladen werden:",
301
296
  "editor.record.loadError.closeMessage": "Verstanden",
302
297
  "editor.record.loadError.title": "Fehler beim Laden des Datensatzes",
303
- "editor.record.lock.reason": "",
304
298
  "editor.record.onlineResource.protocol.other": "",
305
299
  "editor.record.onlineResourceError.body": "",
306
300
  "editor.record.onlineResourceError.closeMessage": "",
@@ -321,9 +315,9 @@
321
315
  "editor.record.resourceError.body": "",
322
316
  "editor.record.resourceError.closeMessage": "",
323
317
  "editor.record.resourceError.title": "",
324
- "editor.record.saveStatus.draftWithChangesPending": "Gespeichert - nicht publizierte Unterschiede",
325
- "editor.record.saveStatus.recordNotPublished": "",
326
- "editor.record.saveStatus.recordUpToDate": "Gespeichert - auf dem neuesten Stand",
318
+ "editor.record.saveStatus.asDraftOnly": "Nur als Entwurf gespeichert - noch nicht veröffentlicht",
319
+ "editor.record.saveStatus.draftWithChangesPending": "Als Entwurf gespeichert - Änderungen stehen aus",
320
+ "editor.record.saveStatus.recordUpToDate": "Datensatz ist auf dem neuesten Stand",
327
321
  "editor.record.undo.confirmation.cancelText": "",
328
322
  "editor.record.undo.confirmation.confirmText": "",
329
323
  "editor.record.undo.confirmation.message": "",
@@ -427,32 +421,14 @@
427
421
  "record.metadata.api.form.closeButton": "Schließen",
428
422
  "record.metadata.api.form.closeForm": "Formular schließen",
429
423
  "record.metadata.api.form.create": "Ihre Anfrage erstellen",
430
- "record.metadata.api.form.crsTitle": "",
431
- "record.metadata.api.form.crsTooltip": "",
432
424
  "record.metadata.api.form.customUrl": "Benutzerdefinierte URL",
433
- "record.metadata.api.form.filter": "",
434
- "record.metadata.api.form.filterDescription": "",
435
- "record.metadata.api.form.formatTitle": "",
436
- "record.metadata.api.form.formatTooltip": "",
437
- "record.metadata.api.form.items": "",
438
- "record.metadata.api.form.itemsDescription": "",
439
- "record.metadata.api.form.itemsTooltip": "",
440
425
  "record.metadata.api.form.limit": "Anzahl der Datensätze",
441
426
  "record.metadata.api.form.limit.all": "Alle",
442
- "record.metadata.api.form.nextPage": "",
443
- "record.metadata.api.form.nextPageTooltip": "",
444
427
  "record.metadata.api.form.offset": "Anzahl des ersten Datensatzes",
445
428
  "record.metadata.api.form.openForm": "Formular öffnen",
446
- "record.metadata.api.form.paginationDescription": "",
447
- "record.metadata.api.form.previousPage": "",
448
- "record.metadata.api.form.previousPageTooltip": "",
449
- "record.metadata.api.form.productTooltip": "",
450
429
  "record.metadata.api.form.reset": "Zurücksetzen",
451
- "record.metadata.api.form.resetTooltip": "",
430
+ "record.metadata.api.form.title": "Benutzerdefinierte URL generieren",
452
431
  "record.metadata.api.form.type": "Ausgabeformat",
453
- "record.metadata.api.form.zoneTitle": "",
454
- "record.metadata.api.form.zoneTooltip": "",
455
- "record.metadata.api.gpfdl": "",
456
432
  "record.metadata.catalog": "Katalog",
457
433
  "record.metadata.contact": "Kontakt",
458
434
  "record.metadata.creation": "Erstellungsdatum",
@@ -517,6 +493,7 @@
517
493
  "record.tab.chart": "Diagramm",
518
494
  "record.tab.data": "Tabelle",
519
495
  "record.tab.map": "Karte",
496
+ "record.was.created.time": "erstellte diesen Datensatz {time}",
520
497
  "records": "Datensätze",
521
498
  "results.layout.selectOne": "Layout auswählen",
522
499
  "results.records.hits.displayedOn": "{displayed, plural, =0{Kein Datensatz.} one{1 Datensatz} other{{displayed} Datensätze }} {hits, plural, other{angezeigt von {hits} insgesamt.}}",
@@ -139,7 +139,6 @@
139
139
  "datahub.search.back": "Back",
140
140
  "datahub.search.filter.all": "All",
141
141
  "datahub.search.filter.generatedByAPI": "Generated by an API",
142
- "datahub.search.filter.generatedByWfs": "",
143
142
  "datahub.search.filter.others": "Others",
144
143
  "dataset.error.http": "The data could not be loaded because of an HTTP error: \"{ info }\"",
145
144
  "dataset.error.network": "The data could not be loaded because of a network error or CORS limitations: \"{ info }\"",
@@ -205,9 +204,6 @@
205
204
  "editor.record.deleteError.title": "Error deleting dataset",
206
205
  "editor.record.deleteSuccess.body": "The dataset was successfully deleted!",
207
206
  "editor.record.deleteSuccess.title": "Delete success",
208
- "editor.record.error.back": "Go back to the catalog",
209
- "editor.record.error.explanation": "You might not have access to this record,<br> Or this link might not be valid.",
210
- "editor.record.error.message": "Something went wrong",
211
207
  "editor.record.form.bottomButtons.comeBackLater": "Come back later",
212
208
  "editor.record.form.bottomButtons.next": "Next",
213
209
  "editor.record.form.bottomButtons.previous": "Previous",
@@ -229,6 +225,7 @@
229
225
  "editor.record.form.field.constraintsShortcuts": "",
230
226
  "editor.record.form.field.contacts.noContact": "Please provide at least one point of contact.",
231
227
  "editor.record.form.field.contactsForResource.noContact": "Please provide at least one point of contact responsible for the data.",
228
+ "editor.record.form.field.draft.only.disabled": "This field will be enabled once the dataset has been published",
232
229
  "editor.record.form.field.keywords": "Keywords",
233
230
  "editor.record.form.field.legalConstraints": "Legal constraint",
234
231
  "editor.record.form.field.license": "License",
@@ -238,10 +235,8 @@
238
235
  "editor.record.form.field.onlineResource.dialogTitle": "Modify the dataset preview",
239
236
  "editor.record.form.field.onlineResource.edit.description": "Description",
240
237
  "editor.record.form.field.onlineResource.edit.protocol": "Protocol",
241
- "editor.record.form.field.onlineResource.edit.identifier.error": "Unable to retrieve layers from protocol",
242
238
  "editor.record.form.field.onlineResource.edit.identifier.placeholder": "Layer name",
243
239
  "editor.record.form.field.onlineResource.edit.identifier.placeholder.wps": "Process name",
244
- "editor.record.form.field.onlineResource.edit.identifier.select.label": "Select a layer",
245
240
  "editor.record.form.field.onlineResource.edit.identifier.submit": "Link to the service",
246
241
  "editor.record.form.field.onlineResource.edit.title": "Title",
247
242
  "editor.record.form.field.onlineResource.fileSize": "{sizeMB}MB",
@@ -300,7 +295,6 @@
300
295
  "editor.record.loadError.body": "The dataset could not be loaded:",
301
296
  "editor.record.loadError.closeMessage": "Understood",
302
297
  "editor.record.loadError.title": "Error loading dataset",
303
- "editor.record.lock.reason": "You are not an editor of the allowed groups",
304
298
  "editor.record.onlineResource.protocol.other": "Other",
305
299
  "editor.record.onlineResourceError.body": "An error happened while adding the resource:",
306
300
  "editor.record.onlineResourceError.closeMessage": "Understood",
@@ -321,9 +315,9 @@
321
315
  "editor.record.resourceError.body": "There was an issue with the dataset attachments:",
322
316
  "editor.record.resourceError.closeMessage": "Understood",
323
317
  "editor.record.resourceError.title": "Error with the dataset attachments",
324
- "editor.record.saveStatus.draftWithChangesPending": "Saved - Unpublished differences",
325
- "editor.record.saveStatus.recordNotPublished": "Saved - not published",
326
- "editor.record.saveStatus.recordUpToDate": "Saved - Record up to date",
318
+ "editor.record.saveStatus.asDraftOnly": "Saved as draft only - not published yet",
319
+ "editor.record.saveStatus.draftWithChangesPending": "Saved as draft - changes are pending",
320
+ "editor.record.saveStatus.recordUpToDate": "Dataset is up to date",
327
321
  "editor.record.undo.confirmation.cancelText": "Keep the changes",
328
322
  "editor.record.undo.confirmation.confirmText": "Discard the changes",
329
323
  "editor.record.undo.confirmation.message": "Are you sure you want to cancel the pending changes on this dataset ?",
@@ -427,13 +421,13 @@
427
421
  "record.metadata.api.form.closeButton": "Close",
428
422
  "record.metadata.api.form.closeForm": "Close the form",
429
423
  "record.metadata.api.form.create": "Create your request",
430
- "record.metadata.api.form.crsTitle": "Coordinate System",
431
- "record.metadata.api.form.crsTooltip": "Dropdown for selecting a coordinate reference system",
432
424
  "record.metadata.api.form.customUrl": "Custom URL",
433
425
  "record.metadata.api.form.filter": "Filters",
434
426
  "record.metadata.api.form.filterDescription": "Section for refining displayed elements",
435
427
  "record.metadata.api.form.formatTitle": "Format",
436
428
  "record.metadata.api.form.formatTooltip": "Dropdown for selecting a element format",
429
+ "record.metadata.api.form.crsTitle": "Coordinate System",
430
+ "record.metadata.api.form.crsTooltip": "Dropdown for selecting a coordinate reference system",
437
431
  "record.metadata.api.form.items": "Available Items",
438
432
  "record.metadata.api.form.itemsDescription": "List of items",
439
433
  "record.metadata.api.form.itemsTooltip": "Scroll to view all available items",
@@ -446,9 +440,10 @@
446
440
  "record.metadata.api.form.paginationDescription": "Pagination of displayed items",
447
441
  "record.metadata.api.form.previousPage": "Previous",
448
442
  "record.metadata.api.form.previousPageTooltip": "Go to the previous page",
449
- "record.metadata.api.form.productTooltip": "",
450
443
  "record.metadata.api.form.reset": "Reset",
451
444
  "record.metadata.api.form.resetTooltip": "Reset all filters",
445
+ "record.metadata.api.form.title": "Generate a custom URL",
446
+ "record.metadata.api.form.title.gpf": "Download data",
452
447
  "record.metadata.api.form.type": "Output format",
453
448
  "record.metadata.api.form.zoneTitle": "Zone",
454
449
  "record.metadata.api.form.zoneTooltip": "Dropdown for selecting a geographic zone",
@@ -517,6 +512,7 @@
517
512
  "record.tab.chart": "Chart",
518
513
  "record.tab.data": "Table",
519
514
  "record.tab.map": "Map",
515
+ "record.was.created.time": "created this dataset {time}",
520
516
  "records": "datasets",
521
517
  "results.layout.selectOne": "Results layout",
522
518
  "results.records.hits.displayedOn": "{displayed, plural, =0{No dataset.} one{1 } other{{displayed} }} {hits, plural, other{displayed on {hits} total.}}",