@piveau/piveau-hub-ui-modules 4.3.1 → 4.3.3
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/composables/useRuntimeEnv.d.ts +1 -1
- package/dist/configurations/config-schema/apiSchema.d.ts +3 -3
- package/dist/configurations/config-schema/apiSchema.mjs +1 -1
- package/dist/configurations/config-schema/apiSchema.mjs.map +1 -1
- package/dist/configurations/config-schema/configSchema.d.ts +5 -5
- package/dist/data-provider-interface/DPIMenu.vue.mjs +37 -36
- package/dist/data-provider-interface/DPIMenu.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/AutocompleteInput.vue.mjs +149 -135
- package/dist/data-provider-interface/components/AutocompleteInput.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/ConditionalInput.vue.mjs +152 -140
- package/dist/data-provider-interface/components/ConditionalInput.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/DistributionStepper.vue.mjs +60 -60
- package/dist/data-provider-interface/components/DistributionStepper.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/Dropup.vue.mjs +17 -17
- package/dist/data-provider-interface/components/Dropup.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/Dropup.vue2.mjs +2 -2
- package/dist/data-provider-interface/components/FileUpload.vue.d.ts +5 -2
- package/dist/data-provider-interface/components/FileUpload.vue.mjs +119 -117
- package/dist/data-provider-interface/components/FileUpload.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/Navigation.vue.d.ts +1 -1
- package/dist/data-provider-interface/components/Navigation.vue.mjs +69 -69
- package/dist/data-provider-interface/components/Navigation.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/SimpleInput.vue.mjs +19 -14
- package/dist/data-provider-interface/components/SimpleInput.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/SimpleSelect.vue.mjs +31 -31
- package/dist/data-provider-interface/components/SimpleSelect.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/SpatialInput.vue.mjs +90 -94
- package/dist/data-provider-interface/components/SpatialInput.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/SpatialInput.vue2.mjs +2 -2
- package/dist/data-provider-interface/components/UniqueIdentifierInput.vue.mjs +41 -30
- package/dist/data-provider-interface/components/UniqueIdentifierInput.vue.mjs.map +1 -1
- package/dist/data-provider-interface/config/dcatapde/input-definition.mjs +81 -78
- package/dist/data-provider-interface/config/dcatapde/input-definition.mjs.map +1 -1
- package/dist/data-provider-interface/config/dcatapdeODB/format-types.mjs +3 -272
- package/dist/data-provider-interface/config/dcatapdeODB/format-types.mjs.map +1 -1
- package/dist/data-provider-interface/config/dcatapdeODB/input-definition.d.ts +4 -15
- package/dist/data-provider-interface/config/dcatapdeODB/input-definition.mjs +13 -2081
- package/dist/data-provider-interface/config/dcatapdeODB/input-definition.mjs.map +1 -1
- package/dist/data-provider-interface/config/dcatapdeODB/page-content-config.mjs +3 -21
- package/dist/data-provider-interface/config/dcatapdeODB/page-content-config.mjs.map +1 -1
- package/dist/data-provider-interface/config/dcatapdeODB/prefixes.mjs +3 -24
- package/dist/data-provider-interface/config/dcatapdeODB/prefixes.mjs.map +1 -1
- package/dist/data-provider-interface/config/dcatapdeODB/vocab-prefixes.mjs +3 -31
- package/dist/data-provider-interface/config/dcatapdeODB/vocab-prefixes.mjs.map +1 -1
- package/dist/data-provider-interface/config/dpi-spec-config.mjs +8 -8
- package/dist/data-provider-interface/config/dpi-spec-config.mjs.map +1 -1
- package/dist/data-provider-interface/views/DistributionInputPage.vue.mjs +52 -52
- package/dist/data-provider-interface/views/DistributionInputPage.vue.mjs.map +1 -1
- package/dist/data-provider-interface/views/DraftsPage.vue.d.ts +1 -1
- package/dist/data-provider-interface/views/DraftsPage.vue.mjs +127 -138
- package/dist/data-provider-interface/views/DraftsPage.vue.mjs.map +1 -1
- package/dist/data-provider-interface/views/InputPage.vue.mjs +68 -68
- package/dist/data-provider-interface/views/InputPage.vue.mjs.map +1 -1
- package/dist/data-provider-interface/views/UserCataloguesPage.vue.mjs +31 -31
- package/dist/data-provider-interface/views/UserCataloguesPage.vue.mjs.map +1 -1
- package/dist/form/Repeatable.vue.mjs +37 -37
- package/dist/form/Repeatable.vue.mjs.map +1 -1
- package/dist/modal/AppConfirmationDialog.vue.d.ts +3 -1
- package/dist/modal/AppConfirmationDialog.vue.mjs +45 -39
- package/dist/modal/AppConfirmationDialog.vue.mjs.map +1 -1
- package/dist/piveau-hub-ui-modules.css +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { mapGetters as x, mapActions as
|
|
1
|
+
import { mapGetters as x, mapActions as b } from "vuex";
|
|
2
2
|
import C from "axios";
|
|
3
3
|
import V from "../utils/general-helper.mjs";
|
|
4
4
|
import { getNode as E } from "@formkit/core";
|
|
5
|
-
import { reactive as S, ref as O, resolveComponent as
|
|
6
|
-
import { onClickOutside as
|
|
7
|
-
import { useRuntimeEnv as
|
|
5
|
+
import { reactive as S, ref as O, resolveComponent as A, openBlock as a, createElementBlock as n, Fragment as y, createElementVNode as u, createVNode as L, createTextVNode as r, toDisplayString as f, createCommentVNode as c, mergeProps as T, withDirectives as G, vModelText as P, renderList as q, pushScopeId as D, popScopeId as N } from "vue";
|
|
6
|
+
import { onClickOutside as I } from "../../external/@vueuse/core/index";
|
|
7
|
+
import { useRuntimeEnv as B } from "../../composables/useRuntimeEnv.mjs";
|
|
8
8
|
import "@formkit/vue";
|
|
9
|
+
import { useI18n as H } from "vue-i18n";
|
|
9
10
|
import "./FileUpload.vue2.mjs";
|
|
10
|
-
import
|
|
11
|
-
const
|
|
11
|
+
import K from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
12
|
+
const M = {
|
|
12
13
|
props: {
|
|
13
14
|
context: {
|
|
14
15
|
type: Object,
|
|
@@ -16,7 +17,7 @@ const H = {
|
|
|
16
17
|
}
|
|
17
18
|
},
|
|
18
19
|
data() {
|
|
19
|
-
var
|
|
20
|
+
var t;
|
|
20
21
|
return {
|
|
21
22
|
inputChoice: "",
|
|
22
23
|
error: "",
|
|
@@ -27,7 +28,7 @@ const H = {
|
|
|
27
28
|
isLoading: !1,
|
|
28
29
|
success: !1,
|
|
29
30
|
fail: !1,
|
|
30
|
-
validExtensions: ((
|
|
31
|
+
validExtensions: ((t = this.$env.content.dataProviderInterface.uploadFileTypes) == null ? void 0 : t.split(",")) || []
|
|
31
32
|
};
|
|
32
33
|
},
|
|
33
34
|
computed: {
|
|
@@ -43,18 +44,18 @@ const H = {
|
|
|
43
44
|
}
|
|
44
45
|
},
|
|
45
46
|
methods: {
|
|
46
|
-
...
|
|
47
|
+
...b("dpiStore", [
|
|
47
48
|
"saveLocalstorageValues"
|
|
48
49
|
]),
|
|
49
50
|
toggleUploadUrl() {
|
|
50
|
-
this.inputChoice = "
|
|
51
|
+
this.inputChoice = this.t("message.dataupload.datasets.conditional.fileupload"), this.uploadURL && (this.uploadURL = !this.uploadURL);
|
|
51
52
|
},
|
|
52
53
|
toggleUploadFileSwitch() {
|
|
53
|
-
this.inputChoice = "
|
|
54
|
+
this.inputChoice = this.t("message.dataupload.datasets.conditional.URL"), this.uploadFileSwitch && (this.uploadFileSwitch = !this.uploadFileSwitch);
|
|
54
55
|
},
|
|
55
|
-
validateFile(
|
|
56
|
-
const l = "." +
|
|
57
|
-
this.validExtensions && this.validExtensions.length ? this.validExtensions.includes(l) ? this.uploadOrReplaceFile({ file:
|
|
56
|
+
validateFile(t) {
|
|
57
|
+
const l = "." + t.target.files[0].name.split(".").pop().toLowerCase();
|
|
58
|
+
this.validExtensions && this.validExtensions.length ? this.validExtensions.includes(l) ? this.uploadOrReplaceFile({ file: t.target.files[0] }) : console.log("Wrong filetype") : (this.error = "", this.uploadOrReplaceFile({ file: t.target.files[0] }));
|
|
58
59
|
},
|
|
59
60
|
async saveUrl() {
|
|
60
61
|
this.URLValue.includes("http://") || this.URLValue.includes("https://") ? await this.context.node.input({ "@id": this.URLValue, mode: this.inputChoice }) : await this.context.node.input({ "@id": "https://" + this.URLValue, mode: this.inputChoice });
|
|
@@ -64,8 +65,8 @@ const H = {
|
|
|
64
65
|
return this.URLValue = this.context.value["@id"], !0;
|
|
65
66
|
},
|
|
66
67
|
// finds the parent input group of a given element.
|
|
67
|
-
findParentInputGroupOfElement(
|
|
68
|
-
let e =
|
|
68
|
+
findParentInputGroupOfElement(t) {
|
|
69
|
+
let e = t;
|
|
69
70
|
for (; e; ) {
|
|
70
71
|
if (e.classList.contains("formkit-input-group-repeatable"))
|
|
71
72
|
return e;
|
|
@@ -75,41 +76,41 @@ const H = {
|
|
|
75
76
|
},
|
|
76
77
|
// finds the index of the distribution access URL based on the root of this component.
|
|
77
78
|
findDistributionAccessUrlIndex() {
|
|
78
|
-
const
|
|
79
|
+
const t = this.$refs.fileupload, e = this.findParentInputGroupOfElement(t);
|
|
79
80
|
if (!e)
|
|
80
81
|
return null;
|
|
81
82
|
const s = e.parentElement.querySelectorAll(".formkit-input-group-repeatable");
|
|
82
83
|
return Array.from(s).indexOf(e);
|
|
83
84
|
},
|
|
84
|
-
async uploadOrReplaceFile({ file:
|
|
85
|
-
var s,
|
|
86
|
-
const e = ((
|
|
85
|
+
async uploadOrReplaceFile({ file: t }) {
|
|
86
|
+
var s, i, d, p, o, h, v;
|
|
87
|
+
const e = ((d = (i = (s = this.$env) == null ? void 0 : s.content) == null ? void 0 : i.dataProviderInterface) == null ? void 0 : d.enableFileUploadReplace) || !1, l = ((p = this.$route.query) == null ? void 0 : p.edit) ?? !1;
|
|
87
88
|
if (e && l) {
|
|
88
|
-
const
|
|
89
|
+
const _ = (o = this.$route.query) == null ? void 0 : o.edit, k = this.findDistributionAccessUrlIndex(), m = (h = this.getData("distributions")) == null ? void 0 : h[_], g = (v = m == null ? void 0 : m["dcat:accessURL"]) == null ? void 0 : v[k], U = g == null ? void 0 : g["@id"];
|
|
89
90
|
if (U) {
|
|
90
|
-
const R = this.$env.api.fileUploadUrl,
|
|
91
|
-
return await this.uploadFile(
|
|
91
|
+
const R = this.$env.api.fileUploadUrl, F = V.getFileIdByAccessUrl({ accessUrl: U, fileUploadUrl: R });
|
|
92
|
+
return await this.uploadFile(t, {
|
|
92
93
|
method: "PUT",
|
|
93
|
-
url: `${this.$env.api.fileUploadUrl}data/${
|
|
94
|
+
url: `${this.$env.api.fileUploadUrl}data/${F}?catalog=${this.getCatalogue}`
|
|
94
95
|
});
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
|
-
return await this.uploadFile(
|
|
98
|
+
return await this.uploadFile(t);
|
|
98
99
|
},
|
|
99
|
-
async uploadFile(
|
|
100
|
+
async uploadFile(t, e = {}) {
|
|
100
101
|
this.isLoading = !0;
|
|
101
102
|
const l = new FormData();
|
|
102
|
-
l.append("file",
|
|
103
|
-
const s = this.getCatalogue,
|
|
103
|
+
l.append("file", t);
|
|
104
|
+
const s = this.getCatalogue, i = this.getUserData.rtpToken, d = {
|
|
104
105
|
method: "POST",
|
|
105
106
|
url: `${this.$env.api.fileUploadUrl}data?catalog=${s}`,
|
|
106
107
|
...e
|
|
107
108
|
}, p = {
|
|
108
|
-
method:
|
|
109
|
-
url:
|
|
109
|
+
method: d.method,
|
|
110
|
+
url: d.url,
|
|
110
111
|
headers: {
|
|
111
112
|
"Content-Type": "multipart/form-data",
|
|
112
|
-
Authorization: `Bearer ${
|
|
113
|
+
Authorization: `Bearer ${i}`
|
|
113
114
|
},
|
|
114
115
|
data: l
|
|
115
116
|
};
|
|
@@ -128,57 +129,56 @@ const H = {
|
|
|
128
129
|
});
|
|
129
130
|
},
|
|
130
131
|
setup() {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
var
|
|
132
|
+
const { t } = H();
|
|
133
|
+
B();
|
|
134
|
+
var e = S({
|
|
134
135
|
active: !1
|
|
135
136
|
});
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
const l = O("fload");
|
|
138
|
+
I(l, (i) => {
|
|
139
|
+
e.active = !1;
|
|
139
140
|
});
|
|
140
|
-
function
|
|
141
|
-
|
|
141
|
+
function s(i) {
|
|
142
|
+
e.active = !e.active;
|
|
142
143
|
}
|
|
143
144
|
return {
|
|
144
|
-
drop:
|
|
145
|
-
onClickOutside:
|
|
146
|
-
triggerDropdown:
|
|
147
|
-
|
|
148
|
-
placeholderMessage: e
|
|
145
|
+
drop: e,
|
|
146
|
+
onClickOutside: I,
|
|
147
|
+
triggerDropdown: s,
|
|
148
|
+
t
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
|
-
}, w = (
|
|
151
|
+
}, w = (t) => (D("data-v-a011305e"), t = t(), N(), t), W = { class: "position-relative w-100" }, j = {
|
|
152
152
|
key: 0,
|
|
153
153
|
ref: "fLoad",
|
|
154
154
|
class: "selectListUpload fileuploadList"
|
|
155
|
-
},
|
|
155
|
+
}, z = {
|
|
156
156
|
key: 0,
|
|
157
157
|
class: "w-100 position-relative"
|
|
158
|
-
},
|
|
158
|
+
}, J = ["data-type"], Q = { class: "file-div position-relative" }, X = ["accept"], Y = {
|
|
159
159
|
class: "upload-feedback position-absolute d-flex",
|
|
160
160
|
style: { right: "0" }
|
|
161
|
-
},
|
|
161
|
+
}, Z = {
|
|
162
162
|
key: 0,
|
|
163
163
|
class: "lds-ring"
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
],
|
|
167
|
-
|
|
168
|
-
],
|
|
164
|
+
}, $ = { key: 1 }, ee = /* @__PURE__ */ w(() => /* @__PURE__ */ u("i", { class: "material-icons d-flex check-icon" }, "check_circle", -1)), te = [
|
|
165
|
+
ee
|
|
166
|
+
], ie = { key: 2 }, oe = /* @__PURE__ */ w(() => /* @__PURE__ */ u("i", { class: "material-icons d-flex close-icon" }, "error", -1)), le = [
|
|
167
|
+
oe
|
|
168
|
+
], se = {
|
|
169
169
|
key: 0,
|
|
170
170
|
class: "dURLText my-3"
|
|
171
|
-
},
|
|
171
|
+
}, ae = ["href"], ne = {
|
|
172
172
|
key: 1,
|
|
173
173
|
class: "allowedTypesWrapper"
|
|
174
|
-
},
|
|
174
|
+
}, re = {
|
|
175
175
|
key: 0,
|
|
176
176
|
class: "errorSub my-3 d-flex"
|
|
177
|
-
},
|
|
178
|
-
function
|
|
179
|
-
const p =
|
|
180
|
-
return
|
|
181
|
-
|
|
177
|
+
}, de = { class: "d-flex flex-wrap w-100" };
|
|
178
|
+
function ue(t, e, l, s, i, d) {
|
|
179
|
+
const p = A("FormKit");
|
|
180
|
+
return a(), n(y, null, [
|
|
181
|
+
u("div", W, [
|
|
182
182
|
L(p, {
|
|
183
183
|
name: "mode",
|
|
184
184
|
validation: "required",
|
|
@@ -186,104 +186,106 @@ function de(i, e, l, s, t, a) {
|
|
|
186
186
|
class: "selectInputField formkit-inner",
|
|
187
187
|
readonly: "readonly",
|
|
188
188
|
onClick: e[0] || (e[0] = (o) => s.triggerDropdown()),
|
|
189
|
-
placeholder: s.
|
|
190
|
-
modelValue:
|
|
191
|
-
"onUpdate:modelValue": e[1] || (e[1] = (o) =>
|
|
189
|
+
placeholder: s.t("message.dataupload.info.preferredInput"),
|
|
190
|
+
modelValue: i.inputChoice,
|
|
191
|
+
"onUpdate:modelValue": e[1] || (e[1] = (o) => i.inputChoice = o),
|
|
192
192
|
"validation-messages": {
|
|
193
|
-
required: s.
|
|
193
|
+
required: s.t("message.dataupload.info.preferredInput")
|
|
194
194
|
}
|
|
195
195
|
}, null, 8, ["placeholder", "modelValue", "validation-messages"]),
|
|
196
|
-
|
|
197
|
-
s.drop.active ? (
|
|
198
|
-
|
|
196
|
+
r(),
|
|
197
|
+
s.drop.active ? (a(), n("ul", j, [
|
|
198
|
+
u("li", {
|
|
199
199
|
onClick: e[2] || (e[2] = (o) => {
|
|
200
|
-
|
|
200
|
+
i.uploadFileSwitch = !0, d.toggleUploadUrl();
|
|
201
201
|
}),
|
|
202
202
|
class: "p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC"
|
|
203
|
-
}, "
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
}, f(t.$t("message.dataupload.datasets.conditional.fileupload")), 1),
|
|
204
|
+
r(),
|
|
205
|
+
u("li", {
|
|
206
206
|
onClick: e[3] || (e[3] = (o) => {
|
|
207
|
-
|
|
207
|
+
i.uploadURL = !0, d.toggleUploadFileSwitch();
|
|
208
208
|
}),
|
|
209
209
|
class: "p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC"
|
|
210
|
-
}, "
|
|
211
|
-
], 512)) :
|
|
210
|
+
}, f(t.$t("message.dataupload.datasets.conditional.URL")), 1)
|
|
211
|
+
], 512)) : c("", !0)
|
|
212
212
|
]),
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
r(),
|
|
214
|
+
i.uploadURL && !i.uploadFileSwitch ? (a(), n("div", z, [
|
|
215
215
|
L(p, {
|
|
216
216
|
id: "aUrlLink",
|
|
217
|
-
modelValue:
|
|
218
|
-
"onUpdate:modelValue": e[4] || (e[4] = (o) =>
|
|
217
|
+
modelValue: i.URLValue,
|
|
218
|
+
"onUpdate:modelValue": e[4] || (e[4] = (o) => i.URLValue = o),
|
|
219
219
|
class: "selectInputField formkit-inner",
|
|
220
220
|
type: "url",
|
|
221
221
|
name: "@id",
|
|
222
|
-
|
|
222
|
+
placeholder: l.context.attrs.placeholder,
|
|
223
|
+
onInput: d.saveUrl,
|
|
223
224
|
validation: "required|url",
|
|
224
225
|
"validation-visibility": "live",
|
|
225
226
|
"validation-messages": {
|
|
226
|
-
required: s.
|
|
227
|
+
required: s.t("message.dataupload.datasets.conditional.URL"),
|
|
228
|
+
url: s.t("message.dataupload.info.urlFormat")
|
|
227
229
|
}
|
|
228
|
-
}, null, 8, ["modelValue", "onInput", "validation-messages"])
|
|
229
|
-
])) :
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
}, null, 8, ["modelValue", "placeholder", "onInput", "validation-messages"])
|
|
231
|
+
])) : c("", !0),
|
|
232
|
+
r(),
|
|
233
|
+
i.uploadFileSwitch ? (a(), n("div", T({
|
|
232
234
|
key: 1,
|
|
233
235
|
ref: "fileupload",
|
|
234
236
|
class: ["p-3 w-100", `formkit-input-element formkit-input-element--${l.context.type}`],
|
|
235
237
|
"data-type": l.context.type
|
|
236
|
-
},
|
|
237
|
-
|
|
238
|
+
}, t.$attrs), [
|
|
239
|
+
G(u("input", {
|
|
238
240
|
type: "text",
|
|
239
241
|
"onUpdate:modelValue": e[5] || (e[5] = (o) => l.context.model = o),
|
|
240
242
|
onBlur: e[6] || (e[6] = (...o) => l.context.blurHandler && l.context.blurHandler(...o)),
|
|
241
243
|
hidden: ""
|
|
242
244
|
}, null, 544), [
|
|
243
|
-
[
|
|
245
|
+
[P, l.context.model]
|
|
244
246
|
]),
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
247
|
+
r(),
|
|
248
|
+
u("div", Q, [
|
|
249
|
+
u("input", {
|
|
248
250
|
class: "mt-3",
|
|
249
251
|
type: "file",
|
|
250
252
|
id: "aUrlFL",
|
|
251
253
|
name: "fileUpload",
|
|
252
|
-
onChange: e[7] || (e[7] = (o) =>
|
|
253
|
-
accept:
|
|
254
|
-
}, null, 40,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
254
|
+
onChange: e[7] || (e[7] = (o) => d.validateFile(o)),
|
|
255
|
+
accept: i.validExtensions
|
|
256
|
+
}, null, 40, X),
|
|
257
|
+
r(),
|
|
258
|
+
u("div", Y, [
|
|
259
|
+
i.isLoading ? (a(), n("div", Z)) : c("", !0),
|
|
260
|
+
r(),
|
|
261
|
+
i.success ? (a(), n("div", $, te)) : c("", !0),
|
|
262
|
+
r(),
|
|
263
|
+
i.fail ? (a(), n("div", ie, le)) : c("", !0)
|
|
262
264
|
])
|
|
263
265
|
]),
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
r(),
|
|
267
|
+
i.success ? (a(), n("p", se, [
|
|
268
|
+
r(f(t.$t("message.metadata.downloadUrl")) + ": ", 1),
|
|
269
|
+
u("a", {
|
|
268
270
|
href: l.context.model
|
|
269
|
-
},
|
|
270
|
-
])) :
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
(
|
|
271
|
+
}, f(l.context.model), 9, ae)
|
|
272
|
+
])) : c("", !0),
|
|
273
|
+
r(),
|
|
274
|
+
i.validExtensions && i.validExtensions.length ? (a(), n("div", ne, [
|
|
275
|
+
i.success ? c("", !0) : (a(), n("p", re, "Allowed types: ")),
|
|
276
|
+
r(),
|
|
277
|
+
u("div", de, [
|
|
278
|
+
(a(!0), n(y, null, q(i.validExtensions, (o) => (a(), n("span", {
|
|
277
279
|
key: o,
|
|
278
280
|
class: "mr-1 mb-1 allowedFTypes"
|
|
279
|
-
},
|
|
281
|
+
}, f(o), 1))), 128))
|
|
280
282
|
])
|
|
281
|
-
])) :
|
|
282
|
-
], 16,
|
|
283
|
+
])) : c("", !0)
|
|
284
|
+
], 16, J)) : c("", !0)
|
|
283
285
|
], 64);
|
|
284
286
|
}
|
|
285
|
-
const
|
|
287
|
+
const Ie = /* @__PURE__ */ K(M, [["render", ue], ["__scopeId", "data-v-a011305e"]]);
|
|
286
288
|
export {
|
|
287
|
-
|
|
289
|
+
Ie as default
|
|
288
290
|
};
|
|
289
291
|
//# sourceMappingURL=FileUpload.vue.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.vue.mjs","sources":["../../../lib/data-provider-interface/components/FileUpload.vue"],"sourcesContent":["<template>\n \n <div class=\"position-relative w-100 \">\n <FormKit name=\"mode\" validation=\"required\" type=\"text\" class=\"selectInputField formkit-inner \" readonly=\"readonly\"\n @click=\"triggerDropdown()\" :placeholder=\"placeholderMessage\" v-model=\"inputChoice\" :validation-messages=\"{\n required: validationMessage,\n }\" />\n <ul ref=\"fLoad\" v-if=\"drop.active\" class=\"selectListUpload fileuploadList\">\n <li @click=\"uploadFileSwitch = true; toggleUploadUrl()\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">Upload a file</li>\n <li @click=\"uploadURL = true; toggleUploadFileSwitch()\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">Provide an URL</li>\n </ul>\n </div>\n <div class=\"w-100 position-relative\" v-if=\"uploadURL && !uploadFileSwitch\">\n\n <FormKit id=\"aUrlLink\" v-model=\"URLValue\" class=\"selectInputField formkit-inner\" type=\"url\" name=\"@id\" @input=\"saveUrl\"\n validation=\"required|url\" validation-visibility=\"live\" :validation-messages=\"{\n required: validationMessage,\n }\" />\n\n </div>\n <div v-if=\"uploadFileSwitch\" ref=\"fileupload\" class=\"p-3 w-100\"\n :class=\"`formkit-input-element formkit-input-element--${context.type}`\" :data-type=\"context.type\" v-bind=\"$attrs\">\n <input type=\"text\" v-model=\"context.model\" @blur=\"context.blurHandler\" hidden />\n <div class=\"file-div position-relative\">\n <input class=\"mt-3\" type=\"file\" id=\"aUrlFL\" name=\"fileUpload\" @change=\"validateFile($event)\"\n :accept=\"validExtensions\">\n <div class=\"upload-feedback position-absolute d-flex\" style=\"right: 0\">\n <div v-if=\"isLoading\" class=\"lds-ring\">\n </div>\n <div v-if=\"success\"><i class=\"material-icons d-flex check-icon\">check_circle</i></div>\n <div v-if=\"fail\"><i class=\"material-icons d-flex close-icon\">error</i></div>\n </div>\n </div>\n <p class=\"dURLText my-3\" v-if=\"success\">{{ $t('message.metadata.downloadUrl') }}: <a :href=\"context.model\">{{\n context.model }}</a></p>\n <div v-if=\"validExtensions && validExtensions.length\" class=\"allowedTypesWrapper\">\n <p class=\"errorSub my-3 d-flex \" v-if=\"!success\">Allowed types: </p>\n <div class=\"d-flex flex-wrap w-100\">\n <span v-for=\"types in validExtensions\" :key=\"types\" class=\"mr-1 mb-1 allowedFTypes \">\n {{ types }}\n </span>\n </div>\n\n </div>\n\n\n </div>\n\n</template>\n\n<script>\n/* eslint-disable consistent-return, no-unused-vars */\nimport { mapGetters, mapActions } from 'vuex';\nimport axios from 'axios';\nimport helper from '../utils/general-helper'\nimport { getNode } from '@formkit/core'\n\nimport { reactive, ref, onMounted, computed } from 'vue';\nimport { onClickOutside } from '@vueuse/core'\nimport { useRuntimeEnv } from \"../../composables/useRuntimeEnv.ts\";\nimport { FormKit } from '@formkit/vue';\n\nexport default {\n props: {\n context: {\n type: Object,\n required: true,\n },\n },\n\n data() {\n return {\n inputChoice: '',\n error: '',\n URLValue: '',\n uploadURL: false,\n uploadFileSwitch: false,\n checkifSet: false,\n isLoading: false,\n success: false,\n fail: false,\n validExtensions: this.$env.content.dataProviderInterface.uploadFileTypes?.split(',') || []\n };\n },\n computed: {\n\n ...mapGetters('auth', [\n 'getUserData',\n 'getIsEditMode'\n ]),\n ...mapGetters('dpiStore', [\n 'getData',\n ]),\n getCatalogue() {\n return getNode('dcat:catalog').value;\n }\n },\n methods: {\n ...mapActions('dpiStore', [\n 'saveLocalstorageValues',\n ]),\n toggleUploadUrl() {\n this.inputChoice = \"Upload a file\"\n if (this.uploadURL) { this.uploadURL = !this.uploadURL }\n },\n toggleUploadFileSwitch() {\n this.inputChoice = \"Provide an URL\"\n if (this.uploadFileSwitch) { this.uploadFileSwitch = !this.uploadFileSwitch }\n },\n validateFile(event) {\n const file = event.target.files[0];\n const fileExtension = '.' + file.name.split('.').pop().toLowerCase();\n if (this.validExtensions && this.validExtensions.length) {\n if (!this.validExtensions.includes(fileExtension)) {\n console.log('Wrong filetype');\n } else {\n this.uploadOrReplaceFile({ file: event.target.files[0] })\n }\n } else {\n this.error = \"\"\n this.uploadOrReplaceFile({ file: event.target.files[0] })\n }\n },\n async saveUrl() {\n\n if (this.URLValue.includes('http://') || this.URLValue.includes('https://')) {\n await this.context.node.input({ '@id': this.URLValue , 'mode': this.inputChoice})\n }\n else await this.context.node.input({ '@id': 'https://' + this.URLValue , 'mode': this.inputChoice})\n\n },\n checkIfPresent() {\n // console.log(this.context.value['@id']);\n if (this.context.value['@id']) {\n // console.log(this.context.value['@id']);\n this.URLValue = this.context.value['@id']\n return true\n }\n else false\n },\n // finds the parent input group of a given element.\n findParentInputGroupOfElement(element) {\n // Start with the given element.\n let currentElement = element;\n\n // Traverse the DOM tree upwards.\n while (currentElement) {\n // If the current element is an input group, return it.\n if (currentElement.classList.contains('formkit-input-group-repeatable')) {\n return currentElement;\n }\n // If not, move to the parent element.\n currentElement = currentElement.parentElement;\n }\n\n // If no input group was found, return null.\n return null;\n },\n // finds the index of the distribution access URL based on the root of this component.\n findDistributionAccessUrlIndex() {\n // todo: find a more stable way to find the index of the distribution access URL.\n // this way uses the DOM tree, which is not stable.\n\n // Start at the root of this component.\n const rootElement = this.$refs.fileupload;\n\n // Find the parent input group of the root element.\n const parentInputGroup = this.findParentInputGroupOfElement(rootElement);\n if (!parentInputGroup) return null;\n\n // Get the parent element of all input groups.\n const parentOfAllInputGroups = parentInputGroup.parentElement;\n const allInputGroupsNodeList = parentOfAllInputGroups.querySelectorAll('.formkit-input-group-repeatable');\n const allInputGroupsArray = Array.from(allInputGroupsNodeList);\n\n // Find the index of the parent input group within the array of all input groups.\n const indexOfParentInputGroup = allInputGroupsArray.indexOf(parentInputGroup);\n\n return indexOfParentInputGroup;\n },\n async uploadOrReplaceFile({ file }) {\n\n const replaceEnabled = this.$env?.content?.dataProviderInterface?.enableFileUploadReplace || false;\n const wantsToReplace = this.$route.query?.edit ?? false;\n\n if (replaceEnabled && wantsToReplace) {\n const distributionIndexToReplace = this.$route.query?.edit;\n const fileIndexToReplace = this.findDistributionAccessUrlIndex();\n\n const targetDistribution = this.getData('distributions')?.[distributionIndexToReplace];\n const targetFile = targetDistribution?.['dcat:accessURL']?.[fileIndexToReplace];\n const accessUrl = targetFile?.['@id'];\n if (accessUrl) {\n const fileUploadUrl = this.$env.api.fileUploadUrl;\n\n const fileId = helper.getFileIdByAccessUrl({ accessUrl, fileUploadUrl })\n\n return await this.uploadFile(file, {\n method: 'PUT',\n url: `${this.$env.api.fileUploadUrl}data/${fileId}?catalog=${this.getCatalogue}`,\n });\n }\n\n }\n\n return await this.uploadFile(file);\n },\n async uploadFile(file, options = {}) {\n\n this.isLoading = true;\n\n const form = new FormData();\n form.append('file', file);\n\n const catalog = this.getCatalogue;\n const token = this.getUserData.rtpToken;\n\n const resolvedOptions = {\n method: 'POST',\n url: `${this.$env.api.fileUploadUrl}data?catalog=${catalog}`,\n ...options,\n };\n\n const requestOptions = {\n method: resolvedOptions.method,\n url: resolvedOptions.url,\n headers: {\n 'Content-Type': 'multipart/form-data',\n Authorization: `Bearer ${token}`,\n },\n data: form,\n };\n\n try {\n\n const result = await axios.request(requestOptions);\n const path = result.data.result.location.substring(result.data.result.location.indexOf('/') + 1);\n this.context.model = `${this.$env.api.fileUploadUrl}${path}`;\n this.isLoading = false;\n this.success = true;\n await this.context.node.input({ '@id': `${this.$env.api.fileUploadUrl}${path}` })\n // this.context.rootEmit('change');\n\n } catch (err) {\n\n this.isLoading = false;\n this.fail = true;\n console.error(err); // eslint-disable-line\n }\n },\n },\n mounted() {\n\n this.$nextTick(function () {\n\n if (this.context.value['@id']) {\n this.uploadURL = true\n this.URLValue = this.context.value['@id']\n this.inputChoice = \"Provide an URL\"\n return true\n }\n else false\n })\n },\n setup() {\n const env = useRuntimeEnv();\n let validationMessage = 'This property is required'\n let placeholderMessage = 'Choose between fileupload and providing a URL'\n\n var drop = reactive({\n active: false,\n })\n\n\n const fLoad = ref('fload');\n\n onClickOutside(fLoad, event => {\n drop.active = false\n })\n function triggerDropdown(e) {\n drop.active = !drop.active\n }\n\n return {\n drop,\n onClickOutside,\n triggerDropdown,\n validationMessage,\n placeholderMessage\n };\n }\n};\n</script>\n\n<style lang=\"scss\" scoped>\n// @import '../../../styles/bootstrap_theme';\n// @import '../../../styles/utils/css-animations';\n.dURLText {}\n\n\n.accessUrl {\n .formkit-outer {}\n}\n\n.file-div {\n display: flex;\n align-items: center;\n}\n\n.upload-feedback {\n padding: 10px;\n}\n\n/*** MATERIAL ICONS ***/\n%modal-icon {\n font-size: 20px;\n cursor: default;\n}\n\n.check-icon {\n @extend %modal-icon;\n color: #28a745;\n}\n\n.close-icon {\n @extend %modal-icon;\n color: red;\n}\n\n.lds-ring {\n display: inline-block;\n position: relative;\n width: 30px;\n height: 30px;\n}\n\n.lds-ring div {\n box-sizing: border-box;\n display: block;\n position: absolute;\n right: 0;\n width: 30px;\n height: 30px;\n border: 8px solid lightgray;\n border-radius: 50%;\n animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: lightgray transparent transparent transparent;\n}\n\n.lds-ring div:nth-child(1) {\n animation-delay: -0.45s;\n}\n\n.lds-ring div:nth-child(2) {\n animation-delay: -0.3s;\n}\n\n.lds-ring div:nth-child(3) {\n animation-delay: -0.15s;\n}\n\n.error {\n color: red;\n}\n\n.errorSub {\n color: black;\n}\n\n@keyframes lds-ring {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.allowedFTypes {\n padding: 0.5rem;\n border-radius: 5px;\n border: 1px solid lightgrey;\n}\n\n.allowedTypesWrapper {\n max-width: 100%;\n display: flex;\n flex-wrap: wrap;\n}\n.fileuploadList{\n width: 96.7%;\n}\n</style>\n"],"names":["_sfc_main","_a","mapGetters","getNode","mapActions","event","fileExtension","element","currentElement","rootElement","parentInputGroup","allInputGroupsNodeList","file","replaceEnabled","_c","_b","wantsToReplace","_d","distributionIndexToReplace","_e","fileIndexToReplace","targetDistribution","_f","targetFile","_g","accessUrl","fileUploadUrl","fileId","helper","options","form","catalog","token","resolvedOptions","requestOptions","result","axios","path","err","useRuntimeEnv","validationMessage","placeholderMessage","drop","reactive","fLoad","ref","onClickOutside","triggerDropdown","e","_hoisted_1","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_10","_withScopeId","_createElementVNode","_hoisted_13","_hoisted_16","_hoisted_19","_openBlock","_createElementBlock","_Fragment","_createVNode","_component_FormKit","$setup","$data","_cache","$event","_createTextVNode","_hoisted_2","$options","_createCommentVNode","_hoisted_3","_mergeProps","$props","_ctx","args","_vModelText","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_11","_hoisted_12","_hoisted_14","_hoisted_15","_toDisplayString","_hoisted_17","_hoisted_18","_renderList","types"],"mappings":";;;;;;;;;;AAgEA,MAAKA,IAAU;AAAA,EACb,OAAO;AAAA,IACL,SAAS;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACF;AAAA,EAED,OAAO;;AACL,WAAO;AAAA,MACL,aAAa;AAAA,MACb,OAAO;AAAA,MACP,UAAU;AAAA,MACV,WAAW;AAAA,MACX,kBAAkB;AAAA,MAClB,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,MACN,mBAAiBC,IAAA,KAAK,KAAK,QAAQ,sBAAsB,oBAAxC,gBAAAA,EAAyD,MAAM,SAAQ,CAAC;AAAA;EAE5F;AAAA,EACD,UAAU;AAAA,IAER,GAAGC,EAAW,QAAQ;AAAA,MACpB;AAAA,MACA;AAAA,IACF,CAAC;AAAA,IACD,GAAGA,EAAW,YAAY;AAAA,MACxB;AAAA,IACF,CAAC;AAAA,IACD,eAAe;AACb,aAAOC,EAAQ,cAAc,EAAE;AAAA,IACjC;AAAA,EACD;AAAA,EACD,SAAS;AAAA,IACP,GAAGC,EAAW,YAAY;AAAA,MACxB;AAAA,IACF,CAAC;AAAA,IACD,kBAAkB;AAChB,WAAK,cAAc,iBACf,KAAK,cAAa,KAAK,YAAY,CAAC,KAAK;AAAA,IAC9C;AAAA,IACD,yBAAyB;AACvB,WAAK,cAAc,kBACf,KAAK,qBAAoB,KAAK,mBAAmB,CAAC,KAAK;AAAA,IAC5D;AAAA,IACD,aAAaC,GAAO;AAElB,YAAMC,IAAgB,MADTD,EAAM,OAAO,MAAM,CAAC,EACA,KAAK,MAAM,GAAG,EAAE,MAAM;AACvD,MAAI,KAAK,mBAAmB,KAAK,gBAAgB,S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EAEOC,GA1Cf,MAAA2B,EAwC8BvB,EAAe,iBAxC7C,CAwCqBwB,YAAb7B,EAEO,QAAA;AAAA,YAFiC,KAAK6B;AAAA,YAAO,OAAM;AAAA,eACrDA,CAAK,GAAA,CAAA;;YAzClBlB,EAAA,IAAA,EAAA;AAAA,IAAA,GAAA,IAAArB,CAAA,KAAAqB,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
1
|
+
{"version":3,"file":"FileUpload.vue.mjs","sources":["../../../lib/data-provider-interface/components/FileUpload.vue"],"sourcesContent":["<template>\n\n <div class=\"position-relative w-100 \">\n <FormKit name=\"mode\" validation=\"required\" type=\"text\" class=\"selectInputField formkit-inner \" readonly=\"readonly\"\n @click=\"triggerDropdown()\" :placeholder=\"t('message.dataupload.info.preferredInput')\" v-model=\"inputChoice\" :validation-messages=\"{\n required: t('message.dataupload.info.preferredInput'),\n }\" />\n <ul ref=\"fLoad\" v-if=\"drop.active\" class=\"selectListUpload fileuploadList\">\n <li @click=\"uploadFileSwitch = true; toggleUploadUrl()\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{$t('message.dataupload.datasets.conditional.fileupload')}}</li>\n <li @click=\"uploadURL = true; toggleUploadFileSwitch()\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{$t('message.dataupload.datasets.conditional.URL')}}</li>\n </ul>\n </div>\n <div class=\"w-100 position-relative\" v-if=\"uploadURL && !uploadFileSwitch\">\n\n <FormKit id=\"aUrlLink\" v-model=\"URLValue\" class=\"selectInputField formkit-inner\" type=\"url\" name=\"@id\" :placeholder=\"context.attrs.placeholder\"\n @input=\"saveUrl\" validation=\"required|url\" validation-visibility=\"live\" :validation-messages=\"{\n required: t('message.dataupload.datasets.conditional.URL'),\n url: t('message.dataupload.info.urlFormat')\n }\" />\n\n </div>\n <div v-if=\"uploadFileSwitch\" ref=\"fileupload\" class=\"p-3 w-100\"\n :class=\"`formkit-input-element formkit-input-element--${context.type}`\" :data-type=\"context.type\" v-bind=\"$attrs\">\n <input type=\"text\" v-model=\"context.model\" @blur=\"context.blurHandler\" hidden />\n <div class=\"file-div position-relative\">\n <input class=\"mt-3\" type=\"file\" id=\"aUrlFL\" name=\"fileUpload\" @change=\"validateFile($event)\"\n :accept=\"validExtensions\">\n <div class=\"upload-feedback position-absolute d-flex\" style=\"right: 0\">\n <div v-if=\"isLoading\" class=\"lds-ring\">\n </div>\n <div v-if=\"success\"><i class=\"material-icons d-flex check-icon\">check_circle</i></div>\n <div v-if=\"fail\"><i class=\"material-icons d-flex close-icon\">error</i></div>\n </div>\n </div>\n <p class=\"dURLText my-3\" v-if=\"success\">{{ $t('message.metadata.downloadUrl') }}: <a :href=\"context.model\">{{\n context.model }}</a></p>\n <div v-if=\"validExtensions && validExtensions.length\" class=\"allowedTypesWrapper\">\n <p class=\"errorSub my-3 d-flex \" v-if=\"!success\">Allowed types: </p>\n <div class=\"d-flex flex-wrap w-100\">\n <span v-for=\"types in validExtensions\" :key=\"types\" class=\"mr-1 mb-1 allowedFTypes \">\n {{ types }}\n </span>\n </div>\n\n </div>\n\n\n </div>\n\n</template>\n\n<script>\n/* eslint-disable consistent-return, no-unused-vars */\nimport { mapGetters, mapActions } from 'vuex';\nimport axios from 'axios';\nimport helper from '../utils/general-helper'\nimport { getNode } from '@formkit/core'\n\nimport { reactive, ref, onMounted, computed } from 'vue';\nimport { onClickOutside } from '@vueuse/core'\nimport { useRuntimeEnv } from \"../../composables/useRuntimeEnv.ts\";\nimport { FormKit } from '@formkit/vue';\nimport { useI18n } from 'vue-i18n';\n\nexport default {\n props: {\n context: {\n type: Object,\n required: true,\n },\n },\n\n data() {\n return {\n inputChoice: '',\n error: '',\n URLValue: '',\n uploadURL: false,\n uploadFileSwitch: false,\n checkifSet: false,\n isLoading: false,\n success: false,\n fail: false,\n \n validExtensions: this.$env.content.dataProviderInterface.uploadFileTypes?.split(',') || []\n };\n },\n computed: {\n\n ...mapGetters('auth', [\n 'getUserData',\n 'getIsEditMode'\n ]),\n ...mapGetters('dpiStore', [\n 'getData',\n ]),\n getCatalogue() {\n return getNode('dcat:catalog').value;\n }\n },\n methods: {\n ...mapActions('dpiStore', [\n 'saveLocalstorageValues',\n ]),\n toggleUploadUrl() {\n this.inputChoice = this.t('message.dataupload.datasets.conditional.fileupload')\n if (this.uploadURL) { this.uploadURL = !this.uploadURL }\n },\n toggleUploadFileSwitch() {\n this.inputChoice = this.t('message.dataupload.datasets.conditional.URL')\n if (this.uploadFileSwitch) { this.uploadFileSwitch = !this.uploadFileSwitch }\n },\n validateFile(event) {\n const file = event.target.files[0];\n const fileExtension = '.' + file.name.split('.').pop().toLowerCase();\n if (this.validExtensions && this.validExtensions.length) {\n if (!this.validExtensions.includes(fileExtension)) {\n console.log('Wrong filetype');\n } else {\n this.uploadOrReplaceFile({ file: event.target.files[0] })\n }\n } else {\n this.error = \"\"\n this.uploadOrReplaceFile({ file: event.target.files[0] })\n }\n },\n async saveUrl() {\n\n if (this.URLValue.includes('http://') || this.URLValue.includes('https://')) {\n await this.context.node.input({ '@id': this.URLValue, 'mode': this.inputChoice })\n }\n else await this.context.node.input({ '@id': 'https://' + this.URLValue, 'mode': this.inputChoice })\n\n },\n checkIfPresent() {\n // console.log(this.context.value['@id']);\n if (this.context.value['@id']) {\n // console.log(this.context.value['@id']);\n this.URLValue = this.context.value['@id']\n return true\n }\n else false\n },\n // finds the parent input group of a given element.\n findParentInputGroupOfElement(element) {\n // Start with the given element.\n let currentElement = element;\n\n // Traverse the DOM tree upwards.\n while (currentElement) {\n // If the current element is an input group, return it.\n if (currentElement.classList.contains('formkit-input-group-repeatable')) {\n return currentElement;\n }\n // If not, move to the parent element.\n currentElement = currentElement.parentElement;\n }\n\n // If no input group was found, return null.\n return null;\n },\n // finds the index of the distribution access URL based on the root of this component.\n findDistributionAccessUrlIndex() {\n // todo: find a more stable way to find the index of the distribution access URL.\n // this way uses the DOM tree, which is not stable.\n\n // Start at the root of this component.\n const rootElement = this.$refs.fileupload;\n\n // Find the parent input group of the root element.\n const parentInputGroup = this.findParentInputGroupOfElement(rootElement);\n if (!parentInputGroup) return null;\n\n // Get the parent element of all input groups.\n const parentOfAllInputGroups = parentInputGroup.parentElement;\n const allInputGroupsNodeList = parentOfAllInputGroups.querySelectorAll('.formkit-input-group-repeatable');\n const allInputGroupsArray = Array.from(allInputGroupsNodeList);\n\n // Find the index of the parent input group within the array of all input groups.\n const indexOfParentInputGroup = allInputGroupsArray.indexOf(parentInputGroup);\n\n return indexOfParentInputGroup;\n },\n async uploadOrReplaceFile({ file }) {\n\n const replaceEnabled = this.$env?.content?.dataProviderInterface?.enableFileUploadReplace || false;\n const wantsToReplace = this.$route.query?.edit ?? false;\n\n if (replaceEnabled && wantsToReplace) {\n const distributionIndexToReplace = this.$route.query?.edit;\n const fileIndexToReplace = this.findDistributionAccessUrlIndex();\n\n const targetDistribution = this.getData('distributions')?.[distributionIndexToReplace];\n const targetFile = targetDistribution?.['dcat:accessURL']?.[fileIndexToReplace];\n const accessUrl = targetFile?.['@id'];\n if (accessUrl) {\n const fileUploadUrl = this.$env.api.fileUploadUrl;\n\n const fileId = helper.getFileIdByAccessUrl({ accessUrl, fileUploadUrl })\n\n return await this.uploadFile(file, {\n method: 'PUT',\n url: `${this.$env.api.fileUploadUrl}data/${fileId}?catalog=${this.getCatalogue}`,\n });\n }\n\n }\n\n return await this.uploadFile(file);\n },\n async uploadFile(file, options = {}) {\n\n this.isLoading = true;\n\n const form = new FormData();\n form.append('file', file);\n\n const catalog = this.getCatalogue;\n const token = this.getUserData.rtpToken;\n\n const resolvedOptions = {\n method: 'POST',\n url: `${this.$env.api.fileUploadUrl}data?catalog=${catalog}`,\n ...options,\n };\n\n const requestOptions = {\n method: resolvedOptions.method,\n url: resolvedOptions.url,\n headers: {\n 'Content-Type': 'multipart/form-data',\n Authorization: `Bearer ${token}`,\n },\n data: form,\n };\n\n try {\n\n const result = await axios.request(requestOptions);\n const path = result.data.result.location.substring(result.data.result.location.indexOf('/') + 1);\n this.context.model = `${this.$env.api.fileUploadUrl}${path}`;\n this.isLoading = false;\n this.success = true;\n await this.context.node.input({ '@id': `${this.$env.api.fileUploadUrl}${path}` })\n // this.context.rootEmit('change');\n\n } catch (err) {\n\n this.isLoading = false;\n this.fail = true;\n console.error(err); // eslint-disable-line\n }\n },\n },\n mounted() {\n\n this.$nextTick(function () {\n\n if (this.context.value['@id']) {\n this.uploadURL = true\n this.URLValue = this.context.value['@id']\n this.inputChoice = \"Provide an URL\"\n return true\n }\n else false\n })\n },\n setup() {\n const { t } = useI18n();\n const env = useRuntimeEnv();\n \n\n\n var drop = reactive({\n active: false,\n })\n\n\n const fLoad = ref('fload');\n\n onClickOutside(fLoad, event => {\n drop.active = false\n })\n function triggerDropdown(e) {\n drop.active = !drop.active\n }\n\n return {\n drop,\n onClickOutside,\n triggerDropdown,\n t\n };\n }\n};\n</script>\n\n<style lang=\"scss\" scoped>\n// @import '../../../styles/bootstrap_theme';\n// @import '../../../styles/utils/css-animations';\n.dURLText {}\n\n\n.accessUrl {\n .formkit-outer {}\n}\n\n.file-div {\n display: flex;\n align-items: center;\n}\n\n.upload-feedback {\n padding: 10px;\n}\n\n/*** MATERIAL ICONS ***/\n%modal-icon {\n font-size: 20px;\n cursor: default;\n}\n\n.check-icon {\n @extend %modal-icon;\n color: #28a745;\n}\n\n.close-icon {\n @extend %modal-icon;\n color: red;\n}\n\n.lds-ring {\n display: inline-block;\n position: relative;\n width: 30px;\n height: 30px;\n}\n\n.lds-ring div {\n box-sizing: border-box;\n display: block;\n position: absolute;\n right: 0;\n width: 30px;\n height: 30px;\n border: 8px solid lightgray;\n border-radius: 50%;\n animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: lightgray transparent transparent transparent;\n}\n\n.lds-ring div:nth-child(1) {\n animation-delay: -0.45s;\n}\n\n.lds-ring div:nth-child(2) {\n animation-delay: -0.3s;\n}\n\n.lds-ring div:nth-child(3) {\n animation-delay: -0.15s;\n}\n\n.error {\n color: red;\n}\n\n.errorSub {\n color: black;\n}\n\n@keyframes lds-ring {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.allowedFTypes {\n padding: 0.5rem;\n border-radius: 5px;\n border: 1px solid lightgrey;\n}\n\n.allowedTypesWrapper {\n max-width: 100%;\n display: flex;\n flex-wrap: wrap;\n}\n\n.fileuploadList {\n width: 96.7%;\n}\n</style>\n"],"names":["_sfc_main","_a","mapGetters","getNode","mapActions","event","fileExtension","element","currentElement","rootElement","parentInputGroup","allInputGroupsNodeList","file","replaceEnabled","_c","_b","wantsToReplace","_d","distributionIndexToReplace","_e","fileIndexToReplace","targetDistribution","_f","targetFile","_g","accessUrl","fileUploadUrl","fileId","helper","options","form","catalog","token","resolvedOptions","requestOptions","result","axios","path","err","useI18n","useRuntimeEnv","drop","reactive","fLoad","ref","onClickOutside","triggerDropdown","e","_hoisted_1","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_10","_withScopeId","_createElementVNode","_hoisted_13","_hoisted_16","_hoisted_19","_openBlock","_createElementBlock","_Fragment","_createVNode","_component_FormKit","$setup","$data","_cache","$event","_createTextVNode","_hoisted_2","$options","_ctx","_createCommentVNode","_hoisted_3","$props","_mergeProps","args","_vModelText","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_11","_hoisted_12","_hoisted_14","_hoisted_15","_toDisplayString","_hoisted_17","_hoisted_18","_renderList","types"],"mappings":";;;;;;;;;;;AAkEA,MAAKA,IAAU;AAAA,EACb,OAAO;AAAA,IACL,SAAS;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACF;AAAA,EAED,OAAO;;AACL,WAAO;AAAA,MACL,aAAa;AAAA,MACb,OAAO;AAAA,MACP,UAAU;AAAA,MACV,WAAW;AAAA,MACX,kBAAkB;AAAA,MAClB,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,SAAS;AAAA,MACT,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
|
|
|
18
18
|
hubUrl: string;
|
|
19
19
|
qualityBaseUrl: string;
|
|
20
20
|
similarityBaseUrl: string;
|
|
21
|
-
|
|
21
|
+
similarityServiceName: string;
|
|
22
22
|
fileUploadUrl: string;
|
|
23
23
|
sparqlUrl: string;
|
|
24
24
|
gazetteerBaseUrl: string;
|