@piveau/dpi 0.2.0-alpha.14 → 0.2.0-alpha.15
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/dist/assets/dpi.css +1 -1
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/AboutProject.vue.js +46 -48
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/DPIHome.vue.js +48 -31
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/HomeTable.vue.js +107 -88
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ProjectTable.vue.js +1 -1
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ProjectTable.vue2.js +86 -62
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/services/dpiV3_apis.js +36 -68
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectDescriptionStep.vue.js +14 -14
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectNameStep.vue.js +7 -4
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectOrganisationStep.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectOrganisationStep.vue2.js +26 -27
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectStatusStep.vue.js +8 -8
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataCollection/BasicInformationStep.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataCollection/BasicInformationStep.vue2.js +19 -19
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataProcessing/BasicInformationStep.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataProcessing/BasicInformationStep.vue2.js +38 -39
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataSimulation/BasicInformationStep.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataSimulation/BasicInformationStep.vue2.js +72 -67
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataVisualisation/BasicInformationStep.vue.js +1 -1
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataVisualisation/BasicInformationStep.vue2.js +84 -97
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Dropdown.vue.js +103 -88
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Findability/ApplicationsStep.vue.js +1 -1
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Findability/ApplicationsStep.vue2.js +18 -17
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Findability/CategoriesStep.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Findability/CategoriesStep.vue2.js +35 -28
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Findability/DiscoverabilityStep.vue.js +11 -10
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/InputField/InputFieldDefinition.js +4 -3
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/InputField/InputFieldFormKit.vue.js +46 -40
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/InputField.vue.js +144 -134
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/OptionalDataStep/OptionalDataStep.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/OptionalDataStep/OptionalDataStep.vue2.js +189 -155
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/DatasetForm.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/DatasetForm.vue2.js +44 -38
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/HardwareForm.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/HardwareForm.vue2.js +128 -123
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/SoftwareForm.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/SoftwareForm.vue2.js +50 -45
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/utils.js +17 -17
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue2.js +337 -337
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/SectionItems/CoverageModal.vue.js +38 -71
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/SectionItems/CoverageModal.vue2.js +4 -0
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/TableRowV3.vue.js +157 -141
- package/dist/packages/dpi/src/data-provider-interface/components/Spatial.vue.js +7 -0
- package/dist/packages/dpi/src/data-provider-interface/components/Spatial.vue2.js +172 -0
- package/dist/packages/dpi/src/data-provider-interface/components/SpatialPage.vue.js +7 -0
- package/dist/packages/dpi/src/data-provider-interface/components/SpatialPage.vue2.js +44 -0
- package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue.js +1 -1
- package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue2.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/components/TheErrorDialog.vue.js +57 -46
- package/dist/packages/dpi/src/data-provider-interface/composables/project-transformer/encodeProject.js +53 -55
- package/dist/packages/dpi/src/data-provider-interface/composables/useDpiEditMode.js +61 -59
- package/dist/packages/dpi/src/data-provider-interface/composables/useDpiSimpleLoader.js +185 -180
- package/dist/packages/dpi/src/data-provider-interface/composables/useDpiStepper.js +60 -61
- package/dist/packages/dpi/src/data-provider-interface/composables/useProjectActions.js +76 -46
- package/dist/packages/dpi/src/data-provider-interface/composables/useTwinbyHome.js +67 -34
- package/dist/packages/dpi/src/data-provider-interface/composables/useTwinbyUser.js +85 -0
- package/dist/packages/dpi/src/data-provider-interface/config/dcatapdeHappyFlow/converter.js +19 -19
- package/dist/packages/dpi/src/data-provider-interface/views/InputPage.vue.js +333 -308
- package/dist/packages/dpi/src/data-provider-interface/views/InputPageProject.vue.js +314 -307
- package/dist/packages/dpi/src/form/inputDefinitions.js +52 -53
- package/dist/packages/dpi/src/stories/components/PartnerCard.vue.js +2 -2
- package/dist/packages/dpi/src/stories/components/PartnerCard.vue2.js +14 -14
- package/dist/packages/dpi/src/stories/components/ScreenshotCard.vue.js +2 -2
- package/dist/packages/dpi/src/stories/components/ScreenshotCard.vue2.js +9 -8
- package/package.json +5 -5
- package/dist/packages/dpi/src/data-provider-interface/components/PolGeoUriPage.vue.js +0 -124
- package/dist/packages/dpi/src/data-provider-interface/composables/project-transformer/__tests__/fixtures/theProjectForm.js +0 -281
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
import { useStepper as
|
|
2
|
-
import { ref as
|
|
3
|
-
import { dpiStepperKey as
|
|
4
|
-
import
|
|
5
|
-
function
|
|
6
|
-
const { steps: p, activeStep:
|
|
7
|
-
e.current.value && e.current.value !==
|
|
8
|
-
}, c = (
|
|
9
|
-
s.value.includes(
|
|
10
|
-
}, v = () => {
|
|
11
|
-
e.goToNext(), r();
|
|
1
|
+
import { useStepper as H } from "@vueuse/core";
|
|
2
|
+
import { ref as J, computed as r, provide as M } from "vue";
|
|
3
|
+
import { dpiStepperKey as O } from "../utils/injectionKeys.js";
|
|
4
|
+
import Q from "../utils/useSteps.js";
|
|
5
|
+
function Z(R) {
|
|
6
|
+
const { steps: p, activeStep: t, stepPlugin: y, visitedSteps: B, subSteps: A, triggerValidation: u, triggerValidationCurrentStep: n } = Q(), s = J([]), e = H(s, t.value), C = r(() => s.value[s.value.length - 1]), v = r(() => t.value === C.value), i = () => {
|
|
7
|
+
e.current.value && e.current.value !== t.value && (t.value = e.current.value);
|
|
8
|
+
}, c = (o) => {
|
|
9
|
+
s.value.includes(o) || (s.value.push(o), s.value.length === 1 && !t.value && (t.value = o, e.goTo(o)));
|
|
12
10
|
}, a = () => {
|
|
13
|
-
e.
|
|
14
|
-
},
|
|
15
|
-
e.
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
e.goToNext(), i();
|
|
12
|
+
}, l = () => {
|
|
13
|
+
e.goToPrevious(), i();
|
|
14
|
+
}, g = (o) => {
|
|
15
|
+
e.goTo(o), i();
|
|
16
|
+
}, I = (o) => {
|
|
17
|
+
const h = e.at(o);
|
|
18
|
+
h && (e.goTo(h), i());
|
|
19
|
+
}, L = r(() => e.index.value), N = r(() => e.previous.value || ""), V = r(() => e.next.value || ""), {
|
|
20
|
+
steps: b,
|
|
21
|
+
stepNames: k,
|
|
22
|
+
index: D,
|
|
23
|
+
current: F,
|
|
24
|
+
next: K,
|
|
25
|
+
previous: j,
|
|
26
|
+
isFirst: q,
|
|
27
|
+
at: w,
|
|
28
|
+
get: z,
|
|
30
29
|
goTo: S,
|
|
31
|
-
goToNext:
|
|
32
|
-
goToPrevious:
|
|
30
|
+
goToNext: E,
|
|
31
|
+
goToPrevious: G,
|
|
33
32
|
goBackTo: T,
|
|
34
33
|
isNext: f,
|
|
35
34
|
isPrevious: x,
|
|
@@ -37,55 +36,55 @@ function Y(Q) {
|
|
|
37
36
|
isBefore: m,
|
|
38
37
|
isAfter: P
|
|
39
38
|
} = e;
|
|
40
|
-
return
|
|
39
|
+
return M(O, {
|
|
41
40
|
steps: p,
|
|
42
|
-
activeStep:
|
|
41
|
+
activeStep: t,
|
|
43
42
|
registerStep: c,
|
|
44
43
|
goTo: S,
|
|
45
|
-
goToNextStep:
|
|
46
|
-
goToPreviousStep:
|
|
44
|
+
goToNextStep: a,
|
|
45
|
+
goToPreviousStep: l,
|
|
47
46
|
goBackTo: T,
|
|
48
47
|
isNext: f,
|
|
49
48
|
isPrevious: x,
|
|
50
49
|
isCurrent: d,
|
|
51
50
|
isBefore: m,
|
|
52
51
|
isAfter: P,
|
|
53
|
-
triggerValidation:
|
|
54
|
-
triggerValidationCurrentStep:
|
|
55
|
-
isLast:
|
|
52
|
+
triggerValidation: u,
|
|
53
|
+
triggerValidationCurrentStep: n,
|
|
54
|
+
isLast: v,
|
|
56
55
|
goToStep: g
|
|
57
56
|
}), {
|
|
58
57
|
// Original API for backward compatibility (form validation steps)
|
|
59
58
|
steps: p,
|
|
60
59
|
subSteps: A,
|
|
61
|
-
activeStep:
|
|
62
|
-
activeStepIndex:
|
|
63
|
-
previousStep:
|
|
64
|
-
nextStep:
|
|
65
|
-
visitedSteps:
|
|
66
|
-
stepPlugin:
|
|
60
|
+
activeStep: t,
|
|
61
|
+
activeStepIndex: L,
|
|
62
|
+
previousStep: N,
|
|
63
|
+
nextStep: V,
|
|
64
|
+
visitedSteps: B,
|
|
65
|
+
stepPlugin: y,
|
|
67
66
|
stepList: s,
|
|
68
67
|
registerStep: c,
|
|
69
|
-
goToNextStep:
|
|
70
|
-
goToPreviousStep:
|
|
68
|
+
goToNextStep: a,
|
|
69
|
+
goToPreviousStep: l,
|
|
71
70
|
goToStep: g,
|
|
72
|
-
goToStepByIndex:
|
|
73
|
-
triggerValidation:
|
|
74
|
-
triggerValidationCurrentStep:
|
|
71
|
+
goToStepByIndex: I,
|
|
72
|
+
triggerValidation: u,
|
|
73
|
+
triggerValidationCurrentStep: n,
|
|
75
74
|
// Extended useStepper utilities
|
|
76
|
-
stepperSteps:
|
|
77
|
-
stepNames:
|
|
78
|
-
index:
|
|
79
|
-
current:
|
|
80
|
-
next:
|
|
81
|
-
previous:
|
|
82
|
-
isFirst:
|
|
83
|
-
isLast:
|
|
84
|
-
at:
|
|
85
|
-
get:
|
|
75
|
+
stepperSteps: b,
|
|
76
|
+
stepNames: k,
|
|
77
|
+
index: D,
|
|
78
|
+
current: F,
|
|
79
|
+
next: K,
|
|
80
|
+
previous: j,
|
|
81
|
+
isFirst: q,
|
|
82
|
+
isLast: v,
|
|
83
|
+
at: w,
|
|
84
|
+
get: z,
|
|
86
85
|
goTo: S,
|
|
87
|
-
goToNext:
|
|
88
|
-
goToPrevious:
|
|
86
|
+
goToNext: E,
|
|
87
|
+
goToPrevious: G,
|
|
89
88
|
goBackTo: T,
|
|
90
89
|
isNext: f,
|
|
91
90
|
isPrevious: x,
|
|
@@ -95,5 +94,5 @@ function Y(Q) {
|
|
|
95
94
|
};
|
|
96
95
|
}
|
|
97
96
|
export {
|
|
98
|
-
|
|
97
|
+
Z as useDpiStepper
|
|
99
98
|
};
|
|
@@ -1,65 +1,95 @@
|
|
|
1
|
-
import { putResource as
|
|
2
|
-
import { useAsyncState as
|
|
3
|
-
import { computed as
|
|
4
|
-
import { useStore as
|
|
5
|
-
import { useRuntimeEnv as
|
|
6
|
-
import { slugify as
|
|
7
|
-
import { useEditModeInfo as
|
|
8
|
-
import { useFormValues as
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { putResource as y } from "@piveau/sdk-core/hubRepo";
|
|
2
|
+
import { useAsyncState as E } from "@vueuse/core";
|
|
3
|
+
import { computed as I } from "vue";
|
|
4
|
+
import { useStore as $ } from "vuex";
|
|
5
|
+
import { useRuntimeEnv as j } from "../../composables/useRuntimeEnv.js";
|
|
6
|
+
import { slugify as S, encodeProject as U } from "./project-transformer/encodeProject.js";
|
|
7
|
+
import { useEditModeInfo as w } from "./useDpiEditMode.js";
|
|
8
|
+
import { useFormValues as P } from "./useDpiFormValues.js";
|
|
9
|
+
import { useErrorDialog as T } from "./useErrorDialog.js";
|
|
10
|
+
import { useTwinbyUser as D } from "./useTwinbyUser.js";
|
|
11
|
+
async function M(d) {
|
|
12
|
+
var r, t, i, f;
|
|
11
13
|
const {
|
|
12
|
-
baseUrl:
|
|
13
|
-
formValues:
|
|
14
|
-
isEditMode:
|
|
15
|
-
editIdQuery:
|
|
16
|
-
authToken:
|
|
17
|
-
catalogId:
|
|
18
|
-
} =
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
id:
|
|
14
|
+
baseUrl: u,
|
|
15
|
+
formValues: e,
|
|
16
|
+
isEditMode: m,
|
|
17
|
+
editIdQuery: p,
|
|
18
|
+
authToken: v,
|
|
19
|
+
catalogId: s
|
|
20
|
+
} = d, n = m ? p : S((t = (r = e.value) == null ? void 0 : r["Grundlegende Informationen/Name"]) == null ? void 0 : t.projectName), a = U(e.value, { language: "de" });
|
|
21
|
+
let o = (f = (i = e.value) == null ? void 0 : i["Auffindbarkeit/Sichtbarkeit"]) == null ? void 0 : f.visibility;
|
|
22
|
+
o || (o = "public"), await y({
|
|
23
|
+
id: n,
|
|
22
24
|
// todo
|
|
23
25
|
// publicationStatus: editFromDraft.value ? 'draft' : 'published',
|
|
24
26
|
publicationStatus: "draft",
|
|
25
|
-
baseUrl:
|
|
27
|
+
baseUrl: u || "https://twin.bydata.de/api/hub/repo",
|
|
26
28
|
type: "project",
|
|
27
|
-
data:
|
|
28
|
-
accessLevel:
|
|
29
|
-
catalogId:
|
|
30
|
-
authToken:
|
|
29
|
+
data: a,
|
|
30
|
+
accessLevel: o,
|
|
31
|
+
catalogId: s || "catalog-1",
|
|
32
|
+
authToken: v
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
function L(d) {
|
|
36
|
+
var b, g, h, k;
|
|
37
|
+
const u = $(), e = j(), { openErrorDialog: m } = T(), {
|
|
38
|
+
onSuccess: p = () => {
|
|
39
|
+
u.dispatch("snackbar/showSnackbar", {
|
|
37
40
|
message: "Projekt erfolgreich gespeichert",
|
|
38
41
|
variant: "success"
|
|
39
42
|
});
|
|
40
43
|
},
|
|
41
|
-
onError:
|
|
42
|
-
} = {}, { formValues:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
onError: v
|
|
45
|
+
} = d || {}, { formValues: s } = P(), { organization: n, catalogProject: a } = D({
|
|
46
|
+
keycloak: ((g = (b = e.authentication) == null ? void 0 : b.keycloak) == null ? void 0 : g.url) || "https://keycloak.twin.bydata.de",
|
|
47
|
+
realm: ((k = (h = e.authentication) == null ? void 0 : h.keycloak) == null ? void 0 : k.realm) || "piveau",
|
|
48
|
+
audience: "piveau-hub-repo"
|
|
49
|
+
}), o = I(() => {
|
|
50
|
+
var c, l;
|
|
51
|
+
return (l = (c = u.getters) == null ? void 0 : c["auth/getUserData"]) == null ? void 0 : l.authToken;
|
|
52
|
+
}), { editIdQuery: r, isEditMode: t, catalogId: i } = w();
|
|
46
53
|
return {
|
|
47
|
-
submitDraft:
|
|
48
|
-
await
|
|
49
|
-
formValues:
|
|
50
|
-
isEditMode:
|
|
51
|
-
editIdQuery:
|
|
52
|
-
authToken:
|
|
53
|
-
baseUrl:
|
|
54
|
-
catalogId:
|
|
54
|
+
submitDraft: E(async () => {
|
|
55
|
+
await M({
|
|
56
|
+
formValues: s,
|
|
57
|
+
isEditMode: t.value,
|
|
58
|
+
editIdQuery: r.value,
|
|
59
|
+
authToken: o.value,
|
|
60
|
+
baseUrl: e.api.hubUrl,
|
|
61
|
+
catalogId: t.value ? i.value : a.value
|
|
55
62
|
});
|
|
56
63
|
}, null, {
|
|
57
64
|
immediate: !1,
|
|
58
|
-
onSuccess:
|
|
59
|
-
onError:
|
|
60
|
-
|
|
65
|
+
onSuccess: p,
|
|
66
|
+
onError: (c) => {
|
|
67
|
+
const l = new Error(
|
|
68
|
+
`Fehler beim Speichern des Projekts: ${c}
|
|
69
|
+
|
|
70
|
+
${JSON.stringify(s.value)}
|
|
71
|
+
|
|
72
|
+
authToken: ${o.value}
|
|
73
|
+
|
|
74
|
+
catalogId: ${i.value}
|
|
75
|
+
|
|
76
|
+
isEditMode: ${t.value}
|
|
77
|
+
|
|
78
|
+
editIdQuery: ${r.value}
|
|
79
|
+
|
|
80
|
+
baseUrl: ${e.api.hubUrl}
|
|
81
|
+
|
|
82
|
+
catalogProject: ${a.value}
|
|
83
|
+
|
|
84
|
+
organization: ${n.value}`
|
|
85
|
+
);
|
|
86
|
+
m(l);
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
organization: n,
|
|
90
|
+
catalogProject: a
|
|
61
91
|
};
|
|
62
92
|
}
|
|
63
93
|
export {
|
|
64
|
-
|
|
94
|
+
L as useProjectActions
|
|
65
95
|
};
|
|
@@ -1,50 +1,83 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { schemaDataset as D } from "@piveau/sdk-core";
|
|
2
|
+
import { defineHubSearch as P, dcatApDataset as x, getTranslationFor as _ } from "@piveau/sdk-vue";
|
|
3
|
+
import * as s from "zod";
|
|
4
|
+
import { schemaProject as v } from "../../utils/schema/schemaProject.js";
|
|
5
|
+
const d = s.object({
|
|
6
|
+
accessControlPermissions: s.array(s.enum(["view", "edit", "publish", "delete"])).optional(),
|
|
7
|
+
catalog_record: s.object({
|
|
8
|
+
modified: s.string().optional(),
|
|
9
|
+
status: s.string().optional(),
|
|
10
|
+
access_level: s.enum(["public", "restricted", "internal", "private"]).optional(),
|
|
11
|
+
publication_status: s.enum(["draft", "published"]).optional()
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
function y(f) {
|
|
15
|
+
const g = "project", a = P(
|
|
6
16
|
{
|
|
7
|
-
baseUrl:
|
|
17
|
+
baseUrl: f,
|
|
8
18
|
index: "resource",
|
|
9
19
|
indexDetails: "resources/project",
|
|
10
|
-
schema:
|
|
11
|
-
accessControlPermissions: i.array(i.enum(["view", "edit", "publish", "delete"])).optional(),
|
|
12
|
-
catalog_record: i.object({
|
|
13
|
-
modified: i.string().optional(),
|
|
14
|
-
status: i.string().optional(),
|
|
15
|
-
access_level: i.enum(["public", "restricted", "internal", "private"]).optional(),
|
|
16
|
-
publication_status: i.enum(["draft", "published"]).optional()
|
|
17
|
-
})
|
|
18
|
-
}),
|
|
20
|
+
schema: v.extend(d.shape),
|
|
19
21
|
facets: ["theme"]
|
|
20
22
|
},
|
|
21
|
-
(
|
|
22
|
-
var
|
|
23
|
-
const { currentLocale:
|
|
23
|
+
(i, b) => {
|
|
24
|
+
var l, o, e, u, c, m, r, h;
|
|
25
|
+
const { currentLocale: n } = b;
|
|
24
26
|
return {
|
|
25
27
|
...{
|
|
26
|
-
id:
|
|
27
|
-
title: typeof (
|
|
28
|
-
description: typeof (
|
|
29
|
-
accessControlPermissions:
|
|
30
|
-
allowEdit: (
|
|
31
|
-
allowPublish: (
|
|
32
|
-
allowDelete: (e =
|
|
33
|
-
modified:
|
|
34
|
-
status: (
|
|
35
|
-
accessLevel: (
|
|
36
|
-
publicationStatus: (m =
|
|
37
|
-
catalogId: (
|
|
38
|
-
superCatalogId: (
|
|
28
|
+
id: i.id,
|
|
29
|
+
title: typeof (i == null ? void 0 : i.name) == "string" ? i.name : _(i.name, n),
|
|
30
|
+
description: typeof (i == null ? void 0 : i.description) == "string" ? i.description : _(i.description, n),
|
|
31
|
+
accessControlPermissions: i == null ? void 0 : i.accessControlPermissions,
|
|
32
|
+
allowEdit: (l = i == null ? void 0 : i.accessControlPermissions) == null ? void 0 : l.includes("edit"),
|
|
33
|
+
allowPublish: (o = i == null ? void 0 : i.accessControlPermissions) == null ? void 0 : o.includes("publish"),
|
|
34
|
+
allowDelete: (e = i == null ? void 0 : i.accessControlPermissions) == null ? void 0 : e.includes("delete"),
|
|
35
|
+
modified: i == null ? void 0 : i.modified,
|
|
36
|
+
status: (u = i == null ? void 0 : i.catalog_record) == null ? void 0 : u.status,
|
|
37
|
+
accessLevel: (c = i == null ? void 0 : i.catalog_record) == null ? void 0 : c.access_level,
|
|
38
|
+
publicationStatus: (m = i == null ? void 0 : i.catalog_record) == null ? void 0 : m.publication_status,
|
|
39
|
+
catalogId: (r = i == null ? void 0 : i.catalog) == null ? void 0 : r.id,
|
|
40
|
+
superCatalogId: (h = i == null ? void 0 : i.catalog) == null ? void 0 : h.is_part_of
|
|
39
41
|
}
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
44
|
);
|
|
43
45
|
return {
|
|
44
|
-
resource:
|
|
45
|
-
...
|
|
46
|
+
resource: g,
|
|
47
|
+
...a
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function E(f) {
|
|
51
|
+
const g = "dataset", a = P({
|
|
52
|
+
baseUrl: f,
|
|
53
|
+
index: g,
|
|
54
|
+
indexDetails: "datasets",
|
|
55
|
+
schema: D.extend(d.shape)
|
|
56
|
+
}, (i, b) => {
|
|
57
|
+
var l, o, e, u, c, m, r, h;
|
|
58
|
+
const n = x().setup(i, b);
|
|
59
|
+
return {
|
|
60
|
+
id: n.getId,
|
|
61
|
+
title: n.getTitle,
|
|
62
|
+
description: n.getDescription,
|
|
63
|
+
accessControlPermissions: i == null ? void 0 : i.accessControlPermissions,
|
|
64
|
+
allowEdit: (l = i == null ? void 0 : i.accessControlPermissions) == null ? void 0 : l.includes("edit"),
|
|
65
|
+
allowPublish: (o = i == null ? void 0 : i.accessControlPermissions) == null ? void 0 : o.includes("publish"),
|
|
66
|
+
allowDelete: (e = i == null ? void 0 : i.accessControlPermissions) == null ? void 0 : e.includes("delete"),
|
|
67
|
+
modified: (i == null ? void 0 : i.modified) || "",
|
|
68
|
+
status: (u = i == null ? void 0 : i.catalog_record) == null ? void 0 : u.status,
|
|
69
|
+
accessLevel: (c = i == null ? void 0 : i.catalog_record) == null ? void 0 : c.access_level,
|
|
70
|
+
publicationStatus: (m = i == null ? void 0 : i.catalog_record) == null ? void 0 : m.publication_status,
|
|
71
|
+
catalogId: (r = i == null ? void 0 : i.catalog) == null ? void 0 : r.id,
|
|
72
|
+
superCatalogId: (h = i == null ? void 0 : i.catalog) == null ? void 0 : h.is_part_of
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
return {
|
|
76
|
+
resource: g,
|
|
77
|
+
...a
|
|
46
78
|
};
|
|
47
79
|
}
|
|
48
80
|
export {
|
|
49
|
-
|
|
81
|
+
E as useDatasetSearch,
|
|
82
|
+
y as useProjectSearch
|
|
50
83
|
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { createGlobalState as x, useAsyncState as T } from "@vueuse/core";
|
|
2
|
+
import b from "axios";
|
|
3
|
+
import z from "qs";
|
|
4
|
+
import { computed as i, toValue as h, watch as y, onBeforeUnmount as A, ref as P } from "vue";
|
|
5
|
+
import { useStore as _ } from "vuex";
|
|
6
|
+
const S = x(() => {
|
|
7
|
+
const u = P([]), e = i(() => {
|
|
8
|
+
var t;
|
|
9
|
+
return ((t = u.value.find((o) => o.rsname.endsWith("-orga"))) == null ? void 0 : t.rsname) || "";
|
|
10
|
+
}), d = i(() => e.value ? e.value.replace("-orga", "-projects") : ""), p = i(() => e.value ? e.value.replace("-orga", "-datasets") : ""), r = i(() => {
|
|
11
|
+
var m;
|
|
12
|
+
if (!e.value)
|
|
13
|
+
return [];
|
|
14
|
+
const t = ((m = u.value.find((c) => c.rsname === e.value)) == null ? void 0 : m.scopes) || [], o = (c, l) => c.every((n) => l.includes(n)), s = [];
|
|
15
|
+
return o(["catalog:update", "catalog:create", "catalog:delete"], t) && s.push("organizationAdmin"), t.includes("dataset:view_published") && s.push("dataViewer"), o(["dataset:delete", "dataset:view_draft", "dataset:publish"], t) && s.push("dataPublisher"), o(["dataset:view_draft", "dataset:create", "dataset:update"], t) && s.push("dataExpert"), s;
|
|
16
|
+
}), v = i(() => r.value.includes("dataExpert") || r.value.includes("organizationAdmin"));
|
|
17
|
+
return {
|
|
18
|
+
permissions: u,
|
|
19
|
+
organization: e,
|
|
20
|
+
catalogProject: d,
|
|
21
|
+
catalogDataset: p,
|
|
22
|
+
userRoles: r,
|
|
23
|
+
allowedToCreate: v
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
function $(u) {
|
|
27
|
+
const {
|
|
28
|
+
keycloak: e,
|
|
29
|
+
realm: d,
|
|
30
|
+
audience: p
|
|
31
|
+
} = u, { permissions: r, organization: v, catalogProject: t, catalogDataset: o, userRoles: s, allowedToCreate: m } = S(), c = _(), l = i(() => {
|
|
32
|
+
var a, g;
|
|
33
|
+
return (g = (a = c.getters) == null ? void 0 : a["auth/getUserData"]) == null ? void 0 : g.authToken;
|
|
34
|
+
}), n = T(async () => (await b.post(
|
|
35
|
+
`${h(e)}/realms/${h(d)}/protocol/openid-connect/token`,
|
|
36
|
+
z.stringify({
|
|
37
|
+
grant_type: "urn:ietf:params:oauth:grant-type:uma-ticket",
|
|
38
|
+
audience: h(p),
|
|
39
|
+
response_mode: "permissions"
|
|
40
|
+
}),
|
|
41
|
+
{
|
|
42
|
+
headers: {
|
|
43
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
44
|
+
Authorization: `Bearer ${l.value}`
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
)).data, void 0, {
|
|
48
|
+
immediate: !1
|
|
49
|
+
});
|
|
50
|
+
let f = null;
|
|
51
|
+
function k() {
|
|
52
|
+
f = y(() => h(l), (a, g) => {
|
|
53
|
+
a !== g && n.execute();
|
|
54
|
+
}, {
|
|
55
|
+
immediate: !0
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function w() {
|
|
59
|
+
f == null || f();
|
|
60
|
+
}
|
|
61
|
+
return y(() => n.state.value, (a) => {
|
|
62
|
+
a && n.isReady.value && (r.value = a || []);
|
|
63
|
+
}, {
|
|
64
|
+
immediate: !0
|
|
65
|
+
}), A(() => {
|
|
66
|
+
w();
|
|
67
|
+
}), {
|
|
68
|
+
authToken: l,
|
|
69
|
+
keycloak: e,
|
|
70
|
+
realm: d,
|
|
71
|
+
audience: p,
|
|
72
|
+
fetchPermissions: n,
|
|
73
|
+
organization: v,
|
|
74
|
+
catalogProject: t,
|
|
75
|
+
catalogDataset: o,
|
|
76
|
+
userRoles: s,
|
|
77
|
+
startFetchPermissions: k,
|
|
78
|
+
stopFetchPermissions: w,
|
|
79
|
+
permissions: r,
|
|
80
|
+
allowedToCreate: m
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
$ as useTwinbyUser
|
|
85
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "axios";
|
|
2
|
-
import { asSomeArray as
|
|
2
|
+
import { asSomeArray as ot } from "../../composables/useDpiSimpleLoader.js";
|
|
3
3
|
let e = { distribution: [], dataset: {}, meta: {} };
|
|
4
|
-
function
|
|
4
|
+
function lt(t) {
|
|
5
5
|
return t.replace(/[^a-z0-9\s]/gi, "").replace(/\s+/g, "-").toLowerCase();
|
|
6
6
|
}
|
|
7
|
-
async function
|
|
8
|
-
var h, v, f, k, D, O, j, R, w, S, x, I, B, C, P, T, L, U, M, G, $, F, N, X, q, z, W, E, H, Y, J, K, _, Q, Z, m, V, tt, it, dt, et;
|
|
7
|
+
async function ut(t, g, s, p) {
|
|
8
|
+
var h, v, f, k, D, O, j, R, w, S, x, I, B, C, P, T, L, U, M, G, $, F, N, X, q, z, W, E, H, Y, J, K, _, Q, Z, m, V, tt, it, dt, et, at;
|
|
9
9
|
const u = g.specification.prefixes;
|
|
10
10
|
let r = [];
|
|
11
11
|
const o = Object.keys(t);
|
|
@@ -14,7 +14,7 @@ async function yt(t, g, s, p) {
|
|
|
14
14
|
r.push(crypto.randomUUID()), e.dataset["dcat:distribution"].push({
|
|
15
15
|
"@id": `https://piveau.io/set/distribution/${r[c]}`
|
|
16
16
|
});
|
|
17
|
-
const
|
|
17
|
+
const st = new URLSearchParams(window.location.search).get("edit");
|
|
18
18
|
let y = "";
|
|
19
19
|
try {
|
|
20
20
|
for (let c = 0; c < o.length; c++) {
|
|
@@ -33,9 +33,9 @@ async function yt(t, g, s, p) {
|
|
|
33
33
|
if (o[c] === "BasicInfos") {
|
|
34
34
|
e.dataset["dpi:isDPIv3"] = !0;
|
|
35
35
|
for (let i = 0; i < Object.keys(t.BasicInfos).length; i++)
|
|
36
|
-
Object.keys(t.BasicInfos)[i] === "dct:title" && (e.dataset["dct:title"] = t.BasicInfos["dct:title"][0] || "", y =
|
|
36
|
+
Object.keys(t.BasicInfos)[i] === "dct:title" && (e.dataset["dct:title"] = t.BasicInfos["dct:title"][0] || "", y = lt(
|
|
37
37
|
t.BasicInfos["dct:title"][0]["@value"]
|
|
38
|
-
),
|
|
38
|
+
), st === "true" && (y = t.BasicInfos.datasetID)), Object.keys(t.BasicInfos)[i] === "dct:description" && (e.dataset["dct:description"] = t.BasicInfos["dct:description"][0] || ""), Object.keys(t.BasicInfos)[i] === "dct:modified" && (e.dataset["dct:modified"] = t.BasicInfos["dct:modified"][0] || ""), Object.keys(t.BasicInfos)[i] === "dct:publisher" && (e.dataset["dct:publisher"] = t.BasicInfos["dct:publisher"][0] || "", e.dataset["dct:publisher"]["@type"] = "foaf:Agent"), Object.keys(t.BasicInfos)[i] === "dcat:contactPoint" && (e.dataset["dcat:contactPoint"] = t.BasicInfos["dcat:contactPoint"][0] || ""), e.dataset["@type"] = "dcat:Dataset", e.meta["dcat:catalog"] = s.permissions[0].rsname, e.meta["@type"] = "dcat:CatalogRecord";
|
|
39
39
|
}
|
|
40
40
|
if (o[c] === "Covering" && Object.keys(t.Covering).length > 1)
|
|
41
41
|
for (let i = 0; i < Object.keys(t.Covering).length; i++) {
|
|
@@ -87,9 +87,9 @@ async function yt(t, g, s, p) {
|
|
|
87
87
|
b && (e.distribution[i]["dct:format"] = {
|
|
88
88
|
"@id": (b == null ? void 0 : b.uri) || ""
|
|
89
89
|
}), (($ = (G = (M = t.DistributionSimple) == null ? void 0 : M["dcat:distribution"]) == null ? void 0 : G[i]) == null ? void 0 : $["dcatap:applicableLegislation"]) != null && (e.distribution[i]["dct:format"] = (X = (N = (F = t.DistributionSimple) == null ? void 0 : F["dcat:distribution"]) == null ? void 0 : N[i]) == null ? void 0 : X["dcatap:applicableLegislation"]["@id"]);
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
92
|
-
|
|
90
|
+
const nt = ((W = (z = (q = t.DistributionSimple) == null ? void 0 : q["dcat:distribution"]) == null ? void 0 : z[i]) == null ? void 0 : W.conformsToItems) || [];
|
|
91
|
+
if (nt && (e.distribution[i]["dct:conformsTo"] = ot(
|
|
92
|
+
nt
|
|
93
93
|
).filter(
|
|
94
94
|
(a) => a && (a["dcat:downloadURL"] || a["dct:title"])
|
|
95
95
|
).map((a) => ({
|
|
@@ -153,8 +153,8 @@ async function yt(t, g, s, p) {
|
|
|
153
153
|
"@id": t.DistributionSimple["dcat:distribution"][i]["dct:language"][a].uri
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
|
|
156
|
+
const ct = ((Y = (H = (E = t.DistributionSimple) == null ? void 0 : E["dcat:distribution"]) == null ? void 0 : H[i]) == null ? void 0 : Y.accessServices) || [];
|
|
157
|
+
ct && (e.distribution[i]["dcat:accessService"] = (J = ot(ct)) == null ? void 0 : J.filter(
|
|
158
158
|
(a) => a && (a["dct:title"] || a["dct:description"] || a["dcat:downloadURL"] || a["dcat:endpointURL"])
|
|
159
159
|
).map((a) => {
|
|
160
160
|
const n = {
|
|
@@ -173,7 +173,7 @@ async function yt(t, g, s, p) {
|
|
|
173
173
|
"@id": l
|
|
174
174
|
}), n;
|
|
175
175
|
})), e.distribution[i]["foaf:page"] || (e.distribution[i]["foaf:page"] = []);
|
|
176
|
-
for (let a = 0; a < ((Q = (_ = (K = t.DistributionSimple) == null ? void 0 : K["dcat:distribution"]) == null ? void 0 : _[i]) == null ? void 0 : Q.documentations.length); a++) {
|
|
176
|
+
for (let a = 0; a < ((Z = (Q = (_ = (K = t.DistributionSimple) == null ? void 0 : K["dcat:distribution"]) == null ? void 0 : _[i]) == null ? void 0 : Q.documentations) == null ? void 0 : Z.length); a++) {
|
|
177
177
|
const n = t.DistributionSimple["dcat:distribution"][i].documentations[a];
|
|
178
178
|
if ((n == null ? void 0 : n["dct:title"]) !== void 0) {
|
|
179
179
|
const l = {
|
|
@@ -220,7 +220,7 @@ async function yt(t, g, s, p) {
|
|
|
220
220
|
for (let d = 0; d < t.Additionals["dcat:keyword"].length; d++)
|
|
221
221
|
e.dataset["dcat:keyword"] === void 0 && (e.dataset["dcat:keyword"] = []), e.dataset["dcat:keyword"].push({
|
|
222
222
|
"@value": t.Additionals["dcat:keyword"][d]["@value"],
|
|
223
|
-
"@language": ((
|
|
223
|
+
"@language": ((V = (m = t.Additionals["dcat:keyword"]) == null ? void 0 : m[d]) == null ? void 0 : V["@language"]) || "de"
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
if (Object.keys(t.Additionals)[i] === "dct:references") {
|
|
@@ -302,7 +302,7 @@ async function yt(t, g, s, p) {
|
|
|
302
302
|
for (let d = 0; d < t.Additionals["dcatde:legalBasis"].length; d++)
|
|
303
303
|
e.dataset["dcatde:legalBasis"] === void 0 && (e.dataset["dcatde:legalBasis"] = []), e.dataset["dcatde:legalBasis"].push({
|
|
304
304
|
"@value": t.Additionals["dcatde:legalBasis"][d]["@value"],
|
|
305
|
-
"@language": ((
|
|
305
|
+
"@language": ((dt = (it = (tt = t.Additionals) == null ? void 0 : tt["dcatde:legalBasis"]) == null ? void 0 : it[d]) == null ? void 0 : dt["@language"]) || "de"
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
if (Object.keys(t.Additionals)[i] === "dct:relation") {
|
|
@@ -427,7 +427,7 @@ async function yt(t, g, s, p) {
|
|
|
427
427
|
for (let d = 0; d < t.Additionals["foaf:page"].length; d++)
|
|
428
428
|
e.dataset["foaf:page"] === void 0 && (e.dataset["foaf:page"] = []), e.dataset["foaf:page"].push({
|
|
429
429
|
"dct:format": {
|
|
430
|
-
"@id": (
|
|
430
|
+
"@id": (at = (et = t.Additionals["foaf:page"]) == null ? void 0 : et[d]) == null ? void 0 : at.uri
|
|
431
431
|
},
|
|
432
432
|
"dct:title": t.Additionals["foaf:page"][d]["dct:title"],
|
|
433
433
|
"dct:description": t.Additionals["foaf:page"][d]["dct:description"],
|
|
@@ -469,7 +469,7 @@ async function yt(t, g, s, p) {
|
|
|
469
469
|
} catch (c) {
|
|
470
470
|
console.log(c);
|
|
471
471
|
}
|
|
472
|
-
let A =
|
|
472
|
+
let A = rt(e, u);
|
|
473
473
|
return { actionParams: {
|
|
474
474
|
id: y,
|
|
475
475
|
catalog: s.permissions[0].rsname,
|
|
@@ -478,7 +478,7 @@ async function yt(t, g, s, p) {
|
|
|
478
478
|
description: e.dataset["dct:description"]["@value"]
|
|
479
479
|
}, body: A };
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function rt(t, g) {
|
|
482
482
|
const s = {}, p = Object.keys(t);
|
|
483
483
|
for (let o = 0; o < p.length; o++)
|
|
484
484
|
p[o], s[p[o]] = t[p[o]];
|
|
@@ -498,5 +498,5 @@ function lt(t, g) {
|
|
|
498
498
|
return console.log(r), r;
|
|
499
499
|
}
|
|
500
500
|
export {
|
|
501
|
-
|
|
501
|
+
ut as default
|
|
502
502
|
};
|