geonetwork-ui 2.4.2 → 2.4.4-dev.9094d472a
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.
- package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.mjs +31 -16
- package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +2 -2
- package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +7 -4
- package/esm2022/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.mjs +18 -16
- package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +24 -14
- package/esm2022/libs/feature/dataviz/src/lib/table-view/table-view.component.mjs +16 -18
- package/esm2022/libs/feature/editor/src/lib/components/wizard-summarize/wizard-summarize.component.mjs +11 -11
- package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +4 -3
- package/esm2022/libs/feature/record/src/lib/feature-record.module.mjs +6 -7
- package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +3 -2
- package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +8 -1
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.mjs +46 -1
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +3 -2
- package/esm2022/libs/ui/dataviz/src/index.mjs +3 -3
- package/esm2022/libs/ui/dataviz/src/lib/data-table/custom.mat.paginator.intl.mjs +51 -0
- package/esm2022/libs/ui/dataviz/src/lib/data-table/data-table.component.mjs +133 -0
- package/esm2022/libs/ui/dataviz/src/lib/data-table/data-table.data.source.mjs +24 -0
- package/esm2022/libs/ui/dataviz/src/lib/data-table/data-table.fixtures.mjs +82 -0
- package/esm2022/libs/ui/elements/src/index.mjs +2 -1
- package/esm2022/libs/ui/elements/src/lib/application-banner/application-banner.component.mjs +78 -0
- package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +18 -10
- package/esm2022/libs/ui/elements/src/lib/record-api-form/record-api-form.component.mjs +2 -1
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +10 -4
- package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +7 -2
- package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +14 -12
- package/esm2022/libs/util/data-fetcher/src/index.mjs +3 -1
- package/esm2022/libs/util/data-fetcher/src/lib/data-fetcher.mjs +5 -4
- package/esm2022/libs/util/data-fetcher/src/lib/model.mjs +7 -3
- package/esm2022/libs/util/data-fetcher/src/lib/readers/base-cache.mjs +12 -0
- package/esm2022/libs/util/data-fetcher/src/lib/readers/base-file.mjs +3 -3
- package/esm2022/libs/util/data-fetcher/src/lib/readers/base.mjs +1 -1
- package/esm2022/libs/util/data-fetcher/src/lib/readers/csv.mjs +2 -2
- package/esm2022/libs/util/data-fetcher/src/lib/readers/excel.mjs +2 -2
- package/esm2022/libs/util/data-fetcher/src/lib/readers/geojson.mjs +2 -2
- package/esm2022/libs/util/data-fetcher/src/lib/readers/gml.mjs +5 -3
- package/esm2022/libs/util/data-fetcher/src/lib/readers/json.mjs +2 -2
- package/esm2022/libs/util/data-fetcher/src/lib/readers/wfs.mjs +35 -9
- package/esm2022/libs/util/data-fetcher/src/lib/utils.mjs +14 -10
- package/esm2022/libs/util/shared/src/lib/services/date.service.mjs +41 -0
- package/esm2022/libs/util/shared/src/lib/services/index.mjs +2 -1
- package/esm2022/libs/util/shared/src/lib/utils/temporal-extent-union.mjs +4 -4
- package/esm2022/translations/de.json +6 -0
- package/esm2022/translations/en.json +6 -0
- package/esm2022/translations/es.json +6 -0
- package/esm2022/translations/fr.json +6 -0
- package/esm2022/translations/it.json +7 -0
- package/esm2022/translations/nl.json +6 -0
- package/esm2022/translations/pt.json +6 -0
- package/fesm2022/geonetwork-ui.mjs +957 -485
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts +2 -1
- package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts +2 -1
- package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.d.ts +7 -9
- package/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts +2 -2
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts +5 -7
- package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/wizard-summarize/wizard-summarize.component.d.ts +3 -3
- package/libs/feature/editor/src/lib/components/wizard-summarize/wizard-summarize.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/data-view/data-view.component.d.ts +1 -0
- package/libs/feature/record/src/lib/data-view/data-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/feature-record.module.d.ts +2 -2
- package/libs/feature/record/src/lib/feature-record.module.d.ts.map +1 -1
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts +1 -0
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.d.ts +10 -0
- package/libs/feature/search/src/lib/utils/service/fields.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
- package/libs/ui/dataviz/src/index.d.ts +2 -2
- package/libs/ui/dataviz/src/index.d.ts.map +1 -1
- package/libs/ui/dataviz/src/lib/data-table/custom.mat.paginator.intl.d.ts +14 -0
- package/libs/ui/dataviz/src/lib/data-table/custom.mat.paginator.intl.d.ts.map +1 -0
- package/libs/ui/dataviz/src/lib/data-table/data-table.component.d.ts +45 -0
- package/libs/ui/dataviz/src/lib/data-table/data-table.component.d.ts.map +1 -0
- package/libs/ui/dataviz/src/lib/data-table/data-table.data.source.d.ts +12 -0
- package/libs/ui/dataviz/src/lib/data-table/data-table.data.source.d.ts.map +1 -0
- package/libs/ui/dataviz/src/lib/data-table/data-table.fixtures.d.ts +10 -0
- package/libs/ui/dataviz/src/lib/data-table/data-table.fixtures.d.ts.map +1 -0
- package/libs/ui/elements/src/index.d.ts +1 -0
- package/libs/ui/elements/src/index.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/application-banner/application-banner.component.d.ts +16 -0
- package/libs/ui/elements/src/lib/application-banner/application-banner.component.d.ts.map +1 -0
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts +5 -0
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +2 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts.map +1 -1
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +3 -2
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/index.d.ts +3 -1
- package/libs/util/data-fetcher/src/index.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/data-fetcher.d.ts +2 -2
- package/libs/util/data-fetcher/src/lib/data-fetcher.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/model.d.ts +1 -1
- package/libs/util/data-fetcher/src/lib/model.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/readers/base-cache.d.ts +8 -0
- package/libs/util/data-fetcher/src/lib/readers/base-cache.d.ts.map +1 -0
- package/libs/util/data-fetcher/src/lib/readers/base-file.d.ts +2 -2
- package/libs/util/data-fetcher/src/lib/readers/base-file.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/readers/base.d.ts +2 -2
- package/libs/util/data-fetcher/src/lib/readers/base.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/readers/gml.d.ts +5 -3
- package/libs/util/data-fetcher/src/lib/readers/gml.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/readers/wfs.d.ts +7 -4
- package/libs/util/data-fetcher/src/lib/readers/wfs.d.ts.map +1 -1
- package/libs/util/data-fetcher/src/lib/utils.d.ts +2 -2
- package/libs/util/data-fetcher/src/lib/utils.d.ts.map +1 -1
- package/libs/util/shared/src/lib/services/date.service.d.ts +13 -0
- package/libs/util/shared/src/lib/services/date.service.d.ts.map +1 -0
- package/libs/util/shared/src/lib/services/index.d.ts +1 -0
- package/libs/util/shared/src/lib/services/index.d.ts.map +1 -1
- package/libs/util/shared/src/lib/utils/temporal-extent-union.d.ts +2 -1
- package/libs/util/shared/src/lib/utils/temporal-extent-union.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +33 -16
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +1 -5
- package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +4 -1
- package/src/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.html +3 -3
- package/src/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.ts +17 -15
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +43 -20
- package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.html +4 -3
- package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.ts +10 -18
- package/src/libs/feature/editor/src/lib/components/wizard-summarize/wizard-summarize.component.ts +3 -4
- package/src/libs/feature/record/src/lib/data-view/data-view.component.html +3 -1
- package/src/libs/feature/record/src/lib/data-view/data-view.component.ts +3 -0
- package/src/libs/feature/record/src/lib/feature-record.module.ts +6 -4
- package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +2 -1
- package/src/libs/feature/record/src/lib/state/mdview.facade.ts +13 -0
- package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +2 -0
- package/src/libs/feature/search/src/lib/utils/service/fields.ts +55 -0
- package/src/libs/ui/dataviz/src/index.ts +2 -2
- package/src/libs/ui/dataviz/src/lib/data-table/custom.mat.paginator.intl.ts +52 -0
- package/src/libs/ui/dataviz/src/lib/{table/table.component.css → data-table/data-table.component.css} +4 -0
- package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.html +67 -0
- package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.ts +173 -0
- package/src/libs/ui/dataviz/src/lib/data-table/data-table.data.source.ts +33 -0
- package/src/libs/ui/dataviz/src/lib/data-table/data-table.fixtures.ts +84 -0
- package/src/libs/ui/elements/src/index.ts +1 -0
- package/src/libs/ui/elements/src/lib/application-banner/application-banner.component.css +0 -0
- package/src/libs/ui/elements/src/lib/application-banner/application-banner.component.html +25 -0
- package/src/libs/ui/elements/src/lib/application-banner/application-banner.component.ts +70 -0
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.ts +2 -2
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +3 -3
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +12 -2
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.ts +2 -0
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +3 -0
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +6 -0
- package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +4 -2
- package/src/libs/util/data-fetcher/src/index.ts +3 -0
- package/src/libs/util/data-fetcher/src/lib/data-fetcher.ts +13 -4
- package/src/libs/util/data-fetcher/src/lib/model.ts +6 -2
- package/src/libs/util/data-fetcher/src/lib/readers/base-cache.ts +14 -0
- package/src/libs/util/data-fetcher/src/lib/readers/base-file.ts +2 -1
- package/src/libs/util/data-fetcher/src/lib/readers/base.ts +2 -2
- package/src/libs/util/data-fetcher/src/lib/readers/csv.ts +1 -1
- package/src/libs/util/data-fetcher/src/lib/readers/excel.ts +1 -1
- package/src/libs/util/data-fetcher/src/lib/readers/geojson.ts +1 -1
- package/src/libs/util/data-fetcher/src/lib/readers/gml.ts +7 -7
- package/src/libs/util/data-fetcher/src/lib/readers/json.ts +1 -1
- package/src/libs/util/data-fetcher/src/lib/readers/wfs.ts +53 -8
- package/src/libs/util/data-fetcher/src/lib/utils.ts +38 -32
- package/src/libs/util/shared/src/lib/services/date.service.ts +45 -0
- package/src/libs/util/shared/src/lib/services/index.ts +1 -0
- package/src/libs/util/shared/src/lib/utils/temporal-extent-union.ts +6 -3
- package/translations/de.json +6 -0
- package/translations/en.json +6 -0
- package/translations/es.json +6 -0
- package/translations/fr.json +6 -0
- package/translations/it.json +7 -0
- package/translations/nl.json +6 -0
- package/translations/pt.json +6 -0
- package/translations/sk.json +6 -0
- package/esm2022/libs/ui/dataviz/src/lib/table/table.component.mjs +0 -61
- package/esm2022/libs/ui/dataviz/src/lib/table/table.fixtures.mjs +0 -40
- package/libs/ui/dataviz/src/lib/table/table.component.d.ts +0 -29
- package/libs/ui/dataviz/src/lib/table/table.component.d.ts.map +0 -1
- package/libs/ui/dataviz/src/lib/table/table.fixtures.d.ts +0 -11
- package/libs/ui/dataviz/src/lib/table/table.fixtures.d.ts.map +0 -1
- package/src/libs/ui/dataviz/src/lib/table/table.component.html +0 -40
- package/src/libs/ui/dataviz/src/lib/table/table.component.ts +0 -80
- package/src/libs/ui/dataviz/src/lib/table/table.fixtures.ts +0 -40
|
@@ -164,17 +164,26 @@ export class DataService {
|
|
|
164
164
|
wfsLink.url.toString(),
|
|
165
165
|
wfsLink.name
|
|
166
166
|
).pipe(
|
|
167
|
-
map((urls) =>
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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(
|
|
@@ -232,8 +242,11 @@ export class DataService {
|
|
|
232
242
|
}))
|
|
233
243
|
}
|
|
234
244
|
|
|
235
|
-
readAsGeoJson(
|
|
236
|
-
|
|
245
|
+
readAsGeoJson(
|
|
246
|
+
link: DatasetOnlineResource,
|
|
247
|
+
cacheActive: boolean
|
|
248
|
+
): Observable<FeatureCollection> {
|
|
249
|
+
return this.getDataset(link, cacheActive).pipe(
|
|
237
250
|
switchMap((dataset) => dataset.selectAll().read()),
|
|
238
251
|
map((features) => ({
|
|
239
252
|
type: 'FeatureCollection',
|
|
@@ -242,13 +255,21 @@ export class DataService {
|
|
|
242
255
|
)
|
|
243
256
|
}
|
|
244
257
|
|
|
245
|
-
getDataset(
|
|
258
|
+
getDataset(
|
|
259
|
+
link: DatasetOnlineResource,
|
|
260
|
+
cacheActive: boolean
|
|
261
|
+
): Observable<BaseReader> {
|
|
246
262
|
if (link.type === 'service' && link.accessServiceProtocol === 'wfs') {
|
|
247
263
|
const wfsUrlEndpoint = this.proxy.getProxiedUrl(link.url.toString())
|
|
248
264
|
return from(
|
|
249
|
-
openDataset(
|
|
250
|
-
|
|
251
|
-
|
|
265
|
+
openDataset(
|
|
266
|
+
wfsUrlEndpoint,
|
|
267
|
+
'wfs',
|
|
268
|
+
{
|
|
269
|
+
wfsFeatureType: link.name,
|
|
270
|
+
},
|
|
271
|
+
cacheActive
|
|
272
|
+
)
|
|
252
273
|
)
|
|
253
274
|
} else if (link.type === 'download') {
|
|
254
275
|
const linkProxifiedUrl = this.proxy.getProxiedUrl(link.url.toString())
|
|
@@ -257,7 +278,9 @@ export class DataService {
|
|
|
257
278
|
SupportedTypes.indexOf(format as any) > -1
|
|
258
279
|
? (format as SupportedType)
|
|
259
280
|
: undefined
|
|
260
|
-
return from(
|
|
281
|
+
return from(
|
|
282
|
+
openDataset(linkProxifiedUrl, supportedType, undefined, cacheActive)
|
|
283
|
+
).pipe()
|
|
261
284
|
} else if (
|
|
262
285
|
link.type === 'service' &&
|
|
263
286
|
link.accessServiceProtocol === 'esriRest'
|
|
@@ -266,7 +289,7 @@ export class DataService {
|
|
|
266
289
|
link.url.toString(),
|
|
267
290
|
'geojson'
|
|
268
291
|
)
|
|
269
|
-
return from(openDataset(url, 'geojson')).pipe()
|
|
292
|
+
return from(openDataset(url, 'geojson', undefined, cacheActive)).pipe()
|
|
270
293
|
} else if (
|
|
271
294
|
link.type === 'service' &&
|
|
272
295
|
link.accessServiceProtocol === 'ogcFeatures'
|
|
@@ -274,7 +297,7 @@ export class DataService {
|
|
|
274
297
|
return from(this.getDownloadUrlsFromOgcApi(link.url.href)).pipe(
|
|
275
298
|
switchMap((collectionInfo) => {
|
|
276
299
|
const geojsonUrl = collectionInfo.jsonDownloadLink
|
|
277
|
-
return openDataset(geojsonUrl, 'geojson')
|
|
300
|
+
return openDataset(geojsonUrl, 'geojson', undefined, cacheActive)
|
|
278
301
|
}),
|
|
279
302
|
tap((url) => {
|
|
280
303
|
if (url === null) {
|
|
@@ -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
|
-
[
|
|
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 {
|
|
10
|
+
import { BaseReader, FetchError } from '../../../../../../libs/util/data-fetcher/src'
|
|
12
11
|
import { DataService } from '../service/data.service'
|
|
13
|
-
import {
|
|
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
|
-
|
|
28
|
+
DataTableComponent,
|
|
30
29
|
LoadingMaskComponent,
|
|
31
30
|
PopupAlertComponent,
|
|
32
31
|
TranslateModule,
|
|
@@ -34,6 +33,7 @@ import { CommonModule } from '@angular/common'
|
|
|
34
33
|
standalone: true,
|
|
35
34
|
})
|
|
36
35
|
export class TableViewComponent {
|
|
36
|
+
@Input() cacheActive = true
|
|
37
37
|
@Input() set link(value: DatasetOnlineResource) {
|
|
38
38
|
this.currentLink$.next(value)
|
|
39
39
|
}
|
|
@@ -45,25 +45,19 @@ export class TableViewComponent {
|
|
|
45
45
|
tableData$ = this.currentLink$.pipe(
|
|
46
46
|
switchMap((link) => {
|
|
47
47
|
this.error = null
|
|
48
|
-
if (!link) return of(
|
|
48
|
+
if (!link) return of(undefined)
|
|
49
49
|
this.loading = true
|
|
50
|
-
return this.
|
|
51
|
-
map((items) =>
|
|
52
|
-
items.map((item) => ({
|
|
53
|
-
id: item.id,
|
|
54
|
-
...item.properties,
|
|
55
|
-
}))
|
|
56
|
-
),
|
|
50
|
+
return this.getDatasetReader(link).pipe(
|
|
57
51
|
catchError((error) => {
|
|
58
52
|
this.handleError(error)
|
|
59
|
-
return of(
|
|
53
|
+
return of(undefined)
|
|
60
54
|
}),
|
|
61
55
|
finalize(() => {
|
|
62
56
|
this.loading = false
|
|
63
57
|
})
|
|
64
58
|
)
|
|
65
59
|
}),
|
|
66
|
-
startWith(
|
|
60
|
+
startWith(undefined),
|
|
67
61
|
shareReplay(1)
|
|
68
62
|
)
|
|
69
63
|
|
|
@@ -72,10 +66,8 @@ export class TableViewComponent {
|
|
|
72
66
|
private translateService: TranslateService
|
|
73
67
|
) {}
|
|
74
68
|
|
|
75
|
-
|
|
76
|
-
return this.dataService
|
|
77
|
-
.getDataset(link)
|
|
78
|
-
.pipe(switchMap((dataset) => dataset.read()))
|
|
69
|
+
getDatasetReader(link: DatasetOnlineResource): Observable<BaseReader> {
|
|
70
|
+
return this.dataService.getDataset(link, this.cacheActive)
|
|
79
71
|
}
|
|
80
72
|
|
|
81
73
|
onTableSelect(event) {
|
package/src/libs/feature/editor/src/lib/components/wizard-summarize/wizard-summarize.component.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component } from '@angular/core'
|
|
2
2
|
import { WizardService } from '../../services/wizard.service'
|
|
3
|
-
import {
|
|
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))
|
|
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
|
|
56
|
+
private dateService: DateService
|
|
58
57
|
) {}
|
|
59
58
|
}
|
|
@@ -8,14 +8,16 @@
|
|
|
8
8
|
[choices]="choices"
|
|
9
9
|
(selectValue)="selectLink($event)"
|
|
10
10
|
></gn-ui-dropdown-selector>
|
|
11
|
-
<div class="relative h-[
|
|
11
|
+
<div class="relative h-[460px]">
|
|
12
12
|
<gn-ui-table-view
|
|
13
13
|
*ngIf="mode === 'table'"
|
|
14
|
+
[cacheActive]="cacheActive$ | async"
|
|
14
15
|
[link]="selectedLink$ | async"
|
|
15
16
|
></gn-ui-table-view>
|
|
16
17
|
<gn-ui-chart-view
|
|
17
18
|
*ngIf="mode === 'chart'"
|
|
18
19
|
(chartConfig$)="setChartConfig($event)"
|
|
20
|
+
[cacheActive]="cacheActive$ | async"
|
|
19
21
|
[link]="selectedLink$ | async"
|
|
20
22
|
></gn-ui-chart-view>
|
|
21
23
|
</div>
|
|
@@ -36,6 +36,9 @@ export class DataViewComponent {
|
|
|
36
36
|
@Input() mode: 'table' | 'chart'
|
|
37
37
|
@Input() displaySource = true
|
|
38
38
|
@Output() chartConfig$ = new BehaviorSubject<DatavizConfigurationModel>(null)
|
|
39
|
+
cacheActive$ = this.mdViewFacade.isHighUpdateFrequency$.pipe(
|
|
40
|
+
map((highF) => !highF)
|
|
41
|
+
)
|
|
39
42
|
compatibleDataLinks$ = combineLatest([
|
|
40
43
|
this.mdViewFacade.dataLinks$,
|
|
41
44
|
this.mdViewFacade.geoDataLinks$,
|
|
@@ -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 {
|
|
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 {
|
|
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
|
-
|
|
38
|
+
DataTableComponent,
|
|
37
39
|
NgIconsModule,
|
|
38
40
|
DropdownSelectorComponent,
|
|
39
41
|
],
|
|
@@ -239,7 +239,8 @@ export class MapViewComponent implements AfterViewInit {
|
|
|
239
239
|
link.accessServiceProtocol === 'ogcFeatures')) ||
|
|
240
240
|
link.type === 'download'
|
|
241
241
|
) {
|
|
242
|
-
|
|
242
|
+
const cacheActive = true // TODO implement whether should be true or false
|
|
243
|
+
return this.dataService.readAsGeoJson(link, cacheActive).pipe(
|
|
243
244
|
map((data) => ({
|
|
244
245
|
type: 'geojson',
|
|
245
246
|
data,
|
|
@@ -57,6 +57,19 @@ export class MdViewFacade {
|
|
|
57
57
|
filter((incomplete) => incomplete !== null)
|
|
58
58
|
)
|
|
59
59
|
|
|
60
|
+
isHighUpdateFrequency$ = this.metadata$.pipe(
|
|
61
|
+
map((record) => {
|
|
62
|
+
if (record.updateFrequency instanceof Object) {
|
|
63
|
+
return (
|
|
64
|
+
record.updateFrequency.per === 'day' &&
|
|
65
|
+
record.updateFrequency.updatedTimes > 1
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return record.updateFrequency === 'continual'
|
|
70
|
+
})
|
|
71
|
+
)
|
|
72
|
+
|
|
60
73
|
error$ = this.store.pipe(select(MdViewSelectors.getMetadataError))
|
|
61
74
|
|
|
62
75
|
related$ = this.store.pipe(select(MdViewSelectors.getRelated))
|
|
@@ -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
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './lib/ui-dataviz.module'
|
|
2
2
|
export * from './lib/chart/chart.component'
|
|
3
|
-
export * from './lib/table/table.component'
|
|
4
|
-
export * from './lib/table/table.fixtures'
|
|
3
|
+
export * from './lib/data-table/data-table.component'
|
|
4
|
+
export * from './lib/data-table/data-table.fixtures'
|
|
5
5
|
export * from './lib/figure/figure.component'
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core'
|
|
2
|
+
import { MatPaginatorIntl } from '@angular/material/paginator'
|
|
3
|
+
import { TranslateService } from '@ngx-translate/core'
|
|
4
|
+
import { Subject } from 'rxjs'
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class CustomMatPaginatorIntl extends MatPaginatorIntl {
|
|
8
|
+
override changes = new Subject<void>()
|
|
9
|
+
|
|
10
|
+
constructor(private translate: TranslateService) {
|
|
11
|
+
super()
|
|
12
|
+
this.setLabels()
|
|
13
|
+
this.translate.onLangChange.subscribe(() => {
|
|
14
|
+
this.setLabels()
|
|
15
|
+
this.changes.next()
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
setLabels() {
|
|
20
|
+
this.itemsPerPageLabel = this.translate.instant(
|
|
21
|
+
'table.paginator.itemsPerPage'
|
|
22
|
+
)
|
|
23
|
+
this.nextPageLabel = this.translate.instant('table.paginator.nextPage')
|
|
24
|
+
this.previousPageLabel = this.translate.instant(
|
|
25
|
+
'table.paginator.previousPage'
|
|
26
|
+
)
|
|
27
|
+
this.firstPageLabel = this.translate.instant('table.paginator.firstPage')
|
|
28
|
+
this.lastPageLabel = this.translate.instant('table.paginator.lastPage')
|
|
29
|
+
this.getRangeLabel = this.getRangeLabelIntl
|
|
30
|
+
this.changes.next()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
getRangeLabelIntl(page: number, pageSize: number, length: number): string {
|
|
34
|
+
if (length === 0 || pageSize === 0) {
|
|
35
|
+
return this.translate.instant('table.paginator.rangeLabel', {
|
|
36
|
+
startIndex: 0,
|
|
37
|
+
endIndex: 0,
|
|
38
|
+
length,
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
const startIndex = page * pageSize
|
|
42
|
+
const endIndex =
|
|
43
|
+
startIndex < length
|
|
44
|
+
? Math.min(startIndex + pageSize, length)
|
|
45
|
+
: startIndex + pageSize
|
|
46
|
+
return this.translate.instant('table.paginator.rangeLabel', {
|
|
47
|
+
startIndex: startIndex + 1,
|
|
48
|
+
endIndex,
|
|
49
|
+
length,
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<div class="flex flex-col border border-gray-300 rounded-lg bg-white h-full">
|
|
2
|
+
<div class="flex-1 overflow-y-hidden overflow-x-auto rounded-lg relative">
|
|
3
|
+
<table
|
|
4
|
+
mat-table
|
|
5
|
+
[dataSource]="dataSource"
|
|
6
|
+
matSort
|
|
7
|
+
(matSortChange)="setSort($event)"
|
|
8
|
+
[matSortDisableClear]="true"
|
|
9
|
+
*ngrxLet="properties$ as properties"
|
|
10
|
+
>
|
|
11
|
+
<ng-container *ngFor="let prop of properties" [matColumnDef]="prop">
|
|
12
|
+
<th
|
|
13
|
+
mat-header-cell
|
|
14
|
+
*matHeaderCellDef
|
|
15
|
+
mat-sort-header
|
|
16
|
+
class="text-sm text-black bg-white"
|
|
17
|
+
>
|
|
18
|
+
{{ prop }}
|
|
19
|
+
</th>
|
|
20
|
+
<td
|
|
21
|
+
mat-cell
|
|
22
|
+
*matCellDef="let element"
|
|
23
|
+
class="whitespace-nowrap pr-1 truncate"
|
|
24
|
+
>
|
|
25
|
+
{{ element[prop] }}
|
|
26
|
+
</td>
|
|
27
|
+
</ng-container>
|
|
28
|
+
|
|
29
|
+
<tr mat-header-row *matHeaderRowDef="properties; sticky: true"></tr>
|
|
30
|
+
<tr
|
|
31
|
+
[id]="getRowEltId(row.id)"
|
|
32
|
+
mat-row
|
|
33
|
+
*matRowDef="let row; columns: properties"
|
|
34
|
+
(click)="selected.emit(row)"
|
|
35
|
+
[class.active]="row.id === activeId"
|
|
36
|
+
></tr>
|
|
37
|
+
</table>
|
|
38
|
+
<gn-ui-loading-mask
|
|
39
|
+
*ngIf="loading$ | async"
|
|
40
|
+
class="sticky inset-0"
|
|
41
|
+
[message]="'table.loading.data' | translate"
|
|
42
|
+
></gn-ui-loading-mask>
|
|
43
|
+
<gn-ui-popup-alert
|
|
44
|
+
*ngIf="error"
|
|
45
|
+
type="warning"
|
|
46
|
+
icon="matErrorOutlineOutline"
|
|
47
|
+
class="absolute m-2 inset-0 z-[100]"
|
|
48
|
+
>
|
|
49
|
+
<span translate>{{ error }}</span>
|
|
50
|
+
</gn-ui-popup-alert>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="flex justify-between items-center overflow-hidden">
|
|
53
|
+
<div class="text-gray-900 px-4 py-2 text-sm">
|
|
54
|
+
<span class="count font-extrabold text-primary">{{ count }}</span
|
|
55
|
+
> <span translate>table.object.count</span>.
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<mat-paginator
|
|
59
|
+
class="my-[-16px]"
|
|
60
|
+
(page)="setPagination()"
|
|
61
|
+
[length]="count"
|
|
62
|
+
[pageSize]="10"
|
|
63
|
+
[showFirstLastButtons]="true"
|
|
64
|
+
[hidePageSize]="true"
|
|
65
|
+
></mat-paginator>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|