@piveau/piveau-hub-ui-modules 4.5.12 → 4.6.0
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/CatalogueMQA.vue.mjs +21 -21
- package/dist/data-provider-interface/CatalogueMQA.vue.mjs.map +1 -1
- package/dist/data-provider-interface/DPIMenu.vue.mjs +5 -5
- package/dist/data-provider-interface/DataProviderInterface.vue.d.ts +9 -4
- package/dist/data-provider-interface/components/Navigation.vue.mjs +57 -56
- package/dist/data-provider-interface/components/Navigation.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/SpatialInput.vue.mjs +23 -22
- package/dist/data-provider-interface/components/SpatialInput.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/UniqueIdentifierInput.vue.mjs +13 -13
- package/dist/data-provider-interface/components/UniqueIdentifierInput.vue.mjs.map +1 -1
- package/dist/data-provider-interface/composables/index.d.ts +1 -0
- package/dist/data-provider-interface/composables/useDpiEditMode.mjs +15 -16
- package/dist/data-provider-interface/composables/useDpiEditMode.mjs.map +1 -1
- package/dist/data-provider-interface/composables/useFormSchema.d.ts +13 -0
- package/dist/data-provider-interface/composables/useFormSchema.mjs +59 -0
- package/dist/data-provider-interface/composables/useFormSchema.mjs.map +1 -0
- package/dist/data-provider-interface/index.d.ts +33 -0
- package/dist/data-provider-interface/utils/translation-helper.mjs +23 -23
- package/dist/data-provider-interface/utils/translation-helper.mjs.map +1 -1
- package/dist/data-provider-interface/views/DistributionOverview.vue.d.ts +1 -1
- package/dist/data-provider-interface/views/InputPage.vue.d.ts +9 -4
- package/dist/data-provider-interface/views/InputPage.vue.mjs +110 -110
- package/dist/data-provider-interface/views/InputPage.vue.mjs.map +1 -1
- package/dist/dataProviderInterface.d.ts +1 -0
- package/dist/dataProviderInterface.mjs +71 -0
- package/dist/dataProviderInterface.mjs.map +1 -0
- package/dist/datasetDetails/DatasetDetails.vue.mjs +31 -29
- package/dist/datasetDetails/DatasetDetails.vue.mjs.map +1 -1
- package/dist/embed/DatasetEmbedModal.vue.d.ts +2 -0
- package/dist/embed/DatasetEmbedModal.vue.mjs +126 -88
- package/dist/embed/DatasetEmbedModal.vue.mjs.map +1 -1
- package/dist/embed/EmbedDataset.vue.mjs +31 -26
- package/dist/embed/EmbedDataset.vue.mjs.map +1 -1
- package/dist/embed/EmbedDatasetSnippet.vue.mjs +30 -25
- package/dist/embed/EmbedDatasetSnippet.vue.mjs.map +1 -1
- package/dist/external/@vueuse/core/index +31 -31
- package/dist/external/@vueuse/shared/index +66 -63
- package/dist/external/@vueuse/shared/index.map +1 -1
- package/dist/form/FormKitGroup.vue.mjs.map +1 -1
- package/dist/index.mjs +54 -54
- package/dist/piveau-hub-ui-modules.css +1 -1
- package/package.json +17 -1
- package/dist/data-provider-interface/index.mjs +0 -15
- package/dist/data-provider-interface/index.mjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ref as i, getCurrentInstance as it, openBlock as a, createElementBlock as
|
|
1
|
+
import { ref as i, getCurrentInstance as it, openBlock as a, createElementBlock as d, createElementVNode as l, createTextVNode as e, toDisplayString as u, unref as n, createCommentVNode as A, normalizeClass as k, Fragment as Q, renderList as L, withDirectives as E, vModelText as T, isRef as G } from "vue";
|
|
2
2
|
import { useRouter as ut, useRoute as rt } from "vue-router";
|
|
3
3
|
import { useStore as at } from "vuex";
|
|
4
4
|
import U from "axios";
|
|
5
5
|
import "./CatalogueMQA.vue2.mjs";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
6
|
+
import dt from "../_virtual/_plugin-vue_export-helper.mjs";
|
|
7
|
+
const vt = { class: "container mb-3" }, pt = { class: "debug" }, ft = { key: 0 }, mt = { key: 1 }, bt = { key: 0 }, gt = { class: "mqaWrapper" }, yt = { key: 0 }, kt = ["onUpdate:modelValue", "onInput"], Ct = ["onClick"], wt = ["onClick"], At = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "errormsg"
|
|
10
10
|
}, St = { class: "d-flex mt-3" }, Mt = {
|
|
@@ -21,7 +21,7 @@ const dt = { class: "container mb-3" }, pt = { class: "debug" }, ft = { key: 0 }
|
|
|
21
21
|
variant: "success"
|
|
22
22
|
});
|
|
23
23
|
}, J = rt();
|
|
24
|
-
let y = i(!1), m = i(!1), K = i(null), V = i("Activate"), W = i(!1),
|
|
24
|
+
let y = i(!1), m = i(!1), K = i(null), V = i("Activate"), W = i(!1), v = i(!1), b = i(), X = ["Mo", "Tue", "We", "Th", "Fr", "Sa", "Su"], p = i(1), I = i(!1), C = i(0), S = i(""), g = i(""), M = i(null);
|
|
25
25
|
const B = J.params.id, O = it(), Y = O.appContext.app.config.globalProperties.$env.api.notificationBaseUrl, P = O.appContext.app.config.globalProperties.$env.api.apiKey, z = (s) => {
|
|
26
26
|
m.value && (M.value = s, g.value = M);
|
|
27
27
|
}, Z = () => {
|
|
@@ -42,7 +42,7 @@ const dt = { class: "container mb-3" }, pt = { class: "debug" }, ft = { key: 0 }
|
|
|
42
42
|
};
|
|
43
43
|
try {
|
|
44
44
|
const t = await U.request(s);
|
|
45
|
-
w.value = t.data, w.value.activeStatus === !0 && (
|
|
45
|
+
w.value = t.data, w.value.activeStatus === !0 && (v.value = !0, V.value = "Deactivate"), w.value.activeStatus === !1 && (v.value = !1, V.value = "Activate"), b.value = w.value.receiverEmailList, S.value = w.value.frequency.unit, g.value = w.value.frequency.value, C.value = w.value.threshold, S.value === "week" ? (m.value = !0, y.value = !1, M.value = g.value) : S.value === "month" && (m.value = !1, y.value = !0, p.value = g.value), console.log("Response:", t);
|
|
46
46
|
} catch (t) {
|
|
47
47
|
console.log("Full error:", t);
|
|
48
48
|
}
|
|
@@ -92,12 +92,12 @@ const dt = { class: "container mb-3" }, pt = { class: "debug" }, ft = { key: 0 }
|
|
|
92
92
|
},
|
|
93
93
|
withCredentials: !0,
|
|
94
94
|
data: JSON.stringify({
|
|
95
|
-
activeStatus:
|
|
95
|
+
activeStatus: v.value
|
|
96
96
|
})
|
|
97
97
|
};
|
|
98
98
|
try {
|
|
99
99
|
const t = await U.request(s);
|
|
100
|
-
return console.log("Settings updated:", t.data), N(),
|
|
100
|
+
return console.log("Settings updated:", t.data), N(), v.value || D.push({ name: "DataProviderInterface-UserCatalogues" }), t.data;
|
|
101
101
|
} catch (t) {
|
|
102
102
|
throw N(), console.log("Error updating settings:", t), t;
|
|
103
103
|
}
|
|
@@ -120,11 +120,11 @@ const dt = { class: "container mb-3" }, pt = { class: "debug" }, ft = { key: 0 }
|
|
|
120
120
|
}
|
|
121
121
|
R(f.value.mail) ? (b.value.push(f.value.mail), f.value.mail = "", f.value.isValid = !0) : f.value.isValid = !1;
|
|
122
122
|
}, st = () => {
|
|
123
|
-
|
|
123
|
+
v.value ? (v.value = !1, V.value = "Activate", j()) : (v.value = !0, V.value = "Deactivate", j());
|
|
124
124
|
}, ot = () => {
|
|
125
125
|
D.push({ name: "DataProviderInterface-UserCatalogues" });
|
|
126
126
|
};
|
|
127
|
-
return (s, t) => (a(),
|
|
127
|
+
return (s, t) => (a(), d("div", vt, [
|
|
128
128
|
l("div", null, [
|
|
129
129
|
l("div", null, [
|
|
130
130
|
l("div", pt, [
|
|
@@ -178,9 +178,9 @@ const dt = { class: "container mb-3" }, pt = { class: "debug" }, ft = { key: 0 }
|
|
|
178
178
|
t[37] || (t[37] = l("b", null, "MQA Rating Checks ", -1)),
|
|
179
179
|
t[38] || (t[38] = e("are currently ")),
|
|
180
180
|
l("b", null, [
|
|
181
|
-
n(
|
|
181
|
+
n(v) ? A("", !0) : (a(), d("span", ft, "deactivated")),
|
|
182
182
|
t[35] || (t[35] = e()),
|
|
183
|
-
n(
|
|
183
|
+
n(v) ? (a(), d("span", mt, "activated")) : A("", !0)
|
|
184
184
|
]),
|
|
185
185
|
t[39] || (t[39] = e("."))
|
|
186
186
|
])
|
|
@@ -188,18 +188,18 @@ const dt = { class: "container mb-3" }, pt = { class: "debug" }, ft = { key: 0 }
|
|
|
188
188
|
t[44] || (t[44] = e()),
|
|
189
189
|
l("button", {
|
|
190
190
|
type: "button",
|
|
191
|
-
class: k({ "btn btn-primary mb-5": !n(
|
|
191
|
+
class: k({ "btn btn-primary mb-5": !n(v), "btn btn-secondary": n(v) }),
|
|
192
192
|
onClick: t[0] || (t[0] = (o) => st())
|
|
193
193
|
}, u(n(V)), 3)
|
|
194
194
|
]),
|
|
195
195
|
t[84] || (t[84] = e()),
|
|
196
|
-
n(
|
|
196
|
+
n(v) ? (a(), d("div", bt, [
|
|
197
197
|
l("div", gt, [
|
|
198
198
|
t[52] || (t[52] = l("h3", null, "Recipients Mail", -1)),
|
|
199
199
|
t[53] || (t[53] = e()),
|
|
200
200
|
t[54] || (t[54] = l("span", null, "Add and edit mail addresses for recieving the MQA report", -1)),
|
|
201
201
|
t[55] || (t[55] = e()),
|
|
202
|
-
n(b).length != 0 ? (a(),
|
|
202
|
+
n(b).length != 0 ? (a(), d("table", {
|
|
203
203
|
key: 0,
|
|
204
204
|
class: "mt-4",
|
|
205
205
|
ref_key: "mailButtonWrap",
|
|
@@ -209,14 +209,14 @@ const dt = { class: "container mb-3" }, pt = { class: "debug" }, ft = { key: 0 }
|
|
|
209
209
|
l("th", null, "Mail")
|
|
210
210
|
], -1)),
|
|
211
211
|
t[50] || (t[50] = e()),
|
|
212
|
-
(a(!0),
|
|
212
|
+
(a(!0), d(Q, null, L(n(b), (o, r) => (a(), d("tr", {
|
|
213
213
|
class: "mailItems",
|
|
214
214
|
key: r
|
|
215
215
|
}, [
|
|
216
216
|
l("td", null, [
|
|
217
|
-
n(I) ? A("", !0) : (a(),
|
|
217
|
+
n(I) ? A("", !0) : (a(), d("span", yt, u(o), 1)),
|
|
218
218
|
t[46] || (t[46] = e()),
|
|
219
|
-
n(I) ? E((a(),
|
|
219
|
+
n(I) ? E((a(), d("input", {
|
|
220
220
|
key: 1,
|
|
221
221
|
type: "text",
|
|
222
222
|
"onUpdate:modelValue": (q) => n(b)[r] = q,
|
|
@@ -241,7 +241,7 @@ const dt = { class: "container mb-3" }, pt = { class: "debug" }, ft = { key: 0 }
|
|
|
241
241
|
])
|
|
242
242
|
]),
|
|
243
243
|
t[48] || (t[48] = e()),
|
|
244
|
-
n($)[r] ? (a(),
|
|
244
|
+
n($)[r] ? (a(), d("span", At, u(n($)[r]), 1)) : A("", !0)
|
|
245
245
|
]))), 128))
|
|
246
246
|
], 512)) : A("", !0),
|
|
247
247
|
t[56] || (t[56] = e()),
|
|
@@ -263,7 +263,7 @@ const dt = { class: "container mb-3" }, pt = { class: "debug" }, ft = { key: 0 }
|
|
|
263
263
|
}, "+ Add Mail")
|
|
264
264
|
]),
|
|
265
265
|
t[57] || (t[57] = e()),
|
|
266
|
-
n(f).isValid ? A("", !0) : (a(),
|
|
266
|
+
n(f).isValid ? A("", !0) : (a(), d("span", Mt, "*Invalid email format"))
|
|
267
267
|
]),
|
|
268
268
|
t[81] || (t[81] = e()),
|
|
269
269
|
l("div", It, [
|
|
@@ -282,7 +282,7 @@ const dt = { class: "container mb-3" }, pt = { class: "debug" }, ft = { key: 0 }
|
|
|
282
282
|
l("div", {
|
|
283
283
|
class: k(["weekdays", { blur: !n(m) }])
|
|
284
284
|
}, [
|
|
285
|
-
(a(!0),
|
|
285
|
+
(a(!0), d(Q, null, L(n(X), (o, r) => (a(), d("span", { key: r }, [
|
|
286
286
|
l("button", {
|
|
287
287
|
disabled: !n(m),
|
|
288
288
|
class: k(["dayButtons", { activeItem: n(M) === r }]),
|
|
@@ -400,7 +400,7 @@ const dt = { class: "container mb-3" }, pt = { class: "debug" }, ft = { key: 0 }
|
|
|
400
400
|
])) : A("", !0)
|
|
401
401
|
]));
|
|
402
402
|
}
|
|
403
|
-
}, Qt = /* @__PURE__ */
|
|
403
|
+
}, Qt = /* @__PURE__ */ dt(Pt, [["__scopeId", "data-v-79dfafde"]]);
|
|
404
404
|
export {
|
|
405
405
|
Qt as default
|
|
406
406
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogueMQA.vue.mjs","sources":["../../lib/data-provider-interface/CatalogueMQA.vue"],"sourcesContent":["<template>\n <div class=\"container mb-3\">\n <div>\n <div>\n <div class=\"debug\">\n <strong> API object:</strong> <br><br>\n <!-- Disabled for PPE release (no backend on PPE yet)-->\n {{ notficationInfo }}\n\n <br> --- <br>\n\n {{ mailList }}\n\n <br>---<br>\n <strong>Fequency:</strong> <br>\n weekly: {{ weekly }}<br>\n monthly: {{ monthly }} <br>\n <p></p>\n unit: {{ frequencyUnit }} <br>\n value: {{ frequencyValue }}\n\n <br>---<br>\n treshold: {{ treshold }}\n\n </div>\n <h1>MQA Report Settings</h1>\n <p>Configuration for\n\n <strong>{{ catalogId }}</strong>\n <!-- <strong>Test Catalogue</strong> -->\n </p>\n <p>For this Catalogue the <b>MQA Rating Checks </b>are currently <b>\n <span v-if=\"!active\">deactivated</span>\n <span v-if=\"active\">activated</span></b>.</p>\n </div>\n\n <button type=\"button\" :class=\"{ 'btn btn-primary mb-5': !active, 'btn btn-secondary': active }\" @click=\"handleActivate()\">\n {{ activatedString }}\n </button>\n </div>\n \n <div v-if=\"active\">\n <div class=\"mqaWrapper\" >\n <h3>Recipients Mail</h3>\n <span>Add and edit mail addresses for recieving the MQA report</span>\n <table class=\"mt-4\" ref=\"mailButtonWrap\" v-if=\"mailList.length != 0\">\n <tr>\n <th>Mail</th>\n </tr>\n <tr v-for=\"(item, index) in mailList\" class=\"mailItems\" :key=\"index\">\n <td>\n <span v-if=\"!editMode\">{{ item }}</span>\n <input type=\"text\" v-model=\"mailList[index]\" class=\"mail-input\" v-if=\"editMode\"\n @input=\"editErrors[index] = ''\"\n :class=\"{ 'invalidNewMail': editErrors[index] }\" >\n \n <div>\n <button type=\"button\" class=\"btn btn-simple\"\n @click=\"editMode ? saveMail(index) : editMail(index)\">\n {{ editMode ? 'Save' : 'Edit' }}\n </button>\n <button type=\"button\" class=\"btn btn-simple\"\n @click=\"deleteMail(index)\">Delete</button>\n </div>\n </td>\n <span class=\"errormsg\" v-if=\"editErrors[index]\">{{ editErrors[index] }}</span>\n </tr>\n </table>\n <div class=\"d-flex mt-3\">\n <input type=\"text\" v-model=\"newMail.mail\" @input=\"newMail.isValid = true\"\n :class=\"{ 'invalidNewMail': !newMail.isValid }\" placeholder=\"Enter email address\"\n class=\"mail\">\n <button type=\"button\" class=\"btn btn-simple mx-3\" @click=\"addNewMail()\">+ Add Mail</button>\n </div>\n <span class=\"errormsg\" v-if=\"!newMail.isValid\">*Invalid email format</span>\n </div>\n <div class=\"mqaWrapper\">\n <h3>Frequency of Rating Checks</h3>\n <span>Configure the frequency of the MQA rating checks.</span>\n\n <div class=\"d-flex mt-3\">\n <div class=\"mr-3 my-3\">\n <button type=\"button\" class=\"btn btn-simple\" @click=\"setWeekly()\"\n :class=\"{ 'activeChoiceButton': weekly }\">Weekly</button>\n <div class=\"weekdays\" :class=\"{ 'blur': !weekly }\">\n <span v-for=\"(day, index) in week\" :key=\"index\">\n <button :disabled=\"!weekly\" class=\"dayButtons\"\n :class=\"{ 'activeItem': selectedDay === index }\" @click=\"selectDay(index)\">\n {{ day }}\n </button>\n </span>\n </div>\n </div>\n <div class=\"my-3\">\n <button type=\"button\" :class=\"{ 'activeChoiceButton': monthly }\" class=\"btn btn-simple\"\n @click=\"setMonthly()\">Monthly</button>\n <div class=\"d-flex daypicker my-3\" :class=\"{ 'blur': !monthly }\">\n <input v-model=\"daysInMonth\" @input=\"selectDay(index)\" :class=\"{ dynamicWidth: inputWidth }\"\n :disabled=\"!monthly\">\n <div class=\"caretWrap\">\n <button @click=\"editDate('up')\" class=\"caretButtons ml-1\"><svg\n xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"currentColor\"\n class=\"bi bi-caret-up-fill\" viewBox=\"0 0 16 16\">\n <path\n d=\"m7.247 4.86-4.796 5.481c-.566.647-.106 1.659.753 1.659h9.592a1 1 0 0 0 .753-1.659l-4.796-5.48a1 1 0 0 0-1.506 0z\" />\n </svg></button>\n <button @click=\"editDate()\" class=\"caretButtons mr-1\"><svg\n xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"currentColor\"\n class=\"bi bi-caret-down-fill\" viewBox=\"0 0 16 16\">\n <path\n d=\"M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z\" />\n </svg></button>\n </div>\n <span>day of the month</span> \n </div>\n </div>\n </div>\n </div>\n <div class=\"mqaWrapper\">\n <h3>Notification Treshold</h3>\n <span>Set the threshold for triggering the report.</span>\n <div class=\"w-50 mt-3\">\n <div class=\"d-flex justify-content-between\">\n <span><b>0</b></span>\n <span><b>400</b></span>\n </div>\n <input type=\"range\" v-model=\"treshold\" min=\"0\" max=\"400\" />\n <p>Lower than <b>{{ treshold }}</b> Points</p>\n </div>\n </div>\n <div class=\"actionWrapper\">\n <button type=\"button\" class=\"btn btn-primary\" @click=\"postNotificationSettings\">Save</button>\n <button type=\"button\" class=\"btn btn-cancel\" @click=\"back()\">Cancel</button>\n </div>\n </div>\n </div>\n\n</template>\n<script setup>\n\nimport { ref } from 'vue';\nimport { useRoute } from 'vue-router'\nimport { getCurrentInstance } from \"vue\";\nimport { useStore } from 'vuex';\nimport { useRouter } from 'vue-router';\n\n\nimport axios from 'axios'\n\nconst store = useStore();\nconst router = useRouter();\n\nconst showSnackbar = (payload) => {\n store.dispatch('snackbar/showSnackbar', payload);\n};\n\n\nconst triggerSnackbar = () => {\n showSnackbar({\n message: 'Saved Successfully',\n variant: 'success',\n });\n };\n\n// Map the showSnackbar action from the snackbar module\n\nconst route = useRoute()\n\nlet monthly = ref(false)\nlet weekly = ref(false)\nlet mailButtonWrap = ref(null)\nlet activatedString = ref('Activate')\nlet inputWidth = ref(false)\nlet active = ref(false)\nlet mailList = ref()\nlet week = ['Mo', 'Tue', 'We', 'Th', 'Fr', 'Sa', 'Su']\nlet daysInMonth = ref(1)\nlet editMode = ref(false);\nlet treshold = ref(0);\nlet frequencyUnit = ref('');\nlet frequencyValue = ref('');\nlet selectedDay = ref(null);\nconst catalogId = route.params.id\nconst app = getCurrentInstance()\nconst notificationBaseUrl = app.appContext.app.config.globalProperties.$env.api.notificationBaseUrl\nconst apiKey = app.appContext.app.config.globalProperties.$env.api.apiKey\n\nconst selectDay = (index) => {\n if (weekly.value) {\n selectedDay.value = index;\n frequencyValue.value = selectedDay; // Update frequencyValue when a day is selected\n } \n};\n\nconst setWeekly = () => {\n weekly.value = true;\n monthly.value = false;\n selectedDay.value = frequencyValue.value; // Set the selected day based on frequencyValue\n};\n\nconst setMonthly = () => {\n weekly.value = false;\n monthly.value = true;\n selectedDay.value = frequencyValue.value; // Set the day of the month based on frequencyValue\n};\n\nconst notficationInfo = ref({})\n\nconst isValidEmail = (email) => {\n const regex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return regex.test(email);\n};\n\nlet newMail = ref({ mail: '', isValid: true });\nlet editErrors = ref({});\n\n// enabeld for PPE release (dummy data)\n// mailList.value = [{ 'mail': \"mail@mail2.com\" }, { 'mail': \"mail@mail1.com\" }]\n\nconst fetchNotificationInfo = async () => {\n const config = {\n method: 'get',\n url: `${notificationBaseUrl}/catalogue/${catalogId}/setting`,\n headers: {\n 'Authorization': apiKey,\n 'Accept': 'application/json',\n },\n withCredentials: true\n }\n\n try {\n const response = await axios.request(config)\n notficationInfo.value = response.data\n\n if (notficationInfo.value.activeStatus === true) {\n active.value = true\n activatedString.value = 'Deactivate'\n } if (notficationInfo.value.activeStatus === false) {\n active.value = false\n activatedString.value = 'Activate'\n }\n\n mailList.value = notficationInfo.value.receiverEmailList\n frequencyUnit.value = notficationInfo.value.frequency.unit\n frequencyValue.value = notficationInfo.value.frequency.value\n treshold.value = notficationInfo.value.threshold\n\n if (frequencyUnit.value === 'week') {\n weekly.value = true\n monthly.value = false\n selectedDay.value = frequencyValue.value; // Set the selected day based on frequencyValue\n } else if (frequencyUnit.value === 'month') {\n weekly.value = false\n monthly.value = true\n daysInMonth.value = frequencyValue.value\n }\n\n console.log('Response:', response)\n } catch (error) {\n console.log('Full error:', error)\n }\n}\n\nconst postNotificationSettings = async () => {\n\n if (weekly.value === true) {\n frequencyUnit.value = \"week\"\n frequencyValue.value = selectedDay.value\n } else if (monthly.value === true) {\n frequencyUnit.value = \"month\"\n frequencyValue.value = daysInMonth.value\n }\n\n const config = {\n method: 'post',\n url: `https://piveau-metrics-notifications-piveau.apps.osc.fokus.fraunhofer.de/catalogue/${catalogId}/setting`,\n headers: {\n 'Authorization': apiKey,\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',\n 'Access-Control-Allow-Headers': 'Authorization'\n },\n withCredentials: true,\n data: JSON.stringify({\n receiverEmailList: mailList.value,\n threshold: Number(treshold.value),\n frequency: {\n unit: frequencyUnit.value,\n value: frequencyValue.value\n },\n activeStatus: true\n })\n }\n\n try {\n const response = await axios.request(config)\n console.log('Settings updated:', response.data)\n triggerSnackbar();\n router.push({ name: 'DataProviderInterface-UserCatalogues' });\n return response.data\n \n\n } catch (error) {\n triggerSnackbar({\n message: 'Error updating settings.',\n variant: 'error',\n });\n\n console.log('Error updating settings:', error)\n \n throw error\n \n }\n \n\n}\n\nfetchNotificationInfo()\n\nconst postDeactive = async () => {\n\n const config = {\n method: 'post',\n url: `https://piveau-metrics-notifications-piveau.apps.osc.fokus.fraunhofer.de/catalogue/${catalogId}/setting`,\n headers: {\n 'Authorization': apiKey,\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',\n 'Access-Control-Allow-Headers': 'Authorization'\n },\n withCredentials: true,\n data: JSON.stringify({\n activeStatus: active.value\n })\n }\n\n try {\n const response = await axios.request(config)\n console.log('Settings updated:', response.data)\n triggerSnackbar();\n if(!active.value) {router.push({ name: 'DataProviderInterface-UserCatalogues' });}\n return response.data\n \n\n } catch (error) {\n triggerSnackbar({\n message: 'Error updating settings.',\n variant: 'error',\n });\n\n console.log('Error updating settings:', error)\n \n throw error\n \n }\n}\n\nconst editMail = () => {\n editMode.value = true\n showSnackbar({\n message: 'Email added successfully.',\n variant: 'success',\n });\n}\n\nconst saveMail = (index) => {\n const email = mailList.value[index].trim();\n if (isValidEmail(email)) {\n editMode.value = false;\n delete editErrors.value[index];\n } else {\n editErrors.value[index] = '*Invalid email format';\n }\n};\n\nconst deleteMail = (index) => {\n mailList.value.splice(index, 1);\n}\n\nconst editDate = (count) => {\n if (count === \"up\" && daysInMonth.value < 28) {\n if (daysInMonth.value > 8) {\n inputWidth.value = true\n }\n daysInMonth.value++\n }\n else if (daysInMonth.value > 1) {\n if (daysInMonth.value < 11) {\n inputWidth.value = false\n }\n daysInMonth.value--\n }\n}\n\nconst addNewMail = () => {\n if (newMail.value.mail.trim() === '') {\n newMail.value.isValid = false;\n return;\n }\n if (isValidEmail(newMail.value.mail)) {\n mailList.value.push(newMail.value.mail);\n newMail.value.mail = ''; // Clear input after successful addition\n newMail.value.isValid = true;\n } else {\n newMail.value.isValid = false;\n }\n}\nconst handleActivate = () => {\n if (!active.value) {\n active.value = true\n activatedString.value = 'Deactivate'\n postDeactive()\n } else {\n active.value = false\n activatedString.value = 'Activate'\n postDeactive()\n }\n}\n\nconst back = () => {\n router.push({ name: 'DataProviderInterface-UserCatalogues' });\n}\n\n</script>\n<style scoped>\n.debug {\n position: fixed;\n right: 20px;\n top: 20px;\n border-radius: 20px;\n width: 400px;\n z-index: 999999;\n padding: 20px;\n background: rgba(255, 255, 255, 0.2);\n border-radius: 16px;\n box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);\n backdrop-filter: blur(5px);\n -webkit-backdrop-filter: blur(5px);\n border: 1px solid rgba(255, 255, 255, 0.3);\n display: none; \n}\n\n.btn-simple {\n border-color: rgb(115, 115, 115);\n}\n\n.btn-cancel {\n border-color: transparent;\n}\n\n.mail {\n width: 270px;\n padding: 5px 5px 5px 10px;\n}\n\n\n.errormsg {\n color: red;\n font-size: 10px;\n}\n\n.activeChoiceButton {\n background-color: var(--primary);\n color: white;\n border-color: var(--primary);\n\n &:active {\n background-color: #3E6CD5 !important;\n }\n\n &:focus {\n outline: none;\n background-color: #3E6CD5;\n }\n\n &:focus-visible {\n outline: none;\n background-color: #3E6CD5;\n }\n}\n\n\n.invalid {\n border-bottom: 1px solid red !important;\n}\n\n.blur {\n opacity: 0.3;\n}\n\n.invalidNewMail {\n\n border-radius: 2px;\n border: 2px solid rgba(255, 0, 0, 0.336);\n\n &:focus {\n border-radius: 2px;\n box-shadow: 0 0 0 0.1rem rgba(255, 0, 0, 0.774);\n border: 1px solid rgba(255, 0, 0, 0.336);\n }\n\n &:focus-visible {\n outline: 0;\n border-radius: 2px;\n box-shadow: 0 0 0 0.1rem rgba(255, 0, 0, 0.774);\n border: 1px solid rgba(255, 0, 0, 0.336);\n }\n}\n\n.editable {\n transition: all 200ms ease-in-out;\n padding-left: 0.5rem;\n border-bottom: 2px solid var(--primary) !important;\n}\n\n.invalid {\n border-bottom: 1px solid red !important;\n}\n\n.caretButtons {\n all: unset;\n cursor: pointer;\n}\n\n.caretWrap {\n display: contents;\n\n}\n\n.actionWrapper {\n display: flex;\n flex-direction: row-reverse;\n margin-bottom: 100px;\n\n button {\n margin-left: 1rem;\n }\n}\n\ninput[type=\"range\"] {\n width: 100%;\n}\n\n.mqaWrapper {\n margin: 3rem 0;\n}\n\ntable {\n margin-top: 1rem;\n min-width: 50%;\n}\n\nth {\n border-bottom: 1px solid lightgray;\n}\n\ntd {\n display: flex;\n justify-content: space-between;\n padding: 15px 0 0 0cap;\n}\n\n.daypicker {\n padding: 1rem;\n border: 1px solid lightgray;\n border-radius: 15px;\n\n input {\n width: 25px;\n border: none;\n background-color: unset;\n font-weight: 700;\n }\n\n}\n\n.dynamicWidth {\n width: 22px !important;\n}\n\n.activeItem {\n background-color: var(--primary);\n color: white;\n}\n\n.weekdays {\n border: 1px solid lightgray;\n border-radius: 15px;\n margin: 1rem 0;\n overflow: hidden;\n\n .dayButtons {\n border: none;\n display: inline-block;\n text-align: center;\n flex-direction: row;\n min-width: 60px;\n padding: 1rem;\n border-right: 1px solid lightgray;\n cursor: pointer;\n\n &:focus-visible {\n outline: unset;\n background-color: #3E6CD5;\n color: white;\n }\n\n &:hover {\n background-color: #3E6CD5;\n color: white;\n }\n }\n\n span:last-child button {\n border: none;\n }\n}\n\n.mqaWrapper {\n padding: 1rem;\n background-color: #f5f5f5;\n border-radius: 3px;\n}\n\nbutton {\n background-color: unset;\n border: 1px solid var(--primary);\n color: black;\n\n &:hover {\n background-color: #3E6CD5;\n color: white;\n border: 1px solid #3E6CD5;\n }\n}\n\n.btn-primary {\n background-color: var(--primary);\n color: white;\n\n}\n\n.btn-secondary {\n color: #0e47cb;\n}\n\nbutton,\nspan {\n transition: all 100ms ease-in-out;\n}\n</style>"],"names":["store","useStore","router","useRouter","showSnackbar","payload","triggerSnackbar","route","useRoute","monthly","ref","weekly","mailButtonWrap","activatedString","inputWidth","active","mailList","week","daysInMonth","editMode","treshold","frequencyUnit","frequencyValue","selectedDay","catalogId","app","getCurrentInstance","notificationBaseUrl","apiKey","selectDay","index","setWeekly","setMonthly","notficationInfo","isValidEmail","email","newMail","editErrors","fetchNotificationInfo","config","response","axios","error","postNotificationSettings","postDeactive","editMail","saveMail","deleteMail","editDate","count","addNewMail","handleActivate","back"],"mappings":";;;;;;;;;;;;;;;AAqJA,UAAMA,IAAQC,GAAQ,GAChBC,IAASC,GAAS,GAElBC,IAAe,CAACC,MAAY;AAChC,MAAAL,EAAM,SAAS,yBAAyBK,CAAO;AAAA,IACjD,GAGMC,IAAkB,MAAM;AAClB,MAAAF,EAAa;AAAA,QACT,SAAS;AAAA,QACT,SAAS;AAAA,MACzB,CAAa;AAAA,IACb,GAIMG,IAAQC,GAAS;AAEvB,QAAIC,IAAUC,EAAI,EAAK,GACnBC,IAASD,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CatalogueMQA.vue.mjs","sources":["../../lib/data-provider-interface/CatalogueMQA.vue"],"sourcesContent":["<template>\n <div class=\"container mb-3\">\n <div>\n <div>\n <div class=\"debug\">\n <strong> API object:</strong> <br><br>\n <!-- Disabled for PPE release (no backend on PPE yet)-->\n {{ notficationInfo }}\n\n <br> --- <br>\n\n {{ mailList }}\n\n <br>---<br>\n <strong>Fequency:</strong> <br>\n weekly: {{ weekly }}<br>\n monthly: {{ monthly }} <br>\n <p></p>\n unit: {{ frequencyUnit }} <br>\n value: {{ frequencyValue }}\n\n <br>---<br>\n treshold: {{ treshold }}\n\n </div>\n <h1>MQA Report Settings</h1>\n <p>Configuration for\n\n <strong>{{ catalogId }}</strong>\n <!-- <strong>Test Catalogue</strong> -->\n </p>\n <p>For this Catalogue the <b>MQA Rating Checks </b>are currently <b>\n <span v-if=\"!active\">deactivated</span>\n <span v-if=\"active\">activated</span></b>.</p>\n </div>\n\n <button type=\"button\" :class=\"{ 'btn btn-primary mb-5': !active, 'btn btn-secondary': active }\" @click=\"handleActivate()\">\n {{ activatedString }}\n </button>\n </div>\n \n <div v-if=\"active\">\n <div class=\"mqaWrapper\" >\n <h3>Recipients Mail</h3>\n <span>Add and edit mail addresses for recieving the MQA report</span>\n <table class=\"mt-4\" ref=\"mailButtonWrap\" v-if=\"mailList.length != 0\">\n <tr>\n <th>Mail</th>\n </tr>\n <tr v-for=\"(item, index) in mailList\" class=\"mailItems\" :key=\"index\">\n <td>\n <span v-if=\"!editMode\">{{ item }}</span>\n <input type=\"text\" v-model=\"mailList[index]\" class=\"mail-input\" v-if=\"editMode\"\n @input=\"editErrors[index] = ''\"\n :class=\"{ 'invalidNewMail': editErrors[index] }\" >\n \n <div>\n <button type=\"button\" class=\"btn btn-simple\"\n @click=\"editMode ? saveMail(index) : editMail(index)\">\n {{ editMode ? 'Save' : 'Edit' }}\n </button>\n <button type=\"button\" class=\"btn btn-simple\"\n @click=\"deleteMail(index)\">Delete</button>\n </div>\n </td>\n <span class=\"errormsg\" v-if=\"editErrors[index]\">{{ editErrors[index] }}</span>\n </tr>\n </table>\n <div class=\"d-flex mt-3\">\n <input type=\"text\" v-model=\"newMail.mail\" @input=\"newMail.isValid = true\"\n :class=\"{ 'invalidNewMail': !newMail.isValid }\" placeholder=\"Enter email address\"\n class=\"mail\">\n <button type=\"button\" class=\"btn btn-simple mx-3\" @click=\"addNewMail()\">+ Add Mail</button>\n </div>\n <span class=\"errormsg\" v-if=\"!newMail.isValid\">*Invalid email format</span>\n </div>\n <div class=\"mqaWrapper\">\n <h3>Frequency of Rating Checks</h3>\n <span>Configure the frequency of the MQA rating checks.</span>\n\n <div class=\"d-flex mt-3\">\n <div class=\"mr-3 my-3\">\n <button type=\"button\" class=\"btn btn-simple\" @click=\"setWeekly()\"\n :class=\"{ 'activeChoiceButton': weekly }\">Weekly</button>\n <div class=\"weekdays\" :class=\"{ 'blur': !weekly }\">\n <span v-for=\"(day, index) in week\" :key=\"index\">\n <button :disabled=\"!weekly\" class=\"dayButtons\"\n :class=\"{ 'activeItem': selectedDay === index }\" @click=\"selectDay(index)\">\n {{ day }}\n </button>\n </span>\n </div>\n </div>\n <div class=\"my-3\">\n <button type=\"button\" :class=\"{ 'activeChoiceButton': monthly }\" class=\"btn btn-simple\"\n @click=\"setMonthly()\">Monthly</button>\n <div class=\"d-flex daypicker my-3\" :class=\"{ 'blur': !monthly }\">\n <input v-model=\"daysInMonth\" @input=\"selectDay(index)\" :class=\"{ dynamicWidth: inputWidth }\"\n :disabled=\"!monthly\">\n <div class=\"caretWrap\">\n <button @click=\"editDate('up')\" class=\"caretButtons ml-1\"><svg\n xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"currentColor\"\n class=\"bi bi-caret-up-fill\" viewBox=\"0 0 16 16\">\n <path\n d=\"m7.247 4.86-4.796 5.481c-.566.647-.106 1.659.753 1.659h9.592a1 1 0 0 0 .753-1.659l-4.796-5.48a1 1 0 0 0-1.506 0z\" />\n </svg></button>\n <button @click=\"editDate()\" class=\"caretButtons mr-1\"><svg\n xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"currentColor\"\n class=\"bi bi-caret-down-fill\" viewBox=\"0 0 16 16\">\n <path\n d=\"M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z\" />\n </svg></button>\n </div>\n <span>day of the month</span> \n </div>\n </div>\n </div>\n </div>\n <div class=\"mqaWrapper\">\n <h3>Notification Treshold</h3>\n <span>Set the threshold for triggering the report.</span>\n <div class=\"w-50 mt-3\">\n <div class=\"d-flex justify-content-between\">\n <span><b>0</b></span>\n <span><b>400</b></span>\n </div>\n <input type=\"range\" v-model=\"treshold\" min=\"0\" max=\"400\" />\n <p>Lower than <b>{{ treshold }}</b> Points</p>\n </div>\n </div>\n <div class=\"actionWrapper\">\n <button type=\"button\" class=\"btn btn-primary\" @click=\"postNotificationSettings\">Save</button>\n <button type=\"button\" class=\"btn btn-cancel\" @click=\"back()\">Cancel</button>\n </div>\n </div>\n </div>\n\n</template>\n<script setup>\n\nimport { ref } from 'vue';\nimport { useRoute } from 'vue-router'\nimport { getCurrentInstance } from \"vue\";\nimport { useStore } from 'vuex';\nimport { useRouter } from 'vue-router';\n\n\nimport axios from 'axios'\n\nconst store = useStore();\nconst router = useRouter();\n\nconst showSnackbar = (payload) => {\n store.dispatch('snackbar/showSnackbar', payload);\n};\n\n\nconst triggerSnackbar = () => {\n showSnackbar({\n message: 'Saved Successfully',\n variant: 'success',\n });\n };\n\n// Map the showSnackbar action from the snackbar module\n\nconst route = useRoute()\n\nlet monthly = ref(false)\nlet weekly = ref(false)\nlet mailButtonWrap = ref(null)\nlet activatedString = ref('Activate')\nlet inputWidth = ref(false)\nlet active = ref(false)\nlet mailList = ref()\nlet week = ['Mo', 'Tue', 'We', 'Th', 'Fr', 'Sa', 'Su']\nlet daysInMonth = ref(1)\nlet editMode = ref(false);\nlet treshold = ref(0);\nlet frequencyUnit = ref('');\nlet frequencyValue = ref('');\nlet selectedDay = ref(null);\nconst catalogId = route.params.id\nconst app = getCurrentInstance()\nconst notificationBaseUrl = app.appContext.app.config.globalProperties.$env.api.notificationBaseUrl\nconst apiKey = app.appContext.app.config.globalProperties.$env.api.apiKey\n\nconst selectDay = (index) => {\n if (weekly.value) {\n selectedDay.value = index;\n frequencyValue.value = selectedDay; // Update frequencyValue when a day is selected\n } \n};\n\nconst setWeekly = () => {\n weekly.value = true;\n monthly.value = false;\n selectedDay.value = frequencyValue.value; // Set the selected day based on frequencyValue\n};\n\nconst setMonthly = () => {\n weekly.value = false;\n monthly.value = true;\n selectedDay.value = frequencyValue.value; // Set the day of the month based on frequencyValue\n};\n\nconst notficationInfo = ref({})\n\nconst isValidEmail = (email) => {\n const regex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return regex.test(email);\n};\n\nlet newMail = ref({ mail: '', isValid: true });\nlet editErrors = ref({});\n\n// enabeld for PPE release (dummy data)\n// mailList.value = [{ 'mail': \"mail@mail2.com\" }, { 'mail': \"mail@mail1.com\" }]\n\nconst fetchNotificationInfo = async () => {\n const config = {\n method: 'get',\n url: `${notificationBaseUrl}/catalogue/${catalogId}/setting`,\n headers: {\n 'Authorization': apiKey,\n 'Accept': 'application/json',\n },\n withCredentials: true\n }\n\n try {\n const response = await axios.request(config)\n notficationInfo.value = response.data\n\n if (notficationInfo.value.activeStatus === true) {\n active.value = true\n activatedString.value = 'Deactivate'\n } if (notficationInfo.value.activeStatus === false) {\n active.value = false\n activatedString.value = 'Activate'\n }\n\n mailList.value = notficationInfo.value.receiverEmailList\n frequencyUnit.value = notficationInfo.value.frequency.unit\n frequencyValue.value = notficationInfo.value.frequency.value\n treshold.value = notficationInfo.value.threshold\n\n if (frequencyUnit.value === 'week') {\n weekly.value = true\n monthly.value = false\n selectedDay.value = frequencyValue.value; // Set the selected day based on frequencyValue\n } else if (frequencyUnit.value === 'month') {\n weekly.value = false\n monthly.value = true\n daysInMonth.value = frequencyValue.value\n }\n\n console.log('Response:', response)\n } catch (error) {\n console.log('Full error:', error)\n }\n}\n\nconst postNotificationSettings = async () => {\n\n if (weekly.value === true) {\n frequencyUnit.value = \"week\"\n frequencyValue.value = selectedDay.value\n } else if (monthly.value === true) {\n frequencyUnit.value = \"month\"\n frequencyValue.value = daysInMonth.value\n }\n\n const config = {\n method: 'post',\n url: `https://piveau-metrics-notifications-piveau.apps.osc.fokus.fraunhofer.de/catalogue/${catalogId}/setting`,\n headers: {\n 'Authorization': apiKey,\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',\n 'Access-Control-Allow-Headers': 'Authorization'\n },\n withCredentials: true,\n data: JSON.stringify({\n receiverEmailList: mailList.value,\n threshold: Number(treshold.value),\n frequency: {\n unit: frequencyUnit.value,\n value: frequencyValue.value\n },\n activeStatus: true\n })\n }\n\n try {\n const response = await axios.request(config)\n console.log('Settings updated:', response.data)\n triggerSnackbar();\n router.push({ name: 'DataProviderInterface-UserCatalogues' });\n return response.data\n \n\n } catch (error) {\n triggerSnackbar({\n message: 'Error updating settings.',\n variant: 'error',\n });\n\n console.log('Error updating settings:', error)\n \n throw error\n \n }\n \n\n}\n\nfetchNotificationInfo()\n\nconst postDeactive = async () => {\n\n const config = {\n method: 'post',\n url: `https://piveau-metrics-notifications-piveau.apps.osc.fokus.fraunhofer.de/catalogue/${catalogId}/setting`,\n headers: {\n 'Authorization': apiKey,\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',\n 'Access-Control-Allow-Headers': 'Authorization'\n },\n withCredentials: true,\n data: JSON.stringify({\n activeStatus: active.value\n })\n }\n\n try {\n const response = await axios.request(config)\n console.log('Settings updated:', response.data)\n triggerSnackbar();\n if(!active.value) {router.push({ name: 'DataProviderInterface-UserCatalogues' });}\n return response.data\n \n\n } catch (error) {\n triggerSnackbar({\n message: 'Error updating settings.',\n variant: 'error',\n });\n\n console.log('Error updating settings:', error)\n \n throw error\n \n }\n}\n\nconst editMail = () => {\n editMode.value = true\n showSnackbar({\n message: 'Email added successfully.',\n variant: 'success',\n });\n}\n\nconst saveMail = (index) => {\n const email = mailList.value[index].trim();\n if (isValidEmail(email)) {\n editMode.value = false;\n delete editErrors.value[index];\n } else {\n editErrors.value[index] = '*Invalid email format';\n }\n};\n\nconst deleteMail = (index) => {\n mailList.value.splice(index, 1);\n}\n\nconst editDate = (count) => {\n if (count === \"up\" && daysInMonth.value < 28) {\n if (daysInMonth.value > 8) {\n inputWidth.value = true\n }\n daysInMonth.value++\n }\n else if (daysInMonth.value > 1) {\n if (daysInMonth.value < 11) {\n inputWidth.value = false\n }\n daysInMonth.value--\n }\n}\n\nconst addNewMail = () => {\n if (newMail.value.mail.trim() === '') {\n newMail.value.isValid = false;\n return;\n }\n if (isValidEmail(newMail.value.mail)) {\n mailList.value.push(newMail.value.mail);\n newMail.value.mail = ''; // Clear input after successful addition\n newMail.value.isValid = true;\n } else {\n newMail.value.isValid = false;\n }\n}\nconst handleActivate = () => {\n if (!active.value) {\n active.value = true\n activatedString.value = 'Deactivate'\n postDeactive()\n } else {\n active.value = false\n activatedString.value = 'Activate'\n postDeactive()\n }\n}\n\nconst back = () => {\n router.push({ name: 'DataProviderInterface-UserCatalogues' });\n}\n\n</script>\n<style scoped>\n.debug {\n position: fixed;\n right: 20px;\n top: 20px;\n border-radius: 20px;\n width: 400px;\n z-index: 999999;\n padding: 20px;\n background: rgba(255, 255, 255, 0.2);\n border-radius: 16px;\n box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);\n backdrop-filter: blur(5px);\n -webkit-backdrop-filter: blur(5px);\n border: 1px solid rgba(255, 255, 255, 0.3);\n display: none; \n}\n\n.btn-simple {\n border-color: rgb(115, 115, 115);\n}\n\n.btn-cancel {\n border-color: transparent;\n}\n\n.mail {\n width: 270px;\n padding: 5px 5px 5px 10px;\n}\n\n\n.errormsg {\n color: red;\n font-size: 10px;\n}\n\n.activeChoiceButton {\n background-color: var(--primary);\n color: white;\n border-color: var(--primary);\n\n &:active {\n background-color: #3E6CD5 !important;\n }\n\n &:focus {\n outline: none;\n background-color: #3E6CD5;\n }\n\n &:focus-visible {\n outline: none;\n background-color: #3E6CD5;\n }\n}\n\n\n.invalid {\n border-bottom: 1px solid red !important;\n}\n\n.blur {\n opacity: 0.3;\n}\n\n.invalidNewMail {\n\n border-radius: 2px;\n border: 2px solid rgba(255, 0, 0, 0.336);\n\n &:focus {\n border-radius: 2px;\n box-shadow: 0 0 0 0.1rem rgba(255, 0, 0, 0.774);\n border: 1px solid rgba(255, 0, 0, 0.336);\n }\n\n &:focus-visible {\n outline: 0;\n border-radius: 2px;\n box-shadow: 0 0 0 0.1rem rgba(255, 0, 0, 0.774);\n border: 1px solid rgba(255, 0, 0, 0.336);\n }\n}\n\n.editable {\n transition: all 200ms ease-in-out;\n padding-left: 0.5rem;\n border-bottom: 2px solid var(--primary) !important;\n}\n\n.invalid {\n border-bottom: 1px solid red !important;\n}\n\n.caretButtons {\n all: unset;\n cursor: pointer;\n}\n\n.caretWrap {\n display: contents;\n\n}\n\n.actionWrapper {\n display: flex;\n flex-direction: row-reverse;\n margin-bottom: 100px;\n\n button {\n margin-left: 1rem;\n }\n}\n\ninput[type=\"range\"] {\n width: 100%;\n}\n\n.mqaWrapper {\n margin: 3rem 0;\n}\n\ntable {\n margin-top: 1rem;\n min-width: 50%;\n}\n\nth {\n border-bottom: 1px solid lightgray;\n}\n\ntd {\n display: flex;\n justify-content: space-between;\n padding: 15px 0 0 0cap;\n}\n\n.daypicker {\n padding: 1rem;\n border: 1px solid lightgray;\n border-radius: 15px;\n\n input {\n width: 25px;\n border: none;\n background-color: unset;\n font-weight: 700;\n }\n\n}\n\n.dynamicWidth {\n width: 22px !important;\n}\n\n.activeItem {\n background-color: var(--primary);\n color: white;\n}\n\n.weekdays {\n border: 1px solid lightgray;\n border-radius: 15px;\n margin: 1rem 0;\n overflow: hidden;\n\n .dayButtons {\n border: none;\n display: inline-block;\n text-align: center;\n flex-direction: row;\n min-width: 60px;\n padding: 1rem;\n border-right: 1px solid lightgray;\n cursor: pointer;\n\n &:focus-visible {\n outline: unset;\n background-color: #3E6CD5;\n color: white;\n }\n\n &:hover {\n background-color: #3E6CD5;\n color: white;\n }\n }\n\n span:last-child button {\n border: none;\n }\n}\n\n.mqaWrapper {\n padding: 1rem;\n background-color: #f3f6fc;\n border-radius: 3px;\n}\n\nbutton {\n background-color: unset;\n border: 1px solid var(--primary);\n color: black;\n\n &:hover {\n background-color: #3E6CD5;\n color: white;\n border: 1px solid #3E6CD5;\n }\n}\n\n.btn-primary {\n background-color: var(--primary);\n color: white;\n\n}\n\n.btn-secondary {\n color: #0e47cb;\n}\n\nbutton,\nspan {\n transition: all 100ms ease-in-out;\n}\n</style>"],"names":["store","useStore","router","useRouter","showSnackbar","payload","triggerSnackbar","route","useRoute","monthly","ref","weekly","mailButtonWrap","activatedString","inputWidth","active","mailList","week","daysInMonth","editMode","treshold","frequencyUnit","frequencyValue","selectedDay","catalogId","app","getCurrentInstance","notificationBaseUrl","apiKey","selectDay","index","setWeekly","setMonthly","notficationInfo","isValidEmail","email","newMail","editErrors","fetchNotificationInfo","config","response","axios","error","postNotificationSettings","postDeactive","editMail","saveMail","deleteMail","editDate","count","addNewMail","handleActivate","back"],"mappings":";;;;;;;;;;;;;;;AAqJA,UAAMA,IAAQC,GAAQ,GAChBC,IAASC,GAAS,GAElBC,IAAe,CAACC,MAAY;AAChC,MAAAL,EAAM,SAAS,yBAAyBK,CAAO;AAAA,IACjD,GAGMC,IAAkB,MAAM;AAClB,MAAAF,EAAa;AAAA,QACT,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,7 +4,7 @@ import "lodash-es";
|
|
|
4
4
|
import { mapGetters as $, mapActions as k } from "vuex";
|
|
5
5
|
import T from "./components/Dropup.vue.mjs";
|
|
6
6
|
import { useWindowScroll as U } from "../external/@vueuse/core/index";
|
|
7
|
-
import { resolveComponent as f, openBlock as u, createElementBlock as g, createElementVNode as n, toDisplayString as c, createTextVNode as d, Fragment as y, renderList as b, createBlock as C, resolveDynamicComponent as _, normalizeClass as q, withCtx as D, renderSlot as O, createVNode as
|
|
7
|
+
import { resolveComponent as f, openBlock as u, createElementBlock as g, createElementVNode as n, toDisplayString as c, createTextVNode as d, Fragment as y, renderList as b, createBlock as C, resolveDynamicComponent as _, normalizeClass as q, withCtx as D, renderSlot as O, createVNode as v, createCommentVNode as P } from "vue";
|
|
8
8
|
import "./DPIMenu.vue2.mjs";
|
|
9
9
|
import z from "../_virtual/_plugin-vue_export-helper.mjs";
|
|
10
10
|
const L = {
|
|
@@ -376,7 +376,7 @@ function B(t, e, o, s, a, r) {
|
|
|
376
376
|
e[3] || (e[3] = n("br", null, null, -1)),
|
|
377
377
|
e[4] || (e[4] = d()),
|
|
378
378
|
n("button", F, [
|
|
379
|
-
|
|
379
|
+
v(h, { to: { name: "Logout" } }, {
|
|
380
380
|
default: D(() => [
|
|
381
381
|
d(c(t.$t("message.dataupload.menu.logout")), 1)
|
|
382
382
|
]),
|
|
@@ -384,10 +384,10 @@ function B(t, e, o, s, a, r) {
|
|
|
384
384
|
})
|
|
385
385
|
])
|
|
386
386
|
], !0)
|
|
387
|
-
])) :
|
|
388
|
-
])) :
|
|
387
|
+
])) : P("", !0)
|
|
388
|
+
])) : P("", !0),
|
|
389
389
|
e[7] || (e[7] = d()),
|
|
390
|
-
|
|
390
|
+
v(I, {
|
|
391
391
|
id: "DPIMenuModal",
|
|
392
392
|
loading: a.modal.loading,
|
|
393
393
|
confirm: a.modal.confirm,
|
|
@@ -1257,6 +1257,15 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1257
1257
|
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1258
1258
|
}>;
|
|
1259
1259
|
isEditMode: import('vue').ComputedRef<boolean>;
|
|
1260
|
+
translateSchema: ({ property, page }: {
|
|
1261
|
+
property: string;
|
|
1262
|
+
page: string;
|
|
1263
|
+
}) => void;
|
|
1264
|
+
createSchema: ({ property, page }: {
|
|
1265
|
+
property: string;
|
|
1266
|
+
page: string;
|
|
1267
|
+
}) => void;
|
|
1268
|
+
getSchema: (property: import('vue').MaybeRefOrGetter<string>) => import('vue').ComputedRef<{} | undefined>;
|
|
1260
1269
|
}, {
|
|
1261
1270
|
heightActiveSec: string;
|
|
1262
1271
|
formValues: {};
|
|
@@ -1271,7 +1280,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1271
1280
|
createIDFromTitle(): any;
|
|
1272
1281
|
getFirstTitleFromForm(): any;
|
|
1273
1282
|
isInput(): boolean;
|
|
1274
|
-
getSchema: import('vuex').Computed;
|
|
1275
1283
|
getNavSteps: import('vuex').Computed;
|
|
1276
1284
|
getDeleteDistributionInline: import('vuex').Computed;
|
|
1277
1285
|
getIsEditMode: import('vuex').Computed;
|
|
@@ -1285,11 +1293,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1285
1293
|
createDatasetID(): void;
|
|
1286
1294
|
generateandTranslateSchema(property: any): void;
|
|
1287
1295
|
clearAll: import('vuex').ActionMethod;
|
|
1288
|
-
createSchema: import('vuex').ActionMethod;
|
|
1289
|
-
translateSchema: import('vuex').ActionMethod;
|
|
1290
1296
|
saveFormValues: import('vuex').ActionMethod;
|
|
1291
1297
|
saveLocalstorageValues: import('vuex').ActionMethod;
|
|
1292
|
-
addCatalogOptions: import('vuex').ActionMethod;
|
|
1293
1298
|
setIsEditMode: import('vuex').ActionMethod;
|
|
1294
1299
|
setIsDraft: import('vuex').ActionMethod;
|
|
1295
1300
|
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import k from "jquery";
|
|
2
|
-
import { isNil as
|
|
3
|
-
import { mapGetters as
|
|
4
|
-
import { useWindowScroll as
|
|
5
|
-
import
|
|
6
|
-
import { getCurrentInstance as
|
|
2
|
+
import { isNil as N } from "lodash-es";
|
|
3
|
+
import { mapGetters as E, mapActions as D } from "vuex";
|
|
4
|
+
import { useWindowScroll as P } from "../../external/@vueuse/core/index";
|
|
5
|
+
import U from "axios";
|
|
6
|
+
import { getCurrentInstance as q, resolveComponent as w, openBlock as o, createElementBlock as g, createElementVNode as v, createBlock as p, createCommentVNode as n, createTextVNode as r, createVNode as T, withCtx as f, toDisplayString as b } from "vue";
|
|
7
7
|
import "vue-i18n";
|
|
8
8
|
import "./Navigation.vue2.mjs";
|
|
9
|
-
import
|
|
10
|
-
const
|
|
9
|
+
import M from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
10
|
+
const x = {
|
|
11
11
|
name: "Navigation",
|
|
12
12
|
props: ["steps", "nextStep", "previousStep", "goToNextStep", "goToPreviousStep"],
|
|
13
13
|
data() {
|
|
14
14
|
return {
|
|
15
|
-
instance:
|
|
15
|
+
instance: q().appContext.app.config.globalProperties.$env,
|
|
16
16
|
uploading: {
|
|
17
17
|
dataset: !1,
|
|
18
18
|
draft: !1
|
|
@@ -41,18 +41,18 @@ const N = {
|
|
|
41
41
|
setup() {
|
|
42
42
|
return {
|
|
43
43
|
scrollToTop: () => {
|
|
44
|
-
let { x: e, y: s } =
|
|
44
|
+
let { x: e, y: s } = P({ behavior: "smooth" });
|
|
45
45
|
s.value = 0;
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
},
|
|
49
49
|
computed: {
|
|
50
|
-
...
|
|
50
|
+
...E("auth", [
|
|
51
51
|
"getIsEditMode",
|
|
52
52
|
"getIsDraft",
|
|
53
53
|
"getUserData"
|
|
54
54
|
]),
|
|
55
|
-
...
|
|
55
|
+
...E("dpiStore", [
|
|
56
56
|
"getData"
|
|
57
57
|
]),
|
|
58
58
|
formErrorCount() {
|
|
@@ -63,7 +63,7 @@ const N = {
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
created() {
|
|
66
|
-
this
|
|
66
|
+
this.modals.clear.message = this.$t("message.dataupload.modal.resetForm"), this.modals.clear.confirm = this.$t("message.dataupload.modal.confirmReset");
|
|
67
67
|
},
|
|
68
68
|
methods: {
|
|
69
69
|
...D("auth", [
|
|
@@ -92,8 +92,9 @@ const N = {
|
|
|
92
92
|
this.closeModal(), this.$formkit.reset("dpiForm"), this.clearAll();
|
|
93
93
|
},
|
|
94
94
|
async submit(t) {
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
var I, $, C, S;
|
|
96
|
+
this.uploading[t] = !0, (I = this.$Progress) == null || I.start();
|
|
97
|
+
const e = this.$env.content.dataProviderInterface.specification, s = await this.convertToRDF({ property: this.property, specification: e }).then((y) => y), m = this.getUserData.rtpToken, a = this.getData(this.property).datasetID, i = this.getData(this.property)["dct:title"], l = this.getData(this.property)["dct:description"], u = this.getData(this.property)["dcat:catalog"] ? this.getData(this.property)["dcat:catalog"] : "";
|
|
97
98
|
let d, c, h = {
|
|
98
99
|
id: a,
|
|
99
100
|
catalog: u,
|
|
@@ -103,9 +104,9 @@ const N = {
|
|
|
103
104
|
};
|
|
104
105
|
t === "dataset" ? !this.getIsEditMode || this.getIsEditMode && !this.getIsDraft || this.getIsEditMode && this.getIsDraft && localStorage.getItem("dpi_duplicate") ? (d = `${this.$env.api.hubUrl}datasets?id=${a}&catalogue=${u}`, h = { data: s, token: m, url: d }, c = "auth/createDataset") : (h = { id: a, catalog: u }, c = "auth/publishUserDraftById") : t === "draft" ? !this.getIsEditMode || this.getIsEditMode && this.getIsDraft ? (d = `${this.$env.api.hubUrl}drafts/datasets/${a}?catalogue=${u}`, c = "auth/createUserDraft") : (h = { id: a, catalog: u, title: i, description: l }, c = "auth/putDatasetToDraft") : t === "createcatalogue" && (d = `${this.$env.api.hubUrl}catalogues/${a}`, h = { data: s, token: m, url: d, id: a }, c = "auth/createCatalogue");
|
|
105
106
|
try {
|
|
106
|
-
this.idunique(a) ? (await this.$store.dispatch(c, h), this.$Progress
|
|
107
|
-
} catch {
|
|
108
|
-
this.uploading[t] = !1, this.$Progress.fail(), this.showSnackbar({ message: "Network Error", variant: "error" });
|
|
107
|
+
this.idunique(a) ? (await this.$store.dispatch(c, h), ($ = this.$Progress) == null || $.finish(), this.uploading[t] = !1, t === "createcatalogue" && this.createCatalogue(a), t === "dataset" && this.createDataset(a), t === "draft" && this.createDraft(), this.clearAll()) : (this.uploading[t] = !1, (C = this.$Progress) == null || C.fail(), this.handleIDError());
|
|
108
|
+
} catch (y) {
|
|
109
|
+
console.error(y), this.uploading[t] = !1, (S = this.$Progress) == null || S.fail(), this.showSnackbar({ message: "Network Error", variant: "error" });
|
|
109
110
|
}
|
|
110
111
|
},
|
|
111
112
|
createDataset(t) {
|
|
@@ -125,13 +126,13 @@ const N = {
|
|
|
125
126
|
let e = !0;
|
|
126
127
|
const s = this.$store.getters["auth/getUserDraftIds"];
|
|
127
128
|
return new Promise(() => {
|
|
128
|
-
if (
|
|
129
|
+
if (N(t) || t === "" || t === void 0)
|
|
129
130
|
e = !0;
|
|
130
131
|
else if (s.includes(t))
|
|
131
132
|
e = !1;
|
|
132
133
|
else {
|
|
133
134
|
const m = `${this.$env.api.hubUrl}datasets/${t}?useNormalizedId=true`;
|
|
134
|
-
|
|
135
|
+
U.head(m).then(() => {
|
|
135
136
|
e = !1;
|
|
136
137
|
}).catch((a) => {
|
|
137
138
|
e = !0;
|
|
@@ -140,71 +141,71 @@ const N = {
|
|
|
140
141
|
}), e;
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
|
-
},
|
|
144
|
+
}, A = {
|
|
144
145
|
id: "nav",
|
|
145
146
|
class: "d-flex"
|
|
146
|
-
},
|
|
147
|
+
}, B = { class: "left-form-nav w-25" }, F = { class: "right-form-nav w-75" }, R = {
|
|
147
148
|
key: 0,
|
|
148
149
|
class: "loading-spinner"
|
|
149
|
-
},
|
|
150
|
+
}, V = {
|
|
150
151
|
key: 0,
|
|
151
152
|
class: "loading-spinner"
|
|
152
|
-
},
|
|
153
|
+
}, _ = {
|
|
153
154
|
key: 0,
|
|
154
155
|
class: "loading-spinner"
|
|
155
|
-
},
|
|
156
|
+
}, K = {
|
|
156
157
|
key: 0,
|
|
157
158
|
class: "loading-spinner"
|
|
158
159
|
};
|
|
159
|
-
function
|
|
160
|
-
const l =
|
|
161
|
-
return
|
|
162
|
-
v("div",
|
|
163
|
-
v("div",
|
|
164
|
-
s.previousStep ? (
|
|
160
|
+
function j(t, e, s, m, a, i) {
|
|
161
|
+
const l = w("FormKit"), u = w("app-confirmation-dialog");
|
|
162
|
+
return o(), g("div", null, [
|
|
163
|
+
v("div", A, [
|
|
164
|
+
v("div", B, [
|
|
165
|
+
s.previousStep ? (o(), p(l, {
|
|
165
166
|
key: 0,
|
|
166
167
|
type: "button",
|
|
167
168
|
label: t.$t("message.dataupload.preview"),
|
|
168
169
|
onClick: s.goToPreviousStep,
|
|
169
170
|
class: "prev-btn mx-1 my-0"
|
|
170
171
|
}, null, 8, ["label", "onClick"])) : n("", !0),
|
|
171
|
-
e[4] || (e[4] =
|
|
172
|
-
|
|
172
|
+
e[4] || (e[4] = r()),
|
|
173
|
+
T(l, {
|
|
173
174
|
type: "button",
|
|
174
175
|
label: t.$t("message.dataupload.clear"),
|
|
175
176
|
onClick: i.handleClear,
|
|
176
177
|
class: "clear-btn"
|
|
177
178
|
}, null, 8, ["label", "onClick"])
|
|
178
179
|
]),
|
|
179
|
-
e[9] || (e[9] =
|
|
180
|
-
v("div",
|
|
181
|
-
!t.getIsEditMode && !t.getIsDraft && a.property === "catalogues" ? (
|
|
180
|
+
e[9] || (e[9] = r()),
|
|
181
|
+
v("div", F, [
|
|
182
|
+
!t.getIsEditMode && !t.getIsDraft && a.property === "catalogues" ? (o(), p(l, {
|
|
182
183
|
key: 0,
|
|
183
184
|
type: "button",
|
|
184
185
|
onClick: e[0] || (e[0] = (d) => i.submit("createcatalogue")),
|
|
185
186
|
class: "mr-2"
|
|
186
187
|
}, {
|
|
187
188
|
default: f(() => [
|
|
188
|
-
a.uploading.createcatalogue ? (
|
|
189
|
-
|
|
189
|
+
a.uploading.createcatalogue ? (o(), g("span", R)) : n("", !0),
|
|
190
|
+
r(b(t.$t("message.dataupload.publishcatalogue")), 1)
|
|
190
191
|
]),
|
|
191
192
|
_: 1
|
|
192
193
|
})) : n("", !0),
|
|
193
|
-
e[5] || (e[5] =
|
|
194
|
-
t.getIsEditMode && !t.getIsDraft && a.property === "catalogues" ? (
|
|
194
|
+
e[5] || (e[5] = r()),
|
|
195
|
+
t.getIsEditMode && !t.getIsDraft && a.property === "catalogues" ? (o(), p(l, {
|
|
195
196
|
key: 1,
|
|
196
197
|
type: "button",
|
|
197
198
|
onClick: e[1] || (e[1] = (d) => i.submit("createcatalogue")),
|
|
198
199
|
class: "mx-1 my-0"
|
|
199
200
|
}, {
|
|
200
201
|
default: f(() => [
|
|
201
|
-
a.uploading.createcatalogue ? (
|
|
202
|
-
|
|
202
|
+
a.uploading.createcatalogue ? (o(), g("span", V)) : n("", !0),
|
|
203
|
+
r(b(t.$t("message.dataupload.publishcatalogue")), 1)
|
|
203
204
|
]),
|
|
204
205
|
_: 1
|
|
205
206
|
})) : n("", !0),
|
|
206
|
-
e[6] || (e[6] =
|
|
207
|
-
a.property === "datasets" ? (
|
|
207
|
+
e[6] || (e[6] = r()),
|
|
208
|
+
a.property === "datasets" ? (o(), p(l, {
|
|
208
209
|
key: 2,
|
|
209
210
|
type: "button",
|
|
210
211
|
onClick: e[2] || (e[2] = (d) => i.submit("dataset")),
|
|
@@ -212,13 +213,13 @@ function R(t, e, s, m, a, i) {
|
|
|
212
213
|
class: "mx-1 my-0"
|
|
213
214
|
}, {
|
|
214
215
|
default: f(() => [
|
|
215
|
-
a.uploading.dataset ? (
|
|
216
|
-
|
|
216
|
+
a.uploading.dataset ? (o(), g("span", _)) : n("", !0),
|
|
217
|
+
r(b(t.$t("message.dataupload.publishdataset")), 1)
|
|
217
218
|
]),
|
|
218
219
|
_: 1
|
|
219
220
|
}, 8, ["disabled"])) : n("", !0),
|
|
220
|
-
e[7] || (e[7] =
|
|
221
|
-
a.property === "datasets" ? (
|
|
221
|
+
e[7] || (e[7] = r()),
|
|
222
|
+
a.property === "datasets" ? (o(), p(l, {
|
|
222
223
|
key: 3,
|
|
223
224
|
type: "button",
|
|
224
225
|
onClick: e[3] || (e[3] = (d) => i.submit("draft")),
|
|
@@ -226,13 +227,13 @@ function R(t, e, s, m, a, i) {
|
|
|
226
227
|
class: "mx-1 my-0"
|
|
227
228
|
}, {
|
|
228
229
|
default: f(() => [
|
|
229
|
-
a.uploading.draft ? (
|
|
230
|
-
|
|
230
|
+
a.uploading.draft ? (o(), g("span", K)) : n("", !0),
|
|
231
|
+
r(b(t.$t("message.dataupload.saveasdraft")), 1)
|
|
231
232
|
]),
|
|
232
233
|
_: 1
|
|
233
234
|
}, 8, ["disabled"])) : n("", !0),
|
|
234
|
-
e[8] || (e[8] =
|
|
235
|
-
s.nextStep ? (
|
|
235
|
+
e[8] || (e[8] = r()),
|
|
236
|
+
s.nextStep ? (o(), p(l, {
|
|
236
237
|
key: 4,
|
|
237
238
|
type: "button",
|
|
238
239
|
label: t.$t("message.dataupload.next"),
|
|
@@ -240,22 +241,22 @@ function R(t, e, s, m, a, i) {
|
|
|
240
241
|
}, null, 8, ["label", "onClick"])) : n("", !0)
|
|
241
242
|
])
|
|
242
243
|
]),
|
|
243
|
-
e[10] || (e[10] =
|
|
244
|
-
|
|
244
|
+
e[10] || (e[10] = r()),
|
|
245
|
+
T(u, {
|
|
245
246
|
id: "modal",
|
|
246
247
|
confirm: a.modal.confirm,
|
|
247
248
|
onConfirm: a.modal.callback,
|
|
248
249
|
close: a.modal.confirm
|
|
249
250
|
}, {
|
|
250
251
|
default: f(() => [
|
|
251
|
-
|
|
252
|
+
r(b(a.modal.message), 1)
|
|
252
253
|
]),
|
|
253
254
|
_: 1
|
|
254
255
|
}, 8, ["confirm", "onConfirm", "close"])
|
|
255
256
|
]);
|
|
256
257
|
}
|
|
257
|
-
const
|
|
258
|
+
const Y = /* @__PURE__ */ M(x, [["render", j]]);
|
|
258
259
|
export {
|
|
259
|
-
|
|
260
|
+
Y as default
|
|
260
261
|
};
|
|
261
262
|
//# sourceMappingURL=Navigation.vue.mjs.map
|