geonetwork-ui 2.5.0-dev.e41adefdb → 2.5.0-dev.ed99f2ef4
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/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +11 -1
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
- package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +22 -2
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
- package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +7 -4
- package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +8 -8
- package/esm2022/libs/feature/dataviz/src/lib/table-view/table-view.component.mjs +7 -4
- package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +4 -3
- package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +3 -2
- package/esm2022/libs/feature/record/src/lib/state/mdview.actions.mjs +4 -1
- package/esm2022/libs/feature/record/src/lib/state/mdview.effects.mjs +7 -2
- package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +9 -1
- package/esm2022/libs/feature/record/src/lib/state/mdview.reducer.mjs +19 -1
- package/esm2022/libs/feature/record/src/lib/state/mdview.selectors.mjs +6 -1
- package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +1 -1
- package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +14 -4
- package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +10 -3
- package/esm2022/libs/util/data-fetcher/src/lib/data-fetcher.mjs +5 -4
- 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 +19 -11
- package/esm2022/libs/util/data-fetcher/src/lib/utils.mjs +9 -7
- package/esm2022/translations/de.json +1 -1
- package/esm2022/translations/en.json +2 -10
- package/esm2022/translations/es.json +1 -1
- package/esm2022/translations/fr.json +11 -11
- package/esm2022/translations/it.json +18 -17
- package/esm2022/translations/nl.json +1 -1
- package/esm2022/translations/pt.json +1 -1
- package/fesm2022/geonetwork-ui.mjs +264 -151
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +3 -0
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +2 -1
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +6 -0
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +2 -1
- package/libs/common/domain/src/lib/repository/records-repository.interface.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/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 +2 -1
- package/libs/feature/dataviz/src/lib/table-view/table-view.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/map-view/map-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.actions.d.ts +16 -1
- package/libs/feature/record/src/lib/state/mdview.actions.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.effects.d.ts +5 -0
- package/libs/feature/record/src/lib/state/mdview.effects.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts +2 -0
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.reducer.d.ts +4 -1
- package/libs/feature/record/src/lib/state/mdview.reducer.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.selectors.d.ts +2 -0
- package/libs/feature/record/src/lib/state/mdview.selectors.d.ts.map +1 -1
- package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts +4 -2
- package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts.map +1 -1
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +3 -1
- package/libs/ui/search/src/lib/results-table/results-table.component.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/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/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +25 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +4 -0
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +41 -2
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +3 -1
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +4 -1
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +75 -0
- package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +4 -1
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +22 -9
- package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.ts +2 -1
- package/src/libs/feature/record/src/lib/data-view/data-view.component.html +2 -0
- package/src/libs/feature/record/src/lib/data-view/data-view.component.ts +3 -0
- package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +2 -1
- package/src/libs/feature/record/src/lib/state/mdview.actions.ts +16 -0
- package/src/libs/feature/record/src/lib/state/mdview.effects.ts +21 -2
- package/src/libs/feature/record/src/lib/state/mdview.facade.ts +15 -0
- package/src/libs/feature/record/src/lib/state/mdview.reducer.ts +30 -1
- package/src/libs/feature/record/src/lib/state/mdview.selectors.ts +12 -0
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.html +37 -1
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.ts +8 -2
- package/src/libs/ui/search/src/lib/results-table/results-table.component.html +2 -0
- package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +6 -0
- package/src/libs/util/data-fetcher/src/lib/data-fetcher.ts +13 -4
- 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 +34 -11
- package/src/libs/util/data-fetcher/src/lib/utils.ts +36 -32
- package/translations/de.json +1 -1
- package/translations/en.json +2 -10
- package/translations/es.json +1 -1
- package/translations/fr.json +11 -11
- package/translations/it.json +18 -17
- package/translations/nl.json +1 -1
- package/translations/pt.json +1 -1
- package/translations/sk.json +1 -1
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
>
|
|
7
7
|
<ul class="flex flex-col gap-2 w-full">
|
|
8
8
|
<gn-ui-button
|
|
9
|
+
*ngIf="!isDraftPage"
|
|
9
10
|
type="light"
|
|
10
11
|
extraClass="flex flex-row items-center gap-2 w-full justify-start"
|
|
11
12
|
(buttonClick)="duplicate.emit()"
|
|
@@ -23,7 +24,10 @@
|
|
|
23
24
|
(buttonClick)="displayDeleteMenu()"
|
|
24
25
|
[disabled]="!canDelete"
|
|
25
26
|
data-test="record-menu-delete-button"
|
|
26
|
-
><span translate>record.action.delete</span
|
|
27
|
+
><span *ngIf="!isDraftPage" translate>record.action.delete</span>
|
|
28
|
+
<span *ngIf="isDraftPage" translate
|
|
29
|
+
>record.action.rollback</span
|
|
30
|
+
></gn-ui-button
|
|
27
31
|
>
|
|
28
32
|
</ul>
|
|
29
33
|
</div>
|
|
@@ -60,4 +64,36 @@
|
|
|
60
64
|
</div>
|
|
61
65
|
</div>
|
|
62
66
|
</ng-container>
|
|
67
|
+
<ng-container *ngSwitchCase="'rollbackMenu'">
|
|
68
|
+
<div
|
|
69
|
+
data-test="rollbackMenuSection"
|
|
70
|
+
class="w-80 p-6 flex flex-col gap-3 mt-2 border border-gray-100 bg-white shadow-2xl rounded-2xl"
|
|
71
|
+
>
|
|
72
|
+
<span class="text-lg font-bold text-center">{{
|
|
73
|
+
'editor.record.undo.confirmation.title' | translate
|
|
74
|
+
}}</span>
|
|
75
|
+
<span class="text-center">{{
|
|
76
|
+
'editor.record.undo.confirmation.message' | translate
|
|
77
|
+
}}</span>
|
|
78
|
+
<div class="flex flex-row gap-8 justify-center">
|
|
79
|
+
<gn-ui-button
|
|
80
|
+
(buttonClick)="rollback.emit()"
|
|
81
|
+
cdkFocusInitial
|
|
82
|
+
type="primary"
|
|
83
|
+
data-cy="confirm-button"
|
|
84
|
+
[style.--gn-ui-button-width]="'120px'"
|
|
85
|
+
>{{
|
|
86
|
+
'editor.record.undo.confirmation.confirmText' | translate
|
|
87
|
+
}}</gn-ui-button
|
|
88
|
+
>
|
|
89
|
+
<gn-ui-button
|
|
90
|
+
[style.--gn-ui-button-width]="'120px'"
|
|
91
|
+
(buttonClick)="closeActionMenu.emit()"
|
|
92
|
+
>{{
|
|
93
|
+
'editor.record.undo.confirmation.cancelText' | translate
|
|
94
|
+
}}</gn-ui-button
|
|
95
|
+
>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</ng-container>
|
|
63
99
|
</ng-container>
|
|
@@ -13,7 +13,7 @@ import { ConfirmationDialogComponent } from '../../../../../../../libs/ui/elemen
|
|
|
13
13
|
import { ButtonComponent } from '../../../../../../../libs/ui/inputs/src'
|
|
14
14
|
import { TranslateModule } from '@ngx-translate/core'
|
|
15
15
|
|
|
16
|
-
type ActionMenuPage = 'mainMenu' | 'deleteMenu'
|
|
16
|
+
type ActionMenuPage = 'mainMenu' | 'deleteMenu' | 'rollbackMenu'
|
|
17
17
|
|
|
18
18
|
@Component({
|
|
19
19
|
selector: 'gn-ui-action-menu',
|
|
@@ -32,9 +32,11 @@ type ActionMenuPage = 'mainMenu' | 'deleteMenu'
|
|
|
32
32
|
export class ActionMenuComponent {
|
|
33
33
|
@Input() canDuplicate: boolean
|
|
34
34
|
@Input() canDelete: boolean
|
|
35
|
+
@Input() isDraftPage: boolean
|
|
35
36
|
@Output() duplicate = new EventEmitter<void>()
|
|
36
37
|
@Output() delete = new EventEmitter<void>()
|
|
37
38
|
@Output() closeActionMenu = new EventEmitter<void>()
|
|
39
|
+
@Output() rollback = new EventEmitter<void>()
|
|
38
40
|
|
|
39
41
|
@ViewChild(MatMenuTrigger) trigger: MatMenuTrigger
|
|
40
42
|
|
|
@@ -55,7 +57,11 @@ export class ActionMenuComponent {
|
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
displayDeleteMenu() {
|
|
58
|
-
this.
|
|
60
|
+
if (this.isDraftPage) {
|
|
61
|
+
this.sectionDisplayed = 'rollbackMenu'
|
|
62
|
+
} else {
|
|
63
|
+
this.sectionDisplayed = 'deleteMenu'
|
|
64
|
+
}
|
|
59
65
|
this.cdr.markForCheck()
|
|
60
66
|
}
|
|
61
67
|
}
|
|
@@ -162,9 +162,11 @@
|
|
|
162
162
|
<gn-ui-action-menu
|
|
163
163
|
[canDuplicate]="canDuplicate(item) && !isDuplicating"
|
|
164
164
|
[canDelete]="canDelete(item)"
|
|
165
|
+
[isDraftPage]="isDraftPage"
|
|
165
166
|
(duplicate)="handleDuplicate(item)"
|
|
166
167
|
(delete)="handleDelete(item)"
|
|
167
168
|
(closeActionMenu)="closeActionMenu()"
|
|
169
|
+
(rollback)="handleRollback(item)"
|
|
168
170
|
>
|
|
169
171
|
</gn-ui-action-menu>
|
|
170
172
|
</ng-template>
|
|
@@ -74,6 +74,7 @@ export class ResultsTableComponent {
|
|
|
74
74
|
@Output() recordClick = new EventEmitter<CatalogRecord>()
|
|
75
75
|
@Output() duplicateRecord = new EventEmitter<CatalogRecord>()
|
|
76
76
|
@Output() deleteRecord = new EventEmitter<CatalogRecord>()
|
|
77
|
+
@Output() rollbackDraft = new EventEmitter<CatalogRecord>()
|
|
77
78
|
@Output() recordsSelectedChange = new EventEmitter<
|
|
78
79
|
[CatalogRecord[], boolean]
|
|
79
80
|
>()
|
|
@@ -186,6 +187,11 @@ export class ResultsTableComponent {
|
|
|
186
187
|
this.closeActionMenu()
|
|
187
188
|
}
|
|
188
189
|
|
|
190
|
+
handleRollback(item: unknown) {
|
|
191
|
+
this.rollbackDraft.emit(item as CatalogRecord)
|
|
192
|
+
this.closeActionMenu()
|
|
193
|
+
}
|
|
194
|
+
|
|
189
195
|
setSortBy(col: string, order: 'asc' | 'desc') {
|
|
190
196
|
this.sortByChange.emit([col, order])
|
|
191
197
|
}
|
|
@@ -17,10 +17,17 @@ export async function openDataset(
|
|
|
17
17
|
namespace?: string
|
|
18
18
|
wfsVersion?: WfsVersion
|
|
19
19
|
wfsFeatureType?: string
|
|
20
|
-
}
|
|
20
|
+
},
|
|
21
|
+
cacheActive?: boolean
|
|
21
22
|
): Promise<BaseReader> {
|
|
22
23
|
const fileType = await inferDatasetType(url, typeHint)
|
|
23
|
-
let reader:
|
|
24
|
+
let reader:
|
|
25
|
+
| CsvReader
|
|
26
|
+
| JsonReader
|
|
27
|
+
| GeojsonReader
|
|
28
|
+
| ExcelReader
|
|
29
|
+
| GmlReader
|
|
30
|
+
| WfsReader
|
|
24
31
|
try {
|
|
25
32
|
switch (fileType) {
|
|
26
33
|
case 'csv':
|
|
@@ -42,6 +49,7 @@ export async function openDataset(
|
|
|
42
49
|
reader = await WfsReader.createReader(url, options.wfsFeatureType)
|
|
43
50
|
break
|
|
44
51
|
}
|
|
52
|
+
reader.setCacheActive(cacheActive)
|
|
45
53
|
reader.load()
|
|
46
54
|
return reader
|
|
47
55
|
} catch (e: any) {
|
|
@@ -61,9 +69,10 @@ export async function openDataset(
|
|
|
61
69
|
export async function readDataset(
|
|
62
70
|
url: string,
|
|
63
71
|
typeHint?: SupportedType,
|
|
64
|
-
options?: any
|
|
72
|
+
options?: any,
|
|
73
|
+
cacheActive = true
|
|
65
74
|
): Promise<DataItem[]> {
|
|
66
|
-
const reader = await openDataset(url, typeHint, options)
|
|
75
|
+
const reader = await openDataset(url, typeHint, options, cacheActive)
|
|
67
76
|
try {
|
|
68
77
|
return await reader.read()
|
|
69
78
|
} catch (e: any) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseReader } from './base'
|
|
2
|
+
|
|
3
|
+
export abstract class BaseCacheReader extends BaseReader {
|
|
4
|
+
constructor(
|
|
5
|
+
protected url: string,
|
|
6
|
+
protected cacheActive = true
|
|
7
|
+
) {
|
|
8
|
+
super(url)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
setCacheActive(value: boolean) {
|
|
12
|
+
this.cacheActive = value
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -2,13 +2,14 @@ import { BaseReader } from './base'
|
|
|
2
2
|
import { DataItem, DatasetInfo, PropertyInfo } from '../model'
|
|
3
3
|
import { getJsonDataItemsProxy, jsonToGeojsonFeature } from '../utils'
|
|
4
4
|
import { generateSqlQuery } from '../sql-utils'
|
|
5
|
+
import { BaseCacheReader } from './base-cache'
|
|
5
6
|
|
|
6
7
|
type ParseResult = {
|
|
7
8
|
items: DataItem[]
|
|
8
9
|
properties: PropertyInfo[]
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
export class BaseFileReader extends
|
|
12
|
+
export class BaseFileReader extends BaseCacheReader {
|
|
12
13
|
private parseResult_: Promise<ParseResult>
|
|
13
14
|
|
|
14
15
|
protected getData(): Promise<ParseResult> {
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
|
|
12
12
|
export class BaseReader {
|
|
13
13
|
protected selected: FieldName[] = null
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
public groupedBy: FieldGroupBy[] = null
|
|
15
|
+
public aggregations: FieldAggregation[] = null
|
|
16
16
|
protected filter: FieldFilter = null
|
|
17
17
|
protected sort: FieldSort[] = null
|
|
18
18
|
protected startIndex: number = null
|
|
@@ -28,6 +28,6 @@ export function parseExcel(buffer: ArrayBuffer): Promise<{
|
|
|
28
28
|
|
|
29
29
|
export class ExcelReader extends BaseFileReader {
|
|
30
30
|
getData() {
|
|
31
|
-
return fetchDataAsArrayBuffer(this.url).then(parseExcel)
|
|
31
|
+
return fetchDataAsArrayBuffer(this.url, this.cacheActive).then(parseExcel)
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -37,17 +37,17 @@ export function parseGml(
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export class GmlReader extends BaseFileReader {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
constructor(
|
|
41
|
+
protected url: string,
|
|
42
|
+
protected namespace: string,
|
|
43
|
+
protected version: WfsVersion,
|
|
44
|
+
protected cacheActive = true
|
|
45
|
+
) {
|
|
44
46
|
super(url)
|
|
45
|
-
this.namespace = namespace
|
|
46
|
-
this.version = version
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
protected getData() {
|
|
50
|
-
return fetchDataAsText(this.url).then((text) =>
|
|
50
|
+
return fetchDataAsText(this.url, this.cacheActive).then((text) =>
|
|
51
51
|
parseGml(text, this.namespace, this.version)
|
|
52
52
|
)
|
|
53
53
|
}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { WfsEndpoint, WfsVersion } from '@camptocamp/ogc-client'
|
|
2
2
|
import { DataItem, DatasetInfo, PropertyInfo } from '../model'
|
|
3
3
|
import { fetchDataAsText } from '../utils'
|
|
4
|
-
import { BaseReader } from './base'
|
|
5
4
|
import { GmlReader, parseGml } from './gml'
|
|
6
5
|
import { GeojsonReader, parseGeojson } from './geojson'
|
|
7
|
-
import {
|
|
6
|
+
import { BaseCacheReader } from './base-cache'
|
|
7
|
+
import { getJsonDataItemsProxy, jsonToGeojsonFeature } from '../utils'
|
|
8
|
+
import { generateSqlQuery } from '../sql-utils'
|
|
8
9
|
|
|
9
|
-
export class WfsReader extends
|
|
10
|
+
export class WfsReader extends BaseCacheReader {
|
|
10
11
|
endpoint: WfsEndpoint
|
|
11
12
|
featureTypeName: string
|
|
12
13
|
version: WfsVersion
|
|
13
14
|
|
|
14
|
-
constructor(
|
|
15
|
-
|
|
15
|
+
constructor(
|
|
16
|
+
url: string,
|
|
17
|
+
wfsEndpoint: WfsEndpoint,
|
|
18
|
+
featureTypeName: string,
|
|
19
|
+
cacheActive?: boolean
|
|
20
|
+
) {
|
|
21
|
+
super(url, cacheActive)
|
|
16
22
|
this.endpoint = wfsEndpoint
|
|
17
23
|
this.featureTypeName = featureTypeName
|
|
18
24
|
this.version = this.endpoint.getVersion()
|
|
@@ -90,11 +96,10 @@ export class WfsReader extends BaseReader {
|
|
|
90
96
|
}
|
|
91
97
|
}
|
|
92
98
|
|
|
93
|
-
|
|
94
|
-
if (
|
|
95
|
-
|
|
99
|
+
public async getData(aggregation?, groupedBy?) {
|
|
100
|
+
if (aggregation || groupedBy) {
|
|
101
|
+
return { items: await this.getQueryData() }
|
|
96
102
|
}
|
|
97
|
-
|
|
98
103
|
const asJson = this.endpoint.supportsJson(this.featureTypeName)
|
|
99
104
|
const attributes = this.selected ?? undefined
|
|
100
105
|
let url = this.endpoint.getFeatureUrl(this.featureTypeName, {
|
|
@@ -117,18 +122,36 @@ export class WfsReader extends BaseReader {
|
|
|
117
122
|
url = `${url}${finalUrl.search ? '&' : ''}SORTBY=${sorts}`
|
|
118
123
|
}
|
|
119
124
|
|
|
120
|
-
return fetchDataAsText(url).then((text) =>
|
|
125
|
+
return fetchDataAsText(url, this.cacheActive).then((text) =>
|
|
121
126
|
asJson
|
|
122
127
|
? parseGeojson(text)
|
|
123
128
|
: parseGml(text, this.featureTypeName, this.version)
|
|
124
129
|
)
|
|
125
130
|
}
|
|
126
131
|
|
|
132
|
+
public async getQueryData() {
|
|
133
|
+
const items = (await this.getData()).items
|
|
134
|
+
const jsonItems = getJsonDataItemsProxy(items)
|
|
135
|
+
const query = generateSqlQuery(
|
|
136
|
+
this.selected,
|
|
137
|
+
this.filter,
|
|
138
|
+
this.sort,
|
|
139
|
+
this.startIndex,
|
|
140
|
+
this.count,
|
|
141
|
+
this.groupedBy,
|
|
142
|
+
this.aggregations
|
|
143
|
+
)
|
|
144
|
+
const result = await import('alasql').then((module) =>
|
|
145
|
+
module.default(query, [jsonItems])
|
|
146
|
+
)
|
|
147
|
+
return result.map(jsonToGeojsonFeature)
|
|
148
|
+
}
|
|
149
|
+
|
|
127
150
|
load() {
|
|
128
151
|
// Nothing to load for Wfs
|
|
129
152
|
}
|
|
130
153
|
|
|
131
154
|
async read(): Promise<DataItem[]> {
|
|
132
|
-
return (await this.getData()).items
|
|
155
|
+
return (await this.getData(this.aggregations, this.groupedBy)).items
|
|
133
156
|
}
|
|
134
157
|
}
|
|
@@ -51,39 +51,43 @@ export function fetchHeaders(url: string): Promise<DatasetHeaders> {
|
|
|
51
51
|
})
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export function fetchDataAsText(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
export function fetchDataAsText(
|
|
55
|
+
url: string,
|
|
56
|
+
cacheActive: boolean
|
|
57
|
+
): Promise<string> {
|
|
58
|
+
const fetchFactory = () =>
|
|
59
|
+
sharedFetch(url)
|
|
60
|
+
.catch((error) => {
|
|
61
|
+
throw FetchError.corsOrNetwork(error.message)
|
|
62
|
+
})
|
|
63
|
+
.then(async (response) => {
|
|
64
|
+
if (!response.ok) {
|
|
65
|
+
throw FetchError.http(response.status, await response.text())
|
|
66
|
+
}
|
|
67
|
+
return response.text()
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
return cacheActive ? useCache(fetchFactory, url, 'asText') : fetchFactory()
|
|
70
71
|
}
|
|
71
|
-
export function fetchDataAsArrayBuffer(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
72
|
+
export function fetchDataAsArrayBuffer(
|
|
73
|
+
url: string,
|
|
74
|
+
cacheActive: boolean
|
|
75
|
+
): Promise<ArrayBuffer> {
|
|
76
|
+
const fetchFactory = () =>
|
|
77
|
+
sharedFetch(url)
|
|
78
|
+
.catch((error) => {
|
|
79
|
+
throw FetchError.corsOrNetwork(error.message)
|
|
80
|
+
})
|
|
81
|
+
.then(async (response) => {
|
|
82
|
+
if (!response.ok) {
|
|
83
|
+
throw FetchError.http(response.status, await response.text())
|
|
84
|
+
}
|
|
85
|
+
// convert to a numeric array so that we can store the response in cache
|
|
86
|
+
return Array.from(new Uint8Array(await response.arrayBuffer()))
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
cacheActive ? useCache(fetchFactory, url, 'asArrayBuffer') : fetchFactory()
|
|
87
91
|
).then((array) => {
|
|
88
92
|
return new Uint8Array(array).buffer
|
|
89
93
|
})
|
package/translations/de.json
CHANGED
|
@@ -422,6 +422,7 @@
|
|
|
422
422
|
"record.action.download": "Herunterladen",
|
|
423
423
|
"record.action.duplicate": "",
|
|
424
424
|
"record.action.duplicating": "",
|
|
425
|
+
"record.action.rollback": "",
|
|
425
426
|
"record.action.view": "Anzeigen",
|
|
426
427
|
"record.externalViewer.open": "In externem Kartenviewer öffnen",
|
|
427
428
|
"record.feature.limit": "Die Ressource enthält mehr als {count} Features und kann hier nicht angezeigt werden.",
|
|
@@ -601,7 +602,6 @@
|
|
|
601
602
|
"tooltip.url.open": "URL öffnen",
|
|
602
603
|
"ui.readLess": "Weniger lesen",
|
|
603
604
|
"ui.readMore": "Weiterlesen",
|
|
604
|
-
"wfs.aggregations.notsupported": "",
|
|
605
605
|
"wfs.feature.limit": "Zu viele Features, um den WFS-Layer anzuzeigen!",
|
|
606
606
|
"wfs.featuretype.notfound": "Kein passender Feature-Typ wurde im Dienst gefunden",
|
|
607
607
|
"wfs.geojsongml.notsupported": "Dieser Dienst unterstützt das GeoJSON- oder GML-Format nicht",
|
package/translations/en.json
CHANGED
|
@@ -37,15 +37,7 @@
|
|
|
37
37
|
"dashboard.records.username": "Username",
|
|
38
38
|
"dashboard.records.users": "{count, plural, =1{user} other{users}}",
|
|
39
39
|
"datafeeder.analysisProgressBar.illustration.fileFormatDetection": "File format \n detection",
|
|
40
|
-
"datafeeder.
|
|
41
|
-
"datafeeder.analysisProgressBar.illustration.samplingData": "Sampling \n data",
|
|
42
|
-
"datafeeder.analysisProgressBar.subtitle": "The analysis may take several minutes, please wait.",
|
|
43
|
-
"datafeeder.analysisProgressBar.title": "Analysis in progress",
|
|
44
|
-
"datafeeder.datasetValidation.datasetInformation": "The provided dataset contains {number} entities",
|
|
45
|
-
"datafeeder.datasetValidation.submitButton": "OK, my data is correct",
|
|
46
|
-
"datafeeder.datasetValidation.title": "Make sure your data is correct",
|
|
47
|
-
"datafeeder.datasetValidation.unknown": " - ",
|
|
48
|
-
"datafeeder.datasetValidationCsv.explicitLineNumbers": "*The table must display the first 5 lines (excluding the header)<br>If this is not the case, check that the file is correctly formatted",
|
|
40
|
+
"datafeeder.anaeditor.record.saveStatus.recordNotPublishedasetValidationCsv.explicitLineNumbers": "*The table must display the first 5 lines (excluding the header)<br>If this is not the case, check that the file is correctly formatted",
|
|
49
41
|
"datafeeder.datasetValidationCsv.lineNumbers": "Sample of the first 5 lines* of the dataset:",
|
|
50
42
|
"datafeeder.form.abstract": "How would you describe your dataset?",
|
|
51
43
|
"datafeeder.form.datepicker": "Do you know when the dataset was created?",
|
|
@@ -422,6 +414,7 @@
|
|
|
422
414
|
"record.action.download": "Download",
|
|
423
415
|
"record.action.duplicate": "Duplicate",
|
|
424
416
|
"record.action.duplicating": "Duplicating...",
|
|
417
|
+
"record.action.rollback": "Rollback",
|
|
425
418
|
"record.action.view": "View",
|
|
426
419
|
"record.externalViewer.open": "Open in the external map viewer",
|
|
427
420
|
"record.feature.limit": "The resource contains more than {count} features and cannot be displayed here.",
|
|
@@ -601,7 +594,6 @@
|
|
|
601
594
|
"tooltip.url.open": "Open URL",
|
|
602
595
|
"ui.readLess": "Read less",
|
|
603
596
|
"ui.readMore": "Read more",
|
|
604
|
-
"wfs.aggregations.notsupported": "Aggregations are currently not supported for WFS services",
|
|
605
597
|
"wfs.feature.limit": "Too many features to display the WFS layer!",
|
|
606
598
|
"wfs.featuretype.notfound": "No matching feature type was found in the service",
|
|
607
599
|
"wfs.geojsongml.notsupported": "This service does not support the GeoJSON or GML format",
|
package/translations/es.json
CHANGED
|
@@ -422,6 +422,7 @@
|
|
|
422
422
|
"record.action.download": "",
|
|
423
423
|
"record.action.duplicate": "",
|
|
424
424
|
"record.action.duplicating": "",
|
|
425
|
+
"record.action.rollback": "",
|
|
425
426
|
"record.action.view": "",
|
|
426
427
|
"record.externalViewer.open": "",
|
|
427
428
|
"record.feature.limit": "",
|
|
@@ -601,7 +602,6 @@
|
|
|
601
602
|
"tooltip.url.open": "",
|
|
602
603
|
"ui.readLess": "",
|
|
603
604
|
"ui.readMore": "",
|
|
604
|
-
"wfs.aggregations.notsupported": "",
|
|
605
605
|
"wfs.feature.limit": "",
|
|
606
606
|
"wfs.featuretype.notfound": "",
|
|
607
607
|
"wfs.geojsongml.notsupported": "",
|
package/translations/fr.json
CHANGED
|
@@ -264,14 +264,14 @@
|
|
|
264
264
|
"editor.record.form.keywords.place.placeholder": "Rechercher une localisation par mot-clé",
|
|
265
265
|
"editor.record.form.keywords.place.withoutExtent": "Ce mot-clé n'a pas de localisation géographique associée",
|
|
266
266
|
"editor.record.form.keywords.placeholder": "Sélectionnez un mot-clé",
|
|
267
|
-
"editor.record.form.license.cc-by": "",
|
|
268
|
-
"editor.record.form.license.cc-by-sa": "",
|
|
269
|
-
"editor.record.form.license.cc-zero": "",
|
|
267
|
+
"editor.record.form.license.cc-by": "Creative Commons CC-BY",
|
|
268
|
+
"editor.record.form.license.cc-by-sa": "Creative Commons CC-BY-SA",
|
|
269
|
+
"editor.record.form.license.cc-zero": "Creative Commons CC-0",
|
|
270
270
|
"editor.record.form.license.etalab": "Licence Ouverte (Etalab)",
|
|
271
271
|
"editor.record.form.license.etalab-v2": "Licence Ouverte v2.0 (Etalab)",
|
|
272
|
-
"editor.record.form.license.odbl": "",
|
|
273
|
-
"editor.record.form.license.odc-by": "",
|
|
274
|
-
"editor.record.form.license.pddl": "",
|
|
272
|
+
"editor.record.form.license.odbl": "Open Data Commons ODbL",
|
|
273
|
+
"editor.record.form.license.odc-by": "Open Data Commons ODC-By",
|
|
274
|
+
"editor.record.form.license.pddl": "Open Data Commons PDDL",
|
|
275
275
|
"editor.record.form.license.unknown": "Inconnue ou absente",
|
|
276
276
|
"editor.record.form.page.accessAndContact": "Informations pour l'utilisation",
|
|
277
277
|
"editor.record.form.page.description": "Description du jeu de données",
|
|
@@ -324,7 +324,7 @@
|
|
|
324
324
|
"editor.record.resourceError.closeMessage": "Compris",
|
|
325
325
|
"editor.record.resourceError.title": "Erreur avec les pièces jointes",
|
|
326
326
|
"editor.record.saveStatus.draftWithChangesPending": "Sauvegardé - Modifications non publiées",
|
|
327
|
-
"editor.record.saveStatus.recordNotPublished": "",
|
|
327
|
+
"editor.record.saveStatus.recordNotPublished": "Sauvegardé - non publié",
|
|
328
328
|
"editor.record.saveStatus.recordUpToDate": "Sauvegardé - Jeu de données à jour",
|
|
329
329
|
"editor.record.undo.confirmation.cancelText": "Garder les modifications",
|
|
330
330
|
"editor.record.undo.confirmation.confirmText": "Retirer les modifications",
|
|
@@ -334,7 +334,7 @@
|
|
|
334
334
|
"editor.record.undo.tooltip.enabled": "Cliquer sur ce bouton pour annuler les modifications apportées à ce jeu de données",
|
|
335
335
|
"editor.record.upToDate": "Ce jeu de données est à jour",
|
|
336
336
|
"editor.sidebar.logout": "Se déconnecter",
|
|
337
|
-
"editor.sidebar.menu.editor": "",
|
|
337
|
+
"editor.sidebar.menu.editor": "Editeur",
|
|
338
338
|
"editor.temporary.disabled": "Pas encore implémenté",
|
|
339
339
|
"externalviewer.dataset.unnamed": "Couche du datahub",
|
|
340
340
|
"facets.block.title.OrgForResource": "Organisation",
|
|
@@ -382,7 +382,7 @@
|
|
|
382
382
|
"map.add.layer": "Ajouter une couche",
|
|
383
383
|
"map.add.layer.catalog": "Du catalogue",
|
|
384
384
|
"map.add.layer.file": "À partir d'un fichier",
|
|
385
|
-
"map.add.layer.ogc.api": "",
|
|
385
|
+
"map.add.layer.ogc.api": "Depuis un service OGC API",
|
|
386
386
|
"map.add.layer.wfs": "Depuis un service WFS",
|
|
387
387
|
"map.add.layer.wms": "Depuis un service WMS",
|
|
388
388
|
"map.addFromFile.placeholder": "Cliquez ou déposez un fichier ici",
|
|
@@ -395,7 +395,7 @@
|
|
|
395
395
|
"map.loading.data": "Chargement des données...",
|
|
396
396
|
"map.loading.service": "Chargement du service...",
|
|
397
397
|
"map.navigation.message": "Veuillez utiliser CTRL + souris (ou deux doigts sur mobile) pour naviguer sur la carte",
|
|
398
|
-
"map.ogc.urlInput.hint": "",
|
|
398
|
+
"map.ogc.urlInput.hint": "Entrez l'URL du service OGC API",
|
|
399
399
|
"map.select.layer": "Source de données",
|
|
400
400
|
"map.wfs.urlInput.hint": "Entrez l'URL du service WFS",
|
|
401
401
|
"map.wms.urlInput.hint": "Entrez l'URL du service WMS",
|
|
@@ -422,6 +422,7 @@
|
|
|
422
422
|
"record.action.download": "Télécharger",
|
|
423
423
|
"record.action.duplicate": "Dupliquer",
|
|
424
424
|
"record.action.duplicating": "Duplication...",
|
|
425
|
+
"record.action.rollback": "Restaurer",
|
|
425
426
|
"record.action.view": "Voir",
|
|
426
427
|
"record.externalViewer.open": "Ouvrir dans le visualiseur externe",
|
|
427
428
|
"record.feature.limit": "La ressource contient plus de {count} entités et ne peut pas être affichée ici.",
|
|
@@ -601,7 +602,6 @@
|
|
|
601
602
|
"tooltip.url.open": "Ouvrir l'URL",
|
|
602
603
|
"ui.readLess": "Réduire",
|
|
603
604
|
"ui.readMore": "Lire la suite",
|
|
604
|
-
"wfs.aggregations.notsupported": "Agrégations non supportées pour les services WFS",
|
|
605
605
|
"wfs.feature.limit": "Trop d'objets pour afficher la couche WFS !",
|
|
606
606
|
"wfs.featuretype.notfound": "La classe d'objets n'a pas été trouvée dans le service",
|
|
607
607
|
"wfs.geojsongml.notsupported": "Le service ne supporte pas le format GeoJSON ou GML",
|