geonetwork-ui 2.4.2-dev.ff0aab388 → 2.5.0-dev.77e75b46a

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 (127) hide show
  1. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +2 -3
  2. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +4 -1
  3. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
  4. package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +4 -14
  5. package/esm2022/libs/feature/editor/src/lib/components/contact-card/contact-card.component.mjs +3 -3
  6. package/esm2022/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.mjs +3 -3
  7. package/esm2022/libs/feature/editor/src/lib/components/import-record/import-record.component.mjs +3 -4
  8. package/esm2022/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.mjs +3 -3
  9. package/esm2022/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.mjs +31 -40
  10. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.mjs +3 -3
  11. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.mjs +3 -3
  12. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.mjs +3 -3
  13. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.mjs +8 -9
  14. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.mjs +5 -25
  15. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.mjs +5 -4
  16. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.mjs +3 -3
  17. package/esm2022/libs/feature/editor/src/lib/components/wizard-summarize/wizard-summarize.component.mjs +11 -11
  18. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +10 -2
  19. package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +6 -3
  20. package/esm2022/libs/feature/record/src/lib/data-view-share/data-view-share.component.mjs +3 -3
  21. package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +6 -3
  22. package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +18 -10
  23. package/esm2022/libs/ui/search/src/lib/record-preview-feed/record-preview-feed.component.mjs +3 -1
  24. package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +15 -13
  25. package/esm2022/libs/util/data-fetcher/src/lib/data-fetcher.mjs +5 -1
  26. package/esm2022/libs/util/data-fetcher/src/lib/headers.mjs +3 -2
  27. package/esm2022/libs/util/data-fetcher/src/lib/model.mjs +2 -1
  28. package/esm2022/libs/util/data-fetcher/src/lib/readers/wfs.mjs +79 -0
  29. package/esm2022/libs/util/shared/src/lib/services/date.service.mjs +41 -0
  30. package/esm2022/libs/util/shared/src/lib/services/index.mjs +2 -1
  31. package/esm2022/libs/util/shared/src/lib/utils/temporal-extent-union.mjs +4 -4
  32. package/esm2022/translations/de.json +13 -5
  33. package/esm2022/translations/en.json +22 -14
  34. package/esm2022/translations/es.json +13 -5
  35. package/esm2022/translations/fr.json +23 -15
  36. package/esm2022/translations/it.json +32 -26
  37. package/esm2022/translations/nl.json +13 -5
  38. package/esm2022/translations/pt.json +13 -5
  39. package/fesm2022/geonetwork-ui.mjs +597 -442
  40. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  41. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
  42. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
  43. package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
  44. package/libs/feature/editor/src/lib/components/import-record/import-record.component.d.ts +0 -1
  45. package/libs/feature/editor/src/lib/components/import-record/import-record.component.d.ts.map +1 -1
  46. package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts +7 -14
  47. package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts.map +1 -1
  48. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.d.ts +2 -2
  49. 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
  50. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.d.ts +1 -6
  51. 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
  52. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.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/editor/src/lib/fields.config.d.ts.map +1 -1
  56. package/libs/feature/record/src/lib/data-view/data-view.component.d.ts +2 -1
  57. package/libs/feature/record/src/lib/data-view/data-view.component.d.ts.map +1 -1
  58. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +2 -1
  59. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
  60. package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts +5 -0
  61. package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts.map +1 -1
  62. package/libs/ui/search/src/lib/record-preview-feed/record-preview-feed.component.d.ts.map +1 -1
  63. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +3 -2
  64. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
  65. package/libs/util/data-fetcher/src/lib/data-fetcher.d.ts +3 -2
  66. package/libs/util/data-fetcher/src/lib/data-fetcher.d.ts.map +1 -1
  67. package/libs/util/data-fetcher/src/lib/headers.d.ts.map +1 -1
  68. package/libs/util/data-fetcher/src/lib/model.d.ts +1 -1
  69. package/libs/util/data-fetcher/src/lib/model.d.ts.map +1 -1
  70. package/libs/util/data-fetcher/src/lib/readers/wfs.d.ts +21 -0
  71. package/libs/util/data-fetcher/src/lib/readers/wfs.d.ts.map +1 -0
  72. package/libs/util/shared/src/lib/services/date.service.d.ts +13 -0
  73. package/libs/util/shared/src/lib/services/date.service.d.ts.map +1 -0
  74. package/libs/util/shared/src/lib/services/index.d.ts +1 -0
  75. package/libs/util/shared/src/lib/services/index.d.ts.map +1 -1
  76. package/libs/util/shared/src/lib/utils/temporal-extent-union.d.ts +2 -1
  77. package/libs/util/shared/src/lib/utils/temporal-extent-union.d.ts.map +1 -1
  78. package/package.json +1 -1
  79. package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +1 -0
  80. package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +1 -2
  81. package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +3 -0
  82. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +1 -1
  83. package/src/libs/feature/dataviz/src/lib/service/data.service.ts +4 -14
  84. package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.html +1 -1
  85. package/src/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.html +1 -1
  86. package/src/libs/feature/editor/src/lib/components/import-record/import-record.component.html +4 -1
  87. package/src/libs/feature/editor/src/lib/components/import-record/import-record.component.ts +0 -4
  88. package/src/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.ts +2 -2
  89. package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.html +8 -8
  90. package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.ts +32 -45
  91. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.html +1 -1
  92. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.html +3 -1
  93. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.html +1 -1
  94. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.html +0 -1
  95. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.ts +6 -6
  96. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.html +24 -17
  97. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.ts +2 -27
  98. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.html +1 -1
  99. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.ts +2 -1
  100. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.html +1 -1
  101. package/src/libs/feature/editor/src/lib/components/wizard-summarize/wizard-summarize.component.ts +3 -4
  102. package/src/libs/feature/editor/src/lib/fields.config.ts +9 -1
  103. package/src/libs/feature/record/src/lib/data-view/data-view.component.html +1 -0
  104. package/src/libs/feature/record/src/lib/data-view/data-view.component.ts +1 -0
  105. package/src/libs/feature/record/src/lib/data-view-share/data-view-share.component.html +1 -1
  106. package/src/libs/feature/record/src/lib/map-view/map-view.component.html +1 -0
  107. package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +1 -0
  108. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +3 -3
  109. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +12 -2
  110. package/src/libs/ui/search/src/lib/record-preview-feed/record-preview-feed.component.ts +3 -0
  111. package/src/libs/ui/search/src/lib/results-table/results-table.component.html +1 -1
  112. package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +4 -2
  113. package/src/libs/util/data-fetcher/src/lib/data-fetcher.ts +9 -1
  114. package/src/libs/util/data-fetcher/src/lib/headers.ts +4 -3
  115. package/src/libs/util/data-fetcher/src/lib/model.ts +1 -0
  116. package/src/libs/util/data-fetcher/src/lib/readers/wfs.ts +112 -0
  117. package/src/libs/util/shared/src/lib/services/date.service.ts +45 -0
  118. package/src/libs/util/shared/src/lib/services/index.ts +1 -0
  119. package/src/libs/util/shared/src/lib/utils/temporal-extent-union.ts +6 -3
  120. package/translations/de.json +13 -5
  121. package/translations/en.json +22 -14
  122. package/translations/es.json +13 -5
  123. package/translations/fr.json +23 -15
  124. package/translations/it.json +32 -26
  125. package/translations/nl.json +13 -5
  126. package/translations/pt.json +13 -5
  127. package/translations/sk.json +14 -6
@@ -9,7 +9,7 @@ import {
9
9
  DatasetRecord,
10
10
  Keyword,
11
11
  } from '../../../../../../libs/common/domain/src/lib/model/record'
12
- import { getTemporalRangeUnion } from '../../../../../../libs/util/shared/src'
12
+ import { DateService, getTemporalRangeUnion } from '../../../../../../libs/util/shared/src'
13
13
  import { MarkdownParserComponent } from '../markdown-parser/markdown-parser.component'
14
14
  import {
15
15
  ExpandablePanelComponent,
@@ -60,6 +60,8 @@ export class MetadataInfoComponent {
60
60
  @Output() keyword = new EventEmitter<Keyword>()
61
61
  updatedTimes: number
62
62
 
63
+ constructor(private dateService: DateService) {}
64
+
63
65
  get hasUsage() {
64
66
  return (
65
67
  this.metadata.extras?.isOpenData === true ||
@@ -121,7 +123,7 @@ export class MetadataInfoComponent {
121
123
 
122
124
  get temporalExtent(): { start: string; end: string } {
123
125
  const temporalExtents = this.metadata.temporalExtents
124
- return getTemporalRangeUnion(temporalExtents)
126
+ return getTemporalRangeUnion(temporalExtents, this.dateService)
125
127
  }
126
128
 
127
129
  get shownOrganization() {
@@ -139,4 +141,12 @@ export class MetadataInfoComponent {
139
141
  onKeywordClick(keyword: Keyword) {
140
142
  this.keyword.emit(keyword)
141
143
  }
144
+
145
+ formatDate(date: Date): string {
146
+ return this.dateService.formatDate(date)
147
+ }
148
+
149
+ formatDateTime(date: Date): string {
150
+ return this.dateService.formatDateTime(date)
151
+ }
142
152
  }
@@ -2,6 +2,9 @@ import { ChangeDetectionStrategy, Component, ElementRef } from '@angular/core'
2
2
  import { RecordPreviewComponent } from '../record-preview/record-preview.component'
3
3
  import { TranslateService } from '@ngx-translate/core'
4
4
  import Duration from 'duration-relativetimeformat'
5
+ import { marker } from '@biesbjerg/ngx-translate-extract-marker'
6
+
7
+ marker('record.was.created.time')
5
8
 
6
9
  @Component({
7
10
  selector: 'gn-ui-record-preview-feed',
@@ -85,7 +85,7 @@
85
85
 
86
86
  <!-- OWNER COLUMN -->
87
87
  <gn-ui-interactive-table-column
88
- [width]="'9rem'"
88
+ [width]="'12rem'"
89
89
  [sortable]="true"
90
90
  [activeSort]="isSortedBy('recordOwner')"
91
91
  (sortChange)="setSortBy('recordOwner', $event)"
@@ -21,6 +21,7 @@ import {
21
21
  InteractiveTableComponent,
22
22
  } from '../../../../../../libs/ui/layout/src'
23
23
  import {
24
+ DateService,
24
25
  FileFormat,
25
26
  formatUserInfo,
26
27
  getBadgeColor,
@@ -86,7 +87,8 @@ export class ResultsTableComponent {
86
87
  constructor(
87
88
  private overlay: Overlay,
88
89
  private viewContainerRef: ViewContainerRef,
89
- private cdr: ChangeDetectorRef
90
+ private cdr: ChangeDetectorRef,
91
+ private dateService: DateService
90
92
  ) {}
91
93
 
92
94
  openActionMenu(item, template) {
@@ -139,7 +141,7 @@ export class ResultsTableComponent {
139
141
  }
140
142
 
141
143
  dateToString(date: Date): string {
142
- return date?.toLocaleDateString(undefined, {
144
+ return this.dateService.formatDate(date, {
143
145
  year: 'numeric',
144
146
  month: 'long',
145
147
  day: 'numeric',
@@ -8,11 +8,16 @@ import { inferDatasetType } from './utils'
8
8
  import { BaseReader } from './readers/base'
9
9
  import { GmlReader } from './readers/gml'
10
10
  import { WfsVersion } from '@camptocamp/ogc-client'
11
+ import { WfsReader } from './readers/wfs'
11
12
 
12
13
  export async function openDataset(
13
14
  url: string,
14
15
  typeHint?: SupportedType,
15
- options?: { namespace: string; wfsVersion: WfsVersion }
16
+ options?: {
17
+ namespace?: string
18
+ wfsVersion?: WfsVersion
19
+ wfsFeatureType?: string
20
+ }
16
21
  ): Promise<BaseReader> {
17
22
  const fileType = await inferDatasetType(url, typeHint)
18
23
  let reader: BaseReader
@@ -33,6 +38,9 @@ export async function openDataset(
33
38
  case 'gml':
34
39
  reader = new GmlReader(url, options.namespace, options.wfsVersion)
35
40
  break
41
+ case 'wfs':
42
+ reader = await WfsReader.createReader(url, options.wfsFeatureType)
43
+ break
36
44
  }
37
45
  reader.load()
38
46
  return reader
@@ -5,9 +5,10 @@ export function parseHeaders(httpHeaders: Headers): DatasetHeaders {
5
5
  if (httpHeaders.has('Content-Type')) {
6
6
  result.mimeType = httpHeaders.get('Content-Type').split(';')[0]
7
7
  const supported =
8
- SupportedTypes.filter(
9
- (type) => AllMimeTypes[type].indexOf(result.mimeType as never) > -1
10
- )[0] || null
8
+ SupportedTypes.filter((type) => type !== 'wfs') // Ignore wfs type as it is not a file type
9
+ .filter(
10
+ (type) => AllMimeTypes[type].indexOf(result.mimeType as never) > -1
11
+ )[0] || null
11
12
  if (supported !== null) result.supportedType = supported
12
13
  }
13
14
  if (httpHeaders.has('Content-Length')) {
@@ -60,6 +60,7 @@ export const SupportedTypes = [
60
60
  'geojson',
61
61
  'excel',
62
62
  'gml',
63
+ 'wfs',
63
64
  ] as const
64
65
  export type SupportedType = (typeof SupportedTypes)[number]
65
66
 
@@ -0,0 +1,112 @@
1
+ import { WfsEndpoint, WfsVersion } from '@camptocamp/ogc-client'
2
+ import { DataItem, DatasetInfo, PropertyInfo } from '../model'
3
+ import { fetchDataAsText } from '../utils'
4
+ import { BaseReader } from './base'
5
+ import { GmlReader, parseGml } from './gml'
6
+ import { GeojsonReader, parseGeojson } from './geojson'
7
+
8
+ export class WfsReader extends BaseReader {
9
+ endpoint: WfsEndpoint
10
+ featureTypeName: string
11
+ version: WfsVersion
12
+
13
+ constructor(url: string, wfsEndpoint: WfsEndpoint, featureTypeName: string) {
14
+ super(url)
15
+ this.endpoint = wfsEndpoint
16
+ this.featureTypeName = featureTypeName
17
+ this.version = this.endpoint.getVersion()
18
+ }
19
+
20
+ get properties(): Promise<PropertyInfo[]> {
21
+ return this.getData().then((result) => result.properties)
22
+ }
23
+
24
+ get info(): Promise<DatasetInfo> {
25
+ return this.endpoint.getFeatureTypeFull(this.featureTypeName).then(
26
+ (result) =>
27
+ ({
28
+ itemsCount: result.objectCount,
29
+ }) as DatasetInfo
30
+ )
31
+ }
32
+
33
+ static async createReader(wfsUrlEndpoint: string, featureTypeName?: string) {
34
+ const wfsEndpoint = await new WfsEndpoint(wfsUrlEndpoint).isReady()
35
+ const featureTypes = wfsEndpoint.getFeatureTypes()
36
+ const featureType = wfsEndpoint.getFeatureTypeSummary(
37
+ featureTypes.length === 1 && !featureTypeName
38
+ ? featureTypes[0].name
39
+ : featureTypeName
40
+ )
41
+ if (!featureType) {
42
+ throw new Error('wfs.featuretype.notfound')
43
+ }
44
+
45
+ if (wfsEndpoint.supportsStartIndex()) {
46
+ return new WfsReader(wfsUrlEndpoint, wfsEndpoint, featureType.name)
47
+ } else if (wfsEndpoint.supportsJson(featureType.name)) {
48
+ return new GeojsonReader(
49
+ wfsEndpoint.getFeatureUrl(featureType.name, {
50
+ asJson: true,
51
+ outputCrs: 'EPSG:4326',
52
+ })
53
+ )
54
+ } else {
55
+ if (
56
+ featureType.outputFormats.find((f) =>
57
+ f.toLowerCase().includes('gml')
58
+ ) &&
59
+ (featureType.defaultCrs === 'EPSG:4326' ||
60
+ featureType.otherCrs?.includes('EPSG:4326'))
61
+ ) {
62
+ return new GmlReader(
63
+ wfsEndpoint.getFeatureUrl(featureType.name, {
64
+ outputFormat: featureType.outputFormats.find((f) =>
65
+ f.toLowerCase().includes('gml')
66
+ ),
67
+ outputCrs: 'EPSG:4326',
68
+ }),
69
+ featureType.name,
70
+ wfsEndpoint.getVersion()
71
+ )
72
+ }
73
+ throw new Error('wfs.geojsongml.notsupported')
74
+ }
75
+ }
76
+
77
+ protected getData() {
78
+ const asJson = this.endpoint.supportsJson(this.featureTypeName)
79
+ let url = this.endpoint.getFeatureUrl(this.featureTypeName, {
80
+ ...(this.startIndex !== null && { startIndex: this.startIndex }),
81
+ ...(this.count !== null && { maxFeatures: this.count }),
82
+ asJson,
83
+ outputCrs: 'EPSG:4326',
84
+ // sortBy: this.sort // TODO: no sort in ogc-client?
85
+ })
86
+
87
+ if (Array.isArray(this.sort) && this.sort.length > 0) {
88
+ const finalUrl = new URL(url)
89
+ const sorts = this.sort
90
+ .map(
91
+ (fieldSort) => `${fieldSort[1]}+${fieldSort[0] === 'asc' ? 'A' : 'D'}`
92
+ )
93
+ .join(',')
94
+ // Direct update on string url to prevent encoding of +A and +D
95
+ url = `${url}${finalUrl.search ? '&' : ''}SORTBY=${sorts}`
96
+ }
97
+
98
+ return fetchDataAsText(url).then((text) =>
99
+ asJson
100
+ ? parseGeojson(text)
101
+ : parseGml(text, this.featureTypeName, this.version)
102
+ )
103
+ }
104
+
105
+ load() {
106
+ // Nothing to load for Wfs
107
+ }
108
+
109
+ async read(): Promise<DataItem[]> {
110
+ return (await this.getData()).items
111
+ }
112
+ }
@@ -0,0 +1,45 @@
1
+ import { Injectable } from '@angular/core'
2
+ import { TranslateService } from '@ngx-translate/core'
3
+
4
+ @Injectable({
5
+ providedIn: 'root',
6
+ })
7
+ export class DateService {
8
+ constructor(private translateService: TranslateService) {}
9
+
10
+ private getDateObject(date: Date | string): Date {
11
+ if (typeof date === 'string') {
12
+ const dateObj = new Date(date)
13
+ if (isNaN(dateObj.getTime())) {
14
+ throw new Error('Invalid date string')
15
+ }
16
+ return dateObj
17
+ }
18
+ return date
19
+ }
20
+
21
+ private getLocaleAndDate(date: Date | string): {
22
+ locale: string
23
+ dateObj: Date
24
+ } {
25
+ const locale = this.translateService.currentLang || 'en-US'
26
+ const dateObj = this.getDateObject(date)
27
+ return { locale, dateObj }
28
+ }
29
+
30
+ formatDate(
31
+ date: Date | string,
32
+ options?: Intl.DateTimeFormatOptions
33
+ ): string {
34
+ const { locale, dateObj } = this.getLocaleAndDate(date)
35
+ return dateObj.toLocaleDateString(locale, options)
36
+ }
37
+
38
+ formatDateTime(
39
+ date: Date | string,
40
+ options?: Intl.DateTimeFormatOptions
41
+ ): string {
42
+ const { locale, dateObj } = this.getLocaleAndDate(date)
43
+ return dateObj.toLocaleString(locale, options)
44
+ }
45
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './theme.service'
2
2
  export * from './log.service'
3
3
  export * from './proxy.service'
4
+ export * from './date.service'
@@ -1,8 +1,11 @@
1
+ import { DateService } from '../services'
2
+
1
3
  export function getTemporalRangeUnion(
2
4
  ranges: {
3
5
  start?: Date
4
6
  end?: Date
5
- }[]
7
+ }[],
8
+ dateService: DateService
6
9
  ) {
7
10
  let earliestStartDate = Infinity
8
11
  let latestEndDate = -Infinity
@@ -24,11 +27,11 @@ export function getTemporalRangeUnion(
24
27
  return {
25
28
  start:
26
29
  earliestStartDate !== -Infinity
27
- ? new Date(earliestStartDate).toLocaleDateString()
30
+ ? dateService.formatDate(new Date(earliestStartDate))
28
31
  : undefined,
29
32
  end:
30
33
  latestEndDate !== Infinity
31
- ? new Date(latestEndDate).toLocaleDateString()
34
+ ? dateService.formatDate(new Date(latestEndDate))
32
35
  : undefined,
33
36
  }
34
37
  } else {
@@ -25,7 +25,8 @@
25
25
  "dashboard.createRecord": "Neuer Eintrag",
26
26
  "dashboard.importRecord": "",
27
27
  "dashboard.importRecord.importExternal": "",
28
- "dashboard.importRecord.importExternalLabel": "",
28
+ "dashboard.importRecord.importExternal.subtitle": "",
29
+ "dashboard.importRecord.importExternal.title": "",
29
30
  "dashboard.labels.catalog": "Katalog",
30
31
  "dashboard.labels.mySpace": "Mein Bereich",
31
32
  "dashboard.records.all": "Metadatenkatalog",
@@ -194,8 +195,7 @@
194
195
  "downloads.format.unknown": "unbekannt",
195
196
  "downloads.wfs.featuretype.not.found": "Der Layer wurde nicht gefunden",
196
197
  "dropFile": "Datei ablegen",
197
- "editor.form.keywords.placeholder": "",
198
- "editor.form.placeKeywordWithoutExtent": "",
198
+ "editor.new.record.title": "",
199
199
  "editor.record.delete.confirmation.cancelText": "Stornieren",
200
200
  "editor.record.delete.confirmation.confirmText": "Löschen",
201
201
  "editor.record.delete.confirmation.message": "Sind Sie sicher, dass Sie diesen Datensatz löschen möchten?",
@@ -228,7 +228,9 @@
228
228
  "editor.record.form.field.abstract": "Kurzbeschreibung",
229
229
  "editor.record.form.field.constraintsShortcuts": "",
230
230
  "editor.record.form.field.contacts.noContact": "",
231
+ "editor.record.form.field.contacts.placeholder": "",
231
232
  "editor.record.form.field.contactsForResource.noContact": "",
233
+ "editor.record.form.field.contactsForResource.placeholder": "",
232
234
  "editor.record.form.field.keywords": "Schlagwörter",
233
235
  "editor.record.form.field.legalConstraints": "Rechtliche Einschränkung",
234
236
  "editor.record.form.field.license": "Lizenz",
@@ -237,12 +239,12 @@
237
239
  "editor.record.form.field.onlineResource.confirm": "",
238
240
  "editor.record.form.field.onlineResource.dialogTitle": "",
239
241
  "editor.record.form.field.onlineResource.edit.description": "",
240
- "editor.record.form.field.onlineResource.edit.protocol": "",
241
242
  "editor.record.form.field.onlineResource.edit.identifier.error": "Schichten konnten nicht vom Protokoll abgerufen werden",
242
243
  "editor.record.form.field.onlineResource.edit.identifier.placeholder": "Ebenenname",
243
244
  "editor.record.form.field.onlineResource.edit.identifier.placeholder.wps": "Prozessname",
244
245
  "editor.record.form.field.onlineResource.edit.identifier.select.label": "Wählen Sie eine Ebene",
245
246
  "editor.record.form.field.onlineResource.edit.identifier.submit": "Link zum Dienst",
247
+ "editor.record.form.field.onlineResource.edit.protocol": "",
246
248
  "editor.record.form.field.onlineResource.edit.title": "",
247
249
  "editor.record.form.field.onlineResource.fileSize": "",
248
250
  "editor.record.form.field.onlineResource.modify": "",
@@ -262,6 +264,9 @@
262
264
  "editor.record.form.field.title.placeholder": "Geben Sie einen Titel ein",
263
265
  "editor.record.form.field.uniqueIdentifier": "Eindeutige Kennung (ID)",
264
266
  "editor.record.form.field.updateFrequency": "Aktualisierungshäufigkeit",
267
+ "editor.record.form.keywords.place.placeholder": "",
268
+ "editor.record.form.keywords.place.withoutExtent": "",
269
+ "editor.record.form.keywords.placeholder": "",
265
270
  "editor.record.form.license.cc-by": "",
266
271
  "editor.record.form.license.cc-by-sa": "",
267
272
  "editor.record.form.license.cc-zero": "",
@@ -273,7 +278,7 @@
273
278
  "editor.record.form.license.unknown": "",
274
279
  "editor.record.form.page.accessAndContact": "",
275
280
  "editor.record.form.page.description": "",
276
- "editor.record.form.page.ressources": "",
281
+ "editor.record.form.page.resources": "",
277
282
  "editor.record.form.section.about.description": "",
278
283
  "editor.record.form.section.about.label": "",
279
284
  "editor.record.form.section.annexes.description": "",
@@ -450,6 +455,8 @@
450
455
  "record.metadata.api.form.productTooltip": "",
451
456
  "record.metadata.api.form.reset": "Zurücksetzen",
452
457
  "record.metadata.api.form.resetTooltip": "",
458
+ "record.metadata.api.form.title": "Benutzerdefinierte URL generieren",
459
+ "record.metadata.api.form.title.gpf": "",
453
460
  "record.metadata.api.form.type": "Ausgabeformat",
454
461
  "record.metadata.api.form.zoneTitle": "",
455
462
  "record.metadata.api.form.zoneTooltip": "",
@@ -518,6 +525,7 @@
518
525
  "record.tab.chart": "Diagramm",
519
526
  "record.tab.data": "Tabelle",
520
527
  "record.tab.map": "Karte",
528
+ "record.was.created.time": "erstellte diesen Datensatz {time}",
521
529
  "records": "Datensätze",
522
530
  "results.layout.selectOne": "Layout auswählen",
523
531
  "results.records.hits.displayedOn": "{displayed, plural, =0{Kein Datensatz.} one{1 Datensatz} other{{displayed} Datensätze }} {hits, plural, other{angezeigt von {hits} insgesamt.}}",
@@ -25,7 +25,8 @@
25
25
  "dashboard.createRecord": "New dataset",
26
26
  "dashboard.importRecord": "Import",
27
27
  "dashboard.importRecord.importExternal": "Import an external file",
28
- "dashboard.importRecord.importExternalLabel": "External file URL",
28
+ "dashboard.importRecord.importExternal.subtitle": "(link to an XML file)",
29
+ "dashboard.importRecord.importExternal.title": "External file URL",
29
30
  "dashboard.labels.catalog": "Catalog",
30
31
  "dashboard.labels.mySpace": "My space",
31
32
  "dashboard.records.all": "Datasets",
@@ -194,8 +195,7 @@
194
195
  "downloads.format.unknown": "Unknown",
195
196
  "downloads.wfs.featuretype.not.found": "The layer was not found",
196
197
  "dropFile": "Drop file",
197
- "editor.form.keywords.placeholder": "Select a keyword",
198
- "editor.form.placeKeywordWithoutExtent": "This keyword is not associated with any geographical extent",
198
+ "editor.new.record.title": "My dataset",
199
199
  "editor.record.delete.confirmation.cancelText": "Cancel",
200
200
  "editor.record.delete.confirmation.confirmText": "Delete",
201
201
  "editor.record.delete.confirmation.message": "Are you sure you want to delete this dataset?",
@@ -220,15 +220,17 @@
220
220
  "editor.record.form.constraint.header.securityConstraints": "Applicable security conditions",
221
221
  "editor.record.form.constraint.legalConstraints": "Legal constraints",
222
222
  "editor.record.form.constraint.markdown.placeholder": "Your text here",
223
- "editor.record.form.constraint.not.applicable": "No conditions apply.",
224
- "editor.record.form.constraint.not.known": "The conditions are unknown.",
223
+ "editor.record.form.constraint.not.applicable": "No conditions apply",
224
+ "editor.record.form.constraint.not.known": "The conditions are unknown",
225
225
  "editor.record.form.constraint.otherConstraints": "Other constraints",
226
226
  "editor.record.form.constraint.securityConstraints": "Security constraints",
227
227
  "editor.record.form.draft.updateAlert": "Since you created this draft, the dataset has been updated on { date } by { user }. Publishing your draft might erase their edits. To avoid this, you need to either cancel your changes or knowingly publish your own version.",
228
228
  "editor.record.form.field.abstract": "Abstract",
229
229
  "editor.record.form.field.constraintsShortcuts": "",
230
230
  "editor.record.form.field.contacts.noContact": "Please provide at least one point of contact.",
231
+ "editor.record.form.field.contacts.placeholder": "Choose a contact",
231
232
  "editor.record.form.field.contactsForResource.noContact": "Please provide at least one point of contact responsible for the data.",
233
+ "editor.record.form.field.contactsForResource.placeholder": "Choose a contact",
232
234
  "editor.record.form.field.keywords": "Keywords",
233
235
  "editor.record.form.field.legalConstraints": "Legal constraint",
234
236
  "editor.record.form.field.license": "License",
@@ -237,12 +239,12 @@
237
239
  "editor.record.form.field.onlineResource.confirm": "Confirm",
238
240
  "editor.record.form.field.onlineResource.dialogTitle": "Modify the dataset preview",
239
241
  "editor.record.form.field.onlineResource.edit.description": "Description",
240
- "editor.record.form.field.onlineResource.edit.protocol": "Protocol",
241
242
  "editor.record.form.field.onlineResource.edit.identifier.error": "Unable to retrieve layers from protocol",
242
243
  "editor.record.form.field.onlineResource.edit.identifier.placeholder": "Layer name",
243
244
  "editor.record.form.field.onlineResource.edit.identifier.placeholder.wps": "Process name",
244
245
  "editor.record.form.field.onlineResource.edit.identifier.select.label": "Select a layer",
245
246
  "editor.record.form.field.onlineResource.edit.identifier.submit": "Link to the service",
247
+ "editor.record.form.field.onlineResource.edit.protocol": "Protocol",
246
248
  "editor.record.form.field.onlineResource.edit.title": "Title",
247
249
  "editor.record.form.field.onlineResource.fileSize": "{sizeMB}MB",
248
250
  "editor.record.form.field.onlineResource.modify": "Modify",
@@ -250,7 +252,7 @@
250
252
  "editor.record.form.field.onlineResource.toggle.service": "Link to a service",
251
253
  "editor.record.form.field.onlineResources": "Distribution",
252
254
  "editor.record.form.field.otherConstraints": "Other constraint",
253
- "editor.record.form.field.overviews": "Overviews",
255
+ "editor.record.form.field.overviews": "Overview",
254
256
  "editor.record.form.field.recordUpdated": "Record updated",
255
257
  "editor.record.form.field.resourceCreated": "Dataset created",
256
258
  "editor.record.form.field.resourceIdentifier": "Identifier",
@@ -262,6 +264,9 @@
262
264
  "editor.record.form.field.title.placeholder": "Enter a title",
263
265
  "editor.record.form.field.uniqueIdentifier": "Unique identifier",
264
266
  "editor.record.form.field.updateFrequency": "Update frequency",
267
+ "editor.record.form.keywords.place.placeholder": "Search for place keywords",
268
+ "editor.record.form.keywords.place.withoutExtent": "This keyword is not associated with any geographical extent",
269
+ "editor.record.form.keywords.placeholder": "Select a keyword",
265
270
  "editor.record.form.license.cc-by": "Creative Commons CC-BY",
266
271
  "editor.record.form.license.cc-by-sa": "Creative Commons CC-BY-SA",
267
272
  "editor.record.form.license.cc-zero": "Creative Commons CC-0",
@@ -273,26 +278,26 @@
273
278
  "editor.record.form.license.unknown": "Unknown or absent",
274
279
  "editor.record.form.page.accessAndContact": "Information for use",
275
280
  "editor.record.form.page.description": "Dataset description",
276
- "editor.record.form.page.ressources": "Resources",
277
- "editor.record.form.section.about.description": "This section describes the dataset.",
281
+ "editor.record.form.page.resources": "Resources",
282
+ "editor.record.form.section.about.description": "This section describes the dataset",
278
283
  "editor.record.form.section.about.label": "About the dataset",
279
284
  "editor.record.form.section.annexes.description": "Annexes are optional resources. They are attached to the dataset, and help understand the data (manual, etc.).",
280
285
  "editor.record.form.section.annexes.label": "Annexes",
281
- "editor.record.form.section.associatedResources.description": "Point out where the data can be found.",
286
+ "editor.record.form.section.associatedResources.description": "Point out where the data can be found",
282
287
  "editor.record.form.section.associatedResources.label": "Associated resources",
283
- "editor.record.form.section.classification.description": "Appropriate keywords help users find the dataset.",
288
+ "editor.record.form.section.classification.description": "Appropriate keywords help users find the dataset",
284
289
  "editor.record.form.section.classification.label": "Keywords",
285
- "editor.record.form.section.dataManagers.description": "The data managers are responsible for the data.",
290
+ "editor.record.form.section.dataManagers.description": "The data managers are responsible for the data",
286
291
  "editor.record.form.section.dataManagers.label": "Data managers",
287
292
  "editor.record.form.section.geographicalCoverage.label": "Geographical coverage",
288
- "editor.record.form.section.metadataPointOfContact.description": "This information concerns the metadata.",
293
+ "editor.record.form.section.metadataPointOfContact.description": "This information concerns the metadata",
289
294
  "editor.record.form.section.metadataPointOfContact.label": "Metadata point of contact",
290
295
  "editor.record.form.section.useAndAccessConditions.label": "Use and access conditions",
291
296
  "editor.record.form.temporalExtents.addDate": "Time instant",
292
297
  "editor.record.form.temporalExtents.addRange": "Time period",
293
298
  "editor.record.form.temporalExtents.date": "Date",
294
299
  "editor.record.form.temporalExtents.range": "Date range",
295
- "editor.record.form.updateFrequency.planned": "This dataset is updated regularly.",
300
+ "editor.record.form.updateFrequency.planned": "This dataset is updated regularly",
296
301
  "editor.record.importFromExternalFile.failure.body": "Failure",
297
302
  "editor.record.importFromExternalFile.failure.title": "The dataset import failed: ",
298
303
  "editor.record.importFromExternalFile.success.body": "Import successful",
@@ -450,6 +455,8 @@
450
455
  "record.metadata.api.form.productTooltip": "",
451
456
  "record.metadata.api.form.reset": "Reset",
452
457
  "record.metadata.api.form.resetTooltip": "Reset all filters",
458
+ "record.metadata.api.form.title": "Generate a custom URL",
459
+ "record.metadata.api.form.title.gpf": "Download data",
453
460
  "record.metadata.api.form.type": "Output format",
454
461
  "record.metadata.api.form.zoneTitle": "Zone",
455
462
  "record.metadata.api.form.zoneTooltip": "Dropdown for selecting a geographic zone",
@@ -518,6 +525,7 @@
518
525
  "record.tab.chart": "Chart",
519
526
  "record.tab.data": "Table",
520
527
  "record.tab.map": "Map",
528
+ "record.was.created.time": "created this dataset {time}",
521
529
  "records": "datasets",
522
530
  "results.layout.selectOne": "Results layout",
523
531
  "results.records.hits.displayedOn": "{displayed, plural, =0{No dataset.} one{1 } other{{displayed} }} {hits, plural, other{displayed on {hits} total.}}",
@@ -25,7 +25,8 @@
25
25
  "dashboard.createRecord": "",
26
26
  "dashboard.importRecord": "",
27
27
  "dashboard.importRecord.importExternal": "",
28
- "dashboard.importRecord.importExternalLabel": "",
28
+ "dashboard.importRecord.importExternal.subtitle": "",
29
+ "dashboard.importRecord.importExternal.title": "",
29
30
  "dashboard.labels.catalog": "Catálogo",
30
31
  "dashboard.labels.mySpace": "Mi espacio",
31
32
  "dashboard.records.all": "Catálogo",
@@ -194,8 +195,7 @@
194
195
  "downloads.format.unknown": "",
195
196
  "downloads.wfs.featuretype.not.found": "",
196
197
  "dropFile": "",
197
- "editor.form.keywords.placeholder": "",
198
- "editor.form.placeKeywordWithoutExtent": "",
198
+ "editor.new.record.title": "",
199
199
  "editor.record.delete.confirmation.cancelText": "",
200
200
  "editor.record.delete.confirmation.confirmText": "",
201
201
  "editor.record.delete.confirmation.message": "",
@@ -228,7 +228,9 @@
228
228
  "editor.record.form.field.abstract": "",
229
229
  "editor.record.form.field.constraintsShortcuts": "",
230
230
  "editor.record.form.field.contacts.noContact": "",
231
+ "editor.record.form.field.contacts.placeholder": "",
231
232
  "editor.record.form.field.contactsForResource.noContact": "",
233
+ "editor.record.form.field.contactsForResource.placeholder": "",
232
234
  "editor.record.form.field.keywords": "",
233
235
  "editor.record.form.field.legalConstraints": "",
234
236
  "editor.record.form.field.license": "",
@@ -237,12 +239,12 @@
237
239
  "editor.record.form.field.onlineResource.confirm": "",
238
240
  "editor.record.form.field.onlineResource.dialogTitle": "",
239
241
  "editor.record.form.field.onlineResource.edit.description": "",
240
- "editor.record.form.field.onlineResource.edit.protocol": "",
241
242
  "editor.record.form.field.onlineResource.edit.identifier.error": "No se pueden recuperar las capas del protocolo",
242
243
  "editor.record.form.field.onlineResource.edit.identifier.placeholder": "Nombre de la capa",
243
244
  "editor.record.form.field.onlineResource.edit.identifier.placeholder.wps": "Nombre del proceso",
244
245
  "editor.record.form.field.onlineResource.edit.identifier.select.label": "Selecciona una capa",
245
246
  "editor.record.form.field.onlineResource.edit.identifier.submit": "Enlace al servicio",
247
+ "editor.record.form.field.onlineResource.edit.protocol": "",
246
248
  "editor.record.form.field.onlineResource.edit.title": "",
247
249
  "editor.record.form.field.onlineResource.fileSize": "",
248
250
  "editor.record.form.field.onlineResource.modify": "",
@@ -262,6 +264,9 @@
262
264
  "editor.record.form.field.title.placeholder": "Introduzca un título",
263
265
  "editor.record.form.field.uniqueIdentifier": "",
264
266
  "editor.record.form.field.updateFrequency": "",
267
+ "editor.record.form.keywords.place.placeholder": "",
268
+ "editor.record.form.keywords.place.withoutExtent": "",
269
+ "editor.record.form.keywords.placeholder": "",
265
270
  "editor.record.form.license.cc-by": "",
266
271
  "editor.record.form.license.cc-by-sa": "",
267
272
  "editor.record.form.license.cc-zero": "",
@@ -273,7 +278,7 @@
273
278
  "editor.record.form.license.unknown": "",
274
279
  "editor.record.form.page.accessAndContact": "",
275
280
  "editor.record.form.page.description": "",
276
- "editor.record.form.page.ressources": "",
281
+ "editor.record.form.page.resources": "",
277
282
  "editor.record.form.section.about.description": "",
278
283
  "editor.record.form.section.about.label": "",
279
284
  "editor.record.form.section.annexes.description": "",
@@ -450,6 +455,8 @@
450
455
  "record.metadata.api.form.productTooltip": "",
451
456
  "record.metadata.api.form.reset": "",
452
457
  "record.metadata.api.form.resetTooltip": "",
458
+ "record.metadata.api.form.title": "",
459
+ "record.metadata.api.form.title.gpf": "",
453
460
  "record.metadata.api.form.type": "",
454
461
  "record.metadata.api.form.zoneTitle": "",
455
462
  "record.metadata.api.form.zoneTooltip": "",
@@ -518,6 +525,7 @@
518
525
  "record.tab.chart": "",
519
526
  "record.tab.data": "",
520
527
  "record.tab.map": "",
528
+ "record.was.created.time": "",
521
529
  "records": "",
522
530
  "results.layout.selectOne": "",
523
531
  "results.records.hits.displayedOn": "",