@piveau/piveau-hub-ui-modules 4.5.8 → 4.5.9

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.
@@ -1,203 +1,269 @@
1
- import { ref as r, openBlock as p, createElementBlock as f, createElementVNode as l, createTextVNode as e, toDisplayString as B, unref as s, Fragment as D, renderList as L, normalizeClass as y, createCommentVNode as w, withDirectives as W, vModelText as A, isRef as k } from "vue";
2
- import { onClickOutside as U } from "../external/@vueuse/core/index";
1
+ import { ref as a, getCurrentInstance as X, openBlock as p, createElementBlock as m, createElementVNode as l, createTextVNode as e, toDisplayString as x, unref as o, createCommentVNode as C, Fragment as z, renderList as R, normalizeClass as b, withDirectives as B, vModelText as S, isRef as A } from "vue";
2
+ import { onClickOutside as Y } from "../external/@vueuse/core/index";
3
+ import { useRoute as c } from "vue-router";
4
+ import D from "axios";
3
5
  import "./CatalogueMQA.vue2.mjs";
4
- import Z from "../_virtual/_plugin-vue_export-helper.mjs";
5
- const j = { class: "container mb-3" }, O = { key: 0 }, P = { class: "mqaWrapper" }, G = { class: "mailItems" }, H = ["value", "readonly", "onInput"], J = ["onClick"], K = ["onClick"], X = {
6
+ import h from "../_virtual/_plugin-vue_export-helper.mjs";
7
+ const _ = { class: "container mb-3" }, tt = { key: 0 }, lt = { key: 1 }, et = { key: 0 }, nt = { class: "mqaWrapper" }, ot = { class: "mailItems" }, st = ["value", "readonly", "onInput"], it = ["onClick"], at = ["onClick"], rt = {
6
8
  key: 0,
7
9
  class: "errormsg"
8
- }, Y = { class: "my-3 d-flex" }, h = ["disabled"], _ = {
10
+ }, ut = { class: "my-3 d-flex" }, dt = ["disabled"], vt = {
9
11
  key: 1,
10
12
  class: "errormsg"
11
- }, c = { class: "mqaWrapper" }, tt = { class: "d-flex" }, lt = { class: "mr-3 my-3" }, et = ["onClick"], nt = ["disabled"], st = { class: "my-3" }, it = ["disabled"], ot = { class: "caretWrap" }, at = { class: "mqaWrapper" }, ut = { class: "w-50" }, dt = { class: "actionWrapper" }, rt = {
13
+ }, pt = { class: "mqaWrapper" }, mt = { class: "d-flex" }, ft = { class: "mr-3 my-3" }, yt = ["onClick"], bt = ["disabled"], gt = { class: "my-3" }, Ct = ["disabled"], kt = { class: "caretWrap" }, wt = { class: "mqaWrapper" }, At = { class: "w-50" }, xt = { class: "actionWrapper" }, Mt = {
12
14
  __name: "CatalogueMQA",
13
- setup(vt) {
14
- let a = r(!1), u = r(!1), v = r({ mail: "", valid: !0 }), I = r(null);
15
- r(!0);
16
- let x = r("Activate"), g = r(!1), C = r(!1), m = r(), N = ["Mo", "Tue", "We", "Th", "Fr", "Sa", "Su"], o = r(1);
17
- const M = r(0), R = /^(2[0-8]|[1-9])$/;
18
- m.value = [{ mail: "mail@mail2.com", readonly: !0, valid: !0 }, { mail: "mail@mail1.com", readonly: !0, valid: !0 }], U(I, (i) => {
19
- m.value.forEach((t) => {
15
+ setup(It) {
16
+ const L = c();
17
+ let r = a(!1), u = a(!1), f = a({ mail: "", valid: !0 }), E = a(null);
18
+ a(!0);
19
+ let k = a("Activate"), w = a(!1), y = a(!1), d = a(), j = ["Mo", "Tue", "We", "Th", "Fr", "Sa", "Su"], i = a(1);
20
+ const M = L.params.id, W = X(), O = W.appContext.app.config.globalProperties.$env.api.notificationBaseUrl, N = W.appContext.app.config.globalProperties.$env.api.apiKey, I = a({}), $ = a(0), P = /^(2[0-8]|[1-9])$/;
21
+ d.value = [{ mail: "mail@mail2.com", readonly: !0, valid: !0 }, { mail: "mail@mail1.com", readonly: !0, valid: !0 }];
22
+ const V = async () => {
23
+ const s = {
24
+ method: "get",
25
+ url: `${O}/catalogue/${M}/setting`,
26
+ headers: {
27
+ Authorization: N,
28
+ Accept: "application/json"
29
+ },
30
+ withCredentials: !0
31
+ };
32
+ try {
33
+ const t = await D.request(s);
34
+ I.value = t.data, I.value.activeStatus === !0 && (y.value = !0, k.value = "Deactivate"), I.value.activeStatus === !1 && (y.value = !1, k.value = "Activate"), console.log("Response:", t);
35
+ } catch (t) {
36
+ console.log("Full error:", t);
37
+ }
38
+ }, F = async () => {
39
+ const s = {
40
+ method: "post",
41
+ url: `https://piveau-metrics-notifications-piveau.apps.osc.fokus.fraunhofer.de/catalogue/${M}/setting`,
42
+ headers: {
43
+ Authorization: N,
44
+ Accept: "application/json",
45
+ "Content-Type": "application/json",
46
+ "Access-Control-Allow-Origin": "*",
47
+ "Access-Control-Allow-Methods": "GET, POST, OPTIONS",
48
+ "Access-Control-Allow-Headers": "Authorization"
49
+ },
50
+ withCredentials: !0,
51
+ data: JSON.stringify({
52
+ receiverEmailList: d.value,
53
+ frequency: {
54
+ unit: "week",
55
+ value: 9
56
+ },
57
+ activeStatus: !0
58
+ })
59
+ };
60
+ try {
61
+ const t = await D.request(s);
62
+ return console.log("Settings updated:", t.data), t.data;
63
+ } catch (t) {
64
+ throw console.log("Error updating settings:", t), t;
65
+ }
66
+ };
67
+ V(), Y(E, (s) => {
68
+ d.value.forEach((t) => {
20
69
  t.readonly = !0;
21
70
  });
22
71
  });
23
- const q = () => {
24
- const i = document.getElementsByClassName("dayButtons");
25
- for (let t = 0; t < i.length; t++)
26
- i[t].classList.remove("activeItem");
27
- }, E = (i) => {
28
- i === "up" && o.value < 28 ? (o.value > 8 && (g.value = !0), o.value++) : o.value > 1 && (o.value < 11 && (g.value = !1), o.value--);
29
- }, z = (i, t) => {
72
+ const Q = () => {
73
+ const s = document.getElementsByClassName("dayButtons");
74
+ for (let t = 0; t < s.length; t++)
75
+ s[t].classList.remove("activeItem");
76
+ }, T = (s) => {
77
+ s === "up" && i.value < 28 ? (i.value > 8 && (w.value = !0), i.value++) : i.value > 1 && (i.value < 11 && (w.value = !1), i.value--);
78
+ }, U = (s, t) => {
30
79
  t.target.classList.toggle("activeItem");
31
- }, S = () => {
32
- R.test(o.value) || (o.value = "28"), o.value > 8 ? g.value = !0 : g.value = !1;
33
- }, T = () => {
34
- v.value.mail != "" && (m.value.push({ mail: v.value.mail, readonly: !0, valid: !0 }), v.value = { mail: "", valid: !0 });
35
- }, V = () => {
36
- C.value ? (C.value = !1, x.value = "Activate") : (C.value = !0, x.value = "Deactivate");
37
- }, Q = (i) => {
38
- m.value.forEach((t) => {
80
+ }, Z = () => {
81
+ P.test(i.value) || (i.value = "28"), i.value > 8 ? w.value = !0 : w.value = !1;
82
+ }, K = () => {
83
+ f.value.mail != "" && (d.value.push({ mail: f.value.mail, readonly: !0, valid: !0 }), f.value = { mail: "", valid: !0 });
84
+ }, G = () => {
85
+ y.value ? (y.value = !1, k.value = "Activate") : (y.value = !0, k.value = "Deactivate");
86
+ }, H = (s) => {
87
+ d.value.forEach((t) => {
39
88
  t.readonly = !0;
40
- }), i.readonly = !i.readonly;
41
- }, $ = (i, t) => {
42
- const n = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, d = i.target.value;
43
- n.test(d) || d === "" ? (m.value.forEach((b) => {
44
- b.mail === t && (b.mail = d, b.valid = !0);
45
- }), t === void 0 && (v.value.valid = !0)) : (m.value.forEach((b) => {
46
- b.mail === t && (b.valid = !1);
47
- }), t === void 0 && (v.value.valid = !1));
48
- }, F = (i) => {
89
+ }), s.readonly = !s.readonly;
90
+ }, q = (s, t) => {
91
+ const n = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, v = s.target.value;
92
+ n.test(v) || v === "" ? (d.value.forEach((g) => {
93
+ g.mail === t && (g.mail = v, g.valid = !0);
94
+ }), t === void 0 && (f.value.valid = !0)) : (d.value.forEach((g) => {
95
+ g.mail === t && (g.valid = !1);
96
+ }), t === void 0 && (f.value.valid = !1));
97
+ }, J = (s) => {
49
98
  let t = -1;
50
- m.value.forEach((n, d) => {
51
- n.mail === i && (t = d);
52
- }), t !== -1 && m.value.splice(t, 1);
99
+ d.value.forEach((n, v) => {
100
+ n.mail === s && (t = v);
101
+ }), t !== -1 && d.value.splice(t, 1);
53
102
  };
54
- return (i, t) => (p(), f("div", j, [
103
+ return (s, t) => (p(), m("div", _, [
55
104
  l("div", null, [
56
- t[13] || (t[13] = l("div", null, [
57
- l("h1", null, "MQA Report Settings"),
58
- e(),
59
- l("p", null, "Configuration for"),
60
- e(),
105
+ l("div", null, [
106
+ t[18] || (t[18] = l("div", { class: "debug" }, [
107
+ l("strong", null, " API object:"),
108
+ e(),
109
+ l("br"),
110
+ l("br")
111
+ ], -1)),
112
+ t[19] || (t[19] = e()),
113
+ t[20] || (t[20] = l("h1", null, "MQA Report Settings", -1)),
114
+ t[21] || (t[21] = e()),
61
115
  l("p", null, [
62
- e("For this Catalogue the "),
63
- l("b", null, "MQA Rating Checks "),
64
- e("are currently "),
65
- l("b", null, "deactivated"),
66
- e(".")
116
+ t[12] || (t[12] = e(`Configuration for
117
+
118
+
119
+ `)),
120
+ l("strong", null, x(o(M)), 1)
121
+ ]),
122
+ t[22] || (t[22] = e()),
123
+ l("p", null, [
124
+ t[14] || (t[14] = e("For this Catalogue the ")),
125
+ t[15] || (t[15] = l("b", null, "MQA Rating Checks ", -1)),
126
+ t[16] || (t[16] = e("are currently ")),
127
+ l("b", null, [
128
+ o(y) ? C("", !0) : (p(), m("span", tt, "deactivated")),
129
+ t[13] || (t[13] = e()),
130
+ o(y) ? (p(), m("span", lt, "activated")) : C("", !0)
131
+ ]),
132
+ t[17] || (t[17] = e("."))
67
133
  ])
68
- ], -1)),
69
- t[14] || (t[14] = e()),
134
+ ]),
135
+ t[23] || (t[23] = e()),
70
136
  l("button", {
71
137
  type: "button",
72
138
  class: "btn btn-secondary",
73
- onClick: t[0] || (t[0] = (n) => V())
74
- }, B(s(x)), 1)
139
+ onClick: t[0] || (t[0] = (n) => G())
140
+ }, x(o(k)), 1)
75
141
  ]),
76
- t[53] || (t[53] = e()),
77
- s(C) ? (p(), f("div", O, [
78
- l("div", P, [
79
- t[21] || (t[21] = l("h3", null, "Recipients Mail", -1)),
80
- t[22] || (t[22] = e()),
81
- t[23] || (t[23] = l("span", null, "Add and edit mail addresses for recieving the MQA report", -1)),
82
- t[24] || (t[24] = e()),
83
- s(m).length != 0 ? (p(), f("table", {
142
+ t[62] || (t[62] = e()),
143
+ o(y) ? (p(), m("div", et, [
144
+ l("div", nt, [
145
+ t[30] || (t[30] = l("h3", null, "Recipients Mail", -1)),
146
+ t[31] || (t[31] = e()),
147
+ t[32] || (t[32] = l("span", null, "Add and edit mail addresses for recieving the MQA report", -1)),
148
+ t[33] || (t[33] = e()),
149
+ o(d).length != 0 ? (p(), m("table", {
84
150
  key: 0,
85
151
  ref_key: "mailButtonWrap",
86
- ref: I
152
+ ref: E
87
153
  }, [
88
- t[18] || (t[18] = l("tr", null, [
154
+ t[27] || (t[27] = l("tr", null, [
89
155
  l("th", null, "Mail")
90
156
  ], -1)),
91
- t[19] || (t[19] = e()),
92
- (p(!0), f(D, null, L(s(m), (n) => (p(), f("tr", G, [
157
+ t[28] || (t[28] = e()),
158
+ (p(!0), m(z, null, R(o(d), (n) => (p(), m("tr", ot, [
93
159
  l("td", null, [
94
160
  l("input", {
95
161
  type: "text",
96
162
  value: n.mail,
97
163
  readonly: n.readonly,
98
- class: y({ editable: !n.readonly, invalid: !n.valid }),
99
- onInput: (d) => $(d, n.mail)
100
- }, null, 42, H),
101
- t[16] || (t[16] = e()),
164
+ class: b({ editable: !n.readonly, invalid: !n.valid }),
165
+ onInput: (v) => q(v, n.mail)
166
+ }, null, 42, st),
167
+ t[25] || (t[25] = e()),
102
168
  l("div", null, [
103
169
  l("button", {
104
170
  type: "button",
105
171
  class: "btn btn-secondary",
106
- onClick: (d) => Q(n)
107
- }, "Edit", 8, J),
108
- t[15] || (t[15] = e()),
172
+ onClick: (v) => H(n)
173
+ }, "Edit", 8, it),
174
+ t[24] || (t[24] = e()),
109
175
  l("button", {
110
176
  type: "button",
111
177
  class: "btn btn-secondary",
112
- onClick: (d) => F(n.mail)
113
- }, "Delete", 8, K)
178
+ onClick: (v) => J(n.mail)
179
+ }, "Delete", 8, at)
114
180
  ])
115
181
  ]),
116
- t[17] || (t[17] = e()),
117
- n.valid ? w("", !0) : (p(), f("span", X, "*Invalid email format"))
182
+ t[26] || (t[26] = e()),
183
+ n.valid ? C("", !0) : (p(), m("span", rt, "*Invalid email format"))
118
184
  ]))), 256))
119
- ], 512)) : w("", !0),
120
- t[25] || (t[25] = e()),
121
- l("div", Y, [
122
- W(l("input", {
185
+ ], 512)) : C("", !0),
186
+ t[34] || (t[34] = e()),
187
+ l("div", ut, [
188
+ B(l("input", {
123
189
  type: "text",
124
- "onUpdate:modelValue": t[1] || (t[1] = (n) => s(v).mail = n),
125
- onInput: t[2] || (t[2] = (n) => $(n)),
126
- class: y({ invalidNewMail: !s(v).valid }),
190
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => o(f).mail = n),
191
+ onInput: t[2] || (t[2] = (n) => q(n)),
192
+ class: b({ invalidNewMail: !o(f).valid }),
127
193
  style: { padding: "0.25rem" }
128
194
  }, null, 34), [
129
- [A, s(v).mail]
195
+ [S, o(f).mail]
130
196
  ]),
131
- t[20] || (t[20] = e()),
197
+ t[29] || (t[29] = e()),
132
198
  l("button", {
133
199
  type: "button",
134
200
  class: "btn btn-secondary mx-3",
135
- disabled: !s(v).valid,
136
- onClick: t[3] || (t[3] = (n) => T())
201
+ disabled: !o(f).valid,
202
+ onClick: t[3] || (t[3] = (n) => K())
137
203
  }, `+
138
- add Mail`, 8, h)
204
+ add Mail`, 8, dt)
139
205
  ]),
140
- t[26] || (t[26] = e()),
141
- s(v).valid ? w("", !0) : (p(), f("span", _, "*Invalid email format"))
206
+ t[35] || (t[35] = e()),
207
+ o(f).valid ? C("", !0) : (p(), m("span", vt, "*Invalid email format"))
142
208
  ]),
143
- t[50] || (t[50] = e()),
144
- l("div", c, [
145
- t[36] || (t[36] = l("h3", null, "Frequency of Rating Checks", -1)),
146
- t[37] || (t[37] = e()),
147
- t[38] || (t[38] = l("span", null, `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
209
+ t[59] || (t[59] = e()),
210
+ l("div", pt, [
211
+ t[45] || (t[45] = l("h3", null, "Frequency of Rating Checks", -1)),
212
+ t[46] || (t[46] = e()),
213
+ t[47] || (t[47] = l("span", null, `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
148
214
  labore et dolore magna aliquyam erat, sed diam voluptua`, -1)),
149
- t[39] || (t[39] = e()),
150
- l("div", tt, [
151
- l("div", lt, [
215
+ t[48] || (t[48] = e()),
216
+ l("div", mt, [
217
+ l("div", ft, [
152
218
  l("button", {
153
219
  type: "button",
154
- class: y(["btn btn-secondary", { activeChoiceButton: s(u) === !0 }]),
220
+ class: b(["btn btn-secondary", { activeChoiceButton: o(u) === !0 }]),
155
221
  onClick: t[4] || (t[4] = (n) => {
156
- k(u) ? u.value = !s(u) : u = !s(u), k(a) ? a.value = !1 : a = !1;
222
+ A(u) ? u.value = !o(u) : u = !o(u), A(r) ? r.value = !1 : r = !1;
157
223
  })
158
224
  }, "Weekly", 2),
159
- t[27] || (t[27] = e()),
225
+ t[36] || (t[36] = e()),
160
226
  l("div", {
161
- class: y(["weekdays", { blur: !s(u) }])
227
+ class: b(["weekdays", { blur: !o(u) }])
162
228
  }, [
163
- (p(!0), f(D, null, L(s(N), (n) => (p(), f("span", {
164
- onClick: (d) => z(n, d)
229
+ (p(!0), m(z, null, R(o(j), (n) => (p(), m("span", {
230
+ onClick: (v) => U(n, v)
165
231
  }, [
166
232
  l("button", {
167
- disabled: !s(u),
233
+ disabled: !o(u),
168
234
  class: "dayButtons"
169
- }, B(n), 9, nt)
170
- ], 8, et))), 256))
235
+ }, x(n), 9, bt)
236
+ ], 8, yt))), 256))
171
237
  ], 2)
172
238
  ]),
173
- t[35] || (t[35] = e()),
174
- l("div", st, [
239
+ t[44] || (t[44] = e()),
240
+ l("div", gt, [
175
241
  l("button", {
176
242
  type: "button",
177
- class: y([{ activeChoiceButton: s(a) === !0 }, "btn btn-secondary"]),
243
+ class: b([{ activeChoiceButton: o(r) === !0 }, "btn btn-secondary"]),
178
244
  onClick: t[5] || (t[5] = (n) => {
179
- k(a) ? a.value = !s(a) : a = !s(a), k(u) ? u.value = !1 : u = !1, q();
245
+ A(r) ? r.value = !o(r) : r = !o(r), A(u) ? u.value = !1 : u = !1, Q();
180
246
  })
181
247
  }, "Monthly", 2),
182
- t[34] || (t[34] = e()),
248
+ t[43] || (t[43] = e()),
183
249
  l("div", {
184
- class: y(["d-flex daypicker my-3", { blur: !s(a) }])
250
+ class: b(["d-flex daypicker my-3", { blur: !o(r) }])
185
251
  }, [
186
- W(l("input", {
187
- "onUpdate:modelValue": t[6] || (t[6] = (n) => k(o) ? o.value = n : o = n),
188
- onInput: t[7] || (t[7] = (n) => S()),
189
- class: y({ dynamicWidth: s(g) }),
190
- disabled: !s(a)
191
- }, null, 42, it), [
192
- [A, s(o)]
252
+ B(l("input", {
253
+ "onUpdate:modelValue": t[6] || (t[6] = (n) => A(i) ? i.value = n : i = n),
254
+ onInput: t[7] || (t[7] = (n) => Z()),
255
+ class: b({ dynamicWidth: o(w) }),
256
+ disabled: !o(r)
257
+ }, null, 42, Ct), [
258
+ [S, o(i)]
193
259
  ]),
194
- t[31] || (t[31] = e(`.
260
+ t[40] || (t[40] = e(`.
195
261
  `)),
196
- l("div", ot, [
262
+ l("div", kt, [
197
263
  l("button", {
198
- onClick: t[8] || (t[8] = (n) => E("up")),
264
+ onClick: t[8] || (t[8] = (n) => T("up")),
199
265
  class: "caretButtons ml-1"
200
- }, t[28] || (t[28] = [
266
+ }, t[37] || (t[37] = [
201
267
  l("svg", {
202
268
  xmlns: "http://www.w3.org/2000/svg",
203
269
  width: "12",
@@ -209,11 +275,11 @@ const j = { class: "container mb-3" }, O = { key: 0 }, P = { class: "mqaWrapper"
209
275
  l("path", { 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" })
210
276
  ], -1)
211
277
  ])),
212
- t[30] || (t[30] = e()),
278
+ t[39] || (t[39] = e()),
213
279
  l("button", {
214
- onClick: t[9] || (t[9] = (n) => E()),
280
+ onClick: t[9] || (t[9] = (n) => T()),
215
281
  class: "caretButtons mr-1"
216
- }, t[29] || (t[29] = [
282
+ }, t[38] || (t[38] = [
217
283
  l("svg", {
218
284
  xmlns: "http://www.w3.org/2000/svg",
219
285
  width: "12",
@@ -226,21 +292,21 @@ const j = { class: "container mb-3" }, O = { key: 0 }, P = { class: "mqaWrapper"
226
292
  ], -1)
227
293
  ]))
228
294
  ]),
229
- t[32] || (t[32] = e()),
230
- t[33] || (t[33] = l("span", null, "day of the month", -1))
295
+ t[41] || (t[41] = e()),
296
+ t[42] || (t[42] = l("span", null, "day of the month", -1))
231
297
  ], 2)
232
298
  ])
233
299
  ])
234
300
  ]),
235
- t[51] || (t[51] = e()),
236
- l("div", at, [
237
- t[45] || (t[45] = l("h3", null, "Notification Treshold", -1)),
238
- t[46] || (t[46] = e()),
239
- t[47] || (t[47] = l("span", null, `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
301
+ t[60] || (t[60] = e()),
302
+ l("div", wt, [
303
+ t[54] || (t[54] = l("h3", null, "Notification Treshold", -1)),
304
+ t[55] || (t[55] = e()),
305
+ t[56] || (t[56] = l("span", null, `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
240
306
  labore et dolore magna aliquyam erat, sed diam voluptua`, -1)),
241
- t[48] || (t[48] = e()),
242
- l("div", ut, [
243
- t[42] || (t[42] = l("div", { class: "d-flex justify-content-between" }, [
307
+ t[57] || (t[57] = e()),
308
+ l("div", At, [
309
+ t[51] || (t[51] = l("div", { class: "d-flex justify-content-between" }, [
244
310
  l("span", null, [
245
311
  l("b", null, "0")
246
312
  ]),
@@ -249,44 +315,42 @@ const j = { class: "container mb-3" }, O = { key: 0 }, P = { class: "mqaWrapper"
249
315
  l("b", null, "400")
250
316
  ])
251
317
  ], -1)),
252
- t[43] || (t[43] = e()),
253
- W(l("input", {
318
+ t[52] || (t[52] = e()),
319
+ B(l("input", {
254
320
  type: "range",
255
- "onUpdate:modelValue": t[10] || (t[10] = (n) => M.value = n),
321
+ "onUpdate:modelValue": t[10] || (t[10] = (n) => $.value = n),
256
322
  min: "0",
257
323
  max: "400"
258
324
  }, null, 512), [
259
- [A, M.value]
325
+ [S, $.value]
260
326
  ]),
261
- t[44] || (t[44] = e()),
327
+ t[53] || (t[53] = e()),
262
328
  l("p", null, [
263
- t[40] || (t[40] = e("Lower than ")),
264
- l("b", null, B(M.value), 1),
265
- t[41] || (t[41] = e(" Points"))
329
+ t[49] || (t[49] = e("Lower than ")),
330
+ l("b", null, x($.value), 1),
331
+ t[50] || (t[50] = e(" Points"))
266
332
  ])
267
333
  ])
268
334
  ]),
269
- t[52] || (t[52] = e()),
270
- l("div", dt, [
335
+ t[61] || (t[61] = e()),
336
+ l("div", xt, [
271
337
  l("button", {
272
338
  type: "button",
273
339
  class: "btn btn-secondary",
274
- onClick: t[11] || (t[11] = () => {
275
- })
340
+ onClick: F
276
341
  }, "Save"),
277
- t[49] || (t[49] = e()),
342
+ t[58] || (t[58] = e()),
278
343
  l("button", {
279
344
  type: "button",
280
345
  class: "btn btn-secondary",
281
- onClick: t[12] || (t[12] = () => {
282
- })
346
+ onClick: t[11] || (t[11] = (n) => s.back())
283
347
  }, "Cancel")
284
348
  ])
285
- ])) : w("", !0)
349
+ ])) : C("", !0)
286
350
  ]));
287
351
  }
288
- }, bt = /* @__PURE__ */ Z(rt, [["__scopeId", "data-v-f00ed272"]]);
352
+ }, Tt = /* @__PURE__ */ h(Mt, [["__scopeId", "data-v-dd84825d"]]);
289
353
  export {
290
- bt as default
354
+ Tt as default
291
355
  };
292
356
  //# sourceMappingURL=CatalogueMQA.vue.mjs.map
@@ -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 <h1>MQA Report Settings</h1>\n <p>Configuration for</p>\n <p>For this Catalogue the <b>MQA Rating Checks </b>are currently <b>deactivated</b>.</p>\n </div>\n\n <button type=\"button\" class=\"btn btn-secondary\" @click=\"handleActivate()\">{{ activatedString }}</button>\n </div>\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 ref=\"mailButtonWrap\" v-if=\"mailList.length != 0\">\n <tr>\n <th>Mail</th>\n </tr>\n <tr v-for=\"item in mailList\" class=\"mailItems\">\n <td>\n <input type=\"text\" :value=\"item.mail\" :readonly=\"item.readonly\"\n :class=\"{ 'editable': !item.readonly, 'invalid': !item.valid }\"\n @input=\"handleMailinput($event, item.mail)\">\n <div>\n <button type=\"button\" class=\"btn btn-secondary\"\n @click=\"handleReadonly(item)\">Edit</button>\n <button type=\"button\" class=\"btn btn-secondary\"\n @click=\"handleDelete(item.mail)\">Delete</button>\n </div>\n </td>\n <span class=\"errormsg\" v-if=\"!item.valid\">*Invalid email format</span>\n </tr>\n </table>\n <div class=\"my-3 d-flex\">\n <input type=\"text\" v-model=\"newMail.mail\" @input=\"handleMailinput($event)\"\n :class=\"{ 'invalidNewMail': !newMail.valid }\" style=\"padding:0.25rem\">\n <button type=\"button\" class=\"btn btn-secondary mx-3\" :disabled=\"!newMail.valid\"\n @click=\"addNewMail()\">+\n add Mail</button>\n </div>\n \n <span class=\"errormsg\" v-if=\"!newMail.valid\">*Invalid email format</span>\n </div>\n <div class=\"mqaWrapper\">\n <h3>Frequency of Rating Checks</h3>\n <span>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut\n labore et dolore magna aliquyam erat, sed diam voluptua</span>\n <div class=\"d-flex\">\n <div class=\"mr-3 my-3\">\n <button type=\"button\" class=\"btn btn-secondary\" @click=\"weekly = !weekly; monthly = false\"\n :class=\"{ 'activeChoiceButton': weekly === true }\">Weekly</button>\n <div class=\"weekdays\" :class=\"{ 'blur': !weekly }\">\n <span v-for=\"day in week\" @click=\"currentday(day, $event)\">\n <button :disabled=\"!weekly\" class=\"dayButtons\">{{ day }}</button>\n </span>\n </div>\n </div>\n <div class=\"my-3\">\n <button type=\"button\" :class=\"{ 'activeChoiceButton': monthly === true }\"\n class=\"btn btn-secondary\"\n @click=\"monthly = !monthly; weekly = false; resetWeekdays()\">Monthly</button>\n <div class=\"d-flex daypicker my-3\" :class=\"{ 'blur': !monthly }\">\n <input v-model=\"daysInMonth\" @input=\"adjustWidth()\" :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>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut\n labore et dolore magna aliquyam erat, sed diam voluptua</span>\n <div class=\"w-50\">\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=\"value\" min=\"0\" max=\"400\" />\n <p>Lower than <b>{{ value }}</b> Points</p>\n </div>\n </div>\n <div class=\"actionWrapper\">\n <button type=\"button\" class=\"btn btn-secondary\" @click=\"\">Save</button>\n <button type=\"button\" class=\"btn btn-secondary\" @click=\"\">Cancel</button>\n </div>\n </div>\n </div>\n\n</template>\n<script setup>\nimport { ref } from 'vue';\nimport { onClickOutside } from '@vueuse/core'\n\nlet monthly = ref(false)\nlet weekly = ref(false)\nlet newMail = ref({ 'mail': '', 'valid': true })\nlet mailButtonWrap = ref(null)\nlet isReadonly = ref(true)\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)\n\nconst value = ref(0);\nconst regex = /^(2[0-8]|[1-9])$/;\n\nmailList.value = [{ 'mail': \"mail@mail2.com\", readonly: true, valid: true }, { 'mail': \"mail@mail1.com\", readonly: true, valid: true }]\n\n\nonClickOutside(mailButtonWrap, event => {\n mailList.value.forEach(element => {\n element.readonly = true\n })\n});\nconst resetWeekdays = () => {\n const arr = document.getElementsByClassName('dayButtons')\n for (let index = 0; index < arr.length; index++) {\n arr[index].classList.remove('activeItem')\n }\n\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}\nconst currentday = (day, event) => {\n event.target.classList.toggle('activeItem')\n}\nconst adjustWidth = () => {\n\n if (!regex.test(daysInMonth.value)) {\n daysInMonth.value = '28';\n }\n if (daysInMonth.value > 8) {\n inputWidth.value = true\n }\n else inputWidth.value = false\n}\nconst addNewMail = () => {\n if (newMail.value.mail != '') {\n mailList.value.push({ 'mail': newMail.value.mail, readonly: true, valid: true })\n newMail.value = { 'mail': '', 'valid': true }\n }\n\n}\nconst handleActivate = () => {\n if (!active.value) {\n active.value = true\n activatedString.value = 'Deactivate'\n } else {\n active.value = false\n activatedString.value = 'Activate'\n }\n}\nconst handleReadonly = (item) => {\n mailList.value.forEach(element => {\n element.readonly = true\n });\n item.readonly = !item.readonly\n}\nconst handleMailinput = (e, mail) => {\n const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n const newEmail = e.target.value;\n if (emailRegex.test(newEmail) || newEmail === '') {\n mailList.value.forEach(element => {\n if (element.mail === mail) {\n element.mail = newEmail\n element.valid = true\n }\n });\n if (mail === undefined) {\n newMail.value.valid = true\n\n\n }\n } else {\n mailList.value.forEach(element => {\n if (element.mail === mail) {\n element.valid = false\n }\n });\n if (mail === undefined) {\n newMail.value.valid = false\n\n\n }\n }\n\n}\nconst handleDelete = (mail) => {\n let indexToDelete = -1; // Variable zum Speichern des Index\n\n mailList.value.forEach((element, index) => {\n if (element.mail === mail) {\n indexToDelete = index; // Speichere den Index, wenn die Bedingung erfüllt ist\n }\n });\n\n // Wenn ein gültiger Index gefunden wurde, lösche das Element\n if (indexToDelete !== -1) {\n mailList.value.splice(indexToDelete, 1);\n }\n}\n</script>\n<style scoped>\n.errormsg {\n color: red;\n font-size: 10px;\n}\n\n.activeChoiceButton {\n background-color: var(--primary);\n color: white;\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.blur {\n opacity: 0.3;\n}\n\n.mailItems {\n input {\n outline: none;\n background: none;\n border: none;\n width: 20rem;\n }\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\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: 1rem 0;\n}\n\n.daypicker {\n padding: 1rem;\n border: 1px solid lightgray;\n border-radius: 15px;\n\n input {\n width: 13px;\n border: none;\n background-color: unset;\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: #FBFBFB;\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 }\n}\n\nbutton,\nspan {\n transition: all 100ms ease-in-out;\n}\n</style>"],"names":["monthly","ref","weekly","newMail","mailButtonWrap","activatedString","inputWidth","active","mailList","week","daysInMonth","value","regex","onClickOutside","event","element","resetWeekdays","arr","index","editDate","count","currentday","day","adjustWidth","addNewMail","handleActivate","handleReadonly","item","handleMailinput","e","mail","emailRegex","newEmail","handleDelete","indexToDelete"],"mappings":";;;;;;;;;;;;;AA6GA,QAAIA,IAAUC,EAAI,EAAK,GACnBC,IAASD,EAAI,EAAK,GAClBE,IAAUF,EAAI,EAAE,MAAQ,IAAI,OAAS,IAAM,GAC3CG,IAAiBH,EAAI,IAAI;AACZ,IAAAA,EAAI,EAAI;AACzB,QAAII,IAAkBJ,EAAI,UAAU,GAChCK,IAAaL,EAAI,EAAK,GACtBM,IAASN,EAAI,EAAK,GAClBO,IAAWP,EAAI,GACfQ,IAAO,CAAC,MAAM,OAAO,MAAM,MAAM,MAAM,MAAM,IAAI,GACjDC,IAAcT,EAAI,CAAC;AAEvB,UAAMU,IAAQV,EAAI,CAAC,GACbW,IAAQ;AAEd,IAAAJ,EAAS,QAAQ,CAAC,EAAE,MAAQ,kBAAkB,UAAU,IAAM,OAAO,GAAI,GAAI,EAAE,MAAQ,kBAAkB,UAAU,IAAM,OAAO,IAAM,GAGtIK,EAAeT,GAAgB,CAAAU,MAAS;AACpC,MAAAN,EAAS,MAAM,QAAQ,CAAAO,MAAW;AAC9B,QAAAA,EAAQ,WAAW;AAAA,MAC3B,CAAK;AAAA,IACL,CAAC;AACD,UAAMC,IAAgB,MAAM;AACxB,YAAMC,IAAM,SAAS,uBAAuB,YAAY;AACxD,eAASC,IAAQ,GAAGA,IAAQD,EAAI,QAAQC;AACpC,QAAAD,EAAIC,CAAK,EAAE,UAAU,OAAO,YAAY;AAAA,IAIhD,GACMC,IAAW,CAACC,MAAU;AACxB,MAAIA,MAAU,QAAQV,EAAY,QAAQ,MAClCA,EAAY,QAAQ,MACpBJ,EAAW,QAAQ,KAEvBI,EAAY,WAEP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AAAA,MAEhC,CAAS,GACGe,MAAS,WACT3B,EAAQ,MAAM,QAAQ;AAAA,IAMlC,GACM8B,IAAe,CAACH,MAAS;AAC3B,UAAII,IAAgB;AAEpB,MAAA1B,EAAS,MAAM,QAAQ,CAACO,GAASG,MAAU;AACvC,QAAIH,EAAQ,SAASe,MACjBI,IAAgBhB;AAAA,MAE5B,CAAK,GAGGgB,MAAkB,MAClB1B,EAAS,MAAM,OAAO0B,GAAe,CAAC;AAAA,IAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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 </div>\n <h1>MQA Report Settings</h1>\n <p>Configuration for\n <!-- Disabled for PPE release (no backend on PPE yet)-->\n <!-- {{ notficationInfo }} -->\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-secondary\" @click=\"handleActivate()\">\n {{ activatedString }}\n </button>\n </div>\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 ref=\"mailButtonWrap\" v-if=\"mailList.length != 0\">\n <tr>\n <th>Mail</th>\n </tr>\n <tr v-for=\"item in mailList\" class=\"mailItems\">\n \n <td>\n <input type=\"text\" :value=\"item.mail\" :readonly=\"item.readonly\"\n :class=\"{ 'editable': !item.readonly, 'invalid': !item.valid }\"\n @input=\"handleMailinput($event, item.mail)\">\n <div>\n <button type=\"button\" class=\"btn btn-secondary\"\n @click=\"handleReadonly(item)\">Edit</button>\n <button type=\"button\" class=\"btn btn-secondary\"\n @click=\"handleDelete(item.mail)\">Delete</button>\n </div>\n </td>\n <span class=\"errormsg\" v-if=\"!item.valid\">*Invalid email format</span>\n </tr>\n </table>\n <div class=\"my-3 d-flex\">\n <input type=\"text\" v-model=\"newMail.mail\" @input=\"handleMailinput($event)\"\n :class=\"{ 'invalidNewMail': !newMail.valid }\" style=\"padding:0.25rem\">\n <button type=\"button\" class=\"btn btn-secondary mx-3\" :disabled=\"!newMail.valid\"\n @click=\"addNewMail()\">+\n add Mail</button>\n </div>\n\n <span class=\"errormsg\" v-if=\"!newMail.valid\">*Invalid email format</span>\n </div>\n <div class=\"mqaWrapper\">\n <h3>Frequency of Rating Checks</h3>\n <span>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut\n labore et dolore magna aliquyam erat, sed diam voluptua</span>\n <div class=\"d-flex\">\n <div class=\"mr-3 my-3\">\n <button type=\"button\" class=\"btn btn-secondary\" @click=\"weekly = !weekly; monthly = false\"\n :class=\"{ 'activeChoiceButton': weekly === true }\">Weekly</button>\n <div class=\"weekdays\" :class=\"{ 'blur': !weekly }\">\n <span v-for=\"day in week\" @click=\"currentday(day, $event)\">\n <button :disabled=\"!weekly\" class=\"dayButtons\">{{ day }}</button>\n </span>\n </div>\n </div>\n <div class=\"my-3\">\n <button type=\"button\" :class=\"{ 'activeChoiceButton': monthly === true }\"\n class=\"btn btn-secondary\"\n @click=\"monthly = !monthly; weekly = false; resetWeekdays()\">Monthly</button>\n <div class=\"d-flex daypicker my-3\" :class=\"{ 'blur': !monthly }\">\n <input v-model=\"daysInMonth\" @input=\"adjustWidth()\" :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>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut\n labore et dolore magna aliquyam erat, sed diam voluptua</span>\n <div class=\"w-50\">\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=\"value\" min=\"0\" max=\"400\" />\n <p>Lower than <b>{{ value }}</b> Points</p>\n </div>\n </div>\n <div class=\"actionWrapper\">\n <button type=\"button\" class=\"btn btn-secondary\" @click=\"postNotificationSettings\">Save</button>\n <button type=\"button\" class=\"btn btn-secondary\" @click=\"back()\">Cancel</button>\n </div>\n </div>\n </div>\n\n</template>\n<script setup>\nimport { ref } from 'vue';\nimport { onClickOutside } from '@vueuse/core'\nimport { useRoute } from 'vue-router'\nimport { getCurrentInstance } from \"vue\";\nimport axios from 'axios'\n\nconst route = useRoute()\n\nlet monthly = ref(false)\nlet weekly = ref(false)\nlet newMail = ref({ 'mail': '', 'valid': true })\nlet mailButtonWrap = ref(null)\nlet isReadonly = ref(true)\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)\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 notficationInfo = ref({})\n\n\nconst value = ref(0);\nconst regex = /^(2[0-8]|[1-9])$/;\n\n// enabeld for PPE release (dummy data)\n mailList.value = [{ 'mail': \"mail@mail2.com\", readonly: true, valid: true }, { 'mail': \"mail@mail1.com\", readonly: true, valid: true }]\n\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\n console.log('Response:', response)\n } catch (error) {\n console.log('Full error:', error)\n }\n}\n\nconst postNotificationSettings = async () => {\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 frequency: {\n unit: \"week\",\n value: 9\n },\n activeStatus: true\n })\n }\n\n try {\n const response = await axios.request(config)\n console.log('Settings updated:', response.data)\n return response.data\n } catch (error) {\n console.log('Error updating settings:', error)\n throw error\n }\n}\n\nfetchNotificationInfo()\n\nonClickOutside(mailButtonWrap, event => {\n mailList.value.forEach(element => {\n element.readonly = true\n })\n});\nconst resetWeekdays = () => {\n const arr = document.getElementsByClassName('dayButtons')\n for (let index = 0; index < arr.length; index++) {\n arr[index].classList.remove('activeItem')\n }\n\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}\nconst currentday = (day, event) => {\n event.target.classList.toggle('activeItem')\n}\nconst adjustWidth = () => {\n\n if (!regex.test(daysInMonth.value)) {\n daysInMonth.value = '28';\n }\n if (daysInMonth.value > 8) {\n inputWidth.value = true\n }\n else inputWidth.value = false\n}\nconst addNewMail = () => {\n if (newMail.value.mail != '') {\n mailList.value.push({ 'mail': newMail.value.mail, readonly: true, valid: true })\n newMail.value = { 'mail': '', 'valid': true }\n }\n}\nconst handleActivate = () => {\n if (!active.value) {\n active.value = true\n activatedString.value = 'Deactivate'\n } else {\n active.value = false\n activatedString.value = 'Activate'\n }\n}\nconst handleReadonly = (item) => {\n mailList.value.forEach(element => {\n element.readonly = true\n });\n item.readonly = !item.readonly\n}\nconst handleMailinput = (e, mail) => {\n const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n const newEmail = e.target.value;\n if (emailRegex.test(newEmail) || newEmail === '') {\n mailList.value.forEach(element => {\n if (element.mail === mail) {\n element.mail = newEmail\n element.valid = true\n }\n });\n if (mail === undefined) {\n newMail.value.valid = true\n\n\n }\n } else {\n mailList.value.forEach(element => {\n if (element.mail === mail) {\n element.valid = false\n }\n });\n if (mail === undefined) {\n newMail.value.valid = false\n\n\n }\n }\n\n}\nconst handleDelete = (mail) => {\n let indexToDelete = -1; // Variable zum Speichern des Index\n\n mailList.value.forEach((element, index) => {\n if (element.mail === mail) {\n indexToDelete = index; // Speichere den Index, wenn die Bedingung erfüllt ist\n }\n });\n\n // Wenn ein gültiger Index gefunden wurde, lösche das Element\n if (indexToDelete !== -1) {\n mailList.value.splice(indexToDelete, 1);\n }\n}\n</script>\n<style scoped>\n.debug {\n position: fixed;\n right: 20px;\n top: 320px;\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.errormsg {\n color: red;\n font-size: 10px;\n}\n\n.activeChoiceButton {\n background-color: var(--primary);\n color: white;\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.blur {\n opacity: 0.3;\n}\n\n.mailItems {\n input {\n outline: none;\n background: none;\n border: none;\n width: 20rem;\n }\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\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: 1rem 0;\n}\n\n.daypicker {\n padding: 1rem;\n border: 1px solid lightgray;\n border-radius: 15px;\n\n input {\n width: 13px;\n border: none;\n background-color: unset;\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 }\n}\n\nbutton,\nspan {\n transition: all 100ms ease-in-out;\n}\n</style>"],"names":["route","useRoute","monthly","ref","weekly","newMail","mailButtonWrap","activatedString","inputWidth","active","mailList","week","daysInMonth","catalogId","app","getCurrentInstance","notificationBaseUrl","apiKey","notficationInfo","value","regex","fetchNotificationInfo","config","response","axios","error","postNotificationSettings","onClickOutside","event","element","resetWeekdays","arr","index","editDate","count","currentday","day","adjustWidth","addNewMail","handleActivate","handleReadonly","item","handleMailinput","e","mail","emailRegex","newEmail","handleDelete","indexToDelete"],"mappings":";;;;;;;;;;;;;;;AA+HA,UAAMA,IAAQC,EAAS;AAEvB,QAAIC,IAAUC,EAAI,EAAK,GACnBC,IAASD,EAAI,EAAK,GAClBE,IAAUF,EAAI,EAAE,MAAQ,IAAI,OAAS,IAAM,GAC3CG,IAAiBH,EAAI,IAAI;AACZ,IAAAA,EAAI,EAAI;AACzB,QAAII,IAAkBJ,EAAI,UAAU,GAChCK,IAAaL,EAAI,EAAK,GACtBM,IAASN,EAAI,EAAK,GAClBO,IAAWP,EAAI,GACfQ,IAAO,CAAC,MAAM,OAAO,MAAM,MAAM,MAAM,MAAM,IAAI,GACjDC,IAAcT,EAAI,CAAC;AACvB,UAAMU,IAAYb,EAAM,OAAO,IACzBc,IAAMC,EAAmB,GACzBC,IAAsBF,EAAI,WAAW,IAAI,OAAO,iBAAiB,KAAK,IAAI,qBAC1EG,IAASH,EAAI,WAAW,IAAI,OAAO,iBAAiB,KAAK,IAAI,QAE7DI,IAAkBf,EAAI,EAAE,GAGxBgB,IAAQhB,EAAI,CAAC,GACbiB,IAAQ;AAGb,IAAAV,EAAS,QAAQ,CAAC,EAAE,MAAQ,kBAAkB,UAAU,IAAM,OAAO,GAAI,GAAI,EAAE,MAAQ,kBAAkB,UAAU,IAAM,OAAO,IAAM;AAGvI,UAAMW,IAAwB,YAAY;AACtC,YAAMC,IAAS;AAAA,QACX,QAAQ;AAAA,QACR,KAAK,GAAGN,CAAmB,cAAcH,CAAS;AAAA,QAClD,SAAS;AAAA,UACL,eAAiBI;AAAA,UACjB,QAAU;AAAA,QACb;AAAA,QACD,iBAAiB;AAAA,MACrB;AAEA,UAAI;AACA,cAAMM,IAAW,MAAMC,EAAM,QAAQF,CAAM;AAC3C,QAAAJ,EAAgB,QAAQK,EAAS,MAE7BL,EAAgB,MAAM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