geonetwork-ui 2.3.0-dev.61774f7d → 2.3.0-dev.89188551
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/feature/dataviz/src/lib/service/data.service.mjs +35 -2
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.mjs +64 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.mjs +15 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +20 -6
- package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +16 -1
- 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 +1 -1
- package/esm2022/libs/ui/elements/src/lib/downloads-list/downloads-list.component.mjs +2 -2
- package/esm2022/libs/ui/elements/src/lib/link-card/link-card.component.mjs +16 -3
- package/esm2022/libs/ui/elements/src/lib/record-api-form/record-api-form.component.mjs +37 -8
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +1 -6
- package/esm2022/libs/ui/inputs/src/index.mjs +16 -15
- package/esm2022/libs/ui/inputs/src/lib/date-picker/date-picker.component.mjs +22 -0
- package/esm2022/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.mjs +7 -5
- package/esm2022/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.mjs +17 -8
- package/esm2022/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.mjs +29 -0
- package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +11 -9
- package/esm2022/libs/ui/layout/src/index.mjs +2 -1
- package/esm2022/libs/ui/layout/src/lib/block-list/block-list.component.mjs +76 -0
- package/esm2022/libs/ui/layout/src/lib/carousel/carousel.component.mjs +42 -18
- package/esm2022/libs/ui/layout/src/lib/ui-layout.module.mjs +3 -8
- package/esm2022/libs/util/shared/src/lib/links/link-classifier.service.mjs +2 -2
- package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +22 -1
- package/esm2022/translations/de.json +20 -14
- package/esm2022/translations/en.json +20 -14
- package/esm2022/translations/es.json +20 -14
- package/esm2022/translations/fr.json +20 -14
- package/esm2022/translations/it.json +20 -14
- package/esm2022/translations/nl.json +20 -14
- package/esm2022/translations/pt.json +20 -14
- package/fesm2022/geonetwork-ui.mjs +1198 -833
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts +3 -1
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.d.ts +39 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.d.ts +8 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +3 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/fields.config.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.map +1 -1
- package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +1 -1
- package/libs/ui/elements/src/lib/link-card/link-card.component.d.ts +3 -1
- package/libs/ui/elements/src/lib/link-card/link-card.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +4 -2
- 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 +29 -30
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
- package/libs/ui/inputs/src/index.d.ts +15 -14
- package/libs/ui/inputs/src/index.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/date-picker/date-picker.component.d.ts +9 -0
- package/libs/ui/inputs/src/lib/date-picker/date-picker.component.d.ts.map +1 -0
- package/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.d.ts +12 -0
- package/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.d.ts.map +1 -0
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +35 -35
- package/libs/ui/layout/src/index.d.ts +1 -0
- package/libs/ui/layout/src/index.d.ts.map +1 -1
- package/libs/ui/layout/src/lib/block-list/block-list.component.d.ts +25 -0
- package/libs/ui/layout/src/lib/block-list/block-list.component.d.ts.map +1 -0
- package/libs/ui/layout/src/lib/carousel/carousel.component.d.ts +13 -6
- package/libs/ui/layout/src/lib/carousel/carousel.component.d.ts.map +1 -1
- package/libs/ui/layout/src/lib/ui-layout.module.d.ts +4 -5
- package/libs/ui/layout/src/lib/ui-layout.module.d.ts.map +1 -1
- package/libs/util/shared/src/lib/links/link-utils.d.ts +18 -0
- package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/common/fixtures/src/lib/link.fixtures.ts +8 -0
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +2 -2
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +51 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.html +8 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.ts +64 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.html +4 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.ts +15 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +33 -33
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +16 -0
- package/src/libs/feature/editor/src/lib/fields.config.ts +15 -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.facade.ts +0 -1
- package/src/libs/ui/elements/src/lib/downloads-list/downloads-list.component.ts +1 -1
- package/src/libs/ui/elements/src/lib/link-card/link-card.component.html +38 -20
- package/src/libs/ui/elements/src/lib/link-card/link-card.component.ts +12 -0
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.html +1 -1
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.ts +43 -5
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +0 -2
- package/src/libs/ui/inputs/src/index.ts +15 -14
- package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.css +3 -0
- package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.html +11 -0
- package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.ts +16 -0
- package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.ts +8 -1
- package/src/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.ts +13 -0
- package/src/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.css +6 -0
- package/src/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.html +26 -0
- package/src/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.ts +32 -0
- package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +2 -2
- package/src/libs/ui/layout/src/index.ts +1 -0
- package/src/libs/ui/layout/src/lib/block-list/block-list.component.css +23 -0
- package/src/libs/ui/layout/src/lib/block-list/block-list.component.html +20 -0
- package/src/libs/ui/layout/src/lib/block-list/block-list.component.ts +84 -0
- package/src/libs/ui/layout/src/lib/carousel/carousel.component.css +7 -4
- package/src/libs/ui/layout/src/lib/carousel/carousel.component.html +4 -4
- package/src/libs/ui/layout/src/lib/carousel/carousel.component.ts +45 -15
- package/src/libs/ui/layout/src/lib/ui-layout.module.ts +0 -2
- package/src/libs/util/shared/src/lib/links/link-classifier.service.ts +1 -1
- package/src/libs/util/shared/src/lib/links/link-utils.ts +21 -0
- package/translations/de.json +20 -14
- package/translations/en.json +20 -14
- package/translations/es.json +20 -14
- package/translations/fr.json +20 -14
- package/translations/it.json +20 -14
- package/translations/nl.json +20 -14
- package/translations/pt.json +20 -14
- package/translations/sk.json +20 -14
|
@@ -3,13 +3,12 @@ import * as i1 from "./expandable-panel/expandable-panel.component";
|
|
|
3
3
|
import * as i2 from "./sticky-header/sticky-header.component";
|
|
4
4
|
import * as i3 from "./anchor-link/anchor-link.directive";
|
|
5
5
|
import * as i4 from "./expandable-panel-button/expandable-panel-button.component";
|
|
6
|
-
import * as i5 from "
|
|
7
|
-
import * as i6 from "@angular/
|
|
8
|
-
import * as i7 from "@
|
|
9
|
-
import * as i8 from "@ngx-translate/core";
|
|
6
|
+
import * as i5 from "@angular/common";
|
|
7
|
+
import * as i6 from "@angular/material/icon";
|
|
8
|
+
import * as i7 from "@ngx-translate/core";
|
|
10
9
|
export declare class UiLayoutModule {
|
|
11
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<UiLayoutModule, never>;
|
|
12
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<UiLayoutModule, [typeof i1.ExpandablePanelComponent, typeof i2.StickyHeaderComponent, typeof i3.AnchorLinkDirective, typeof i4.ExpandablePanelButtonComponent
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<UiLayoutModule, [typeof i1.ExpandablePanelComponent, typeof i2.StickyHeaderComponent, typeof i3.AnchorLinkDirective, typeof i4.ExpandablePanelButtonComponent], [typeof i5.CommonModule, typeof i6.MatIconModule, typeof i7.TranslateModule], [typeof i1.ExpandablePanelComponent, typeof i2.StickyHeaderComponent, typeof i3.AnchorLinkDirective, typeof i4.ExpandablePanelButtonComponent]>;
|
|
13
12
|
static ɵinj: i0.ɵɵInjectorDeclaration<UiLayoutModule>;
|
|
14
13
|
}
|
|
15
14
|
//# sourceMappingURL=ui-layout.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-layout.module.d.ts","sourceRoot":"","sources":["../../../../../src/libs/ui/layout/src/lib/ui-layout.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ui-layout.module.d.ts","sourceRoot":"","sources":["../../../../../src/libs/ui/layout/src/lib/ui-layout.module.ts"],"names":[],"mappings":";;;;;;;;AAUA,qBAea,cAAc;yCAAd,cAAc;0CAAd,cAAc;0CAAd,cAAc;CAAG"}
|
|
@@ -78,6 +78,24 @@ export declare const FORMATS: {
|
|
|
78
78
|
readonly color: "#de630b";
|
|
79
79
|
readonly mimeTypes: readonly ["application/x-dxf", "image/x-dxf"];
|
|
80
80
|
};
|
|
81
|
+
readonly html: {
|
|
82
|
+
readonly extensions: readonly ["html", "htm"];
|
|
83
|
+
readonly priority: 12;
|
|
84
|
+
readonly color: "#f2bb3a";
|
|
85
|
+
readonly mimeTypes: readonly ["text/html"];
|
|
86
|
+
};
|
|
87
|
+
readonly fgb: {
|
|
88
|
+
readonly extensions: readonly ["fgb", "flatgeobuf"];
|
|
89
|
+
readonly priority: 13;
|
|
90
|
+
readonly color: "#f2bb3a";
|
|
91
|
+
readonly mimeTypes: readonly ["application/flatgeobuf"];
|
|
92
|
+
};
|
|
93
|
+
readonly jsonfg: {
|
|
94
|
+
readonly extensions: readonly ["jsonfg", "jsonfgc"];
|
|
95
|
+
readonly priority: 14;
|
|
96
|
+
readonly color: "#f2bb3a";
|
|
97
|
+
readonly mimeTypes: readonly ["application/vnd.ogc.fg+json", "application/vnd.ogc.fg+json;compatibility=geojson"];
|
|
98
|
+
};
|
|
81
99
|
};
|
|
82
100
|
export type FileFormat = keyof typeof FORMATS;
|
|
83
101
|
export declare function getFormatPriority(linkFormat: FileFormat): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-utils.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/util/shared/src/lib/links/link-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2DAA2D,CAAA;AAI/F,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"link-utils.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/util/shared/src/lib/links/link-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2DAA2D,CAAA;AAI/F,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgHV,CAAA;AAEV,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,OAAO,CAAA;AAE7C,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAUhE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAEjE;AAED,wBAAgB,8BAA8B,CAC5C,aAAa,EAAE,MAAM,GACpB,UAAU,GAAG,IAAI,CAgBnB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,mBAAmB,GAAG,UAAU,CAcnE;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,mBAAmB,EACzB,KAAK,EAAE,MAAM,GACZ,OAAO,CAQT;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAO7D;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE,UAAU,GACjB,OAAO,CAMT;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAQ5D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CA0B9D;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAEtE"}
|
package/package.json
CHANGED
|
@@ -110,6 +110,14 @@ export const LINK_FIXTURES: Record<string, DatasetDistribution> = deepFreeze({
|
|
|
110
110
|
url: new URL('https://my.ogc.server/wfs'),
|
|
111
111
|
accessServiceProtocol: 'wfs',
|
|
112
112
|
},
|
|
113
|
+
geodataWfsDownload: {
|
|
114
|
+
name: 'mylayer',
|
|
115
|
+
type: 'download',
|
|
116
|
+
url: new URL(
|
|
117
|
+
'https://my.ogc.server/wfs?GetFeature&FeatureType=surval_parametre_ligne&format=csv'
|
|
118
|
+
),
|
|
119
|
+
accessServiceProtocol: 'wfs',
|
|
120
|
+
},
|
|
113
121
|
geodataWms2: {
|
|
114
122
|
name: 'myotherlayer',
|
|
115
123
|
type: 'service',
|
|
@@ -49,8 +49,8 @@ export const DATASET_RECORDS: DatasetRecord[] = deepFreeze([
|
|
|
49
49
|
status: 'ongoing',
|
|
50
50
|
recordCreated: new Date('2022-02-01T15:12:00'),
|
|
51
51
|
recordUpdated: new Date('2022-02-01T15:12:00'),
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
resourceCreated: new Date('2022-09-01T14:18:19'),
|
|
53
|
+
resourceUpdated: new Date('2022-12-04T15:12:00'),
|
|
54
54
|
title: 'A very interesting dataset (un jeu de données très intéressant)',
|
|
55
55
|
abstract: `# Introduction
|
|
56
56
|
This dataset has been established for testing purposes.
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core'
|
|
2
2
|
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
OgcApiCollectionInfo,
|
|
5
|
+
OgcApiEndpoint,
|
|
6
|
+
WfsEndpoint,
|
|
7
|
+
WfsVersion,
|
|
8
|
+
} from '@camptocamp/ogc-client'
|
|
4
9
|
import {
|
|
5
10
|
BaseReader,
|
|
6
11
|
FetchError,
|
|
@@ -27,6 +32,7 @@ marker('wfs.unreachable.http')
|
|
|
27
32
|
marker('wfs.unreachable.unknown')
|
|
28
33
|
marker('wfs.featuretype.notfound')
|
|
29
34
|
marker('wfs.geojsongml.notsupported')
|
|
35
|
+
marker('ogc.unreachable.unknown')
|
|
30
36
|
marker('dataset.error.network')
|
|
31
37
|
marker('dataset.error.http')
|
|
32
38
|
marker('dataset.error.parse')
|
|
@@ -148,6 +154,35 @@ export class DataService {
|
|
|
148
154
|
)
|
|
149
155
|
}
|
|
150
156
|
|
|
157
|
+
async getDownloadLinksFromOgcApiFeatures(
|
|
158
|
+
ogcApiLink: DatasetServiceDistribution
|
|
159
|
+
): Promise<DatasetDistribution[]> {
|
|
160
|
+
const collectionInfo = await this.getDownloadUrlsFromOgcApi(
|
|
161
|
+
ogcApiLink.url.href
|
|
162
|
+
)
|
|
163
|
+
return Object.keys(collectionInfo.bulkDownloadLinks).map((downloadLink) => {
|
|
164
|
+
return {
|
|
165
|
+
...ogcApiLink,
|
|
166
|
+
type: 'download',
|
|
167
|
+
url: new URL(collectionInfo.bulkDownloadLinks[downloadLink]),
|
|
168
|
+
mimeType: getMimeTypeForFormat(
|
|
169
|
+
getFileFormatFromServiceOutput(downloadLink)
|
|
170
|
+
),
|
|
171
|
+
}
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
async getDownloadUrlsFromOgcApi(url: string): Promise<OgcApiCollectionInfo> {
|
|
176
|
+
const endpoint = new OgcApiEndpoint(this.proxy.getProxiedUrl(url))
|
|
177
|
+
return await endpoint.featureCollections
|
|
178
|
+
.then((collections) => {
|
|
179
|
+
return endpoint.getCollectionInfo(collections[0])
|
|
180
|
+
})
|
|
181
|
+
.catch((error) => {
|
|
182
|
+
throw new Error(`ogc.unreachable.unknown`)
|
|
183
|
+
})
|
|
184
|
+
}
|
|
185
|
+
|
|
151
186
|
getDownloadLinksFromEsriRest(
|
|
152
187
|
esriRestLink: DatasetServiceDistribution
|
|
153
188
|
): DatasetDistribution[] {
|
|
@@ -205,6 +240,21 @@ export class DataService {
|
|
|
205
240
|
'geojson'
|
|
206
241
|
)
|
|
207
242
|
return from(openDataset(url, 'geojson')).pipe()
|
|
243
|
+
} else if (
|
|
244
|
+
link.type === 'service' &&
|
|
245
|
+
link.accessServiceProtocol === 'ogcFeatures'
|
|
246
|
+
) {
|
|
247
|
+
return from(this.getDownloadUrlsFromOgcApi(link.url.href)).pipe(
|
|
248
|
+
switchMap((collectionInfo) => {
|
|
249
|
+
const geojsonUrl = collectionInfo.jsonDownloadLink
|
|
250
|
+
return openDataset(geojsonUrl, 'geojson')
|
|
251
|
+
}),
|
|
252
|
+
tap((url) => {
|
|
253
|
+
if (url === null) {
|
|
254
|
+
throw new Error('wfs.geojsongml.notsupported')
|
|
255
|
+
}
|
|
256
|
+
})
|
|
257
|
+
)
|
|
208
258
|
}
|
|
209
259
|
return throwError(() => 'protocol not supported')
|
|
210
260
|
}
|
|
File without changes
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
|
2
|
+
import { FormControl } from '@angular/forms'
|
|
3
|
+
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
4
|
+
import { DropdownSelectorComponent } from '../../../../../../../../../libs/ui/inputs/src'
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'gn-ui-form-field-license',
|
|
8
|
+
templateUrl: './form-field-license.component.html',
|
|
9
|
+
styleUrls: ['./form-field-license.component.css'],
|
|
10
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [DropdownSelectorComponent],
|
|
13
|
+
})
|
|
14
|
+
export class FormFieldLicenseComponent {
|
|
15
|
+
@Input() control!: FormControl
|
|
16
|
+
@Input() label: string
|
|
17
|
+
|
|
18
|
+
get selected() {
|
|
19
|
+
return this.control.value[0]?.text
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
onSelectValue(value: unknown) {
|
|
23
|
+
this.control.setValue([{ text: value }])
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
choices = [
|
|
27
|
+
{
|
|
28
|
+
value: 'cc-by',
|
|
29
|
+
label: marker('editor.record.form.license.cc-by'),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: 'cc-by-sa',
|
|
33
|
+
label: marker('editor.record.form.license.cc-by-sa'),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
value: 'cc-zero',
|
|
37
|
+
label: marker('editor.record.form.license.cc-zero'),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: 'etalab',
|
|
41
|
+
label: marker('editor.record.form.license.etalab'),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
value: 'etalab-v2',
|
|
45
|
+
label: marker('editor.record.form.license.etalab-v2'),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
value: 'odbl',
|
|
49
|
+
label: marker('editor.record.form.license.odbl'),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
value: 'odc-by',
|
|
53
|
+
label: marker('editor.record.form.license.odc-by'),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
value: 'pddl',
|
|
57
|
+
label: marker('editor.record.form.license.pddl'),
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
value: 'unknown',
|
|
61
|
+
label: marker('editor.record.form.license.unknown'),
|
|
62
|
+
},
|
|
63
|
+
]
|
|
64
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
|
2
|
+
import { FormControl } from '@angular/forms'
|
|
3
|
+
import { DatePickerComponent } from '../../../../../../../../../libs/ui/inputs/src'
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'gn-ui-form-field-resource-updated',
|
|
7
|
+
templateUrl: './form-field-resource-updated.component.html',
|
|
8
|
+
styleUrls: ['./form-field-resource-updated.component.css'],
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [DatePickerComponent],
|
|
12
|
+
})
|
|
13
|
+
export class FormFieldResourceUpdatedComponent {
|
|
14
|
+
@Input() control!: FormControl
|
|
15
|
+
}
|
package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html
CHANGED
|
@@ -1,29 +1,18 @@
|
|
|
1
1
|
<div class="flex flex-col h-full">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
</span>
|
|
10
|
-
</label>
|
|
11
|
-
<mat-icon
|
|
12
|
-
*ngIf="isFieldOk"
|
|
13
|
-
class="material-symbols-outlined text-[#c6d950] icon-ok"
|
|
14
|
-
>check_circle</mat-icon
|
|
15
|
-
>
|
|
16
|
-
<mat-icon
|
|
17
|
-
*ngIf="isFieldLocked"
|
|
18
|
-
class="material-symbols-outlined text-blue-400 icon-locked"
|
|
19
|
-
>lock</mat-icon
|
|
20
|
-
>
|
|
21
|
-
<mat-icon
|
|
22
|
-
*ngIf="isFieldInvalid"
|
|
23
|
-
class="material-symbols-outlined text-pink-500 icon-invalid"
|
|
24
|
-
>cancel</mat-icon
|
|
2
|
+
<ng-container *ngIf="withoutWrapper; else withGenericWrapper">
|
|
3
|
+
<ng-container *ngTemplateOutlet="fieldContent"></ng-container>
|
|
4
|
+
</ng-container>
|
|
5
|
+
<ng-template #withGenericWrapper>
|
|
6
|
+
<gn-ui-form-field-wrapper
|
|
7
|
+
[label]="config.labelKey | translate"
|
|
8
|
+
[hint]="config.hintKey | translate"
|
|
25
9
|
>
|
|
26
|
-
|
|
10
|
+
<ng-container *ngTemplateOutlet="fieldContent"></ng-container>
|
|
11
|
+
</gn-ui-form-field-wrapper>
|
|
12
|
+
</ng-template>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<ng-template #fieldContent>
|
|
27
16
|
<ng-container *ngIf="isTitle">
|
|
28
17
|
<div class="flex justify-between items-center gap-3">
|
|
29
18
|
<h2
|
|
@@ -48,6 +37,25 @@
|
|
|
48
37
|
</span>
|
|
49
38
|
</div>
|
|
50
39
|
</ng-container>
|
|
40
|
+
<ng-container *ngIf="isAbstract">
|
|
41
|
+
<gn-ui-form-field-rich
|
|
42
|
+
class="h-[8rem]"
|
|
43
|
+
[control]="formControl"
|
|
44
|
+
[label]="config.labelKey | translate"
|
|
45
|
+
[hint]="config.hintKey | translate"
|
|
46
|
+
></gn-ui-form-field-rich>
|
|
47
|
+
</ng-container>
|
|
48
|
+
<ng-container *ngIf="isLicenses">
|
|
49
|
+
<gn-ui-form-field-license
|
|
50
|
+
[control]="formControl"
|
|
51
|
+
[label]="config.labelKey | translate"
|
|
52
|
+
></gn-ui-form-field-license>
|
|
53
|
+
</ng-container>
|
|
54
|
+
<ng-container *ngIf="isResourceUpdated">
|
|
55
|
+
<gn-ui-form-field-resource-updated
|
|
56
|
+
[control]="formControl"
|
|
57
|
+
></gn-ui-form-field-resource-updated>
|
|
58
|
+
</ng-container>
|
|
51
59
|
<ng-container *ngIf="isSimpleField">
|
|
52
60
|
<gn-ui-form-field-simple
|
|
53
61
|
[type]="simpleType"
|
|
@@ -63,14 +71,6 @@
|
|
|
63
71
|
[invalid]="isFieldInvalid"
|
|
64
72
|
></gn-ui-form-field-file>
|
|
65
73
|
</ng-container>
|
|
66
|
-
<ng-container *ngIf="isAbstract">
|
|
67
|
-
<gn-ui-form-field-rich
|
|
68
|
-
class="h-[8rem]"
|
|
69
|
-
[control]="formControl"
|
|
70
|
-
[label]="config.labelKey | translate"
|
|
71
|
-
[hint]="config.hintKey | translate"
|
|
72
|
-
></gn-ui-form-field-rich>
|
|
73
|
-
</ng-container>
|
|
74
74
|
<ng-container *ngIf="isArrayField">
|
|
75
75
|
<gn-ui-form-field-array></gn-ui-form-field-array>
|
|
76
76
|
</ng-container>
|
|
@@ -89,4 +89,4 @@
|
|
|
89
89
|
>
|
|
90
90
|
{{ config.invalidHintKey | translate }}
|
|
91
91
|
</div>
|
|
92
|
-
</
|
|
92
|
+
</ng-template>
|
package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts
CHANGED
|
@@ -11,11 +11,14 @@ import { FormControl, ReactiveFormsModule } from '@angular/forms'
|
|
|
11
11
|
import { MatIconModule } from '@angular/material/icon'
|
|
12
12
|
import { MatTooltipModule } from '@angular/material/tooltip'
|
|
13
13
|
import { EditableLabelDirective } from '../../../../../../../../libs/ui/inputs/src'
|
|
14
|
+
import { FormFieldWrapperComponent } from '../../../../../../../../libs/ui/layout/src'
|
|
14
15
|
import { TranslateModule } from '@ngx-translate/core'
|
|
15
16
|
import { Observable } from 'rxjs'
|
|
16
17
|
import { FormFieldArrayComponent } from './form-field-array/form-field-array.component'
|
|
17
18
|
import { FormFieldFileComponent } from './form-field-file/form-field-file.component'
|
|
19
|
+
import { FormFieldLicenseComponent } from './form-field-license/form-field-license.component'
|
|
18
20
|
import { FormFieldObjectComponent } from './form-field-object/form-field-object.component'
|
|
21
|
+
import { FormFieldResourceUpdatedComponent } from './form-field-resource-updated/form-field-resource-updated.component'
|
|
19
22
|
import { FormFieldRichComponent } from './form-field-rich/form-field-rich.component'
|
|
20
23
|
import { FormFieldSimpleComponent } from './form-field-simple/form-field-simple.component'
|
|
21
24
|
import { FormFieldSpatialExtentComponent } from './form-field-spatial-extent/form-field-spatial-extent.component'
|
|
@@ -34,6 +37,9 @@ import { FormFieldConfig } from './form-field.model'
|
|
|
34
37
|
EditableLabelDirective,
|
|
35
38
|
MatIconModule,
|
|
36
39
|
MatTooltipModule,
|
|
40
|
+
FormFieldWrapperComponent,
|
|
41
|
+
FormFieldLicenseComponent,
|
|
42
|
+
FormFieldResourceUpdatedComponent,
|
|
37
43
|
FormFieldSimpleComponent,
|
|
38
44
|
FormFieldRichComponent,
|
|
39
45
|
FormFieldObjectComponent,
|
|
@@ -118,4 +124,14 @@ export class FormFieldComponent {
|
|
|
118
124
|
get isAbstract() {
|
|
119
125
|
return this.model === 'abstract'
|
|
120
126
|
}
|
|
127
|
+
get isLicenses() {
|
|
128
|
+
return this.model === 'licenses'
|
|
129
|
+
}
|
|
130
|
+
get isResourceUpdated() {
|
|
131
|
+
return this.model === 'resourceUpdated'
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
get withoutWrapper() {
|
|
135
|
+
return this.model === 'title' || this.model === 'abstract'
|
|
136
|
+
}
|
|
121
137
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
1
2
|
import { EditorFieldsConfig } from './models/fields.model'
|
|
2
3
|
|
|
3
4
|
export const DEFAULT_FIELDS: EditorFieldsConfig = [
|
|
@@ -32,4 +33,18 @@ export const DEFAULT_FIELDS: EditorFieldsConfig = [
|
|
|
32
33
|
},
|
|
33
34
|
onSaveProcess: '${dateNow()}',
|
|
34
35
|
},
|
|
36
|
+
{
|
|
37
|
+
model: 'licenses',
|
|
38
|
+
formFieldConfig: {
|
|
39
|
+
labelKey: marker('editor.record.form.license'),
|
|
40
|
+
type: 'list',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
model: 'resourceUpdated',
|
|
45
|
+
formFieldConfig: {
|
|
46
|
+
labelKey: marker('editor.record.form.resourceUpdated'),
|
|
47
|
+
type: 'date',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
35
50
|
]
|
|
@@ -196,7 +196,8 @@ export class MapViewComponent implements OnInit, OnDestroy {
|
|
|
196
196
|
} else if (
|
|
197
197
|
(link.type === 'service' &&
|
|
198
198
|
(link.accessServiceProtocol === 'wfs' ||
|
|
199
|
-
link.accessServiceProtocol === 'esriRest'
|
|
199
|
+
link.accessServiceProtocol === 'esriRest' ||
|
|
200
|
+
link.accessServiceProtocol === 'ogcFeatures')) ||
|
|
200
201
|
link.type === 'download'
|
|
201
202
|
) {
|
|
202
203
|
return this.dataService.readAsGeoJson(link).pipe(
|
|
@@ -8,7 +8,6 @@ import { DatavizConfigurationModel } from '../../../../../../libs/common/domain/
|
|
|
8
8
|
import {
|
|
9
9
|
CatalogRecord,
|
|
10
10
|
UserFeedback,
|
|
11
|
-
UserFeedbackViewModel,
|
|
12
11
|
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
13
12
|
import { AvatarServiceInterface } from '../../../../../../libs/api/repository/src'
|
|
14
13
|
|
|
@@ -1,25 +1,43 @@
|
|
|
1
1
|
<a
|
|
2
2
|
[href]="link.url"
|
|
3
3
|
target="_blank"
|
|
4
|
-
class="flex flex-col justify-between group
|
|
4
|
+
class="flex flex-col justify-between group grow py-5 px-5 bg-white rounded border-gray-300 filter card-shadow overflow-hidden"
|
|
5
|
+
[ngClass]="{ 'h-40': !compact }"
|
|
6
|
+
[title]="title"
|
|
5
7
|
>
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
8
|
+
<ng-container *ngIf="!compact; else compactTpl">
|
|
9
|
+
<div class="max-h-24 overflow-hidden text-ellipsis">
|
|
10
|
+
<p
|
|
11
|
+
class="font-title font-medium text-21 text-black break-words mb-1 line-clamp-2"
|
|
12
|
+
>
|
|
13
|
+
{{ link.name }}
|
|
14
|
+
</p>
|
|
15
|
+
<p class="font-medium text-sm break-words">
|
|
16
|
+
{{ link.description }}
|
|
17
|
+
</p>
|
|
18
|
+
<p
|
|
19
|
+
*ngIf="!link.name && !link.description"
|
|
20
|
+
class="font-medium text-sm break-words truncate"
|
|
21
|
+
>
|
|
22
|
+
{{ link.url }}
|
|
23
|
+
</p>
|
|
24
|
+
</div>
|
|
25
|
+
<div>
|
|
26
|
+
<mat-icon class="material-symbols-outlined card-icon"
|
|
27
|
+
>open_in_new</mat-icon
|
|
28
|
+
>
|
|
29
|
+
</div>
|
|
30
|
+
</ng-container>
|
|
31
|
+
<ng-template #compactTpl>
|
|
32
|
+
<div class="flex items-center justify-between gap-4">
|
|
33
|
+
<p
|
|
34
|
+
class="overflow-hidden font-title font-medium text-21 text-black text-ellipsis whitespace-nowrap"
|
|
35
|
+
>
|
|
36
|
+
{{ link.name || link.description }}
|
|
37
|
+
</p>
|
|
38
|
+
<mat-icon class="material-symbols-outlined card-icon flex-shrink-0"
|
|
39
|
+
>open_in_new</mat-icon
|
|
40
|
+
>
|
|
41
|
+
</div>
|
|
42
|
+
</ng-template>
|
|
25
43
|
</a>
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import { Component, ChangeDetectionStrategy, Input } from '@angular/core'
|
|
2
2
|
import { DatasetDistribution } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
3
|
+
import { MatIconModule } from '@angular/material/icon'
|
|
4
|
+
import { CommonModule } from '@angular/common'
|
|
3
5
|
|
|
4
6
|
@Component({
|
|
5
7
|
selector: 'gn-ui-link-card',
|
|
6
8
|
templateUrl: './link-card.component.html',
|
|
7
9
|
styleUrls: ['./link-card.component.css'],
|
|
8
10
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [CommonModule, MatIconModule],
|
|
9
13
|
})
|
|
10
14
|
export class LinkCardComponent {
|
|
11
15
|
@Input() link: DatasetDistribution
|
|
16
|
+
@Input() compact = false
|
|
17
|
+
|
|
18
|
+
get title() {
|
|
19
|
+
if (this.link.name && this.link.description) {
|
|
20
|
+
return `${this.link.name} | ${this.link.description}`
|
|
21
|
+
}
|
|
22
|
+
return this.link.name || this.link.description || ''
|
|
23
|
+
}
|
|
12
24
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
|
2
|
+
import { OgcApiEndpoint } from '@camptocamp/ogc-client'
|
|
2
3
|
import { DatasetServiceDistribution } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
4
|
+
import { mimeTypeToFormat } from '../../../../../../libs/util/shared/src'
|
|
3
5
|
import { BehaviorSubject, combineLatest, map } from 'rxjs'
|
|
4
6
|
|
|
5
7
|
const DEFAULT_PARAMS = {
|
|
@@ -15,17 +17,18 @@ const DEFAULT_PARAMS = {
|
|
|
15
17
|
})
|
|
16
18
|
export class RecordApiFormComponent {
|
|
17
19
|
@Input() set apiLink(value: DatasetServiceDistribution) {
|
|
18
|
-
this.
|
|
20
|
+
this.outputFormats = [{ value: 'json', label: 'JSON' }]
|
|
21
|
+
if (value) {
|
|
22
|
+
this.apiBaseUrl = value.url.href
|
|
23
|
+
this.parseOutputFormats()
|
|
24
|
+
}
|
|
19
25
|
this.resetUrl()
|
|
20
26
|
}
|
|
21
27
|
offset$ = new BehaviorSubject('')
|
|
22
28
|
limit$ = new BehaviorSubject('')
|
|
23
29
|
format$ = new BehaviorSubject('')
|
|
24
30
|
apiBaseUrl: string
|
|
25
|
-
|
|
26
|
-
{ label: 'JSON', value: 'json' },
|
|
27
|
-
{ label: 'CSV', value: 'csv' },
|
|
28
|
-
]
|
|
31
|
+
outputFormats = [{ value: 'json', label: 'JSON' }]
|
|
29
32
|
apiQueryUrl$ = combineLatest([this.offset$, this.limit$, this.format$]).pipe(
|
|
30
33
|
map(([offset, limit, format]) => {
|
|
31
34
|
let outputUrl
|
|
@@ -70,4 +73,39 @@ export class RecordApiFormComponent {
|
|
|
70
73
|
this.limit$.next(DEFAULT_PARAMS.LIMIT)
|
|
71
74
|
this.format$.next(DEFAULT_PARAMS.FORMAT)
|
|
72
75
|
}
|
|
76
|
+
|
|
77
|
+
parseOutputFormats() {
|
|
78
|
+
const apiUrl =
|
|
79
|
+
this.apiBaseUrl.slice(-1) === '?'
|
|
80
|
+
? this.apiBaseUrl.slice(0, -1)
|
|
81
|
+
: this.apiBaseUrl
|
|
82
|
+
|
|
83
|
+
this.getOutputFormats(apiUrl).then((outputFormats) => {
|
|
84
|
+
const formatsList = outputFormats.itemFormats.map((format) => {
|
|
85
|
+
const normalizedFormat = mimeTypeToFormat(format)
|
|
86
|
+
if (normalizedFormat) {
|
|
87
|
+
return {
|
|
88
|
+
label: normalizedFormat?.toUpperCase(),
|
|
89
|
+
value: normalizedFormat,
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return null
|
|
93
|
+
})
|
|
94
|
+
this.outputFormats = this.outputFormats.concat(
|
|
95
|
+
formatsList.filter(Boolean)
|
|
96
|
+
)
|
|
97
|
+
this.outputFormats = this.outputFormats
|
|
98
|
+
.filter(
|
|
99
|
+
(format, index, self) =>
|
|
100
|
+
index === self.findIndex((t) => t.value === format.value)
|
|
101
|
+
)
|
|
102
|
+
.sort((a, b) => a.label.localeCompare(b.label))
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async getOutputFormats(url) {
|
|
107
|
+
const endpoint = await new OgcApiEndpoint(url)
|
|
108
|
+
const firstCollection = (await endpoint.featureCollections)[0]
|
|
109
|
+
return endpoint.getCollectionInfo(firstCollection)
|
|
110
|
+
}
|
|
73
111
|
}
|
|
@@ -57,7 +57,6 @@ import { TimeSincePipe } from './user-feedback-item/time-since.pipe'
|
|
|
57
57
|
DownloadItemComponent,
|
|
58
58
|
DownloadsListComponent,
|
|
59
59
|
ApiCardComponent,
|
|
60
|
-
LinkCardComponent,
|
|
61
60
|
RelatedRecordCardComponent,
|
|
62
61
|
MetadataContactComponent,
|
|
63
62
|
MetadataCatalogComponent,
|
|
@@ -80,7 +79,6 @@ import { TimeSincePipe } from './user-feedback-item/time-since.pipe'
|
|
|
80
79
|
DownloadItemComponent,
|
|
81
80
|
DownloadsListComponent,
|
|
82
81
|
ApiCardComponent,
|
|
83
|
-
LinkCardComponent,
|
|
84
82
|
RelatedRecordCardComponent,
|
|
85
83
|
MetadataContactComponent,
|
|
86
84
|
MetadataCatalogComponent,
|