geonetwork-ui 2.5.0-dev.d91908296 → 2.5.0-dev.e41adefdb

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 (150) hide show
  1. package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.mjs +50 -32
  2. package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +2 -2
  3. package/esm2022/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.mjs +18 -16
  4. package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +17 -7
  5. package/esm2022/libs/feature/dataviz/src/lib/table-view/table-view.component.mjs +12 -17
  6. package/esm2022/libs/feature/editor/src/lib/components/constraint-card/constraint-card.component.mjs +3 -3
  7. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.mjs +2 -1
  8. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.mjs +2 -2
  9. package/esm2022/libs/feature/editor/src/lib/components/wizard-summarize/wizard-summarize.component.mjs +11 -11
  10. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +2 -2
  11. package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +3 -3
  12. package/esm2022/libs/feature/record/src/lib/feature-record.module.mjs +6 -7
  13. package/esm2022/libs/feature/search/src/lib/utils/service/fields.mjs +46 -1
  14. package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +3 -2
  15. package/esm2022/libs/ui/dataviz/src/index.mjs +3 -3
  16. package/esm2022/libs/ui/dataviz/src/lib/data-table/custom.mat.paginator.intl.mjs +51 -0
  17. package/esm2022/libs/ui/dataviz/src/lib/data-table/data-table.component.mjs +133 -0
  18. package/esm2022/libs/ui/dataviz/src/lib/data-table/data-table.data.source.mjs +24 -0
  19. package/esm2022/libs/ui/dataviz/src/lib/data-table/data-table.fixtures.mjs +82 -0
  20. package/esm2022/libs/ui/elements/src/index.mjs +2 -1
  21. package/esm2022/libs/ui/elements/src/lib/application-banner/application-banner.component.mjs +78 -0
  22. package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +18 -10
  23. package/esm2022/libs/ui/elements/src/lib/record-api-form/record-api-form.component.mjs +2 -1
  24. package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +10 -4
  25. package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +7 -2
  26. package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +14 -12
  27. package/esm2022/libs/util/data-fetcher/src/index.mjs +3 -1
  28. package/esm2022/libs/util/data-fetcher/src/lib/model.mjs +7 -3
  29. package/esm2022/libs/util/data-fetcher/src/lib/readers/wfs.mjs +20 -2
  30. package/esm2022/libs/util/data-fetcher/src/lib/utils.mjs +3 -3
  31. package/esm2022/libs/util/shared/src/lib/services/date.service.mjs +41 -0
  32. package/esm2022/libs/util/shared/src/lib/services/index.mjs +2 -1
  33. package/esm2022/libs/util/shared/src/lib/utils/temporal-extent-union.mjs +4 -4
  34. package/esm2022/translations/de.json +9 -3
  35. package/esm2022/translations/en.json +9 -3
  36. package/esm2022/translations/es.json +9 -3
  37. package/esm2022/translations/fr.json +11 -5
  38. package/esm2022/translations/it.json +9 -3
  39. package/esm2022/translations/nl.json +9 -3
  40. package/esm2022/translations/pt.json +9 -3
  41. package/fesm2022/geonetwork-ui.mjs +867 -432
  42. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  43. package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts +3 -1
  44. package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts.map +1 -1
  45. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  46. package/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.d.ts +7 -9
  47. package/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.d.ts.map +1 -1
  48. package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
  49. package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts +3 -6
  50. package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts.map +1 -1
  51. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.d.ts.map +1 -1
  52. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.d.ts.map +1 -1
  53. package/libs/feature/editor/src/lib/components/wizard-summarize/wizard-summarize.component.d.ts +3 -3
  54. package/libs/feature/editor/src/lib/components/wizard-summarize/wizard-summarize.component.d.ts.map +1 -1
  55. package/libs/feature/record/src/lib/feature-record.module.d.ts +2 -2
  56. package/libs/feature/record/src/lib/feature-record.module.d.ts.map +1 -1
  57. package/libs/feature/search/src/lib/utils/service/fields.d.ts +10 -0
  58. package/libs/feature/search/src/lib/utils/service/fields.d.ts.map +1 -1
  59. package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
  60. package/libs/ui/dataviz/src/index.d.ts +2 -2
  61. package/libs/ui/dataviz/src/index.d.ts.map +1 -1
  62. package/libs/ui/dataviz/src/lib/data-table/custom.mat.paginator.intl.d.ts +14 -0
  63. package/libs/ui/dataviz/src/lib/data-table/custom.mat.paginator.intl.d.ts.map +1 -0
  64. package/libs/ui/dataviz/src/lib/data-table/data-table.component.d.ts +45 -0
  65. package/libs/ui/dataviz/src/lib/data-table/data-table.component.d.ts.map +1 -0
  66. package/libs/ui/dataviz/src/lib/data-table/data-table.data.source.d.ts +12 -0
  67. package/libs/ui/dataviz/src/lib/data-table/data-table.data.source.d.ts.map +1 -0
  68. package/libs/ui/dataviz/src/lib/data-table/data-table.fixtures.d.ts +10 -0
  69. package/libs/ui/dataviz/src/lib/data-table/data-table.fixtures.d.ts.map +1 -0
  70. package/libs/ui/elements/src/index.d.ts +1 -0
  71. package/libs/ui/elements/src/index.d.ts.map +1 -1
  72. package/libs/ui/elements/src/lib/application-banner/application-banner.component.d.ts +16 -0
  73. package/libs/ui/elements/src/lib/application-banner/application-banner.component.d.ts.map +1 -0
  74. package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts +5 -0
  75. package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts.map +1 -1
  76. package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts.map +1 -1
  77. package/libs/ui/elements/src/lib/ui-elements.module.d.ts +2 -1
  78. package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
  79. package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts.map +1 -1
  80. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +3 -2
  81. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
  82. package/libs/util/data-fetcher/src/index.d.ts +3 -1
  83. package/libs/util/data-fetcher/src/index.d.ts.map +1 -1
  84. package/libs/util/data-fetcher/src/lib/model.d.ts +1 -1
  85. package/libs/util/data-fetcher/src/lib/model.d.ts.map +1 -1
  86. package/libs/util/data-fetcher/src/lib/readers/wfs.d.ts.map +1 -1
  87. package/libs/util/shared/src/lib/services/date.service.d.ts +13 -0
  88. package/libs/util/shared/src/lib/services/date.service.d.ts.map +1 -0
  89. package/libs/util/shared/src/lib/services/index.d.ts +1 -0
  90. package/libs/util/shared/src/lib/services/index.d.ts.map +1 -1
  91. package/libs/util/shared/src/lib/utils/temporal-extent-union.d.ts +2 -1
  92. package/libs/util/shared/src/lib/utils/temporal-extent-union.d.ts.map +1 -1
  93. package/package.json +1 -1
  94. package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +55 -32
  95. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +1 -5
  96. package/src/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.html +3 -3
  97. package/src/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.ts +17 -15
  98. package/src/libs/feature/dataviz/src/lib/service/data.service.ts +21 -11
  99. package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.html +4 -3
  100. package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.ts +9 -18
  101. package/src/libs/feature/editor/src/lib/components/constraint-card/constraint-card.component.html +1 -1
  102. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.ts +1 -0
  103. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.ts +1 -1
  104. package/src/libs/feature/editor/src/lib/components/wizard-summarize/wizard-summarize.component.ts +3 -4
  105. package/src/libs/feature/editor/src/lib/fields.config.ts +1 -1
  106. package/src/libs/feature/record/src/lib/data-view/data-view.component.html +1 -1
  107. package/src/libs/feature/record/src/lib/feature-record.module.ts +6 -4
  108. package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +2 -0
  109. package/src/libs/feature/search/src/lib/utils/service/fields.ts +55 -0
  110. package/src/libs/ui/dataviz/src/index.ts +2 -2
  111. package/src/libs/ui/dataviz/src/lib/data-table/custom.mat.paginator.intl.ts +52 -0
  112. package/src/libs/ui/dataviz/src/lib/{table/table.component.css → data-table/data-table.component.css} +4 -0
  113. package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.html +67 -0
  114. package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.ts +173 -0
  115. package/src/libs/ui/dataviz/src/lib/data-table/data-table.data.source.ts +33 -0
  116. package/src/libs/ui/dataviz/src/lib/data-table/data-table.fixtures.ts +84 -0
  117. package/src/libs/ui/elements/src/index.ts +1 -0
  118. package/src/libs/ui/elements/src/lib/application-banner/application-banner.component.css +0 -0
  119. package/src/libs/ui/elements/src/lib/application-banner/application-banner.component.html +25 -0
  120. package/src/libs/ui/elements/src/lib/application-banner/application-banner.component.ts +70 -0
  121. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +3 -3
  122. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +12 -2
  123. package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.ts +2 -0
  124. package/src/libs/ui/elements/src/lib/ui-elements.module.ts +3 -0
  125. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +6 -0
  126. package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +4 -2
  127. package/src/libs/util/data-fetcher/src/index.ts +3 -0
  128. package/src/libs/util/data-fetcher/src/lib/model.ts +6 -2
  129. package/src/libs/util/data-fetcher/src/lib/readers/wfs.ts +23 -1
  130. package/src/libs/util/data-fetcher/src/lib/utils.ts +2 -2
  131. package/src/libs/util/shared/src/lib/services/date.service.ts +45 -0
  132. package/src/libs/util/shared/src/lib/services/index.ts +1 -0
  133. package/src/libs/util/shared/src/lib/utils/temporal-extent-union.ts +6 -3
  134. package/translations/de.json +9 -3
  135. package/translations/en.json +9 -3
  136. package/translations/es.json +9 -3
  137. package/translations/fr.json +11 -5
  138. package/translations/it.json +9 -3
  139. package/translations/nl.json +9 -3
  140. package/translations/pt.json +9 -3
  141. package/translations/sk.json +9 -3
  142. package/esm2022/libs/ui/dataviz/src/lib/table/table.component.mjs +0 -61
  143. package/esm2022/libs/ui/dataviz/src/lib/table/table.fixtures.mjs +0 -40
  144. package/libs/ui/dataviz/src/lib/table/table.component.d.ts +0 -29
  145. package/libs/ui/dataviz/src/lib/table/table.component.d.ts.map +0 -1
  146. package/libs/ui/dataviz/src/lib/table/table.fixtures.d.ts +0 -11
  147. package/libs/ui/dataviz/src/lib/table/table.fixtures.d.ts.map +0 -1
  148. package/src/libs/ui/dataviz/src/lib/table/table.component.html +0 -40
  149. package/src/libs/ui/dataviz/src/lib/table/table.component.ts +0 -80
  150. package/src/libs/ui/dataviz/src/lib/table/table.fixtures.ts +0 -40
@@ -0,0 +1,13 @@
1
+ import { TranslateService } from '@ngx-translate/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DateService {
4
+ private translateService;
5
+ constructor(translateService: TranslateService);
6
+ private getDateObject;
7
+ private getLocaleAndDate;
8
+ formatDate(date: Date | string, options?: Intl.DateTimeFormatOptions): string;
9
+ formatDateTime(date: Date | string, options?: Intl.DateTimeFormatOptions): string;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<DateService, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<DateService>;
12
+ }
13
+ //# sourceMappingURL=date.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.service.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/util/shared/src/lib/services/date.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;;AAEtD,qBAGa,WAAW;IACV,OAAO,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IAEtD,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,gBAAgB;IASxB,UAAU,CACR,IAAI,EAAE,IAAI,GAAG,MAAM,EACnB,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GACnC,MAAM;IAKT,cAAc,CACZ,IAAI,EAAE,IAAI,GAAG,MAAM,EACnB,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GACnC,MAAM;yCAlCE,WAAW;6CAAX,WAAW;CAsCvB"}
@@ -1,4 +1,5 @@
1
1
  export * from './theme.service';
2
2
  export * from './log.service';
3
3
  export * from './proxy.service';
4
+ export * from './date.service';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/util/shared/src/lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/util/shared/src/lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA"}
@@ -1,7 +1,8 @@
1
+ import { DateService } from '../services';
1
2
  export declare function getTemporalRangeUnion(ranges: {
2
3
  start?: Date;
3
4
  end?: Date;
4
- }[]): {
5
+ }[], dateService: DateService): {
5
6
  start: string;
6
7
  end: string;
7
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"temporal-extent-union.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/util/shared/src/lib/utils/temporal-extent-union.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CACnC,MAAM,EAAE;IACN,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,GAAG,CAAC,EAAE,IAAI,CAAA;CACX,EAAE;;;EAgCJ"}
1
+ {"version":3,"file":"temporal-extent-union.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/util/shared/src/lib/utils/temporal-extent-union.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE;IACN,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,GAAG,CAAC,EAAE,IAAI,CAAA;CACX,EAAE,EACH,WAAW,EAAE,WAAW;;;EAgCzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geonetwork-ui",
3
- "version": "2.5.0-dev.d91908296",
3
+ "version": "2.5.0-dev.e41adefdb",
4
4
  "engines": {
5
5
  "node": ">=20"
6
6
  },
@@ -28,6 +28,7 @@ import {
28
28
  } from '../../../../../../../libs/api/metadata-converter/src'
29
29
  import { LangService } from '../../../../../../../libs/util/i18n/src'
30
30
  import { formatDate, isDateRange } from './date-range.utils'
31
+ import { CatalogRecord } from '../../../../../../../libs/common/domain/src/lib/model/record'
31
32
 
32
33
  export type DateRange = { start?: Date; end?: Date }
33
34
 
@@ -50,7 +51,7 @@ export class ElasticsearchService {
50
51
  size = 0,
51
52
  from = 0,
52
53
  sortBy: SortByField = null,
53
- requestFields: RequestFields = [],
54
+ requestFields: RequestFields = null,
54
55
  searchFilters: SearchFilters = {},
55
56
  configFilters: SearchFilters = {},
56
57
  uuids?: string[],
@@ -68,7 +69,7 @@ export class ElasticsearchService {
68
69
  geometry
69
70
  ),
70
71
  ...(size > 0 ? { track_total_hits: true } : {}),
71
- _source: requestFields,
72
+ ...(requestFields && { _source: requestFields }),
72
73
  }
73
74
  this.processRuntimeFields(payload)
74
75
  return payload
@@ -134,8 +135,7 @@ export class ElasticsearchService {
134
135
  }
135
136
 
136
137
  getRelatedRecordPayload(
137
- title: string,
138
- uuid: string,
138
+ record: CatalogRecord,
139
139
  size = 6,
140
140
  _source = [...ES_SOURCE_SUMMARY, 'allKeywords', 'createDate']
141
141
  ): EsSearchParams {
@@ -148,9 +148,23 @@ export class ElasticsearchService {
148
148
  fields: [
149
149
  'resourceTitleObject.default',
150
150
  'resourceAbstractObject.default',
151
- 'tag.raw',
151
+ 'allKeywords',
152
+ ],
153
+ like: [
154
+ {
155
+ doc: {
156
+ resourceTitleObject: {
157
+ default: record.title,
158
+ },
159
+ resourceAbstractObject: {
160
+ default: record.abstract,
161
+ },
162
+ allKeywords: record.keywords.map(
163
+ (keyword) => keyword.label
164
+ ),
165
+ },
166
+ },
152
167
  ],
153
- like: title,
154
168
  min_term_freq: 1,
155
169
  max_query_terms: 12,
156
170
  },
@@ -166,7 +180,7 @@ export class ElasticsearchService {
166
180
  },
167
181
  },
168
182
  ],
169
- must_not: [{ wildcard: { uuid: uuid } }],
183
+ must_not: [{ wildcard: { uuid: record.uniqueIdentifier } }],
170
184
  },
171
185
  },
172
186
  size,
@@ -220,6 +234,7 @@ export class ElasticsearchService {
220
234
  private filtersToQuery(
221
235
  filters: FieldFilters | FiltersAggregationParams | string
222
236
  ): FilterQuery {
237
+ const addQuote = (key: string) => (/^\/.+\/$/.test(key) ? key : `"${key}"`)
223
238
  const makeQuery = (filter: FieldFilter): string => {
224
239
  if (typeof filter === 'string') {
225
240
  return filter
@@ -227,9 +242,9 @@ export class ElasticsearchService {
227
242
  return Object.keys(filter)
228
243
  .map((key) => {
229
244
  if (filter[key] === true) {
230
- return `"${key}"`
245
+ return addQuote(key)
231
246
  }
232
- return `-"${key}"`
247
+ return `-${addQuote(key)}`
233
248
  })
234
249
  .join(' OR ')
235
250
  }
@@ -282,6 +297,25 @@ export class ElasticsearchService {
282
297
  return queryParts.length > 0 ? (queryParts as FilterQuery) : undefined
283
298
  }
284
299
 
300
+ private mustNotFilters(): Record<string, unknown>[] {
301
+ return [
302
+ {
303
+ ...this.queryFilterOnValues('resourceType', [
304
+ 'service',
305
+ 'map',
306
+ 'map/static',
307
+ 'mapDigital',
308
+ ]),
309
+ },
310
+ {
311
+ query_string: {
312
+ query:
313
+ 'resourceType:featureCatalog AND !resourceType:dataset AND !cl_level.key:dataset',
314
+ },
315
+ },
316
+ ]
317
+ }
318
+
285
319
  private buildPayloadQuery(
286
320
  { any, ...fieldSearchFilters }: SearchFilters,
287
321
  configFilters: SearchFilters,
@@ -289,14 +323,7 @@ export class ElasticsearchService {
289
323
  geometry?: Geometry
290
324
  ) {
291
325
  const must = [] as Record<string, unknown>[]
292
- const must_not = {
293
- ...this.queryFilterOnValues('resourceType', [
294
- 'service',
295
- 'map',
296
- 'map/static',
297
- 'mapDigital',
298
- ]),
299
- }
326
+ const must_not = this.mustNotFilters()
300
327
  const should = [] as Record<string, unknown>[]
301
328
  const filter = [this.queryFilterOnValues('isTemplate', 'n')] as Record<
302
329
  string,
@@ -398,14 +425,8 @@ export class ElasticsearchService {
398
425
  },
399
426
  },
400
427
  ],
401
- must_not: {
402
- ...this.queryFilterOnValues('resourceType', [
403
- 'service',
404
- 'map',
405
- 'map/static',
406
- 'mapDigital',
407
- ]),
408
- },
428
+
429
+ must_not: this.mustNotFilters(),
409
430
  },
410
431
  },
411
432
  _source: ['resourceTitleObject', 'uuid'],
@@ -518,13 +539,15 @@ export class ElasticsearchService {
518
539
  switch (aggregation.type) {
519
540
  case 'filters':
520
541
  return {
521
- filters: Object.keys(aggregation.filters).reduce((prev, curr) => {
522
- const filter = aggregation.filters[curr]
523
- return {
524
- ...prev,
525
- [curr]: this.filtersToQuery(filter)[0],
526
- }
527
- }, {}),
542
+ filters: {
543
+ filters: Object.keys(aggregation.filters).reduce((prev, curr) => {
544
+ const filter = aggregation.filters[curr]
545
+ return {
546
+ ...prev,
547
+ [curr]: this.filtersToQuery(filter)[0],
548
+ }
549
+ }, {}),
550
+ },
528
551
  }
529
552
  case 'terms':
530
553
  return {
@@ -143,11 +143,7 @@ export class Gn4Repository implements RecordsRepositoryInterface {
143
143
  'bucket',
144
144
  null,
145
145
  JSON.stringify(
146
- this.gn4SearchHelper.getRelatedRecordPayload(
147
- similarTo.title,
148
- similarTo.uniqueIdentifier,
149
- 3
150
- )
146
+ this.gn4SearchHelper.getRelatedRecordPayload(similarTo, 3)
151
147
  )
152
148
  )
153
149
  .pipe(
@@ -1,11 +1,11 @@
1
1
  <div class="flex flex-row h-full overflow-auto">
2
- <gn-ui-table
2
+ <gn-ui-data-table
3
3
  #table
4
4
  class="w-1/2 overflow-auto"
5
- [data]="tableData"
5
+ [dataset]="dataset"
6
6
  [activeId]="selectionId"
7
7
  (selected)="onTableSelect($event)"
8
- ></gn-ui-table>
8
+ ></gn-ui-data-table>
9
9
  <gn-ui-map-container
10
10
  #mapContainer
11
11
  class="w-1/2 h-full"
@@ -8,7 +8,7 @@ import {
8
8
  ViewChild,
9
9
  } from '@angular/core'
10
10
  import {
11
- TableComponent,
11
+ DataTableComponent,
12
12
  TableItemId,
13
13
  TableItemModel,
14
14
  } from '../../../../../../libs/ui/dataviz/src'
@@ -19,18 +19,19 @@ import {
19
19
  FeatureDetailComponent,
20
20
  MapContainerComponent,
21
21
  } from '../../../../../../libs/ui/map/src'
22
+ import { BaseReader } from '../../../../../../libs/util/data-fetcher/src'
22
23
 
23
24
  @Component({
24
25
  selector: 'gn-ui-geo-table-view',
25
26
  templateUrl: './geo-table-view.component.html',
26
27
  styleUrls: ['./geo-table-view.component.css'],
27
28
  changeDetection: ChangeDetectionStrategy.OnPush,
28
- imports: [TableComponent, MapContainerComponent, FeatureDetailComponent],
29
+ imports: [MapContainerComponent, FeatureDetailComponent, DataTableComponent],
29
30
  standalone: true,
30
31
  })
31
32
  export class GeoTableViewComponent implements OnInit, OnDestroy {
32
- @Input() data: FeatureCollection = { type: 'FeatureCollection', features: [] }
33
- @ViewChild('table') uiTable: TableComponent
33
+ @Input() dataset: BaseReader
34
+ @ViewChild('table') uiTable: DataTableComponent
34
35
  @ViewChild('mapContainer') mapContainer: MapContainerComponent
35
36
 
36
37
  tableData: TableItemModel[]
@@ -39,21 +40,16 @@ export class GeoTableViewComponent implements OnInit, OnDestroy {
39
40
  selection: Feature
40
41
  private subscription = new Subscription()
41
42
 
42
- get features() {
43
- return this.data.features
44
- }
45
-
46
43
  constructor(private changeRef: ChangeDetectorRef) {}
47
44
 
48
- ngOnInit(): void {
49
- this.tableData = this.geojsonToTableData(this.data)
50
- this.mapContext = this.initMapContext()
45
+ async ngOnInit() {
46
+ this.mapContext = await this.initMapContext()
51
47
  }
52
48
 
53
49
  onTableSelect(tableEntry: TableItemModel) {
54
50
  const { id } = tableEntry
55
51
  this.selectionId = id
56
- this.selection = this.getFeatureFromId(id)
52
+ // this.selection = this.getFeatureFromId(id)
57
53
  if (this.selection) {
58
54
  this.animateToFeature(this.selection)
59
55
  }
@@ -77,7 +73,8 @@ export class GeoTableViewComponent implements OnInit, OnDestroy {
77
73
  }))
78
74
  }
79
75
 
80
- private initMapContext(): MapContext {
76
+ private async initMapContext(): Promise<MapContext> {
77
+ this.dataset.selectAll()
81
78
  return {
82
79
  layers: [
83
80
  {
@@ -86,7 +83,11 @@ export class GeoTableViewComponent implements OnInit, OnDestroy {
86
83
  },
87
84
  {
88
85
  type: 'geojson',
89
- data: this.data,
86
+ data: {
87
+ type: 'FeatureCollection',
88
+ // FIXME: we're not getting geojson here
89
+ features: await this.dataset.read(),
90
+ },
90
91
  },
91
92
  ],
92
93
  view: {
@@ -112,7 +113,8 @@ export class GeoTableViewComponent implements OnInit, OnDestroy {
112
113
  }
113
114
 
114
115
  private getFeatureFromId(id: TableItemId) {
115
- return this.features.find((feature) => feature.id === id)
116
+ // FIXME: restore this once we need it?
117
+ // return this.features.find((feature) => feature.id === id)
116
118
  }
117
119
 
118
120
  ngOnDestroy(): void {
@@ -164,17 +164,26 @@ export class DataService {
164
164
  wfsLink.url.toString(),
165
165
  wfsLink.name
166
166
  ).pipe(
167
- map((urls) => urls.all),
168
- map((urls) =>
169
- Object.keys(urls).map((format) => ({
170
- ...wfsLink,
171
- type: 'download',
172
- url: new URL(urls[format]),
173
- mimeType: getMimeTypeForFormat(
174
- getFileFormatFromServiceOutput(format)
175
- ),
176
- }))
177
- )
167
+ map((urls) => {
168
+ if (urls.geojson) {
169
+ urls.all['application/json'] = urls.geojson
170
+ }
171
+ return urls
172
+ }),
173
+ map((urls) => {
174
+ const resources: DatasetOnlineResource[] = Object.keys(urls.all).map(
175
+ (format) => ({
176
+ ...wfsLink,
177
+ name: wfsLink.name,
178
+ type: 'download' as const,
179
+ url: new URL(urls.all[format]),
180
+ mimeType: getMimeTypeForFormat(
181
+ getFileFormatFromServiceOutput(format)
182
+ ),
183
+ })
184
+ )
185
+ return resources
186
+ })
178
187
  )
179
188
  }
180
189
 
@@ -187,6 +196,7 @@ export class DataService {
187
196
  return Object.keys(collectionInfo.bulkDownloadLinks).map((downloadLink) => {
188
197
  return {
189
198
  ...ogcApiLink,
199
+ name: collectionInfo.id,
190
200
  type: 'download',
191
201
  url: new URL(collectionInfo.bulkDownloadLinks[downloadLink]),
192
202
  mimeType: getMimeTypeForFormat(
@@ -1,10 +1,11 @@
1
1
  <div class="w-full h-full flex flex-col">
2
2
  <div class="relative h-full">
3
- <gn-ui-table
3
+ <gn-ui-data-table
4
+ *ngIf="tableData$ | async as dataset"
4
5
  class="overflow-auto grow"
5
- [data]="tableData$ | async"
6
+ [dataset]="dataset"
6
7
  (selected)="onTableSelect($event)"
7
- ></gn-ui-table>
8
+ ></gn-ui-data-table>
8
9
  <gn-ui-loading-mask
9
10
  *ngIf="loading"
10
11
  class="absolute inset-0"
@@ -3,14 +3,13 @@ import { BehaviorSubject, Observable, of } from 'rxjs'
3
3
  import {
4
4
  catchError,
5
5
  finalize,
6
- map,
7
6
  shareReplay,
8
7
  startWith,
9
8
  switchMap,
10
9
  } from 'rxjs/operators'
11
- import { DataItem, FetchError } from '../../../../../../libs/util/data-fetcher/src'
10
+ import { BaseReader, FetchError } from '../../../../../../libs/util/data-fetcher/src'
12
11
  import { DataService } from '../service/data.service'
13
- import { TableComponent, TableItemModel } from '../../../../../../libs/ui/dataviz/src'
12
+ import { DataTableComponent } from '../../../../../../libs/ui/dataviz/src'
14
13
  import { DatasetOnlineResource } from '../../../../../../libs/common/domain/src/lib/model/record'
15
14
  import { TranslateModule, TranslateService } from '@ngx-translate/core'
16
15
  import {
@@ -26,7 +25,7 @@ import { CommonModule } from '@angular/common'
26
25
  changeDetection: ChangeDetectionStrategy.OnPush,
27
26
  imports: [
28
27
  CommonModule,
29
- TableComponent,
28
+ DataTableComponent,
30
29
  LoadingMaskComponent,
31
30
  PopupAlertComponent,
32
31
  TranslateModule,
@@ -45,25 +44,19 @@ export class TableViewComponent {
45
44
  tableData$ = this.currentLink$.pipe(
46
45
  switchMap((link) => {
47
46
  this.error = null
48
- if (!link) return of([] as TableItemModel[])
47
+ if (!link) return of(undefined)
49
48
  this.loading = true
50
- return this.fetchData(link).pipe(
51
- map((items) =>
52
- items.map((item) => ({
53
- id: item.id,
54
- ...item.properties,
55
- }))
56
- ),
49
+ return this.getDatasetReader(link).pipe(
57
50
  catchError((error) => {
58
51
  this.handleError(error)
59
- return of([] as TableItemModel[])
52
+ return of(undefined)
60
53
  }),
61
54
  finalize(() => {
62
55
  this.loading = false
63
56
  })
64
57
  )
65
58
  }),
66
- startWith([] as TableItemModel[]),
59
+ startWith(undefined),
67
60
  shareReplay(1)
68
61
  )
69
62
 
@@ -72,10 +65,8 @@ export class TableViewComponent {
72
65
  private translateService: TranslateService
73
66
  ) {}
74
67
 
75
- fetchData(link: DatasetOnlineResource): Observable<DataItem[]> {
76
- return this.dataService
77
- .getDataset(link)
78
- .pipe(switchMap((dataset) => dataset.read()))
68
+ getDatasetReader(link: DatasetOnlineResource): Observable<BaseReader> {
69
+ return this.dataService.getDataset(link)
79
70
  }
80
71
 
81
72
  onTableSelect(event) {
@@ -2,7 +2,7 @@
2
2
  <gn-ui-form-field-rich
3
3
  class="mt-[-8px]"
4
4
  [label]="label"
5
- [hint]="hint | translate"
5
+ [placeholder]="hint | translate"
6
6
  [value]="constraint_.text ?? ''"
7
7
  (valueChange)="handleConstraintTextChange($event)"
8
8
  ></gn-ui-form-field-rich>
@@ -79,6 +79,7 @@ export class FormFieldContactsForResourceComponent
79
79
  'owner',
80
80
  'point_of_contact',
81
81
  'author',
82
+ 'publisher',
82
83
  ]
83
84
 
84
85
  roleSectionsToDisplay: Role[] = []
@@ -28,7 +28,7 @@ import { FormFieldWrapperComponent } from '../../../../../../../../../libs/ui/la
28
28
  export class FormFieldRichComponent {
29
29
  @Input() label: string
30
30
  @Input() hint: string
31
- @Input() placeholder = 'Votre texte ici' //TODO: translate
31
+ @Input() placeholder = ''
32
32
  @Input() value: string
33
33
 
34
34
  @Output() valueChange: EventEmitter<string> = new EventEmitter()
@@ -1,6 +1,6 @@
1
1
  import { Component } from '@angular/core'
2
2
  import { WizardService } from '../../services/wizard.service'
3
- import { TranslateService } from '@ngx-translate/core'
3
+ import { DateService } from '../../../../../../../libs/util/shared/src'
4
4
 
5
5
  @Component({
6
6
  selector: 'gn-ui-wizard-summarize',
@@ -28,9 +28,8 @@ export class WizardSummarizeComponent {
28
28
 
29
29
  get createdDate() {
30
30
  const time = this.wizardService.getWizardFieldData('datepicker')
31
- const locale = this.translateService.currentLang
32
31
 
33
- return new Date(Number(time)).toLocaleDateString(locale, {
32
+ return this.dateService.formatDate(new Date(Number(time)), {
34
33
  year: 'numeric',
35
34
  month: 'long',
36
35
  day: 'numeric',
@@ -54,6 +53,6 @@ export class WizardSummarizeComponent {
54
53
 
55
54
  constructor(
56
55
  private wizardService: WizardService,
57
- private translateService: TranslateService
56
+ private dateService: DateService
58
57
  ) {}
59
58
  }
@@ -275,8 +275,8 @@ export const DEFAULT_CONFIGURATION: EditorConfig = {
275
275
  labelKey: marker('editor.record.form.page.description'),
276
276
  sections: [
277
277
  TITLE_SECTION,
278
- ABOUT_SECTION,
279
278
  CLASSIFICATION_SECTION,
279
+ ABOUT_SECTION,
280
280
  GEOGRAPHICAL_COVERAGE_SECTION,
281
281
  ],
282
282
  },
@@ -8,7 +8,7 @@
8
8
  [choices]="choices"
9
9
  (selectValue)="selectLink($event)"
10
10
  ></gn-ui-dropdown-selector>
11
- <div class="relative h-[420px]">
11
+ <div class="relative h-[460px]">
12
12
  <gn-ui-table-view
13
13
  *ngIf="mode === 'table'"
14
14
  [link]="selectedLink$ | async"
@@ -4,7 +4,10 @@ import { StoreModule } from '@ngrx/store'
4
4
  import { EffectsModule } from '@ngrx/effects'
5
5
  import { UiLayoutModule } from '../../../../../libs/ui/layout/src'
6
6
  import { FeatureMapModule } from '../../../../../libs/feature/map/src'
7
- import { UiInputsModule } from '../../../../../libs/ui/inputs/src'
7
+ import {
8
+ DropdownSelectorComponent,
9
+ UiInputsModule,
10
+ } from '../../../../../libs/ui/inputs/src'
8
11
  import { UiElementsModule } from '../../../../../libs/ui/elements/src'
9
12
  import { MdViewFacade } from './state'
10
13
  import { MdViewEffects } from './state/mdview.effects'
@@ -16,9 +19,8 @@ import { MatTabsModule } from '@angular/material/tabs'
16
19
  import { UiWidgetsModule } from '../../../../../libs/ui/widgets/src'
17
20
  import { TranslateModule } from '@ngx-translate/core'
18
21
  import { FeatureCatalogModule } from '../../../../../libs/feature/catalog/src'
19
- import { TableComponent } from '../../../../../libs/ui/dataviz/src'
22
+ import { DataTableComponent } from '../../../../../libs/ui/dataviz/src'
20
23
  import { NgIconsModule, provideNgIconsConfig } from '@ng-icons/core'
21
- import { DropdownSelectorComponent } from '../../../../../libs/ui/inputs/src'
22
24
 
23
25
  @NgModule({
24
26
  imports: [
@@ -33,7 +35,7 @@ import { DropdownSelectorComponent } from '../../../../../libs/ui/inputs/src'
33
35
  MatTabsModule,
34
36
  UiWidgetsModule,
35
37
  TranslateModule,
36
- TableComponent,
38
+ DataTableComponent,
37
39
  NgIconsModule,
38
40
  DropdownSelectorComponent,
39
41
  ],
@@ -1,6 +1,7 @@
1
1
  import { Injectable, Injector } from '@angular/core'
2
2
  import {
3
3
  AbstractSearchField,
4
+ AvailableServicesField,
4
5
  DateRangeSearchField,
5
6
  FieldValue,
6
7
  FullTextSearchField,
@@ -91,6 +92,7 @@ export class FieldsService {
91
92
  ),
92
93
  user: new UserSearchField(this.injector),
93
94
  changeDate: new DateRangeSearchField('changeDate', this.injector, 'desc'),
95
+ availableServices: new AvailableServicesField(this.injector),
94
96
  } as Record<string, AbstractSearchField>
95
97
 
96
98
  get supportedFields() {
@@ -9,6 +9,7 @@ import { PlatformServiceInterface } from '../../../../../../../libs/common/domai
9
9
  import {
10
10
  AggregationBuckets,
11
11
  AggregationsParams,
12
+ FieldFilter,
12
13
  FieldFilterByExpression,
13
14
  FieldFilters,
14
15
  TermBucket,
@@ -425,3 +426,57 @@ export class DateRangeSearchField extends SimpleSearchField {
425
426
  return 'dateRange'
426
427
  }
427
428
  }
429
+
430
+ marker('search.filters.availableServices.view')
431
+ marker('search.filters.availableServices.download')
432
+
433
+ export class AvailableServicesField extends SimpleSearchField {
434
+ private translateService = this.injector.get(TranslateService)
435
+
436
+ constructor(injector: Injector) {
437
+ super('availableServices', injector, 'asc')
438
+ }
439
+
440
+ linkProtocolViewFilter = '/OGC:WMT?S.*/'
441
+ linkProtocolDownloadFilter = '/OGC:WFS.*/'
442
+
443
+ protected async getBucketLabel(bucket: TermBucket) {
444
+ return firstValueFrom(
445
+ this.translateService.get(
446
+ `search.filters.availableServices.${bucket.term}`
447
+ )
448
+ )
449
+ }
450
+
451
+ protected getAggregations(): AggregationsParams {
452
+ return {
453
+ availableServices: {
454
+ type: 'filters',
455
+ filters: {
456
+ view: `+linkProtocol:${this.linkProtocolViewFilter}`,
457
+ download: `+linkProtocol:${this.linkProtocolDownloadFilter}`,
458
+ },
459
+ },
460
+ }
461
+ }
462
+
463
+ getFiltersForValues(values: FieldValue[]): Observable<FieldFilters> {
464
+ const filters: FieldFilter = {}
465
+ if (values.includes('view')) filters[this.linkProtocolViewFilter] = true
466
+ if (values.includes('download'))
467
+ filters[this.linkProtocolDownloadFilter] = true
468
+
469
+ return of({
470
+ linkProtocol: filters,
471
+ })
472
+ }
473
+
474
+ getValuesForFilter(filters: FieldFilters): Observable<FieldValue[]> {
475
+ const linkFilter = filters.linkProtocol
476
+ if (!linkFilter) return of([])
477
+ const values = []
478
+ if (linkFilter[this.linkProtocolViewFilter]) values.push('view')
479
+ if (linkFilter[this.linkProtocolDownloadFilter]) values.push('download')
480
+ return of(values)
481
+ }
482
+ }