geonetwork-ui 2.4.1-dev.89bb09dfa → 2.4.1-dev.a1ec7cf5a
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/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.mjs +10 -57
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.mjs +3 -4
- package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +1 -40
- package/esm2022/translations/de.json +0 -2
- package/esm2022/translations/en.json +0 -2
- package/esm2022/translations/es.json +0 -2
- package/esm2022/translations/fr.json +0 -2
- package/esm2022/translations/it.json +0 -2
- package/esm2022/translations/nl.json +0 -2
- package/esm2022/translations/pt.json +0 -2
- package/fesm2022/geonetwork-ui.mjs +11 -110
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts +5 -16
- package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.d.ts +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +1 -1
- package/libs/util/shared/src/lib/links/link-utils.d.ts +1 -2
- package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.html +7 -38
- package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.ts +3 -62
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.html +9 -11
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.ts +2 -3
- package/src/libs/util/shared/src/lib/links/link-utils.ts +1 -51
- package/translations/de.json +0 -2
- package/translations/en.json +0 -2
- package/translations/es.json +0 -2
- package/translations/fr.json +0 -2
- package/translations/it.json +0 -2
- package/translations/nl.json +0 -2
- package/translations/pt.json +0 -2
- package/translations/sk.json +0 -2
|
@@ -1,37 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EventEmitter, OnChanges } from '@angular/core';
|
|
2
2
|
import { DatasetServiceDistribution, ServiceProtocol } from '../../../../../../../libs/common/domain/src/lib/model/record';
|
|
3
|
-
import { DropdownChoice } from '../../../../../../../libs/ui/inputs/src';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class OnlineServiceResourceInputComponent implements OnChanges
|
|
6
|
-
|
|
7
|
-
service: DatasetServiceDistribution;
|
|
4
|
+
export declare class OnlineServiceResourceInputComponent implements OnChanges {
|
|
5
|
+
service: Omit<DatasetServiceDistribution, 'url'>;
|
|
8
6
|
protocolHint?: string;
|
|
9
7
|
disabled?: boolean;
|
|
10
|
-
modifyMode?: boolean;
|
|
11
8
|
urlChange: EventEmitter<string>;
|
|
12
9
|
identifierSubmit: EventEmitter<{
|
|
13
10
|
url: string;
|
|
14
11
|
identifier: string;
|
|
15
12
|
}>;
|
|
16
|
-
errorMessage: boolean;
|
|
17
13
|
selectedProtocol: ServiceProtocol;
|
|
18
14
|
url: string;
|
|
19
|
-
layers: DropdownChoice[] | undefined;
|
|
20
15
|
protocolOptions: {
|
|
21
16
|
label: string;
|
|
22
17
|
value: ServiceProtocol;
|
|
23
18
|
}[];
|
|
24
|
-
constructor(cdr: ChangeDetectorRef);
|
|
25
|
-
get activeLayerSuggestion(): boolean;
|
|
26
19
|
ngOnChanges(): void;
|
|
27
|
-
|
|
28
|
-
handleUrlValueChange(url: string): void;
|
|
29
|
-
handleUploadClick(url: string): Promise<void>;
|
|
30
|
-
handleSelectValue(val: string): void;
|
|
31
|
-
resetLayersSuggestion(): void;
|
|
20
|
+
handleUrlChange(url: string): void;
|
|
32
21
|
submitIdentifier(identifier: string): void;
|
|
33
22
|
getIdentifierPlaceholder(): string;
|
|
34
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<OnlineServiceResourceInputComponent, never>;
|
|
35
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OnlineServiceResourceInputComponent, "gn-ui-online-service-resource-input", never, { "service": { "alias": "service"; "required": false; }; "protocolHint": { "alias": "protocolHint"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; };
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OnlineServiceResourceInputComponent, "gn-ui-online-service-resource-input", never, { "service": { "alias": "service"; "required": false; }; "protocolHint": { "alias": "protocolHint"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "urlChange": "urlChange"; "identifierSubmit": "identifierSubmit"; }, never, never, true, never>;
|
|
36
25
|
}
|
|
37
26
|
//# sourceMappingURL=online-service-resource-input.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"online-service-resource-input.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"online-service-resource-input.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,YAAY,EAEZ,SAAS,EAEV,MAAM,eAAe,CAAA;AAKtB,OAAO,EACL,0BAA0B,EAC1B,eAAe,EAChB,MAAM,8DAA8D,CAAA;;AAcrE,qBAwBa,mCAAoC,YAAW,SAAS;IAC1D,OAAO,EAAE,IAAI,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAA;IAChD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAQ;IAChB,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,CAAqB;IACpD,gBAAgB,EAAE,YAAY,CAAC;QACvC,GAAG,EAAE,MAAM,CAAA;QACX,UAAU,EAAE,MAAM,CAAA;KACnB,CAAC,CAAqB;IAEvB,gBAAgB,EAAE,eAAe,CAAA;IACjC,GAAG,EAAE,MAAM,CAAA;IAEX,eAAe,EAAE;QACf,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,eAAe,CAAA;KACvB,EAAE,CA6BF;IAED,WAAW;IAOX,eAAe,CAAC,GAAG,EAAE,MAAM;IAI3B,gBAAgB,CAAC,UAAU,EAAE,MAAM;IAMnC,wBAAwB,IAAI,MAAM;yCAhEvB,mCAAmC;2CAAnC,mCAAmC;CAuE/C"}
|
|
@@ -24,7 +24,7 @@ export declare class FormFieldOnlineResourcesComponent {
|
|
|
24
24
|
notLinkResources: OnlineNotLinkResource[];
|
|
25
25
|
uploadProgress: any;
|
|
26
26
|
uploadSubscription: Subscription;
|
|
27
|
-
newService: DatasetServiceDistribution
|
|
27
|
+
newService: Omit<DatasetServiceDistribution, "url">;
|
|
28
28
|
protected MAX_UPLOAD_SIZE_MB: number;
|
|
29
29
|
constructor(notificationsService: NotificationsService, translateService: TranslateService, platformService: PlatformServiceInterface, cd: ChangeDetectorRef, dialog: MatDialog);
|
|
30
30
|
onSelectedTypeChange(selectedType: unknown): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field-online-resources.component.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAEjB,YAAY,EAGZ,WAAW,EAEZ,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,cAAc,EACd,eAAe,EAChB,MAAM,oEAAoE,CAAA;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,kFAAkF,CAAA;AAC3H,OAAO,EAAE,oBAAoB,EAAE,MAAM,2DAA2D,CAAA;AAChG,OAAO,EAGL,kBAAkB,EAInB,MAAM,+CAA+C,CAAA;AAKtD,OAAO,EAAmB,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;;AAKnC,KAAK,qBAAqB,GACtB,2BAA2B,GAC3B,0BAA0B,GAC1B,eAAe,CAAA;AAEnB,qBAmBa,iCAAiC;
|
|
1
|
+
{"version":3,"file":"form-field-online-resources.component.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAEjB,YAAY,EAGZ,WAAW,EAEZ,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,cAAc,EACd,eAAe,EAChB,MAAM,oEAAoE,CAAA;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,kFAAkF,CAAA;AAC3H,OAAO,EAAE,oBAAoB,EAAE,MAAM,2DAA2D,CAAA;AAChG,OAAO,EAGL,kBAAkB,EAInB,MAAM,+CAA+C,CAAA;AAKtD,OAAO,EAAmB,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;;AAKnC,KAAK,qBAAqB,GACtB,2BAA2B,GAC3B,0BAA0B,GAC1B,eAAe,CAAA;AAEnB,qBAmBa,iCAAiC;IAwC1C,OAAO,CAAC,oBAAoB;IAC5B,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,MAAM;IA3CP,YAAY,EAAE,MAAM,CAAA;IAC7B,IAAa,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,cAAc,CAAC,EAKxD;IACS,WAAW,EAAE,YAAY,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CACtC;IAES,cAAc,EAAE,WAAW,CAAC,cAAc,CAAC,CAAA;IAExE,WAAW,EAAE,kBAAkB,EAAE,CAWhC;IACD,YAAY,EAAE,UAAU,GAAG,SAAS,CAAa;IAEjD,OAAO,CAAC,YAAY,CAAuB;IAC3C,gBAAgB,EAAE,qBAAqB,EAAE,CAAK;IAC9C,cAAc,MAAY;IAC1B,kBAAkB,EAAE,YAAY,CAAO;IACvC,UAAU,EAIL,IAAI,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAA;IAE5C,SAAS,CAAC,kBAAkB,SAAqB;gBAGvC,oBAAoB,EAAE,oBAAoB,EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,wBAAwB,EACzC,EAAE,EAAE,iBAAiB,EACrB,MAAM,EAAE,SAAS;IAG3B,oBAAoB,CAAC,YAAY,EAAE,OAAO;IAI1C,gBAAgB,CAAC,IAAI,EAAE,IAAI;IAyB3B,kBAAkB;IAOlB,uBAAuB,CAAC,GAAG,EAAE,MAAM;IAcnC,sBAAsB,CAAC,GAAG,EAAE,MAAM;IAUlC,sBAAsB,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE;IAUnE,mBAAmB,CACjB,UAAU,EAAE,0BAA0B,EACtC,UAAU,EAAE,0BAA0B;IAOxC,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE;IAStC,oBAAoB,CAAC,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM;IAInE,OAAO,CAAC,WAAW;IAoBnB,OAAO,CAAC,cAAc;yCA/JX,iCAAiC;2CAAjC,iCAAiC;CA+L7C"}
|
|
@@ -8,7 +8,7 @@ export declare class RecordApiFormComponent {
|
|
|
8
8
|
offset$: BehaviorSubject<string>;
|
|
9
9
|
limit$: BehaviorSubject<string>;
|
|
10
10
|
format$: BehaviorSubject<string>;
|
|
11
|
-
endpoint$: BehaviorSubject<
|
|
11
|
+
endpoint$: BehaviorSubject<WfsEndpoint | OgcApiEndpoint>;
|
|
12
12
|
apiBaseUrl: string;
|
|
13
13
|
apiFeatureType: string;
|
|
14
14
|
supportOffset: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DatasetOnlineResource
|
|
1
|
+
import { DatasetOnlineResource } from '../../../../../../libs/common/domain/src/lib/model/record';
|
|
2
2
|
export declare const FORMATS: {
|
|
3
3
|
readonly csv: {
|
|
4
4
|
readonly extensions: readonly ["csv"];
|
|
@@ -107,6 +107,5 @@ export declare function mimeTypeToFormat(mimeType: string): FileFormat;
|
|
|
107
107
|
export declare function checkFileFormat(link: DatasetOnlineResource, format: FileFormat): boolean;
|
|
108
108
|
export declare function getBadgeColor(linkFormat: FileFormat): string;
|
|
109
109
|
export declare function getLinkLabel(link: DatasetOnlineResource): string;
|
|
110
|
-
export declare function getLayers(url: string, serviceProtocol: ServiceProtocol): Promise<any[]>;
|
|
111
110
|
export declare function getMimeTypeForFormat(format: FileFormat): string | null;
|
|
112
111
|
//# sourceMappingURL=link-utils.d.ts.map
|
|
@@ -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,
|
|
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,qBAAqB,EAAE,MAAM,2DAA2D,CAAA;AAIjG,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,qBAAqB,GAAG,MAAM,CAEnE;AAED,wBAAgB,8BAA8B,CAC5C,aAAa,EAAE,MAAM,GACpB,UAAU,GAAG,IAAI,CAgBnB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,qBAAqB,GAAG,UAAU,CAcrE;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,qBAAqB,EAC3B,KAAK,EAAE,MAAM,GACZ,OAAO,CAQT;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAO7D;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,qBAAqB,EAC3B,MAAM,EAAE,UAAU,GACjB,OAAO,CAMT;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAQ5D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,CA0BhE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAEtE"}
|
package/package.json
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
class="flex flex-row gap-[8px]"
|
|
18
18
|
[(ngModel)]="service.accessServiceProtocol"
|
|
19
19
|
[disabled]="disabled"
|
|
20
|
-
(change)="resetLayersSuggestion()"
|
|
21
20
|
>
|
|
22
21
|
<mat-radio-button
|
|
23
22
|
*ngFor="let protocolOption of protocolOptions"
|
|
@@ -31,59 +30,29 @@
|
|
|
31
30
|
<div class="flex flex-col gap-4">
|
|
32
31
|
<gn-ui-url-input
|
|
33
32
|
class="w-full"
|
|
34
|
-
(
|
|
35
|
-
(valueChange)="handleUrlValueChange($event)"
|
|
33
|
+
(valueChange)="handleUrlChange($event)"
|
|
36
34
|
[disabled]="disabled"
|
|
37
35
|
[value]="url"
|
|
38
|
-
[showValidateButton]="
|
|
36
|
+
[showValidateButton]="false"
|
|
39
37
|
>
|
|
40
|
-
<ng-
|
|
41
|
-
<ng-icon name="iconoirCloudUpload"></ng-icon>
|
|
42
|
-
</ng-content>
|
|
38
|
+
<ng-icon name="iconoirCloudUpload"></ng-icon>
|
|
43
39
|
</gn-ui-url-input>
|
|
44
40
|
|
|
45
|
-
<p class="text-sm text-red-500 pl-4" *ngIf="errorMessage" translate>
|
|
46
|
-
editor.record.form.field.onlineResource.edit.identifier.error
|
|
47
|
-
</p>
|
|
48
|
-
|
|
49
41
|
<gn-ui-text-input
|
|
50
42
|
class="grow border-b border-gray-300 pb-4"
|
|
51
43
|
[(value)]="service.identifierInService"
|
|
52
44
|
[placeholder]="getIdentifierPlaceholder() | translate"
|
|
53
45
|
data-cy="identifier-in-service"
|
|
54
46
|
[disabled]="disabled"
|
|
55
|
-
*ngIf="
|
|
56
|
-
!activeLayerSuggestion ||
|
|
57
|
-
(url && errorMessage) ||
|
|
58
|
-
(modifyMode && layers === undefined)
|
|
59
|
-
"
|
|
60
47
|
></gn-ui-text-input>
|
|
61
|
-
|
|
62
|
-
class="border-b border-gray-300 pb-4"
|
|
63
|
-
[showTitle]="false"
|
|
64
|
-
[title]="
|
|
65
|
-
'editor.record.form.field.onlineResource.edit.identifier.select.label'
|
|
66
|
-
| translate
|
|
67
|
-
"
|
|
68
|
-
[choices]="layers || []"
|
|
69
|
-
*ngIf="activeLayerSuggestion && layers !== undefined"
|
|
70
|
-
[selected]="service.identifierInService"
|
|
71
|
-
(selectValue)="handleSelectValue($event)"
|
|
72
|
-
>
|
|
73
|
-
</gn-ui-dropdown-selector>
|
|
48
|
+
|
|
74
49
|
<gn-ui-button
|
|
75
50
|
(buttonClick)="submitIdentifier(service.identifierInService)"
|
|
76
|
-
[disabled]="disabled || !service.identifierInService"
|
|
51
|
+
[disabled]="disabled || !service.identifierInService || !url"
|
|
77
52
|
type="primary"
|
|
78
|
-
*ngIf="
|
|
79
|
-
!modifyMode &&
|
|
80
|
-
((activeLayerSuggestion && layers) ||
|
|
81
|
-
!activeLayerSuggestion ||
|
|
82
|
-
(url && errorMessage))
|
|
83
|
-
"
|
|
84
53
|
>
|
|
85
|
-
<span class="text-white font-bold" translate
|
|
86
|
-
editor.record.form.field.onlineResource.edit.identifier.submit</span
|
|
54
|
+
<span class="text-white font-bold" translate
|
|
55
|
+
>editor.record.form.field.onlineResource.edit.identifier.submit</span
|
|
87
56
|
>
|
|
88
57
|
</gn-ui-button>
|
|
89
58
|
</div>
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common'
|
|
2
2
|
import {
|
|
3
3
|
ChangeDetectionStrategy,
|
|
4
|
-
ChangeDetectorRef,
|
|
5
4
|
Component,
|
|
6
5
|
EventEmitter,
|
|
7
6
|
Input,
|
|
8
7
|
OnChanges,
|
|
9
|
-
OnInit,
|
|
10
8
|
Output,
|
|
11
9
|
} from '@angular/core'
|
|
12
10
|
import { FormsModule } from '@angular/forms'
|
|
@@ -19,8 +17,6 @@ import {
|
|
|
19
17
|
} from '../../../../../../../libs/common/domain/src/lib/model/record'
|
|
20
18
|
import {
|
|
21
19
|
ButtonComponent,
|
|
22
|
-
DropdownChoice,
|
|
23
|
-
DropdownSelectorComponent,
|
|
24
20
|
TextInputComponent,
|
|
25
21
|
UrlInputComponent,
|
|
26
22
|
} from '../../../../../../../libs/ui/inputs/src'
|
|
@@ -31,7 +27,6 @@ import {
|
|
|
31
27
|
provideNgIconsConfig,
|
|
32
28
|
} from '@ng-icons/core'
|
|
33
29
|
import { iconoirCloudUpload } from '@ng-icons/iconoir'
|
|
34
|
-
import { getLayers } from '../../../../../../../libs/util/shared/src'
|
|
35
30
|
|
|
36
31
|
@Component({
|
|
37
32
|
selector: 'gn-ui-online-service-resource-input',
|
|
@@ -40,7 +35,6 @@ import { getLayers } from '../../../../../../../libs/util/shared/src'
|
|
|
40
35
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
36
|
standalone: true,
|
|
42
37
|
imports: [
|
|
43
|
-
DropdownSelectorComponent,
|
|
44
38
|
ButtonComponent,
|
|
45
39
|
CommonModule,
|
|
46
40
|
FormsModule,
|
|
@@ -58,21 +52,18 @@ import { getLayers } from '../../../../../../../libs/util/shared/src'
|
|
|
58
52
|
}),
|
|
59
53
|
],
|
|
60
54
|
})
|
|
61
|
-
export class OnlineServiceResourceInputComponent implements OnChanges
|
|
62
|
-
@Input() service: DatasetServiceDistribution
|
|
55
|
+
export class OnlineServiceResourceInputComponent implements OnChanges {
|
|
56
|
+
@Input() service: Omit<DatasetServiceDistribution, 'url'>
|
|
63
57
|
@Input() protocolHint?: string
|
|
64
58
|
@Input() disabled? = false
|
|
65
|
-
@Input() modifyMode? = false
|
|
66
59
|
@Output() urlChange: EventEmitter<string> = new EventEmitter()
|
|
67
60
|
@Output() identifierSubmit: EventEmitter<{
|
|
68
61
|
url: string
|
|
69
62
|
identifier: string
|
|
70
63
|
}> = new EventEmitter()
|
|
71
64
|
|
|
72
|
-
errorMessage = false
|
|
73
65
|
selectedProtocol: ServiceProtocol
|
|
74
66
|
url: string
|
|
75
|
-
layers: DropdownChoice[] | undefined = undefined
|
|
76
67
|
|
|
77
68
|
protocolOptions: {
|
|
78
69
|
label: string
|
|
@@ -108,14 +99,6 @@ export class OnlineServiceResourceInputComponent implements OnChanges, OnInit {
|
|
|
108
99
|
},
|
|
109
100
|
]
|
|
110
101
|
|
|
111
|
-
constructor(private cdr: ChangeDetectorRef) {}
|
|
112
|
-
|
|
113
|
-
get activeLayerSuggestion() {
|
|
114
|
-
return !['wps', 'GPFDL', 'esriRest', 'other'].includes(
|
|
115
|
-
this.service.accessServiceProtocol
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
|
|
119
102
|
ngOnChanges() {
|
|
120
103
|
this.selectedProtocol =
|
|
121
104
|
this.protocolOptions.find(
|
|
@@ -123,50 +106,8 @@ export class OnlineServiceResourceInputComponent implements OnChanges, OnInit {
|
|
|
123
106
|
)?.value ?? 'other'
|
|
124
107
|
}
|
|
125
108
|
|
|
126
|
-
|
|
127
|
-
if (this.service.url) {
|
|
128
|
-
this.url = this.service.url.toString()
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
handleUrlValueChange(url: string) {
|
|
133
|
-
this.url = url
|
|
134
|
-
this.service.url = new URL(url)
|
|
135
|
-
this.resetLayersSuggestion()
|
|
136
|
-
this.urlChange.emit(this.url)
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
async handleUploadClick(url: string) {
|
|
109
|
+
handleUrlChange(url: string) {
|
|
140
110
|
this.url = url
|
|
141
|
-
|
|
142
|
-
try {
|
|
143
|
-
const layers = await getLayers(url, this.service.accessServiceProtocol)
|
|
144
|
-
this.layers = layers.map((l) => {
|
|
145
|
-
return {
|
|
146
|
-
label: l.title ? `${l.title} ${l.name ? `(${l.name})` : ''}` : l.name,
|
|
147
|
-
value: l.name || l.title,
|
|
148
|
-
}
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
if (this.layers.length === 0) {
|
|
152
|
-
throw new Error('No layers found')
|
|
153
|
-
}
|
|
154
|
-
} catch (e) {
|
|
155
|
-
this.errorMessage = true
|
|
156
|
-
this.layers = undefined
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
this.cdr.detectChanges()
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
handleSelectValue(val: string) {
|
|
163
|
-
this.service.identifierInService = val
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
resetLayersSuggestion() {
|
|
167
|
-
this.errorMessage = false
|
|
168
|
-
this.layers = undefined
|
|
169
|
-
this.service.identifierInService = null
|
|
170
111
|
}
|
|
171
112
|
|
|
172
113
|
submitIdentifier(identifier: string) {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
<gn-ui-online-service-resource-input
|
|
22
22
|
[service]="newService"
|
|
23
23
|
[disabled]="disabled$ | async"
|
|
24
|
+
(urlChange)="handleServiceUrlChange($event)"
|
|
24
25
|
(identifierSubmit)="handleIdentifierSubmit($event)"
|
|
25
26
|
></gn-ui-online-service-resource-input>
|
|
26
27
|
</div>
|
|
@@ -54,22 +55,19 @@
|
|
|
54
55
|
[(value)]="onlineResource.description"
|
|
55
56
|
></gn-ui-text-area>
|
|
56
57
|
</div>
|
|
57
|
-
<ng-container *ngIf="onlineResource.type === 'service'
|
|
58
|
+
<ng-container *ngIf="onlineResource.type === 'service'">
|
|
58
59
|
<span class="w-full border-b border-gray-300"></span>
|
|
59
60
|
<gn-ui-online-service-resource-input
|
|
60
61
|
[service]="onlineResource"
|
|
61
|
-
[modifyMode]="true"
|
|
62
62
|
></gn-ui-online-service-resource-input>
|
|
63
63
|
</ng-container>
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
></gn-ui-url-input>
|
|
72
|
-
</ng-template>
|
|
64
|
+
<span class="w-full border-b border-gray-300"></span>
|
|
65
|
+
<gn-ui-url-input
|
|
66
|
+
class="w-full"
|
|
67
|
+
[disabled]="true"
|
|
68
|
+
[value]="onlineResource.url"
|
|
69
|
+
[showValidateButton]="false"
|
|
70
|
+
></gn-ui-url-input>
|
|
73
71
|
</div>
|
|
74
72
|
</ng-template>
|
|
75
73
|
</div>
|
|
@@ -92,12 +92,11 @@ export class FormFieldOnlineResourcesComponent {
|
|
|
92
92
|
notLinkResources: OnlineNotLinkResource[] = []
|
|
93
93
|
uploadProgress = undefined
|
|
94
94
|
uploadSubscription: Subscription = null
|
|
95
|
-
newService =
|
|
95
|
+
newService = {
|
|
96
96
|
type: 'service',
|
|
97
97
|
accessServiceProtocol: 'ogcFeatures',
|
|
98
98
|
identifierInService: '',
|
|
99
|
-
|
|
100
|
-
}
|
|
99
|
+
} as Omit<DatasetServiceDistribution, 'url'>
|
|
101
100
|
|
|
102
101
|
protected MAX_UPLOAD_SIZE_MB = MAX_UPLOAD_SIZE_MB
|
|
103
102
|
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
2
|
-
import {
|
|
3
|
-
DatasetOnlineResource,
|
|
4
|
-
ServiceProtocol,
|
|
5
|
-
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
6
|
-
import {
|
|
7
|
-
OgcApiEndpoint,
|
|
8
|
-
WfsEndpoint,
|
|
9
|
-
WmsEndpoint,
|
|
10
|
-
WmtsEndpoint,
|
|
11
|
-
} from '@camptocamp/ogc-client'
|
|
2
|
+
import { DatasetOnlineResource } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
12
3
|
|
|
13
4
|
marker('downloads.wfs.featuretype.not.found')
|
|
14
5
|
|
|
@@ -251,47 +242,6 @@ export function getLinkLabel(link: DatasetOnlineResource): string {
|
|
|
251
242
|
return format ? `${label} (${format})` : label
|
|
252
243
|
}
|
|
253
244
|
|
|
254
|
-
export async function getLayers(url: string, serviceProtocol: ServiceProtocol) {
|
|
255
|
-
switch (serviceProtocol) {
|
|
256
|
-
case 'ogcFeatures': {
|
|
257
|
-
const layers = await new OgcApiEndpoint(url).allCollections
|
|
258
|
-
return layers
|
|
259
|
-
}
|
|
260
|
-
case 'wfs': {
|
|
261
|
-
const endpointWfs = new WfsEndpoint(url)
|
|
262
|
-
await endpointWfs.isReady()
|
|
263
|
-
return endpointWfs.getFeatureTypes()
|
|
264
|
-
}
|
|
265
|
-
case 'wms': {
|
|
266
|
-
const endpointWms = new WmsEndpoint(url)
|
|
267
|
-
await endpointWms.isReady()
|
|
268
|
-
return endpointWms
|
|
269
|
-
.getLayers()
|
|
270
|
-
.flatMap(wmsLayerFlatten)
|
|
271
|
-
.filter((l) => l.name)
|
|
272
|
-
}
|
|
273
|
-
case 'wmts': {
|
|
274
|
-
const endpointWmts = new WmtsEndpoint(url)
|
|
275
|
-
await endpointWmts.isReady()
|
|
276
|
-
return endpointWmts.getLayers()
|
|
277
|
-
}
|
|
278
|
-
default:
|
|
279
|
-
return undefined
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
function wmsLayerFlatten(layerFull) {
|
|
284
|
-
const layer = {
|
|
285
|
-
title: layerFull.title,
|
|
286
|
-
name: layerFull.name,
|
|
287
|
-
abstract: layerFull.abstract,
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
return 'children' in layerFull && Array.isArray(layerFull.children)
|
|
291
|
-
? [layer, ...layerFull.children.flatMap(wmsLayerFlatten)]
|
|
292
|
-
: [layer]
|
|
293
|
-
}
|
|
294
|
-
|
|
295
245
|
export function getMimeTypeForFormat(format: FileFormat): string | null {
|
|
296
246
|
return format in FORMATS ? FORMATS[format.toLowerCase()].mimeTypes[0] : null
|
|
297
247
|
}
|
package/translations/de.json
CHANGED
|
@@ -238,10 +238,8 @@
|
|
|
238
238
|
"editor.record.form.field.onlineResource.dialogTitle": "",
|
|
239
239
|
"editor.record.form.field.onlineResource.edit.description": "",
|
|
240
240
|
"editor.record.form.field.onlineResource.edit.protocol": "",
|
|
241
|
-
"editor.record.form.field.onlineResource.edit.identifier.error": "Schichten konnten nicht vom Protokoll abgerufen werden",
|
|
242
241
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder": "Ebenenname",
|
|
243
242
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder.wps": "Prozessname",
|
|
244
|
-
"editor.record.form.field.onlineResource.edit.identifier.select.label": "Wählen Sie eine Ebene",
|
|
245
243
|
"editor.record.form.field.onlineResource.edit.identifier.submit": "Link zum Dienst",
|
|
246
244
|
"editor.record.form.field.onlineResource.edit.title": "",
|
|
247
245
|
"editor.record.form.field.onlineResource.fileSize": "",
|
package/translations/en.json
CHANGED
|
@@ -238,10 +238,8 @@
|
|
|
238
238
|
"editor.record.form.field.onlineResource.dialogTitle": "Modify the dataset preview",
|
|
239
239
|
"editor.record.form.field.onlineResource.edit.description": "Description",
|
|
240
240
|
"editor.record.form.field.onlineResource.edit.protocol": "Protocol",
|
|
241
|
-
"editor.record.form.field.onlineResource.edit.identifier.error": "Unable to retrieve layers from protocol",
|
|
242
241
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder": "Layer name",
|
|
243
242
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder.wps": "Process name",
|
|
244
|
-
"editor.record.form.field.onlineResource.edit.identifier.select.label": "Select a layer",
|
|
245
243
|
"editor.record.form.field.onlineResource.edit.identifier.submit": "Link to the service",
|
|
246
244
|
"editor.record.form.field.onlineResource.edit.title": "Title",
|
|
247
245
|
"editor.record.form.field.onlineResource.fileSize": "{sizeMB}MB",
|
package/translations/es.json
CHANGED
|
@@ -238,10 +238,8 @@
|
|
|
238
238
|
"editor.record.form.field.onlineResource.dialogTitle": "",
|
|
239
239
|
"editor.record.form.field.onlineResource.edit.description": "",
|
|
240
240
|
"editor.record.form.field.onlineResource.edit.protocol": "",
|
|
241
|
-
"editor.record.form.field.onlineResource.edit.identifier.error": "No se pueden recuperar las capas del protocolo",
|
|
242
241
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder": "Nombre de la capa",
|
|
243
242
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder.wps": "Nombre del proceso",
|
|
244
|
-
"editor.record.form.field.onlineResource.edit.identifier.select.label": "Selecciona una capa",
|
|
245
243
|
"editor.record.form.field.onlineResource.edit.identifier.submit": "Enlace al servicio",
|
|
246
244
|
"editor.record.form.field.onlineResource.edit.title": "",
|
|
247
245
|
"editor.record.form.field.onlineResource.fileSize": "",
|
package/translations/fr.json
CHANGED
|
@@ -238,10 +238,8 @@
|
|
|
238
238
|
"editor.record.form.field.onlineResource.dialogTitle": "Modifier l'aperçu du jeu de données",
|
|
239
239
|
"editor.record.form.field.onlineResource.edit.description": "Description",
|
|
240
240
|
"editor.record.form.field.onlineResource.edit.protocol": "Protocole",
|
|
241
|
-
"editor.record.form.field.onlineResource.edit.identifier.error": "Impossible de récupérer les couches depuis le protocole",
|
|
242
241
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder": "Nom de la couche",
|
|
243
242
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder.wps": "Nom du processus",
|
|
244
|
-
"editor.record.form.field.onlineResource.edit.identifier.select.label": "Sélectionner une couche",
|
|
245
243
|
"editor.record.form.field.onlineResource.edit.identifier.submit": "Lier le service",
|
|
246
244
|
"editor.record.form.field.onlineResource.edit.title": "Titre",
|
|
247
245
|
"editor.record.form.field.onlineResource.fileSize": "{sizeMB} Mo",
|
package/translations/it.json
CHANGED
|
@@ -232,10 +232,8 @@
|
|
|
232
232
|
"editor.record.form.field.keywords": "Parole chiave",
|
|
233
233
|
"editor.record.form.field.legalConstraints": "Vincolo legale",
|
|
234
234
|
"editor.record.form.field.license": "Licenza",
|
|
235
|
-
"editor.record.form.field.onlineResource.edit.identifier.error": "Impossibile recuperare i livelli dal protocollo",
|
|
236
235
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder": "Nome del livello",
|
|
237
236
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder.wps": "Nome del processo",
|
|
238
|
-
"editor.record.form.field.onlineResource.edit.identifier.select.label": "Seleziona un livello",
|
|
239
237
|
"editor.record.form.field.onlineResource.edit.identifier.submit": "Collegare il servizio",
|
|
240
238
|
"editor.record.form.field.title.placeholder": "Inserisci un titolo",
|
|
241
239
|
"editor.record.form.field.onlineLinkResources": "Risorse allegate",
|
package/translations/nl.json
CHANGED
|
@@ -238,10 +238,8 @@
|
|
|
238
238
|
"editor.record.form.field.onlineResource.dialogTitle": "",
|
|
239
239
|
"editor.record.form.field.onlineResource.edit.description": "",
|
|
240
240
|
"editor.record.form.field.onlineResource.edit.protocol": "",
|
|
241
|
-
"editor.record.form.field.onlineResource.edit.identifier.error": "Kan lagen niet ophalen van het protocol",
|
|
242
241
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder": "Laagnaam",
|
|
243
242
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder.wps": "Procesnaam",
|
|
244
|
-
"editor.record.form.field.onlineResource.edit.identifier.select.label": "Selecteer een laag",
|
|
245
243
|
"editor.record.form.field.onlineResource.edit.identifier.submit": "Link naar de dienst",
|
|
246
244
|
"editor.record.form.field.onlineResource.edit.title": "",
|
|
247
245
|
"editor.record.form.field.onlineResource.fileSize": "",
|
package/translations/pt.json
CHANGED
|
@@ -238,10 +238,8 @@
|
|
|
238
238
|
"editor.record.form.field.onlineResource.dialogTitle": "",
|
|
239
239
|
"editor.record.form.field.onlineResource.edit.description": "",
|
|
240
240
|
"editor.record.form.field.onlineResource.edit.protocol": "",
|
|
241
|
-
"editor.record.form.field.onlineResource.edit.identifier.error": "Não é possível recuperar camadas do protocolo",
|
|
242
241
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder": "Nome da camada",
|
|
243
242
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder.wps": "Nome do processo",
|
|
244
|
-
"editor.record.form.field.onlineResource.edit.identifier.select.label": "Selecione uma camada",
|
|
245
243
|
"editor.record.form.field.onlineResource.edit.identifier.submit": "Link para o serviço",
|
|
246
244
|
"editor.record.form.field.onlineResource.edit.title": "",
|
|
247
245
|
"editor.record.form.field.onlineResource.fileSize": "",
|
package/translations/sk.json
CHANGED
|
@@ -238,10 +238,8 @@
|
|
|
238
238
|
"editor.record.form.field.onlineResource.dialogTitle": "",
|
|
239
239
|
"editor.record.form.field.onlineResource.edit.description": "",
|
|
240
240
|
"editor.record.form.field.onlineResource.edit.protocol": "",
|
|
241
|
-
"editor.record.form.field.onlineResource.edit.identifier.error": "Nie je možné načítať vrstvy z protokolu",
|
|
242
241
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder": "Názov vrstvy",
|
|
243
242
|
"editor.record.form.field.onlineResource.edit.identifier.placeholder.wps": "Názov procesu",
|
|
244
|
-
"editor.record.form.field.onlineResource.edit.identifier.select.label": "Vyberte vrstvu",
|
|
245
243
|
"editor.record.form.field.onlineResource.edit.identifier.submit": "Odkaz na službu",
|
|
246
244
|
"editor.record.form.field.onlineResource.edit.title": "",
|
|
247
245
|
"editor.record.form.field.onlineResource.fileSize": "",
|