geonetwork-ui 2.2.0-dev.95201f8f → 2.2.0-dev.a9d33529

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 (191) hide show
  1. package/esm2022/libs/api/metadata-converter/src/lib/gn4/atomic-operations.mjs +2 -1
  2. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +36 -2
  3. package/esm2022/libs/api/repository/src/lib/gn4/index.mjs +3 -1
  4. package/esm2022/libs/api/repository/src/lib/gn4/selection/selection.service.mjs +13 -26
  5. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
  6. package/esm2022/libs/common/domain/src/lib/model/search/search.model.mjs +1 -1
  7. package/esm2022/libs/feature/catalog/src/lib/my-org/my-org.service.mjs +4 -10
  8. package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +5 -4
  9. package/esm2022/libs/feature/editor/src/lib/record-form/record-form.component.mjs +5 -3
  10. package/esm2022/libs/feature/map/src/index.mjs +2 -1
  11. package/esm2022/libs/feature/map/src/lib/constant/index.mjs +2 -1
  12. package/esm2022/libs/feature/map/src/lib/constant/projections.mjs +2 -0
  13. package/esm2022/libs/feature/map/src/lib/feature-map.module.mjs +17 -3
  14. package/esm2022/libs/feature/map/src/lib/geocoding/geocoding.component.mjs +93 -0
  15. package/esm2022/libs/feature/map/src/lib/geocoding.service.mjs +40 -0
  16. package/esm2022/libs/feature/map/src/lib/utils/index.mjs +1 -3
  17. package/esm2022/libs/feature/map/src/lib/utils/map-utils.service.mjs +60 -29
  18. package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +29 -20
  19. package/esm2022/libs/feature/search/src/index.mjs +2 -1
  20. package/esm2022/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.mjs +1 -1
  21. package/esm2022/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.mjs +1 -1
  22. package/esm2022/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.mjs +7 -3
  23. package/esm2022/libs/feature/search/src/lib/results-table/results-table.component.mjs +129 -0
  24. package/esm2022/libs/feature/search/src/lib/state/effects.mjs +5 -3
  25. package/esm2022/libs/ui/elements/src/index.mjs +2 -1
  26. package/esm2022/libs/ui/elements/src/lib/downloads-list/downloads-list.component.mjs +3 -3
  27. package/esm2022/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.mjs +3 -3
  28. package/esm2022/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.mjs +3 -3
  29. package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +3 -1
  30. package/esm2022/libs/ui/inputs/src/index.mjs +2 -1
  31. package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +3 -3
  32. package/esm2022/libs/ui/inputs/src/lib/checkbox/checkbox.component.mjs +3 -3
  33. package/esm2022/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.mjs +3 -3
  34. package/esm2022/libs/ui/inputs/src/lib/editable-label/editable-label.directive.mjs +46 -0
  35. package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +8 -3
  36. package/esm2022/libs/ui/layout/src/index.mjs +3 -1
  37. package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.mjs +36 -0
  38. package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table.component.mjs +37 -0
  39. package/esm2022/libs/ui/search/src/index.mjs +1 -2
  40. package/esm2022/libs/ui/search/src/lib/ui-search.module.mjs +9 -10
  41. package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +29 -13
  42. package/esm2022/translations/de.json +1 -0
  43. package/esm2022/translations/en.json +1 -0
  44. package/esm2022/translations/es.json +1 -0
  45. package/esm2022/translations/fr.json +2 -1
  46. package/esm2022/translations/it.json +1 -0
  47. package/esm2022/translations/nl.json +1 -0
  48. package/esm2022/translations/pt.json +1 -0
  49. package/fesm2022/geonetwork-ui.mjs +543 -293
  50. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  51. package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts +1 -0
  52. package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts.map +1 -1
  53. package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
  54. package/libs/api/repository/src/lib/gn4/index.d.ts +2 -0
  55. package/libs/api/repository/src/lib/gn4/index.d.ts.map +1 -1
  56. package/libs/api/repository/src/lib/gn4/selection/selection.service.d.ts +4 -5
  57. package/libs/api/repository/src/lib/gn4/selection/selection.service.d.ts.map +1 -1
  58. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +10 -5
  59. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  60. package/libs/common/domain/src/lib/model/search/search.model.d.ts +1 -2
  61. package/libs/common/domain/src/lib/model/search/search.model.d.ts.map +1 -1
  62. package/libs/feature/catalog/src/lib/my-org/my-org.service.d.ts +0 -1
  63. package/libs/feature/catalog/src/lib/my-org/my-org.service.d.ts.map +1 -1
  64. package/libs/feature/dataviz/src/lib/service/data.service.d.ts +15 -2
  65. package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
  66. package/libs/feature/editor/src/lib/record-form/record-form.component.d.ts.map +1 -1
  67. package/libs/feature/map/src/index.d.ts +1 -0
  68. package/libs/feature/map/src/index.d.ts.map +1 -1
  69. package/libs/feature/map/src/lib/constant/index.d.ts +1 -0
  70. package/libs/feature/map/src/lib/constant/index.d.ts.map +1 -1
  71. package/libs/feature/map/src/lib/constant/projections.d.ts.map +1 -0
  72. package/libs/feature/map/src/lib/feature-map.module.d.ts +13 -12
  73. package/libs/feature/map/src/lib/feature-map.module.d.ts.map +1 -1
  74. package/libs/feature/map/src/lib/geocoding/geocoding.component.d.ts +25 -0
  75. package/libs/feature/map/src/lib/geocoding/geocoding.component.d.ts.map +1 -0
  76. package/libs/feature/map/src/lib/geocoding.service.d.ts +18 -0
  77. package/libs/feature/map/src/lib/geocoding.service.d.ts.map +1 -0
  78. package/libs/feature/map/src/lib/utils/index.d.ts +0 -2
  79. package/libs/feature/map/src/lib/utils/index.d.ts.map +1 -1
  80. package/libs/feature/map/src/lib/utils/map-utils.service.d.ts +13 -11
  81. package/libs/feature/map/src/lib/utils/map-utils.service.d.ts.map +1 -1
  82. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +1 -3
  83. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
  84. package/libs/feature/search/src/index.d.ts +1 -0
  85. package/libs/feature/search/src/index.d.ts.map +1 -1
  86. package/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.d.ts +3 -3
  87. package/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.d.ts.map +1 -1
  88. package/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.d.ts +3 -2
  89. package/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.d.ts.map +1 -1
  90. package/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.d.ts +1 -1
  91. package/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.d.ts.map +1 -1
  92. package/libs/feature/search/src/lib/results-table/results-table.component.d.ts +34 -0
  93. package/libs/feature/search/src/lib/results-table/results-table.component.d.ts.map +1 -0
  94. package/libs/feature/search/src/lib/state/effects.d.ts.map +1 -1
  95. package/libs/ui/dataviz/src/lib/chart/chart.component.d.ts +1 -1
  96. package/libs/ui/elements/src/index.d.ts +1 -0
  97. package/libs/ui/elements/src/index.d.ts.map +1 -1
  98. package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +1 -1
  99. package/libs/ui/elements/src/lib/ui-elements.module.d.ts +1 -1
  100. package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
  101. package/libs/ui/inputs/src/index.d.ts +1 -0
  102. package/libs/ui/inputs/src/index.d.ts.map +1 -1
  103. package/libs/ui/inputs/src/lib/editable-label/editable-label.directive.d.ts +13 -0
  104. package/libs/ui/inputs/src/lib/editable-label/editable-label.directive.d.ts.map +1 -0
  105. package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +2 -1
  106. package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts.map +1 -1
  107. package/libs/ui/layout/src/index.d.ts +2 -0
  108. package/libs/ui/layout/src/index.d.ts.map +1 -1
  109. package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts +14 -0
  110. package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts.map +1 -0
  111. package/libs/ui/layout/src/lib/interactive-table/interactive-table.component.d.ts +15 -0
  112. package/libs/ui/layout/src/lib/interactive-table/interactive-table.component.d.ts.map +1 -0
  113. package/libs/ui/search/src/index.d.ts +0 -1
  114. package/libs/ui/search/src/index.d.ts.map +1 -1
  115. package/libs/ui/search/src/lib/ui-search.module.d.ts +15 -15
  116. package/libs/ui/search/src/lib/ui-search.module.d.ts.map +1 -1
  117. package/libs/util/shared/src/lib/links/link-utils.d.ts +19 -7
  118. package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
  119. package/package.json +4 -1
  120. package/src/libs/api/metadata-converter/src/lib/gn4/atomic-operations.ts +3 -0
  121. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +43 -0
  122. package/src/libs/api/repository/src/lib/gn4/index.ts +2 -0
  123. package/src/libs/api/repository/src/lib/gn4/selection/selection.service.ts +14 -38
  124. package/src/libs/common/domain/src/lib/index.ts +2 -0
  125. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +12 -7
  126. package/src/libs/common/domain/src/lib/model/search/search.model.ts +1 -1
  127. package/src/libs/common/domain/src/lib/model/user/index.ts +1 -0
  128. package/src/libs/feature/catalog/src/lib/my-org/my-org.service.ts +4 -16
  129. package/src/libs/feature/dataviz/src/lib/service/data.service.ts +8 -5
  130. package/src/libs/feature/editor/src/lib/record-form/record-form.component.ts +2 -1
  131. package/src/libs/feature/map/src/index.ts +1 -0
  132. package/src/libs/feature/map/src/lib/constant/index.ts +1 -0
  133. package/src/libs/feature/map/src/lib/feature-map.module.ts +8 -0
  134. package/src/libs/feature/map/src/lib/geocoding/geocoding.component.css +0 -0
  135. package/src/libs/feature/map/src/lib/geocoding/geocoding.component.html +39 -0
  136. package/src/libs/feature/map/src/lib/geocoding/geocoding.component.ts +99 -0
  137. package/src/libs/feature/map/src/lib/geocoding.service.ts +59 -0
  138. package/src/libs/feature/map/src/lib/utils/index.ts +0 -2
  139. package/src/libs/feature/map/src/lib/utils/map-utils.service.ts +85 -50
  140. package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +18 -3
  141. package/src/libs/feature/search/src/index.ts +1 -0
  142. package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.ts +1 -1
  143. package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.ts +4 -4
  144. package/src/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.ts +9 -3
  145. package/src/libs/feature/search/src/lib/results-table/results-table.component.css +0 -0
  146. package/src/libs/feature/search/src/lib/results-table/results-table.component.html +135 -0
  147. package/src/libs/feature/search/src/lib/results-table/results-table.component.ts +165 -0
  148. package/src/libs/feature/search/src/lib/state/effects.ts +4 -3
  149. package/src/libs/ui/elements/src/index.ts +1 -0
  150. package/src/libs/ui/elements/src/lib/downloads-list/downloads-list.component.html +4 -1
  151. package/src/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.html +3 -2
  152. package/src/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html +1 -1
  153. package/src/libs/ui/elements/src/lib/ui-elements.module.ts +1 -0
  154. package/src/libs/ui/inputs/src/index.ts +1 -0
  155. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +1 -1
  156. package/src/libs/ui/inputs/src/lib/checkbox/checkbox.component.html +0 -1
  157. package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.html +1 -1
  158. package/src/libs/ui/inputs/src/lib/editable-label/editable-label.directive.ts +48 -0
  159. package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +3 -0
  160. package/src/libs/ui/layout/src/index.ts +2 -0
  161. package/src/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.css +0 -0
  162. package/src/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.html +1 -0
  163. package/src/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.ts +33 -0
  164. package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.css +15 -0
  165. package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.html +54 -0
  166. package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.ts +42 -0
  167. package/src/libs/ui/search/src/index.ts +0 -1
  168. package/src/libs/ui/search/src/lib/ui-search.module.ts +2 -3
  169. package/src/libs/util/shared/src/lib/links/link-utils.ts +34 -11
  170. package/translations/de.json +1 -0
  171. package/translations/en.json +1 -0
  172. package/translations/es.json +1 -0
  173. package/translations/fr.json +2 -1
  174. package/translations/it.json +1 -0
  175. package/translations/nl.json +1 -0
  176. package/translations/pt.json +1 -0
  177. package/translations/sk.json +1 -0
  178. package/esm2022/libs/feature/map/src/lib/utils/map-utils-wms.service.mjs +0 -55
  179. package/esm2022/libs/feature/map/src/lib/utils/projections.mjs +0 -2
  180. package/esm2022/libs/ui/search/src/lib/record-table/record-table.component.mjs +0 -145
  181. package/libs/feature/map/src/lib/utils/map-utils-wms.service.d.ts +0 -17
  182. package/libs/feature/map/src/lib/utils/map-utils-wms.service.d.ts.map +0 -1
  183. package/libs/feature/map/src/lib/utils/projections.d.ts.map +0 -1
  184. package/libs/ui/search/src/lib/record-table/record-table.component.d.ts +0 -31
  185. package/libs/ui/search/src/lib/record-table/record-table.component.d.ts.map +0 -1
  186. package/src/libs/feature/map/src/lib/utils/map-utils-wms.service.ts +0 -58
  187. package/src/libs/ui/search/src/lib/record-table/record-table.component.css +0 -7
  188. package/src/libs/ui/search/src/lib/record-table/record-table.component.html +0 -215
  189. package/src/libs/ui/search/src/lib/record-table/record-table.component.ts +0 -149
  190. /package/libs/feature/map/src/lib/{utils → constant}/projections.d.ts +0 -0
  191. /package/src/libs/feature/map/src/lib/{utils → constant}/projections.ts +0 -0
@@ -10,7 +10,7 @@ import { catchError, filter, map, startWith } from 'rxjs/operators'
10
10
  import { SearchFacade } from '../state/search.facade'
11
11
  import { SearchService } from '../utils/service/search.service'
12
12
  import { FieldsService } from '../utils/service/fields.service'
13
- import { FieldAvailableValue } from '../utils/service/fields'
13
+ import { FieldAvailableValue, FieldValue } from '../utils/service/fields'
14
14
 
15
15
  @Component({
16
16
  selector: 'gn-ui-filter-dropdown',
@@ -31,11 +31,11 @@ export class FilterDropdownComponent implements OnInit {
31
31
  filter((selected) => !!selected),
32
32
  startWith([]),
33
33
  catchError(() => of([]))
34
- )
34
+ ) as Observable<FieldValue[]>
35
35
 
36
- onSelectedValues(values: (string | number)[]) {
36
+ onSelectedValues(values: unknown[]) {
37
37
  this.fieldsService
38
- .buildFiltersFromFieldValues({ [this.fieldName]: values })
38
+ .buildFiltersFromFieldValues({ [this.fieldName]: values as FieldValue[] })
39
39
  .subscribe((filters) => this.searchService.updateFilters(filters))
40
40
  }
41
41
 
@@ -11,12 +11,13 @@ import {
11
11
  AutocompleteComponent,
12
12
  AutocompleteItem,
13
13
  } from '../../../../../../libs/ui/inputs/src'
14
- import { Observable } from 'rxjs'
14
+ import { Observable, firstValueFrom } from 'rxjs'
15
15
  import { map } from 'rxjs/operators'
16
16
  import { SearchFacade } from '../state/search.facade'
17
17
  import { SearchService } from '../utils/service/search.service'
18
18
  import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
19
19
  import { RecordsRepositoryInterface } from '../../../../../../libs/common/domain/src/lib/repository/records-repository.interface'
20
+ import { SearchFilters } from '../../../../../../libs/api/metadata-converter/src'
20
21
 
21
22
  @Component({
22
23
  selector: 'gn-ui-fuzzy-search',
@@ -75,7 +76,12 @@ export class FuzzySearchComponent implements OnInit {
75
76
  }
76
77
  }
77
78
 
78
- handleInputCleared() {
79
- this.searchService.updateFilters({ any: '' })
79
+ async handleInputCleared() {
80
+ const currentSearchFilters: SearchFilters = await firstValueFrom(
81
+ this.searchFacade.searchFilters$
82
+ )
83
+ if (currentSearchFilters.any) {
84
+ this.searchService.updateFilters({ any: '' })
85
+ }
80
86
  }
81
87
  }
@@ -0,0 +1,135 @@
1
+ <div>
2
+ <div class="flex" data-cy="records-information">
3
+ <div
4
+ translate
5
+ class="my-8 ml-4 block text-gray-800"
6
+ [translateParams]="{
7
+ displayed: (records$ | async).length,
8
+ hits: (recordCount$ | async)
9
+ }"
10
+ >
11
+ results.records.hits.displayedOn
12
+ </div>
13
+ <div
14
+ *ngIf="(selectedRecords$ | async).length as selectedRecordCount"
15
+ class="my-8 ml-6 block text-gray-400 selected-records"
16
+ translate
17
+ [translateParams]="{ amount: selectedRecordCount }"
18
+ >
19
+ results.records.hits.selected
20
+ </div>
21
+ </div>
22
+
23
+ <gn-ui-interactive-table
24
+ [items]="records$ | async"
25
+ (itemClick)="handleRecordClick($event)"
26
+ >
27
+ <!-- SELECTED COLUMN -->
28
+ <gn-ui-interactive-table-column>
29
+ <ng-template #header>
30
+ <gn-ui-checkbox
31
+ [checked]="isAllSelected() | async"
32
+ [indeterminate]="isSomeSelected() | async"
33
+ (changed)="toggleSelectAll()"
34
+ type="default"
35
+ class="-m-2 mr-3"
36
+ >
37
+ </gn-ui-checkbox>
38
+ </ng-template>
39
+ <ng-template #cell let-item>
40
+ <gn-ui-checkbox
41
+ [checked]="isChecked(item) | async"
42
+ (changed)="handleRecordSelectedChange($event, item)"
43
+ class="-m-2"
44
+ type="default"
45
+ ></gn-ui-checkbox>
46
+ </ng-template>
47
+ </gn-ui-interactive-table-column>
48
+
49
+ <!-- TITLE COLUMN -->
50
+ <gn-ui-interactive-table-column
51
+ [sortable]="true"
52
+ [activeSort]="isSortedBy('resourceTitleObject.default.keyword') | async"
53
+ (sortChange)="setSortBy('resourceTitleObject.default.keyword', $event)"
54
+ >
55
+ <ng-template #header>
56
+ <span translate>record.metadata.title</span>
57
+ </ng-template>
58
+ <ng-template #cell let-item>
59
+ {{ item.title }}
60
+ </ng-template>
61
+ </gn-ui-interactive-table-column>
62
+
63
+ <!-- FORMATS COLUMN -->
64
+ <gn-ui-interactive-table-column>
65
+ <ng-template #header>
66
+ <span translate>record.metadata.formats</span>
67
+ </ng-template>
68
+ <ng-template #cell let-item>
69
+ <div
70
+ class="flex justify-start items-center gap-2"
71
+ *ngIf="getRecordFormats(item) as formats"
72
+ [title]="formats.join(', ')"
73
+ >
74
+ <span
75
+ class="badge-btn min-w-[45px] text-sm text-white px-2 flex-shrink-0"
76
+ [style.background-color]="getBadgeColor(formats[0])"
77
+ *ngIf="formats[0]"
78
+ >
79
+ {{ formats[0] }}
80
+ </span>
81
+ <span
82
+ class="badge-btn min-w-[45px] text-sm text-white px-2 flex-shrink-0"
83
+ [style.background-color]="getBadgeColor(formats[1])"
84
+ *ngIf="formats[1]"
85
+ >
86
+ {{ formats[1] }}
87
+ </span>
88
+ <div class="flex-shrink-0" *ngIf="formats.slice(2).length > 0">
89
+ <span>+{{ formats.slice(2).length }}</span>
90
+ </div>
91
+ </div>
92
+ <div *ngIf="!getRecordFormats(item)"></div>
93
+ </ng-template>
94
+ </gn-ui-interactive-table-column>
95
+
96
+ <!-- OWNER COLUMN -->
97
+ <gn-ui-interactive-table-column
98
+ [sortable]="true"
99
+ [activeSort]="isSortedBy('recordOwner') | async"
100
+ (sortChange)="setSortBy('recordOwner', $event)"
101
+ >
102
+ <ng-template #header>
103
+ <span translate>record.metadata.author</span>
104
+ </ng-template>
105
+ <ng-template #cell let-item>
106
+ <mat-icon class="material-symbols-outlined">person</mat-icon>
107
+ <span>{{ formatUserInfo(item.extras?.ownerInfo) }}</span>
108
+ </ng-template>
109
+ </gn-ui-interactive-table-column>
110
+
111
+ <!-- STATUS COLUMN -->
112
+ <gn-ui-interactive-table-column>
113
+ <ng-template #header>
114
+ <span translate>record.metadata.status</span>
115
+ </ng-template>
116
+ <ng-template #cell let-item>
117
+ {{ item.status }}
118
+ </ng-template>
119
+ </gn-ui-interactive-table-column>
120
+
121
+ <!-- UPDATE DATE COLUMN -->
122
+ <gn-ui-interactive-table-column
123
+ [sortable]="true"
124
+ [activeSort]="isSortedBy('changeDate') | async"
125
+ (sortChange)="setSortBy('changeDate', $event)"
126
+ >
127
+ <ng-template #header>
128
+ <span translate>record.metadata.updatedOn</span>
129
+ </ng-template>
130
+ <ng-template #cell let-item>
131
+ {{ dateToString(item.recordUpdated) }}
132
+ </ng-template>
133
+ </gn-ui-interactive-table-column>
134
+ </gn-ui-interactive-table>
135
+ </div>
@@ -0,0 +1,165 @@
1
+ import { Component, EventEmitter, Output } from '@angular/core'
2
+ import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
3
+ import {
4
+ FileFormat,
5
+ getBadgeColor,
6
+ getFileFormat,
7
+ getFormatPriority,
8
+ } from '../../../../../../libs/util/shared/src'
9
+ import { UiInputsModule } from '../../../../../../libs/ui/inputs/src'
10
+ import {
11
+ InteractiveTableColumnComponent,
12
+ InteractiveTableComponent,
13
+ } from '../../../../../../libs/ui/layout/src'
14
+ import { MatIconModule } from '@angular/material/icon'
15
+ import { TranslateModule } from '@ngx-translate/core'
16
+ import { SearchFacade } from '../state/search.facade'
17
+ import { SelectionService } from '../../../../../../libs/api/repository/src'
18
+ import { combineLatest, firstValueFrom, Observable } from 'rxjs'
19
+ import { CommonModule } from '@angular/common'
20
+ import { map, take } from 'rxjs/operators'
21
+ import { FieldSort } from '../../../../../../libs/common/domain/src/lib/model/search'
22
+ import { SearchService } from '../utils/service/search.service'
23
+
24
+ @Component({
25
+ selector: 'gn-ui-results-table',
26
+ templateUrl: './results-table.component.html',
27
+ styleUrls: ['./results-table.component.css'],
28
+ standalone: true,
29
+ imports: [
30
+ CommonModule,
31
+ UiInputsModule,
32
+ InteractiveTableComponent,
33
+ InteractiveTableColumnComponent,
34
+ MatIconModule,
35
+ TranslateModule,
36
+ ],
37
+ })
38
+ export class ResultsTableComponent {
39
+ @Output() recordClick = new EventEmitter<CatalogRecord>()
40
+
41
+ records$ = this.searchFacade.results$
42
+ recordCount$ = this.searchFacade.resultsHits$
43
+ selectedRecords$ = this.selectionService.selectedRecordsIdentifiers$
44
+
45
+ constructor(
46
+ private searchFacade: SearchFacade,
47
+ private searchService: SearchService,
48
+ private selectionService: SelectionService
49
+ ) {}
50
+
51
+ dateToString(date: Date): string {
52
+ return date?.toLocaleDateString(undefined, {
53
+ year: 'numeric',
54
+ month: 'long',
55
+ day: 'numeric',
56
+ timeZone: 'UTC',
57
+ })
58
+ }
59
+
60
+ getStatus(isPublishedToAll: boolean | unknown) {
61
+ return isPublishedToAll ? 'published' : 'not published'
62
+ }
63
+
64
+ getRecordFormats(record: CatalogRecord): FileFormat[] {
65
+ if (record.kind === 'service' || !('distributions' in record)) {
66
+ return []
67
+ }
68
+ const formats = Array.from(
69
+ new Set(
70
+ record.distributions.map((distribution) => getFileFormat(distribution))
71
+ )
72
+ ).filter((format) => !!format)
73
+ formats.sort((a, b) => getFormatPriority(b) - getFormatPriority(a))
74
+ return formats
75
+ }
76
+
77
+ formatUserInfo(userInfo: string | unknown): string {
78
+ const infos = (typeof userInfo === 'string' ? userInfo : '').split('|')
79
+ if (infos && infos.length === 4) {
80
+ return `${infos[2]} ${infos[1]}`
81
+ }
82
+ return undefined
83
+ }
84
+
85
+ getBadgeColor(format: FileFormat): string {
86
+ return getBadgeColor(format)
87
+ }
88
+
89
+ handleRecordClick(item: unknown) {
90
+ this.recordClick.emit(item as CatalogRecord)
91
+ }
92
+
93
+ setSortBy(col: string, order: 'asc' | 'desc') {
94
+ this.searchService.setSortBy([order, col])
95
+ }
96
+
97
+ isSortedBy(col: string): Observable<'asc' | 'desc' | null> {
98
+ return this.searchFacade.sortBy$.pipe(
99
+ take(1),
100
+ map((sortOrder) => {
101
+ const sortArray = Array.isArray(sortOrder[0])
102
+ ? (sortOrder as FieldSort[])
103
+ : ([sortOrder] as FieldSort[])
104
+ for (const sort of sortArray) {
105
+ if (sort[1] === col) {
106
+ return sort[0]
107
+ }
108
+ }
109
+ return null
110
+ })
111
+ )
112
+ }
113
+
114
+ isChecked(record: CatalogRecord): Observable<boolean> {
115
+ return this.selectedRecords$.pipe(
116
+ take(1),
117
+ map((selectedRecords) => {
118
+ return selectedRecords.includes(record.uniqueIdentifier)
119
+ })
120
+ )
121
+ }
122
+
123
+ handleRecordSelectedChange(selected: boolean, record: CatalogRecord) {
124
+ if (!selected) {
125
+ this.selectionService.deselectRecords([record])
126
+ } else {
127
+ this.selectionService.selectRecords([record])
128
+ }
129
+ }
130
+
131
+ async toggleSelectAll() {
132
+ const records = await firstValueFrom(this.records$)
133
+ if (await firstValueFrom(this.isAllSelected())) {
134
+ this.selectionService.deselectRecords(records)
135
+ } else {
136
+ this.selectionService.selectRecords(records)
137
+ }
138
+ }
139
+
140
+ isAllSelected(): Observable<boolean> {
141
+ return combineLatest([this.records$, this.selectedRecords$]).pipe(
142
+ take(1),
143
+ map(([records, selectedRecords]) => {
144
+ return records.every((record) =>
145
+ selectedRecords.includes(record.uniqueIdentifier)
146
+ )
147
+ })
148
+ )
149
+ }
150
+
151
+ isSomeSelected(): Observable<boolean> {
152
+ return combineLatest([this.records$, this.selectedRecords$]).pipe(
153
+ take(1),
154
+ map(([records, selectedRecords]) => {
155
+ const allSelected = records.every((record) =>
156
+ selectedRecords.includes(record.uniqueIdentifier)
157
+ )
158
+ const someSelected = records.some((record) =>
159
+ selectedRecords.includes(record.uniqueIdentifier)
160
+ )
161
+ return !allSelected && someSelected
162
+ })
163
+ )
164
+ }
165
+ }
@@ -126,10 +126,11 @@ export class SearchEffects {
126
126
  ),
127
127
  switchMap(([state, favorites]) => {
128
128
  if (!state.params.useSpatialFilter || !this.filterGeometry$) {
129
- return of([state, favorites, null])
129
+ return of([state, favorites, undefined])
130
130
  }
131
131
  return this.filterGeometry$.pipe(
132
132
  tap((geom) => {
133
+ if (!geom) return
133
134
  try {
134
135
  const trace = validGeoJson(geom, true) as string[]
135
136
  if (trace?.length > 0) {
@@ -145,7 +146,7 @@ export class SearchEffects {
145
146
  }),
146
147
  map((geom) => [state, favorites, geom]),
147
148
  catchError((e) => {
148
- return of([state, favorites, null])
149
+ return of([state, favorites, undefined])
149
150
  })
150
151
  )
151
152
  }),
@@ -153,7 +154,7 @@ export class SearchEffects {
153
154
  ([state, favorites, geometry]: [
154
155
  SearchStateSearch,
155
156
  string[],
156
- Geometry | null
157
+ Geometry | undefined
157
158
  ]) => {
158
159
  const { currentPage, pageSize, sort } = state.params
159
160
  const filters = {
@@ -18,6 +18,7 @@ export * from './lib/pagination/pagination.component'
18
18
  export * from './lib/related-record-card/related-record-card.component'
19
19
  export * from './lib/search-results-error/search-results-error.component'
20
20
  export * from './lib/user-preview/user-preview.component'
21
+ export * from './lib/max-lines/max-lines.component'
21
22
  export * from './lib/record-api-form/record-api-form.component'
22
23
  export * from './lib/markdown-parser/markdown-parser.component'
23
24
  export * from './lib/image-overlay-preview/image-overlay-preview.component'
@@ -8,7 +8,10 @@
8
8
  >
9
9
  record.metadata.download
10
10
  </p>
11
- <div class="flex flex-wrap justify-start sm:justify-end sm:pb-4">
11
+ <div
12
+ class="flex flex-wrap justify-start sm:justify-end sm:pb-4"
13
+ data-cy="download-format-filters"
14
+ >
12
15
  <gn-ui-button
13
16
  class="m-1 format-filter"
14
17
  [extraClass]="
@@ -1,11 +1,12 @@
1
1
  <gn-ui-content-ghost
2
2
  [showContent]="imageUrl !== undefined"
3
- ghostClass="h-36 mb-3"
3
+ ghostClass="h-48 mb-3"
4
4
  >
5
5
  <div
6
6
  *ngIf="imageUrl"
7
+ [showContent]="imageUrl !== undefined"
7
8
  data-cy="record-thumbnail"
8
- class="flex-shrink-0 bg-gray-100 rounded-lg overflow-hidden w-full border border-gray-300 h-36 group-hover:shadow-xl group-hover:border-0 mb-3"
9
+ class="flex-shrink-0 bg-gray-100 rounded-lg overflow-hidden w-full border border-gray-300 group-hover:shadow-xl group-hover:border-0 h-48 mb-3"
9
10
  >
10
11
  <gn-ui-thumbnail
11
12
  class="relative h-full w-full"
@@ -1,4 +1,4 @@
1
- <div class="py-5 px-5 rounded bg-gray-100 text-black mb-6 sm:mb-12">
1
+ <div class="py-5 px-5 rounded bg-gray-100 text-black mb-6">
2
2
  <div class="grid gap-3">
3
3
  <div>
4
4
  <p class="text-sm font-medium" translate>record.metadata.contact</p>
@@ -88,6 +88,7 @@ import { ImageOverlayPreviewComponent } from './image-overlay-preview/image-over
88
88
  AvatarComponent,
89
89
  UserPreviewComponent,
90
90
  PaginationButtonsComponent,
91
+ MaxLinesComponent,
91
92
  RecordApiFormComponent,
92
93
  MarkdownParserComponent,
93
94
  ImageOverlayPreviewComponent,
@@ -19,3 +19,4 @@ export * from './lib/viewport-intersector/viewport-intersector.component'
19
19
  export * from './lib/checkbox/checkbox.component'
20
20
  export * from './lib/search-input/search-input.component'
21
21
  export * from './lib/date-range-picker/date-range-picker.component'
22
+ export * from './lib/editable-label/editable-label.directive'
@@ -6,7 +6,7 @@
6
6
  [placeholder]="placeholder"
7
7
  [formControl]="control"
8
8
  [matAutocomplete]="auto"
9
- (keyup.enter)="handleEnter($event.target.value)"
9
+ (keyup.enter)="handleEnter(searchInput.value)"
10
10
  />
11
11
  <button
12
12
  type="button"
@@ -1,7 +1,6 @@
1
1
  <mat-checkbox
2
2
  class="cursor-pointer"
3
3
  [class]="classList"
4
- type="checkbox"
5
4
  [checked]="checked"
6
5
  [indeterminate]="indeterminate"
7
6
  (click)="handleClick($event)"
@@ -113,7 +113,7 @@
113
113
  type="checkbox"
114
114
  #checkBox
115
115
  [checked]="isSelected(choice)"
116
- (change)="select(choice, $event.target.checked)"
116
+ (change)="select(choice, checkBox.checked)"
117
117
  />
118
118
  <span class="ml-[8px] text-[14px] truncate">
119
119
  {{ choice.label }}
@@ -0,0 +1,48 @@
1
+ import {
2
+ Directive,
3
+ ElementRef,
4
+ Renderer2,
5
+ AfterViewInit,
6
+ EventEmitter,
7
+ Output,
8
+ Input,
9
+ } from '@angular/core'
10
+
11
+ @Directive({
12
+ selector: '[gnUiEditableLabel]',
13
+ standalone: true,
14
+ })
15
+ export class EditableLabelDirective implements AfterViewInit {
16
+ @Output() editableLabelChanged = new EventEmitter<string>()
17
+ @Input() gnUiEditableLabel?: boolean
18
+
19
+ constructor(private el: ElementRef, private renderer: Renderer2) {}
20
+
21
+ ngAfterViewInit() {
22
+ if (this.gnUiEditableLabel !== false) {
23
+ const appendedInput = this.renderer.createElement('input')
24
+
25
+ this.renderer.setStyle(appendedInput, 'background', 'inherit')
26
+ this.renderer.setStyle(appendedInput, 'color', 'inherit')
27
+ this.renderer.setStyle(appendedInput, 'font', 'inherit')
28
+ this.renderer.setStyle(appendedInput, 'border', 'inherit')
29
+ this.renderer.setStyle(appendedInput, 'width', '100%')
30
+ this.renderer.setStyle(appendedInput, 'padding', 'inherit')
31
+ this.renderer.setStyle(appendedInput, 'margin', '0')
32
+ this.renderer.setStyle(appendedInput, 'height', 'inherit')
33
+ this.renderer.setStyle(appendedInput, 'line-height', 'inherit')
34
+ this.renderer.setStyle(appendedInput, 'text-decoration', 'inherit')
35
+
36
+ const hostContent = this.el.nativeElement.textContent || ''
37
+ const formattedContent = hostContent.replace(/\s+/g, ' ').trim()
38
+ this.renderer.setProperty(appendedInput, 'value', formattedContent)
39
+ this.renderer.setProperty(this.el.nativeElement, 'innerHTML', '')
40
+
41
+ this.renderer.listen(appendedInput, 'input', (event) => {
42
+ this.editableLabelChanged.emit(event.target.value)
43
+ })
44
+
45
+ this.renderer.appendChild(this.el.nativeElement, appendedInput)
46
+ }
47
+ }
48
+ }
@@ -41,6 +41,7 @@ import { MatFormFieldModule } from '@angular/material/form-field'
41
41
  import { MatInputModule } from '@angular/material/input'
42
42
  import { MatDatepickerModule } from '@angular/material/datepicker'
43
43
  import { MatNativeDateModule } from '@angular/material/core'
44
+ import { EditableLabelDirective } from './editable-label/editable-label.directive'
44
45
 
45
46
  @NgModule({
46
47
  declarations: [
@@ -87,6 +88,7 @@ import { MatNativeDateModule } from '@angular/material/core'
87
88
  MatInputModule,
88
89
  MatDatepickerModule,
89
90
  MatNativeDateModule,
91
+ EditableLabelDirective,
90
92
  ],
91
93
  exports: [
92
94
  DropdownSelectorComponent,
@@ -106,6 +108,7 @@ import { MatNativeDateModule } from '@angular/material/core'
106
108
  CheckboxComponent,
107
109
  SearchInputComponent,
108
110
  DateRangePickerComponent,
111
+ EditableLabelDirective,
109
112
  ],
110
113
  })
111
114
  export class UiInputsModule {}
@@ -4,3 +4,5 @@ export * from './lib/carousel/carousel.component'
4
4
  export * from './lib/expandable-panel/expandable-panel.component'
5
5
  export * from './lib/sticky-header/sticky-header.component'
6
6
  export * from './lib/expandable-panel-button/expandable-panel-button.component'
7
+ export * from './lib/interactive-table/interactive-table.component'
8
+ export * from './lib/interactive-table/interactive-table-column/interactive-table-column.component'
@@ -0,0 +1,33 @@
1
+ import {
2
+ ChangeDetectionStrategy,
3
+ Component,
4
+ ContentChild,
5
+ EventEmitter,
6
+ Input,
7
+ Output,
8
+ TemplateRef,
9
+ } from '@angular/core'
10
+ import { CommonModule } from '@angular/common'
11
+
12
+ @Component({
13
+ selector: 'gn-ui-interactive-table-column',
14
+ standalone: true,
15
+ imports: [CommonModule],
16
+ templateUrl: './interactive-table-column.component.html',
17
+ styleUrls: ['./interactive-table-column.component.css'],
18
+ changeDetection: ChangeDetectionStrategy.OnPush,
19
+ })
20
+ export class InteractiveTableColumnComponent {
21
+ @ContentChild('header') header: TemplateRef<unknown>
22
+ @ContentChild('cell') cell: TemplateRef<unknown>
23
+
24
+ @Input() grow = false
25
+ @Input() sortable = false
26
+ @Input() activeSort: 'asc' | 'desc' | null = null
27
+ @Output() sortChange = new EventEmitter<'asc' | 'desc'>()
28
+
29
+ handleSortChange() {
30
+ this.activeSort = this.activeSort === 'asc' ? 'desc' : 'asc'
31
+ this.sortChange.emit(this.activeSort)
32
+ }
33
+ }
@@ -0,0 +1,15 @@
1
+ .sort-button mat-icon {
2
+ padding: 0;
3
+ margin: 0;
4
+ height: 8px;
5
+ line-height: 8px;
6
+ font-size: 18px;
7
+ }
8
+
9
+ .table-header-cell {
10
+ @apply text-gray-700 px-4 py-5 flex items-center truncate bg-white;
11
+ }
12
+
13
+ button.table-header-cell {
14
+ @apply transition-colors duration-75 hover:text-main hover:bg-gray-50 focus:text-main focus:bg-gray-50;
15
+ }
@@ -0,0 +1,54 @@
1
+ <div class="grid w-full" [ngStyle]="gridStyle">
2
+ <div class="contents">
3
+ <ng-container *ngFor="let column of columns">
4
+ <button
5
+ *ngIf="column.sortable"
6
+ type="button"
7
+ class="table-header-cell"
8
+ (click)="column.sortable && column.handleSortChange()"
9
+ >
10
+ <ng-container *ngTemplateOutlet="column.header"></ng-container>
11
+ <div class="sort-button flex flex-col" *ngIf="column.sortable">
12
+ <mat-icon
13
+ class="material-symbols-outlined text-gray-600"
14
+ [ngClass]="{ 'text-main': column.activeSort === 'asc' }"
15
+ >expand_less</mat-icon
16
+ >
17
+ <mat-icon
18
+ class="material-symbols-outlined text-gray-600"
19
+ [ngClass]="{ 'text-main': column.activeSort === 'desc' }"
20
+ >expand_more</mat-icon
21
+ >
22
+ </div>
23
+ </button>
24
+ <div *ngIf="!column.sortable" class="table-header-cell">
25
+ <ng-container *ngTemplateOutlet="column.header"></ng-container>
26
+ </div>
27
+ </ng-container>
28
+ </div>
29
+ <div
30
+ class="contents text-gray-900 cursor-pointer group"
31
+ *ngFor="let item of items"
32
+ (click)="handleRowClick(item)"
33
+ >
34
+ <div
35
+ class="relative h-0"
36
+ [ngStyle]="{ 'grid-column': 'span ' + this.columns.length }"
37
+ >
38
+ <!-- this element is only used in keyboard navigation -->
39
+ <button
40
+ type="button"
41
+ class="absolute inset-x-0 h-[50px] bg-transparent pointer-events-none"
42
+ ></button>
43
+ </div>
44
+ <ng-container *ngFor="let column of columns">
45
+ <div
46
+ class="table-row-cell px-4 py-3 flex items-center bg-white transition-colors duration-75 truncate group-hover:text-main group-hover:bg-gray-50 border-b border-gray-200"
47
+ >
48
+ <ng-container
49
+ *ngTemplateOutlet="column.cell; context: { $implicit: item }"
50
+ ></ng-container>
51
+ </div>
52
+ </ng-container>
53
+ </div>
54
+ </div>