@piveau/piveau-hub-ui-modules 4.3.12 → 4.3.13
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/data-provider-interface/DPIMenu.vue.d.ts +2 -2
- package/dist/data-provider-interface/DataProviderInterface.vue.d.ts +29 -7
- package/dist/data-provider-interface/DataProviderInterface.vue.mjs +12 -69
- package/dist/data-provider-interface/DataProviderInterface.vue.mjs.map +1 -1
- package/dist/data-provider-interface/DataProviderInterface.vue2.mjs +91 -2
- package/dist/data-provider-interface/DataProviderInterface.vue2.mjs.map +1 -1
- package/dist/data-provider-interface/DataProviderInterface.vue3.mjs +5 -0
- package/dist/data-provider-interface/DataProviderInterface.vue3.mjs.map +1 -0
- package/dist/data-provider-interface/components/AutocompleteInput.vue.mjs +30 -37
- package/dist/data-provider-interface/components/AutocompleteInput.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/DataFetchingComponent.vue.d.ts +1 -1
- package/dist/data-provider-interface/components/DataFetchingComponent.vue.mjs +23 -18
- package/dist/data-provider-interface/components/DataFetchingComponent.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/FileUpload.vue.d.ts +1 -1
- package/dist/data-provider-interface/components/Navigation.vue.d.ts +4 -4
- package/dist/data-provider-interface/composables/index.d.ts +2 -0
- package/dist/data-provider-interface/composables/useDpiContext.d.ts +17 -0
- package/dist/data-provider-interface/composables/useDpiContext.mjs +19 -0
- package/dist/data-provider-interface/composables/useDpiContext.mjs.map +1 -0
- package/dist/data-provider-interface/composables/useDpiEditMode.d.ts +16 -0
- package/dist/data-provider-interface/composables/useDpiEditMode.mjs +39 -0
- package/dist/data-provider-interface/composables/useDpiEditMode.mjs.map +1 -0
- package/dist/data-provider-interface/config/dpi-spec-config.mjs +1 -0
- package/dist/data-provider-interface/config/dpi-spec-config.mjs.map +1 -1
- package/dist/data-provider-interface/index.d.ts +2 -0
- package/dist/data-provider-interface/index.mjs +11 -0
- package/dist/data-provider-interface/index.mjs.map +1 -0
- package/dist/data-provider-interface/store/dpiStore.d.ts +31 -15
- package/dist/data-provider-interface/store/dpiStore.mjs +30 -13
- package/dist/data-provider-interface/store/dpiStore.mjs.map +1 -1
- package/dist/data-provider-interface/store/modules/autocompleteStore.d.ts +3 -1
- package/dist/data-provider-interface/store/modules/autocompleteStore.mjs +28 -29
- package/dist/data-provider-interface/store/modules/autocompleteStore.mjs.map +1 -1
- package/dist/data-provider-interface/store/modules/conversionStore.d.ts +6 -6
- package/dist/data-provider-interface/store/modules/conversionStore.mjs +21 -22
- package/dist/data-provider-interface/store/modules/conversionStore.mjs.map +1 -1
- package/dist/data-provider-interface/store/modules/formSchemaStore.d.ts +5 -3
- package/dist/data-provider-interface/store/modules/formSchemaStore.mjs +29 -29
- package/dist/data-provider-interface/store/modules/formSchemaStore.mjs.map +1 -1
- package/dist/data-provider-interface/store/modules/navigationStore.d.ts +1 -1
- package/dist/data-provider-interface/store/modules/navigationStore.mjs +13 -14
- package/dist/data-provider-interface/store/modules/navigationStore.mjs.map +1 -1
- package/dist/data-provider-interface/utils/RDFconverter.mjs +63 -60
- package/dist/data-provider-interface/utils/RDFconverter.mjs.map +1 -1
- package/dist/data-provider-interface/views/DraftsPage.vue.d.ts +1 -1
- package/dist/data-provider-interface/views/InputPage.vue.d.ts +3 -3
- package/dist/data-provider-interface/views/OverviewPage/Properties/URIProp.vue.mjs +1 -1
- package/dist/data-provider-interface/views/OverviewPage.vue.d.ts +1 -1
- package/dist/datasetDetails/DatasetDetails.vue.d.ts +1 -1
- package/dist/datasetDetails/DatasetDetailsDescription.vue.d.ts +1 -1
- package/dist/datasetDetails/distributions/DistributionFormat.vue.d.ts +3 -3
- package/dist/datasetDetails/distributions/DownloadAllDistributions.vue.d.ts +2 -2
- package/dist/datasetDetails/distributions/distributionActions/DistributionDownload.vue.d.ts +3 -3
- package/dist/datasetDetails/header/DatasetDetailsHeaderTitle.vue.d.ts +1 -1
- package/dist/datasetDetails/navigation/DatasetDetailsNavigation.vue.d.ts +1 -1
- package/dist/datasetDetails/navigation/DatasetDetailsNavigationLinks.vue.d.ts +1 -1
- package/dist/embed/EmbedDataset.vue.d.ts +1 -1
- package/dist/embed/EmbedDatasetSnippet.vue.d.ts +2 -2
- package/dist/external/@vueuse/core/index +129 -80
- package/dist/external/@vueuse/core/index.map +1 -1
- package/dist/external/@vueuse/shared/index +121 -17
- package/dist/external/@vueuse/shared/index.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +250 -248
- package/dist/index.mjs.map +1 -1
- package/dist/piveau-hub-ui-modules.css +1 -1
- package/package.json +1 -1
|
@@ -1,53 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
r(t);
|
|
1
|
+
import u from "axios";
|
|
2
|
+
const p = {}, h = {}, f = {
|
|
3
|
+
requestFirstEntrySuggestions({ commit: l }, c, s) {
|
|
4
|
+
return new Promise((e, o) => {
|
|
5
|
+
const a = `${s}search?filter=vocabulary&vocabulary=${c}`;
|
|
6
|
+
u.get(a).then((t) => {
|
|
7
|
+
e(t);
|
|
9
8
|
}).catch((t) => {
|
|
10
9
|
o(t);
|
|
11
10
|
});
|
|
12
11
|
});
|
|
13
12
|
},
|
|
14
|
-
requestAutocompleteSuggestions({ commit:
|
|
13
|
+
requestAutocompleteSuggestions({ commit: l }, { voc: c, text: s, base: e }) {
|
|
15
14
|
return new Promise((o, a) => {
|
|
16
|
-
const t = `${
|
|
17
|
-
|
|
18
|
-
o(
|
|
19
|
-
}).catch((
|
|
20
|
-
a(
|
|
15
|
+
const t = `${e}search?filter=vocabulary&vocabulary=${c}&q=${s}`;
|
|
16
|
+
u.get(t).then((r) => {
|
|
17
|
+
o(r);
|
|
18
|
+
}).catch((r) => {
|
|
19
|
+
a(r);
|
|
21
20
|
});
|
|
22
21
|
});
|
|
23
22
|
},
|
|
24
|
-
async requestResourceName({ commit:
|
|
23
|
+
async requestResourceName({ commit: l, state: c, rootGetters: s }, { voc: e, uri: o, envs: a }) {
|
|
25
24
|
try {
|
|
26
|
-
const
|
|
25
|
+
const t = s["dpiStore/getSpecification"];
|
|
27
26
|
if (e === void 0 || e === "application")
|
|
28
27
|
return;
|
|
29
|
-
let
|
|
28
|
+
let r;
|
|
30
29
|
if (e === "iana-media-types" || e === "spdx-checksum-algorithm")
|
|
31
|
-
|
|
30
|
+
r = `${a.api.baseUrl}vocabularies/${e}`;
|
|
32
31
|
else {
|
|
33
|
-
const
|
|
34
|
-
|
|
32
|
+
const i = encodeURIComponent(o.replace(t.vocabPrefixes[e], ""));
|
|
33
|
+
r = `${a.api.baseUrl}vocabularies/${e}/${i}`;
|
|
35
34
|
}
|
|
36
|
-
return new Promise((
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}).catch((
|
|
40
|
-
|
|
35
|
+
return new Promise((i, m) => {
|
|
36
|
+
u.get(r).then((n) => {
|
|
37
|
+
i(n);
|
|
38
|
+
}).catch((n) => {
|
|
39
|
+
m(n);
|
|
41
40
|
});
|
|
42
41
|
});
|
|
43
42
|
} catch {
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
},
|
|
47
|
-
state:
|
|
48
|
-
getters:
|
|
45
|
+
}, g = {}, b = {
|
|
46
|
+
state: p,
|
|
47
|
+
getters: h,
|
|
49
48
|
actions: f,
|
|
50
|
-
mutations:
|
|
49
|
+
mutations: g
|
|
51
50
|
};
|
|
52
51
|
export {
|
|
53
52
|
b as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocompleteStore.mjs","sources":["../../../../lib/data-provider-interface/store/modules/autocompleteStore.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable no-param-reassign, no-shadow, no-console */\nimport axios from 'axios';\
|
|
1
|
+
{"version":3,"file":"autocompleteStore.mjs","sources":["../../../../lib/data-provider-interface/store/modules/autocompleteStore.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable no-param-reassign, no-shadow, no-console */\nimport axios from 'axios';\n\nconst state = {};\nconst getters = {};\n\nconst actions = {\n requestFirstEntrySuggestions({ commit }, voc, base) {\n return new Promise((resolve, reject) => {\n const req = `${base}search?filter=vocabulary&vocabulary=${voc}`;\n axios.get(req)\n .then((res) => {\n resolve(res);\n })\n .catch((err) => {\n reject(err);\n });\n });\n },\n requestAutocompleteSuggestions({ commit }, { voc, text, base }) {\n // console.log(voc,text,base); \n return new Promise((resolve, reject) => {\n const req = `${base}search?filter=vocabulary&vocabulary=${voc}&q=${text}`;\n axios.get(req)\n .then((res) => {\n // console.log(res);\n\n resolve(res);\n })\n .catch((err) => {\n reject(err);\n });\n });\n },\n async requestResourceName({ commit, state, rootGetters }, { voc, uri, envs }) {\n try {\n \n \n const specification = rootGetters['dpiStore/getSpecification'];\n\n // Catching invalid URI's\n if (voc === undefined) return\n if (voc === \"application\") return\n\n let req;\n\n // vocabularies for spdx checksum and inana-media-types are structured differently in the backend then other vocabularies\n if (voc === 'iana-media-types' || voc === 'spdx-checksum-algorithm') {\n req = `${envs.api.baseUrl}vocabularies/${voc}`;\n\n } else {\n const value = encodeURIComponent(uri.replace(specification.vocabPrefixes[voc], \"\"));\n \n \n req = `${envs.api.baseUrl}vocabularies/${voc}/${value}`;\n\n }\n return new Promise((resolve, reject) => {\n axios.get(req)\n .then((res) => {\n resolve(res);\n })\n .catch((err) => {\n reject(err);\n\n });\n });\n } catch (error) {\n // console.log(error);\n\n }\n\n },\n};\n\nconst mutations = {};\n\nconst autocompleteModule = {\n state,\n getters,\n actions,\n mutations\n};\n\nexport default autocompleteModule;"],"names":["state","getters","actions","commit","voc","base","resolve","reject","req","axios","res","err","text","rootGetters","uri","envs","specification","value","mutations","autocompleteModule"],"mappings":";AAIA,MAAMA,IAAQ,CAAA,GACRC,IAAU,CAAA,GAEVC,IAAU;AAAA,EACZ,6BAA6B,EAAE,QAAAC,KAAUC,GAAKC,GAAM;AAChD,WAAO,IAAI,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M,IAAID,CAAG,EACR,KAAK,CAACE,MAAQ;AACX,UAAAJ,EAAQI,CAAG;AAAA,QAAA,CACd,EACA,MAAM,CAACC,MAAQ;AACZ,UAAAJ,EAAOI,CAAG;AAAA,QAAA,CAEb;AAAA,MAAA,CACR;AAAA,YACW;AAAA,IAGhB;AAAA,EAEJ;AACJ,GAEMO,IAAY,CAAA,GAEZC,IAAqB;AAAA,EACvB,OAAAnB;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAgB;AACJ;"}
|
|
@@ -48,13 +48,13 @@ declare const conversionModule: {
|
|
|
48
48
|
* @param param0
|
|
49
49
|
* @param param1 Object containing endpoint and token for data fetching as well as property
|
|
50
50
|
*/
|
|
51
|
-
convertToInput({ commit }: {
|
|
51
|
+
convertToInput({ commit, rootGetters }: {
|
|
52
52
|
commit: any;
|
|
53
|
-
|
|
53
|
+
rootGetters: any;
|
|
54
|
+
}, { endpoint, token, property }: {
|
|
54
55
|
endpoint: any;
|
|
55
56
|
token: any;
|
|
56
57
|
property: any;
|
|
57
|
-
specification: any;
|
|
58
58
|
}): Promise<void>;
|
|
59
59
|
/**
|
|
60
60
|
* Merges store data and converts the given input values into RDF format
|
|
@@ -62,11 +62,11 @@ declare const conversionModule: {
|
|
|
62
62
|
* @param property Object containing all values within nested objects for each page of the frontend
|
|
63
63
|
* @returns Data values in RDF format
|
|
64
64
|
*/
|
|
65
|
-
convertToRDF({ state }: {
|
|
65
|
+
convertToRDF({ state, rootGetters }: {
|
|
66
66
|
state: any;
|
|
67
|
-
|
|
67
|
+
rootGetters: any;
|
|
68
|
+
}, { property }: {
|
|
68
69
|
property: any;
|
|
69
|
-
specification: any;
|
|
70
70
|
}): undefined;
|
|
71
71
|
/**
|
|
72
72
|
* Calls mutation to clear values and store
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import m from "n3";
|
|
2
|
-
import { has as
|
|
3
|
-
import
|
|
2
|
+
import { has as u, isEmpty as f } from "lodash-es";
|
|
3
|
+
import S from "@rdfjs/dataset";
|
|
4
4
|
import i from "../../utils/general-helper.mjs";
|
|
5
5
|
import b from "../../utils/RDFconverter.mjs";
|
|
6
6
|
import D from "../../utils/inputConverter.mjs";
|
|
7
|
-
import S from "../../config/dpi-spec-config.mjs";
|
|
8
7
|
const v = {
|
|
9
8
|
datasets: {},
|
|
10
9
|
distributions: [],
|
|
11
10
|
catalogues: {},
|
|
12
11
|
deleteDistributionInline: !1
|
|
13
|
-
},
|
|
12
|
+
}, p = {
|
|
14
13
|
/**
|
|
15
14
|
* Returns raw values for given property, page and distribution
|
|
16
15
|
* @param state
|
|
@@ -36,7 +35,7 @@ const v = {
|
|
|
36
35
|
s = i.mergeNestedObjects(t[e]);
|
|
37
36
|
return s;
|
|
38
37
|
}
|
|
39
|
-
},
|
|
38
|
+
}, F = {
|
|
40
39
|
/**
|
|
41
40
|
* Saves values from input form to vuex store
|
|
42
41
|
* @param param0
|
|
@@ -58,11 +57,11 @@ const v = {
|
|
|
58
57
|
* @param param0
|
|
59
58
|
* @param param1 Object containing endpoint and token for data fetching as well as property
|
|
60
59
|
*/
|
|
61
|
-
async convertToInput({ commit: t }, { endpoint:
|
|
62
|
-
const r = await i.fetchLinkedData(
|
|
63
|
-
await
|
|
64
|
-
|
|
65
|
-
}), t("saveLinkedDataToStore", { property:
|
|
60
|
+
async convertToInput({ commit: t, rootGetters: e }, { endpoint: s, token: a, property: o }) {
|
|
61
|
+
const n = e["dpiStore/getSpecification"], r = await i.fetchLinkedData(s, a).then((d) => d), g = new m.Parser(), c = S.dataset();
|
|
62
|
+
await g.parse(r, (d, l, L) => {
|
|
63
|
+
l && c.add(l);
|
|
64
|
+
}), t("saveLinkedDataToStore", { property: o, data: c, specification: n });
|
|
66
65
|
},
|
|
67
66
|
/**
|
|
68
67
|
* Merges store data and converts the given input values into RDF format
|
|
@@ -70,16 +69,16 @@ const v = {
|
|
|
70
69
|
* @param property Object containing all values within nested objects for each page of the frontend
|
|
71
70
|
* @returns Data values in RDF format
|
|
72
71
|
*/
|
|
73
|
-
convertToRDF({ state: t }, { property:
|
|
74
|
-
const a = {
|
|
72
|
+
convertToRDF({ state: t, rootGetters: e }, { property: s }) {
|
|
73
|
+
const a = e["dpiStore/getSpecification"], o = {
|
|
75
74
|
datasets: i.mergeNestedObjects(t.datasets),
|
|
76
75
|
distributions: [],
|
|
77
76
|
catalogues: i.mergeNestedObjects(t.catalogues)
|
|
78
77
|
};
|
|
79
|
-
if (
|
|
78
|
+
if (u(t.datasets, "Distributions") && u(t.datasets.Distributions, "distributionList") && !f(t.datasets.Distributions.distributionList))
|
|
80
79
|
for (let r = 0; r < t.datasets.Distributions.distributionList.length; r++)
|
|
81
|
-
|
|
82
|
-
return b.convertToRDF(
|
|
80
|
+
o.distributions.push(i.mergeNestedObjects(t.datasets.Distributions.distributionList[r]));
|
|
81
|
+
return b.convertToRDF(o, s, a);
|
|
83
82
|
},
|
|
84
83
|
/**
|
|
85
84
|
* Calls mutation to clear values and store
|
|
@@ -88,7 +87,7 @@ const v = {
|
|
|
88
87
|
clearAll({ commit: t }) {
|
|
89
88
|
t("resetStore");
|
|
90
89
|
}
|
|
91
|
-
},
|
|
90
|
+
}, I = {
|
|
92
91
|
/**
|
|
93
92
|
* Saves input values from form into vuex as well as into localStorage of browser
|
|
94
93
|
* @param state
|
|
@@ -115,19 +114,19 @@ const v = {
|
|
|
115
114
|
* @param param1 Object containing data and property and state
|
|
116
115
|
*/
|
|
117
116
|
saveLinkedDataToStore(t, { property: e, data: s, specification: a }) {
|
|
118
|
-
const o =
|
|
117
|
+
const o = a;
|
|
119
118
|
D.convertToInput(t, e, s, o), localStorage.setItem(`dpi_${e}`, JSON.stringify(t[e]));
|
|
120
119
|
},
|
|
121
120
|
resetStore(t) {
|
|
122
121
|
localStorage.removeItem("dpi_datasets"), localStorage.removeItem("dpi_catalogues"), t.datasets = {}, t.catalogues = {}, localStorage.setItem("dpi_editmode", !1), localStorage.setItem("dpi_draftmode", !1);
|
|
123
122
|
}
|
|
124
|
-
},
|
|
123
|
+
}, R = {
|
|
125
124
|
state: v,
|
|
126
|
-
getters:
|
|
127
|
-
actions:
|
|
128
|
-
mutations:
|
|
125
|
+
getters: p,
|
|
126
|
+
actions: F,
|
|
127
|
+
mutations: I
|
|
129
128
|
};
|
|
130
129
|
export {
|
|
131
|
-
|
|
130
|
+
R as default
|
|
132
131
|
};
|
|
133
132
|
//# sourceMappingURL=conversionStore.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversionStore.mjs","sources":["../../../../lib/data-provider-interface/store/modules/conversionStore.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable no-param-reassign, no-shadow, no-console */\nimport N3 from 'n3';\n\nimport { isEmpty, has } from 'lodash';\nimport datasetFactory from '@rdfjs/dataset';\n\nimport generalHelper from '../../utils/general-helper';\nimport toRDF from '../../utils/RDFconverter';\nimport toInput from '../../utils/inputConverter';\n\nimport generalDpiConfig from '../../config/dpi-spec-config.js';\n\nconst state = {\n datasets: {},\n distributions: [],\n catalogues: {},\n deleteDistributionInline: false,\n};\n\nconst getters = {\n /**\n * Returns raw values for given property, page and distribution\n * @param state \n * @param0 Object containing property, page and distribution id\n * @returns Object conatining form values for given property, distribution and page\n */\n getRawValues: (state) => ({ property }) => {\n return state[property];\n },\n /**\n * Provides property data\n * @param state \n * @param property Property of wanted data\n * @returns Object containing all values of given property\n */\n getData: (state) => (property) => {\n let data;\n if (property === 'distributions') {\n data = [];\n for (let index = 0; index < state[property].length; index += 1) {\n const currentDistributionData = generalHelper.mergeNestedObjects(state[property][index]);\n data.push(currentDistributionData);\n }\n\n } else {\n data = generalHelper.mergeNestedObjects(state[property])\n }\n \n \n return data;\n },\n};\n\nconst actions = {\n /**\n * Saves values from input form to vuex store\n * @param param0 \n * @param param1 Object containing property, page, distrbution id and form values\n */\n saveFormValues({ commit }, { property, values }) {\n\n commit('saveFormValuesToStore', { property, values });\n\n },\n /**\n * Saving existing values from localStorage to vuex store\n * @param {*} param0\n * @param {*} param1 Object containing property (datasets/catalogues) and subpage (when curren tprofile is distributions)\n */\n saveLocalstorageValues({ commit }, property) {\n commit('saveFromLocalstorage', property);\n },\n /**\n * Fetches data, writes it to a dataset and calls method for actual conversion to input format\n * @param param0 \n * @param param1 Object containing endpoint and token for data fetching as well as property\n */\n async convertToInput({ commit }, { endpoint, token, property, specification }) {\n \n const fetchedData = await generalHelper.fetchLinkedData(endpoint, token).then((response) => {\n return response;\n });\n\n const parser = new N3.Parser();\n const data = datasetFactory.dataset();\n\n // adding quads to dataset\n await parser.parse(fetchedData, (error, quad, prefixes) => {\n if (quad) data.add(quad);\n })\n\n commit('saveLinkedDataToStore', { property, data, specification });\n },\n /**\n * Merges store data and converts the given input values into RDF format\n * @param state \n * @param property Object containing all values within nested objects for each page of the frontend\n * @returns Data values in RDF format\n */\n convertToRDF({ state }, { property, specification }) {\n\n // merging objects with nested objects containing the values of each page into one main object containing all values for the given property\n const data = {\n datasets: generalHelper.mergeNestedObjects(state.datasets),\n distributions: [],\n catalogues: generalHelper.mergeNestedObjects(state.catalogues)\n };\n\n // merging each distribution object within the overall array of distributions\n if (has(state.datasets, 'Distributions') && has(state.datasets.Distributions, 'distributionList') && !isEmpty(state.datasets.Distributions.distributionList)) {\n for (let index = 0; index < state.datasets.Distributions.distributionList.length; index++) {\n data.distributions.push(generalHelper.mergeNestedObjects(state.datasets.Distributions.distributionList[index]))\n }\n }\n\n const RDFdata = toRDF.convertToRDF(data, property, specification);\n\n return RDFdata;\n },\n /**\n * Calls mutation to clear values and store\n * @param param0 \n */\n clearAll({ commit }) {\n commit('resetStore');\n }, \n};\n\nconst mutations = {\n /**\n * Saves input values from form into vuex as well as into localStorage of browser\n * @param state \n * @param param1 Object containing the property, page and values of input form\n */\n saveFormValuesToStore(state, { property, values }) {\n\n state[property] = values;\n\n // save to local storage\n localStorage.setItem(`dpi_${property}`, JSON.stringify(state[property]));\n },\n /**\n * Save input form values from localStorage into vuex store\n * @param {*} state\n * @param {String} property Property name the data should be saved to (datasets/distributions/catalogues)\n */\n saveFromLocalstorage(state, property) {\n let valueName;\n\n if (property === 'catalogues') {\n valueName = 'dpi_catalogues';\n } else {\n valueName = 'dpi_datasets';\n }\n\n // extract catalogues or datasets data\n if (Object.keys(localStorage).includes(valueName)) {\n const localStorageData = JSON.parse(localStorage.getItem(valueName));\n if (property === 'catalogues') state[property] = localStorageData;\n else state.datasets = localStorageData;\n }\n },\n /**\n * Converts RDF data into input form data\n * @param state \n * @param param1 Object containing data and property and state\n */\n saveLinkedDataToStore(state, { property, data, specification }) {\n\n const dpiConfig = generalDpiConfig[specification];\n toInput.convertToInput(state, property, data, dpiConfig );\n\n localStorage.setItem(`dpi_${property}`, JSON.stringify(state[property]));\n },\n resetStore(state) {\n // remove dpi values from local store\n localStorage.removeItem('dpi_datasets');\n localStorage.removeItem('dpi_catalogues');\n\n // resetting all store data properties\n state.datasets = {};\n state.catalogues = {};\n\n // edit and draft mode not within this store so resetting via local storage\n localStorage.setItem('dpi_editmode', false);\n localStorage.setItem('dpi_draftmode', false);\n },\n};\n\nconst conversionModule = {\n state,\n getters,\n actions,\n mutations\n};\n\nexport default conversionModule;\n"],"names":["state","getters","property","data","index","currentDistributionData","generalHelper","actions","commit","values","endpoint","token","specification","fetchedData","response","parser","N3","datasetFactory","error","quad","prefixes","has","isEmpty","toRDF","mutations","valueName","localStorageData","dpiConfig","generalDpiConfig","toInput","conversionModule"],"mappings":";;;;;;;AAaA,MAAMA,IAAQ;AAAA,EACV,UAAU,CAAC;AAAA,EACX,eAAe,CAAC;AAAA,EAChB,YAAY,CAAC;AAAA,EACb,0BAA0B;AAC9B,GAEMC,IAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOZ,cAAc,CAACD,MAAU,CAAC,EAAE,UAAAE,QACjBF,EAAME,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQzB,SAAS,CAACF,MAAU,CAACE,MAAa;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AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,sBAAsB1B,GAAO,EAAE,UAAAE,GAAU,MAAAC,GAAM,eAAAS,KAAiB;AAEtD,UAAAe,IAAYC,EAAiBhB,CAAa;AAChD,IAAAiB,EAAQ,eAAe7B,GAAOE,GAAUC,GAAMwB,CAAU,GAE3C,aAAA,QAAQ,OAAOzB,CAAQ,IAAI,KAAK,UAAUF,EAAME,CAAQ,CAAC,CAAC;AAAA,EAC3E;AAAA,EACA,WAAWF,GAAO;AAEd,iBAAa,WAAW,cAAc,GACtC,aAAa,WAAW,gBAAgB,GAGxCA,EAAM,WAAW,IACjBA,EAAM,aAAa,IAGN,aAAA,QAAQ,gBAAgB,EAAK,GAC7B,aAAA,QAAQ,iBAAiB,EAAK;AAAA,EAC/C;AACJ,GAEM8B,IAAmB;AAAA,EACrB,OAAA9B;AAAA,EACA,SAAAC;AAAA,EACA,SAAAM;AAAA,EACA,WAAAiB;AACJ;"}
|
|
1
|
+
{"version":3,"file":"conversionStore.mjs","sources":["../../../../lib/data-provider-interface/store/modules/conversionStore.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable no-param-reassign, no-shadow, no-console */\nimport N3 from 'n3';\n\nimport { isEmpty, has } from 'lodash';\nimport datasetFactory from '@rdfjs/dataset';\n\nimport generalHelper from '../../utils/general-helper';\nimport toRDF from '../../utils/RDFconverter';\nimport toInput from '../../utils/inputConverter';\n\nconst state = {\n datasets: {},\n distributions: [],\n catalogues: {},\n deleteDistributionInline: false,\n};\n\nconst getters = {\n /**\n * Returns raw values for given property, page and distribution\n * @param state \n * @param0 Object containing property, page and distribution id\n * @returns Object conatining form values for given property, distribution and page\n */\n getRawValues: (state) => ({ property }) => {\n return state[property];\n },\n /**\n * Provides property data\n * @param state \n * @param property Property of wanted data\n * @returns Object containing all values of given property\n */\n getData: (state) => (property) => {\n let data;\n if (property === 'distributions') {\n data = [];\n for (let index = 0; index < state[property].length; index += 1) {\n const currentDistributionData = generalHelper.mergeNestedObjects(state[property][index]);\n data.push(currentDistributionData);\n }\n\n } else {\n data = generalHelper.mergeNestedObjects(state[property])\n }\n \n \n return data;\n },\n};\n\nconst actions = {\n /**\n * Saves values from input form to vuex store\n * @param param0 \n * @param param1 Object containing property, page, distrbution id and form values\n */\n saveFormValues({ commit }, { property, values }) {\n\n commit('saveFormValuesToStore', { property, values });\n\n },\n /**\n * Saving existing values from localStorage to vuex store\n * @param {*} param0\n * @param {*} param1 Object containing property (datasets/catalogues) and subpage (when curren tprofile is distributions)\n */\n saveLocalstorageValues({ commit }, property) {\n commit('saveFromLocalstorage', property);\n },\n /**\n * Fetches data, writes it to a dataset and calls method for actual conversion to input format\n * @param param0 \n * @param param1 Object containing endpoint and token for data fetching as well as property\n */\n async convertToInput({ commit, rootGetters }, { endpoint, token, property }) {\n const specification = rootGetters['dpiStore/getSpecification'];\n const fetchedData = await generalHelper.fetchLinkedData(endpoint, token).then((response) => {\n return response;\n });\n\n const parser = new N3.Parser();\n const data = datasetFactory.dataset();\n\n // adding quads to dataset\n await parser.parse(fetchedData, (error, quad, prefixes) => {\n if (quad) data.add(quad);\n })\n\n commit('saveLinkedDataToStore', { property, data, specification });\n },\n /**\n * Merges store data and converts the given input values into RDF format\n * @param state \n * @param property Object containing all values within nested objects for each page of the frontend\n * @returns Data values in RDF format\n */\n convertToRDF({ state, rootGetters }, { property }) {\n const specification = rootGetters['dpiStore/getSpecification'];\n\n // merging objects with nested objects containing the values of each page into one main object containing all values for the given property\n const data = {\n datasets: generalHelper.mergeNestedObjects(state.datasets),\n distributions: [],\n catalogues: generalHelper.mergeNestedObjects(state.catalogues)\n };\n\n // merging each distribution object within the overall array of distributions\n if (has(state.datasets, 'Distributions') && has(state.datasets.Distributions, 'distributionList') && !isEmpty(state.datasets.Distributions.distributionList)) {\n for (let index = 0; index < state.datasets.Distributions.distributionList.length; index++) {\n data.distributions.push(generalHelper.mergeNestedObjects(state.datasets.Distributions.distributionList[index]))\n }\n }\n\n const RDFdata = toRDF.convertToRDF(data, property, specification);\n\n return RDFdata;\n },\n /**\n * Calls mutation to clear values and store\n * @param param0 \n */\n clearAll({ commit }) {\n commit('resetStore');\n }, \n};\n\nconst mutations = {\n /**\n * Saves input values from form into vuex as well as into localStorage of browser\n * @param state \n * @param param1 Object containing the property, page and values of input form\n */\n saveFormValuesToStore(state, { property, values }) {\n\n state[property] = values;\n\n // save to local storage\n localStorage.setItem(`dpi_${property}`, JSON.stringify(state[property]));\n },\n /**\n * Save input form values from localStorage into vuex store\n * @param {*} state\n * @param {String} property Property name the data should be saved to (datasets/distributions/catalogues)\n */\n saveFromLocalstorage(state, property) {\n let valueName;\n\n if (property === 'catalogues') {\n valueName = 'dpi_catalogues';\n } else {\n valueName = 'dpi_datasets';\n }\n\n // extract catalogues or datasets data\n if (Object.keys(localStorage).includes(valueName)) {\n const localStorageData = JSON.parse(localStorage.getItem(valueName));\n if (property === 'catalogues') state[property] = localStorageData;\n else state.datasets = localStorageData;\n }\n },\n /**\n * Converts RDF data into input form data\n * @param state \n * @param param1 Object containing data and property and state\n */\n saveLinkedDataToStore(state, { property, data, specification }) {\n\n const dpiConfig = specification;\n toInput.convertToInput(state, property, data, dpiConfig );\n\n localStorage.setItem(`dpi_${property}`, JSON.stringify(state[property]));\n },\n resetStore(state) {\n // remove dpi values from local store\n localStorage.removeItem('dpi_datasets');\n localStorage.removeItem('dpi_catalogues');\n\n // resetting all store data properties\n state.datasets = {};\n state.catalogues = {};\n\n // edit and draft mode not within this store so resetting via local storage\n localStorage.setItem('dpi_editmode', false);\n localStorage.setItem('dpi_draftmode', false);\n },\n};\n\nconst conversionModule = {\n state,\n getters,\n actions,\n mutations\n};\n\nexport default conversionModule;\n"],"names":["state","getters","property","data","index","currentDistributionData","generalHelper","actions","commit","values","rootGetters","endpoint","token","specification","fetchedData","response","parser","N3","datasetFactory","error","quad","prefixes","has","isEmpty","toRDF","mutations","valueName","localStorageData","dpiConfig","toInput","conversionModule"],"mappings":";;;;;;AAWA,MAAMA,IA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CAAC,CAAC;AAAA,EAC3E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,qBAAqBF,GAAOE,GAAU;AAC9B,QAAAwB;AASJ,QAPIxB,MAAa,eACDwB,IAAA,mBAEAA,IAAA,gBAIZ,OAAO,KAAK,YAAY,EAAE,SAASA,CAAS,GAAG;AAC/C,YAAMC,IAAmB,KAAK,MAAM,aAAa,QAAQD,CAAS,CAAC;AACnE,MAAIxB,MAAa,eAAcF,EAAME,CAAQ,IAAIyB,IAC5C3B,EAAM,WAAW2B;AAAA,IAC1B;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,sBAAsB3B,GAAO,EAAE,UAAAE,GAAU,MAAAC,GAAM,eAAAU,KAAiB;AAE5D,UAAMe,IAAYf;AAClB,IAAAgB,EAAQ,eAAe7B,GAAOE,GAAUC,GAAMyB,CAAU,GAE3C,aAAA,QAAQ,OAAO1B,CAAQ,IAAI,KAAK,UAAUF,EAAME,CAAQ,CAAC,CAAC;AAAA,EAC3E;AAAA,EACA,WAAWF,GAAO;AAEd,iBAAa,WAAW,cAAc,GACtC,aAAa,WAAW,gBAAgB,GAGxCA,EAAM,WAAW,IACjBA,EAAM,aAAa,IAGN,aAAA,QAAQ,gBAAgB,EAAK,GAC7B,aAAA,QAAQ,iBAAiB,EAAK;AAAA,EAC/C;AACJ,GAEM8B,IAAmB;AAAA,EACrB,OAAA9B;AAAA,EACA,SAAAC;AAAA,EACA,SAAAM;AAAA,EACA,WAAAkB;AACJ;"}
|
|
@@ -5,6 +5,7 @@ declare const formModule: {
|
|
|
5
5
|
distributions: {};
|
|
6
6
|
catalogues: {};
|
|
7
7
|
};
|
|
8
|
+
usersCatalogs: {};
|
|
8
9
|
};
|
|
9
10
|
getters: {
|
|
10
11
|
getSchema: (state: any) => (property: any) => any;
|
|
@@ -15,12 +16,13 @@ declare const formModule: {
|
|
|
15
16
|
* @param {Object} param0
|
|
16
17
|
* @param {Object} param1 Object containing property (datasets/catalogues), page (step1/step2/step3) and subpage (distribution1/distribution2/distribution3) of current view
|
|
17
18
|
*/
|
|
18
|
-
createSchema({ commit }: {
|
|
19
|
+
createSchema({ commit, state, rootGetters }: {
|
|
19
20
|
commit: any;
|
|
20
|
-
|
|
21
|
+
state: any;
|
|
22
|
+
rootGetters: any;
|
|
23
|
+
}, { property, page }: {
|
|
21
24
|
property: any;
|
|
22
25
|
page: any;
|
|
23
|
-
specification: any;
|
|
24
26
|
}): void;
|
|
25
27
|
/**
|
|
26
28
|
* Calls mutation function for translating translatable properties of schema
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { isEmpty as r } from "lodash-es";
|
|
2
|
-
import m from "../../config/dpi-spec-config.mjs";
|
|
3
2
|
import l from "../../utils/translation-helper.mjs";
|
|
4
|
-
const
|
|
3
|
+
const m = {
|
|
5
4
|
schema: {
|
|
6
5
|
datasets: {},
|
|
7
6
|
distributions: {},
|
|
8
7
|
catalogues: {}
|
|
9
|
-
}
|
|
10
|
-
|
|
8
|
+
},
|
|
9
|
+
usersCatalogs: {}
|
|
10
|
+
}, h = {
|
|
11
11
|
getSchema: (e) => (t) => e.schema[t]
|
|
12
12
|
}, d = {
|
|
13
13
|
/**
|
|
@@ -15,9 +15,9 @@ const h = {
|
|
|
15
15
|
* @param {Object} param0
|
|
16
16
|
* @param {Object} param1 Object containing property (datasets/catalogues), page (step1/step2/step3) and subpage (distribution1/distribution2/distribution3) of current view
|
|
17
17
|
*/
|
|
18
|
-
createSchema({ commit: e }, { property:
|
|
19
|
-
const s =
|
|
20
|
-
e("extractSchema", { pageProperties: o, propertyDefinitions:
|
|
18
|
+
createSchema({ commit: e, state: t, rootGetters: a }, { property: n, page: c }) {
|
|
19
|
+
const s = a["dpiStore/getSpecification"], o = s.pageConent[n][c], i = s.inputDefinition[n];
|
|
20
|
+
e("extractSchema", { pageProperties: o, propertyDefinitions: i, property: n, page: c });
|
|
21
21
|
},
|
|
22
22
|
/**
|
|
23
23
|
* Calls mutation function for translating translatable properties of schema
|
|
@@ -34,24 +34,24 @@ const h = {
|
|
|
34
34
|
addCatalogOptions({ commit: e }, { property: t, catalogs: a }) {
|
|
35
35
|
e("saveCatalogOptions", { property: t, catalogs: a });
|
|
36
36
|
}
|
|
37
|
-
},
|
|
37
|
+
}, f = {
|
|
38
38
|
/**
|
|
39
39
|
* Builds schema based on given pageProperties and their definitions provided by propertyDefinition
|
|
40
40
|
* @param {Object} state
|
|
41
41
|
* @param {Object} param1 Object containing the properties which should be displayed within the view
|
|
42
42
|
* (pageProperties) and the form definitions of the properties defined by DCATAP (propertyDefinition)
|
|
43
43
|
*/
|
|
44
|
-
extractSchema(e, { pageProperties: t, propertyDefinitions: a, property:
|
|
45
|
-
const
|
|
46
|
-
for (let
|
|
47
|
-
const i = t[
|
|
44
|
+
extractSchema(e, { pageProperties: t, propertyDefinitions: a, property: n, page: c }) {
|
|
45
|
+
const s = [];
|
|
46
|
+
for (let o = 0; o < t.length; o += 1) {
|
|
47
|
+
const i = t[o];
|
|
48
48
|
try {
|
|
49
|
-
|
|
49
|
+
s.push(a[i]);
|
|
50
50
|
} catch {
|
|
51
51
|
console.warn(`DCATAP doens't include a property called: ${i}`);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
e.schema[
|
|
54
|
+
e.schema[n][c] = s;
|
|
55
55
|
},
|
|
56
56
|
/**
|
|
57
57
|
* All translatable properties within the existing schema will be translated and added to the schema
|
|
@@ -68,28 +68,28 @@ const h = {
|
|
|
68
68
|
*/
|
|
69
69
|
saveCatalogOptions(e, { property: t, catalogs: a }) {
|
|
70
70
|
if (t === "datasets") {
|
|
71
|
-
let
|
|
72
|
-
for (let
|
|
73
|
-
const
|
|
74
|
-
r(
|
|
71
|
+
let n;
|
|
72
|
+
for (let c in e.schema[t]) {
|
|
73
|
+
const s = e.schema[t][c].filter((o) => o.name === "dcat:catalog");
|
|
74
|
+
r(s) || (n = s[0]);
|
|
75
75
|
}
|
|
76
|
-
if (!r(
|
|
77
|
-
const
|
|
78
|
-
for (let
|
|
79
|
-
const
|
|
80
|
-
|
|
76
|
+
if (!r(n)) {
|
|
77
|
+
const c = {};
|
|
78
|
+
for (let s = 0; s < a.length; s += 1) {
|
|
79
|
+
const o = a[s];
|
|
80
|
+
c[o] = o;
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
n.options = c;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
},
|
|
87
|
-
state:
|
|
88
|
-
getters:
|
|
86
|
+
}, S = {
|
|
87
|
+
state: m,
|
|
88
|
+
getters: h,
|
|
89
89
|
actions: d,
|
|
90
|
-
mutations:
|
|
90
|
+
mutations: f
|
|
91
91
|
};
|
|
92
92
|
export {
|
|
93
|
-
|
|
93
|
+
S as default
|
|
94
94
|
};
|
|
95
95
|
//# sourceMappingURL=formSchemaStore.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formSchemaStore.mjs","sources":["../../../../lib/data-provider-interface/store/modules/formSchemaStore.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable no-param-reassign, no-shadow, no-console */\nimport { isEmpty } from 'lodash-es';\
|
|
1
|
+
{"version":3,"file":"formSchemaStore.mjs","sources":["../../../../lib/data-provider-interface/store/modules/formSchemaStore.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable no-param-reassign, no-shadow, no-console */\nimport { isEmpty } from 'lodash-es';\n\n// external translation method\nimport translate from '../../utils/translation-helper';\n\nconst state = {\n schema: {\n datasets: {},\n distributions: {},\n catalogues: {}\n },\n usersCatalogs: {}\n};\n\nconst getters = {\n getSchema: (state) => (property) => { \n return state.schema[property];\n },\n};\n\nconst actions = {\n /**\n * Commits page properties and related DCATAP property definitions for current view for later building of schema\n * @param {Object} param0\n * @param {Object} param1 Object containing property (datasets/catalogues), page (step1/step2/step3) and subpage (distribution1/distribution2/distribution3) of current view\n */\n createSchema({ commit, state, rootGetters }, { property, page }) {\n\n const dpiConfig = rootGetters['dpiStore/getSpecification'];\n const pageProperties = dpiConfig.pageConent[property][page]\n const propertyDefinitions = dpiConfig.inputDefinition[property]\n commit('extractSchema', { pageProperties, propertyDefinitions, property, page });\n\n },\n /**\n * Calls mutation function for translating translatable properties of schema\n * @param {*} param0\n */\n translateSchema({ commit }, { property, page }) {\n\n commit('translateSchemaProperties', { property, page });\n },\n /**\n * Commits current property and users catalogs to mutation function\n * @param {*} param0\n * @param {*} param1 Object containing curren tproperty (datasets/catalogues) and all catalog options the user has permissions for\n */\n addCatalogOptions({ commit }, { property, catalogs }) {\n commit('saveCatalogOptions', { property, catalogs });\n },\n};\n\nconst mutations = {\n /**\n * Builds schema based on given pageProperties and their definitions provided by propertyDefinition\n * @param {Object} state\n * @param {Object} param1 Object containing the properties which should be displayed within the view\n * (pageProperties) and the form definitions of the properties defined by DCATAP (propertyDefinition)\n */\n extractSchema(state, { pageProperties, propertyDefinitions, property, page }) {\n // important: create new empty schema each time so already existing schema will be overwritten on route/view-change\n const newSchema = [];\n\n for (let index = 0; index < pageProperties.length; index += 1) {\n const propertyKey = pageProperties[index];\n try {\n newSchema.push(propertyDefinitions[propertyKey]);\n } catch (err) {\n console.warn(`DCATAP doens't include a property called: ${propertyKey}`);\n }\n }\n\n state.schema[property][page] = newSchema;\n },\n /**\n * All translatable properties within the existing schema will be translated and added to the schema\n * @param {*} state\n * @param {String} property String defining current property (datasets/ distribution/ catalogues)\n */\n translateSchemaProperties(state, { property, page }) {\n translate(state.schema[property][page], property);\n },\n /**\n * Saves all catalogs the current user has permissions for as options within the schema\n * @param {*} state\n * @param {*} param1 Object containing current property and the users catalog options\n */\n saveCatalogOptions(state, { property, catalogs }) {\n if (property === 'datasets') {\n\n let catalogSchema;\n for (let key in state.schema[property]) {\n const currentSchema = state.schema[property][key].filter(dataset => dataset.name === \"dcat:catalog\");\n if (!isEmpty(currentSchema)) catalogSchema = currentSchema[0];\n }\n\n if (!isEmpty(catalogSchema)) {\n const catalogOptions = {};\n for (let index = 0; index < catalogs.length; index += 1) {\n const value = catalogs[index];\n catalogOptions[value] = value;\n }\n catalogSchema.options = catalogOptions;\n }\n }\n },\n};\n\nconst formModule = {\n state,\n getters,\n actions,\n mutations\n};\n\nexport default formModule;\n"],"names":["state","getters","property","actions","commit","rootGetters","page","dpiConfig","pageProperties","propertyDefinitions","catalogs","mutations","newSchema","index","propertyKey","translate","catalogSchema","key","currentSchema","dataset","isEmpty","catalogOptions","value","formModule"],"mappings":";;AAOA,MAAMA,IAAQ;AAAA,EACV,QAAQ;AAAA,IACJ,UAAU,CAAC;AAAA,IACX,eAAe,CAAC;AAAA,IAChB,YAAY,CAAC;AAAA,EACjB;AAAA,EACA,eAAe,CAAC;AACpB,GAEMC,IAAU;AAAA,EACZ,WAAW,CAACD,MAAU,CAACE,MACZF,EAAM,OAAOE,CAAQ;AAEpC,GAEMC,IAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMZ,aAAa,EAAE,QAAAC,GAAQ,OAAAJ,GAAO,aAAAK,KAAe,EAAE,UAAAH,GAAU,MAAAI,KAAQ;AAEvD,UAAAC,IAAYF,EAAY,2BAA2B,GACnDG,IAAiBD,EAAU,WAAWL,CAAQ,EAAEI,CAAI,GACpDG,IAAsBF,EAAU,gBAAgBL,CAAQ;AAC9D,IAAAE,EAAO,iBAAiB,EAAE,gBAAAI,GAAgB,qBAAAC,GAAqB,UAAAP,GAAU,MAAAI,GAAM;AAAA,EAEnF;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,gBAAgB,EAAE,QAAAF,EAAA,GAAU,EAAE,UAAAF,GAAU,MAAAI,KAAQ;AAE5C,IAAAF,EAAO,6BAA6B,EAAE,UAAAF,GAAU,MAAAI,EAAM,CAAA;AAAA,EAC1D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,kBAAkB,EAAE,QAAAF,EAAA,GAAU,EAAE,UAAAF,GAAU,UAAAQ,KAAY;AAClD,IAAAN,EAAO,sBAAsB,EAAE,UAAA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AA,QAC5B;AACA,QAAAN,EAAc,UAAUK;AAAA,MAC5B;AAAA,IACJ;AAAA,EACJ;AACJ,GAEME,IAAa;AAAA,EACf,OAAAvB;AAAA,EACA,SAAAC;AAAA,EACA,SAAAE;AAAA,EACA,WAAAQ;AACJ;"}
|
|
@@ -7,7 +7,7 @@ declare const navigationModule: {
|
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
9
|
getters: {
|
|
10
|
-
getNavSteps: (state: any) => (specification: any) => any;
|
|
10
|
+
getNavSteps: (state: any, _getters: any, _rootState: any, rootGetters: any) => (specification: any) => any;
|
|
11
11
|
};
|
|
12
12
|
actions: {};
|
|
13
13
|
mutations: {};
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
const n = {
|
|
1
|
+
const a = {
|
|
3
2
|
navigation: {
|
|
4
3
|
datasets: [],
|
|
5
4
|
distributions: [],
|
|
6
5
|
catalogues: []
|
|
7
6
|
}
|
|
8
|
-
},
|
|
9
|
-
getNavSteps: (t) => (
|
|
10
|
-
const
|
|
11
|
-
return
|
|
7
|
+
}, o = {
|
|
8
|
+
getNavSteps: (t, c, u, n) => (d) => {
|
|
9
|
+
const e = n["dpiStore/getSpecification"];
|
|
10
|
+
return s(e), t.navigation;
|
|
12
11
|
}
|
|
13
12
|
};
|
|
14
|
-
function
|
|
15
|
-
|
|
13
|
+
function s(t) {
|
|
14
|
+
a.navigation.datasets = Object.keys(t.pageConent.datasets), a.navigation.distributions = Object.keys(t.pageConent.distributions), a.navigation.catalogues = Object.keys(t.pageConent.catalogues);
|
|
16
15
|
}
|
|
17
|
-
const
|
|
18
|
-
state:
|
|
19
|
-
getters:
|
|
20
|
-
actions:
|
|
21
|
-
mutations:
|
|
16
|
+
const i = {}, g = {}, r = {
|
|
17
|
+
state: a,
|
|
18
|
+
getters: o,
|
|
19
|
+
actions: i,
|
|
20
|
+
mutations: g
|
|
22
21
|
};
|
|
23
22
|
export {
|
|
24
|
-
|
|
23
|
+
r as default
|
|
25
24
|
};
|
|
26
25
|
//# sourceMappingURL=navigationStore.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigationStore.mjs","sources":["../../../../lib/data-provider-interface/store/modules/navigationStore.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable no-param-reassign, no-shadow, no-console */\n\
|
|
1
|
+
{"version":3,"file":"navigationStore.mjs","sources":["../../../../lib/data-provider-interface/store/modules/navigationStore.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable no-param-reassign, no-shadow, no-console */\n\nconst state = {\n navigation: {\n datasets: [],\n distributions: [],\n catalogues: [],\n }\n};\n\nconst getters = {\n getNavSteps: (state, _getters, _rootState, rootGetters) => (specification) => {\n const dpiConfig = rootGetters['dpiStore/getSpecification'];\n setConfig(dpiConfig);\n \n return state.navigation;\n },\n};\nfunction setConfig(specification) {\n state.navigation.datasets = Object.keys(specification.pageConent.datasets);\n state.navigation.distributions = Object.keys(specification.pageConent.distributions);\n state.navigation.catalogues = Object.keys(specification.pageConent.catalogues);\n}\n\nconst actions = {};\nconst mutations = {};\n\nconst navigationModule = {\n state,\n getters,\n actions,\n mutations\n};\n\nexport default navigationModule;"],"names":["state","getters","_getters","_rootState","rootGetters","specification","dpiConfig","setConfig","actions","mutations","navigationModule"],"mappings":"AAGA,MAAMA,IAAQ;AAAA,EACV,YAAY;AAAA,IACR,UAAU,CAAC;AAAA,IACX,eAAe,CAAC;AAAA,IAChB,YAAY,CAAC;AAAA,EACjB;AACJ,GAEMC,IAAU;AAAA,EACZ,aAAa,CAACD,GAAOE,GAAUC,GAAYC,MAAgB,CAACC,MAAkB;AACpE,UAAAC,IAAYF,EAAY,2BAA2B;AACzD,WAAAG,EAAUD,CAAS,GAEZN,EAAM;AAAA,EACjB;AACJ;AACA,SAASO,EAAUF,GAAe;AAC9B,EAAAL,EAAM,WAAW,WAAW,OAAO,KAAKK,EAAc,WAAW,QAAQ,GACzEL,EAAM,WAAW,gBAAgB,OAAO,KAAKK,EAAc,WAAW,aAAa,GACnFL,EAAM,WAAW,aAAa,OAAO,KAAKK,EAAc,WAAW,UAAU;AACjF;AAEA,MAAMG,IAAU,CAAA,GACVC,IAAY,CAAA,GAEZC,IAAmB;AAAA,EACrB,OAAAV;AAAA,EACA,SAAAC;AAAA,EACA,SAAAO;AAAA,EACA,WAAAC;AACJ;"}
|