@piveau/piveau-hub-ui-modules 4.6.22 → 4.6.24

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,7 +1,7 @@
1
- import { computed as z, ref as u, getCurrentInstance as rt, openBlock as a, createElementBlock as v, createElementVNode as l, createTextVNode as e, toDisplayString as i, unref as n, createCommentVNode as M, normalizeClass as k, Fragment as K, renderList as G, withDirectives as N, vModelText as W, isRef as H } from "vue";
1
+ import { computed as P, ref as u, getCurrentInstance as rt, openBlock as a, createElementBlock as v, createElementVNode as l, createTextVNode as e, toDisplayString as i, unref as n, createCommentVNode as M, normalizeClass as k, Fragment as K, renderList as G, withDirectives as N, vModelText as W, isRef as H } from "vue";
2
2
  import { useRouter as at, useRoute as vt } from "vue-router";
3
3
  import { useStore as dt, mapActions as pt } from "vuex";
4
- import F from "axios";
4
+ import z from "axios";
5
5
  import "./CatalogueMQA.vue2.mjs";
6
6
  import mt from "../_virtual/_plugin-vue_export-helper.mjs";
7
7
  const ft = { class: "container mb-3" }, bt = { class: "debug" }, gt = { key: 0 }, yt = { key: 1 }, kt = { key: 0 }, Ct = { class: "mqaWrapper" }, wt = { key: 0 }, Mt = ["onUpdate:modelValue", "onInput"], St = ["onClick"], $t = ["onClick"], It = {
@@ -10,26 +10,26 @@ const ft = { class: "container mb-3" }, bt = { class: "debug" }, gt = { key: 0 }
10
10
  }, At = { class: "d-flex mt-3" }, Dt = {
11
11
  key: 1,
12
12
  class: "errormsg"
13
- }, Vt = { class: "mqaWrapper" }, Bt = { class: "d-flex mt-3" }, Ut = { class: "mr-3 my-3" }, qt = ["disabled", "onClick"], Nt = { class: "my-3" }, Wt = ["disabled"], xt = { class: "caretWrap" }, Et = { class: "mqaWrapper" }, Rt = { class: "w-50 mt-3" }, Pt = { class: "actionWrapper" }, zt = {
13
+ }, Vt = { class: "mqaWrapper" }, Bt = { class: "d-flex mt-3" }, Ut = { class: "mr-3 my-3" }, qt = ["disabled", "onClick"], Nt = { class: "my-3" }, Wt = ["disabled"], xt = { class: "caretWrap" }, Et = { class: "mqaWrapper" }, Rt = { class: "w-50 mt-3" }, Tt = { class: "actionWrapper" }, Pt = {
14
14
  __name: "CatalogueMQA",
15
- setup(Ft) {
15
+ setup(zt) {
16
16
  const x = dt(), E = at();
17
- z(() => x.getters["auth/getUserDrafts"]);
18
- const X = z(() => x.getters["auth/getUserData"]), B = z(() => X.value.rtpToken);
17
+ P(() => x.getters["auth/getUserDrafts"]);
18
+ const X = P(() => x.getters["auth/getUserData"]), B = P(() => X.value.rtpToken);
19
19
  pt("auth", {
20
20
  updateUserData: "updateUserData"
21
21
  });
22
- const Q = (s) => {
22
+ const F = (s) => {
23
23
  x.dispatch("snackbar/showSnackbar", s);
24
24
  }, U = () => {
25
- Q({
25
+ F({
26
26
  message: "Saved Successfully",
27
27
  variant: "success"
28
28
  });
29
29
  }, Y = vt();
30
30
  let y = u(!1), f = u(!1), Z = u(null), D = u("Activate"), R = u(!1), d = u(!1), b = u(), h = ["Mo", "Tue", "We", "Th", "Fr", "Sa", "Su"], p = u(1), I = u(!1), C = u(0), S = u(""), g = u(""), $ = u(null);
31
- const q = Y.params.id, T = rt(), P = T.appContext.app.config.globalProperties.$env.api.notificationBaseUrl;
32
- T.appContext.app.config.globalProperties.$env.api.apiKey;
31
+ const q = Y.params.id, Q = rt(), T = Q.appContext.app.config.globalProperties.$env.api.notificationBaseUrl;
32
+ Q.appContext.app.config.globalProperties.$env.api.apiKey;
33
33
  const L = (s) => {
34
34
  f.value && ($.value = s, g.value = $);
35
35
  }, _ = () => {
@@ -41,13 +41,13 @@ const ft = { class: "container mb-3" }, bt = { class: "debug" }, gt = { key: 0 }
41
41
  const tt = async () => {
42
42
  const s = {
43
43
  method: "get",
44
- url: `${P}/catalogue/${q}/setting`,
44
+ url: `${T}/catalogue/${q}/setting`,
45
45
  headers: {
46
46
  Authorization: `Bearer ${B.value}`
47
47
  }
48
48
  };
49
49
  try {
50
- const t = await F.request(s);
50
+ const t = await z.request(s);
51
51
  w.value = t.data, w.value.activeStatus === !0 && (d.value = !0, D.value = "Deactivate"), w.value.activeStatus === !1 && (d.value = !1, D.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" ? (f.value = !0, y.value = !1, $.value = g.value) : S.value === "month" && (f.value = !1, y.value = !0, p.value = g.value), console.log("Response:", t);
52
52
  } catch (t) {
53
53
  console.log("Full error:", t);
@@ -56,9 +56,10 @@ const ft = { class: "container mb-3" }, bt = { class: "debug" }, gt = { key: 0 }
56
56
  f.value === !0 ? (S.value = "week", g.value = $.value) : y.value === !0 && (S.value = "month", g.value = p.value);
57
57
  const s = {
58
58
  method: "post",
59
- url: `${P}/catalogue/${q}/setting`,
59
+ url: `${T}/catalogue/${q}/setting`,
60
60
  headers: {
61
- Authorization: `Bearer ${B.value}`
61
+ Authorization: `Bearer ${B.value}`,
62
+ "Content-Type": "application/json"
62
63
  },
63
64
  withCredentials: !0,
64
65
  data: JSON.stringify({
@@ -72,7 +73,7 @@ const ft = { class: "container mb-3" }, bt = { class: "debug" }, gt = { key: 0 }
72
73
  })
73
74
  };
74
75
  try {
75
- const t = await F.request(s);
76
+ const t = await z.request(s);
76
77
  return console.log("Settings updated:", t.data), U(), E.push({ name: "DataProviderInterface-UserCatalogues" }), t.data;
77
78
  } catch (t) {
78
79
  throw U(), console.log("Error updating settings:", t), t;
@@ -82,9 +83,10 @@ const ft = { class: "container mb-3" }, bt = { class: "debug" }, gt = { key: 0 }
82
83
  const J = async () => {
83
84
  const s = {
84
85
  method: "post",
85
- url: `${P}/catalogue/${q}/setting`,
86
+ url: `${T}/catalogue/${q}/setting`,
86
87
  headers: {
87
- Authorization: `Bearer ${B.value}`
88
+ Authorization: `Bearer ${B.value}`,
89
+ "Content-Type": "application/json"
88
90
  },
89
91
  withCredentials: !0,
90
92
  data: JSON.stringify({
@@ -92,13 +94,13 @@ const ft = { class: "container mb-3" }, bt = { class: "debug" }, gt = { key: 0 }
92
94
  })
93
95
  };
94
96
  try {
95
- const t = await F.request(s);
97
+ const t = await z.request(s);
96
98
  return console.log("Settings updated:", t.data), U(), d.value || E.push({ name: "DataProviderInterface-UserCatalogues" }), t.data;
97
99
  } catch (t) {
98
100
  throw U(), console.log("Error updating settings:", t), t;
99
101
  }
100
102
  }, et = () => {
101
- I.value = !0, Q({
103
+ I.value = !0, F({
102
104
  message: "Email added successfully.",
103
105
  variant: "success"
104
106
  });
@@ -384,7 +386,7 @@ const ft = { class: "container mb-3" }, bt = { class: "debug" }, gt = { key: 0 }
384
386
  ])
385
387
  ]),
386
388
  t[86] || (t[86] = e()),
387
- l("div", Pt, [
389
+ l("div", Tt, [
388
390
  l("button", {
389
391
  type: "button",
390
392
  class: "btn btn-primary",
@@ -400,7 +402,7 @@ const ft = { class: "container mb-3" }, bt = { class: "debug" }, gt = { key: 0 }
400
402
  ])) : M("", !0)
401
403
  ]));
402
404
  }
403
- }, Kt = /* @__PURE__ */ mt(zt, [["__scopeId", "data-v-62c67979"]]);
405
+ }, Kt = /* @__PURE__ */ mt(Pt, [["__scopeId", "data-v-79523054"]]);
404
406
  export {
405
407
  Kt as default
406
408
  };
@@ -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\n <textarea> {{ token }} </textarea>\n <hr>\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';\nimport { mapActions } from 'vuex'\nimport { computed } from 'vue'\nimport { mapGetters } from 'vuex'\n\nimport axios from 'axios'\n\nconst store = useStore();\nconst router = useRouter();\nconst getUserDrafts = computed(() => store.getters['auth/getUserDrafts'])\nconst getUserData = computed(() => store.getters['auth/getUserData'])\nconst token = computed(() => getUserData.value.rtpToken)\n\n// Update the mapActions usage\nconst authActions = mapActions('auth', {\n updateUserData: 'updateUserData'\n})\n\n// Destructure the action\nconst { updateUserData } = authActions\n\nconst showSnackbar = (payload) => {\n store.dispatch('snackbar/showSnackbar', payload);\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\n\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: `Bearer ${token.value}`,\n },\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: `${notificationBaseUrl}/catalogue/${catalogId}/setting`,\n headers: {\n Authorization: `Bearer ${token.value}`,\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: `${notificationBaseUrl}/catalogue/${catalogId}/setting`,\n headers: {\n Authorization: `Bearer ${token.value}`,\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","computed","getUserData","token","mapActions","showSnackbar","payload","triggerSnackbar","route","useRoute","monthly","ref","weekly","mailButtonWrap","activatedString","inputWidth","active","mailList","week","daysInMonth","editMode","treshold","frequencyUnit","frequencyValue","selectedDay","catalogId","app","getCurrentInstance","notificationBaseUrl","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":";;;;;;;;;;;;;;;AA0JA,UAAMA,IAAQC,GAAQ,GAChBC,IAASC,GAAS;AACF,IAAAC,EAAS,MAAMJ,EAAM,QAAQ,oBAAoB,CAAC;AACxE,UAAMK,IAAcD,EAAS,MAAMJ,EAAM,QAAQ,kBAAkB,CAAC,GAC9DM,IAAQF,EAAS,MAAMC,EAAY,MAAM,QAAQ;AAGnC,IAAAE,GAAW,QAAQ;AAAA,MACrC,gBAAgB;AAAA,IAClB,CAAC;UAKKC,IAAe,CAACC,MAAY;AAChC,MAAAT,EAAM,SAAS,yBAAyBS,CAAO;AAAA,IACjD,GAEMC,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,EAAI,EAAK,GAClBE,IAAiBF,EAAI,IAAI,GACzBG,IAAkBH,EAAI,UAAU,GAChCI,IAAaJ,EAAI,EAAK,GACtBK,IAASL,EAAI,EAAK,GAClBM,IAAWN,EAAI,GACfO,IAAO,CAAC,MAAM,OAAO,MAAM,MAAM,MAAM,MAAM,IAAI,GACjDC,IAAcR,EAAI,CAA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ACpBJ,EAAW,QAAQ,KAEvBI,EAAY;AAAA,IAEpB,GAEM+B,KAAa,MAAM;AACrB,UAAId,EAAQ,MAAM,KAAK,KAAI,MAAO,IAAI;AAClC,QAAAA,EAAQ,MAAM,UAAU;AACxB;AAAA,MACJ;AACA,MAAIF,EAAaE,EAAQ,MAAM,IAAI,KAC/BnB,EAAS,MAAM,KAAKmB,EAAQ,MAAM,IAAI,GACtCA,EAAQ,MAAM,OAAO,IACrBA,EAAQ,MAAM,UAAU,MAExBA,EAAQ,MAAM,UAAU;AAAA,IAEhC,GACMe,KAAiB,MAAM;AACzB,MAAKnC,EAAO,SAKRA,EAAO,QAAQ,IACfF,EAAgB,QAAQ,YACxB8B,EAAa,MANb5B,EAAO,QAAQ,IACfF,EAAgB,QAAQ,cACxB8B,EAAa;AAAA,IAMrB,GAEMQ,KAAO,MAAM;AACf,MAAArD,EAAO,KAAK,EAAE,MAAM,uCAAwC,CAAA;AAAA,IAChE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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\n <textarea> {{ token }} </textarea>\n <hr>\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';\nimport { mapActions } from 'vuex'\nimport { computed } from 'vue'\nimport { mapGetters } from 'vuex'\n\nimport axios from 'axios'\n\nconst store = useStore();\nconst router = useRouter();\nconst getUserDrafts = computed(() => store.getters['auth/getUserDrafts'])\nconst getUserData = computed(() => store.getters['auth/getUserData'])\nconst token = computed(() => getUserData.value.rtpToken)\n\n// Update the mapActions usage\nconst authActions = mapActions('auth', {\n updateUserData: 'updateUserData'\n})\n\n// Destructure the action\nconst { updateUserData } = authActions\n\nconst showSnackbar = (payload) => {\n store.dispatch('snackbar/showSnackbar', payload);\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\n\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: `Bearer ${token.value}`,\n },\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: `${notificationBaseUrl}/catalogue/${catalogId}/setting`,\n headers: {\n Authorization: `Bearer ${token.value}`,\n 'Content-Type': 'application/json', \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 } 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\nfetchNotificationInfo()\n\nconst postDeactive = async () => {\n\n const config = {\n method: 'post',\n url: `${notificationBaseUrl}/catalogue/${catalogId}/setting`,\n headers: {\n Authorization: `Bearer ${token.value}`,\n 'Content-Type': 'application/json', \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","computed","getUserData","token","mapActions","showSnackbar","payload","triggerSnackbar","route","useRoute","monthly","ref","weekly","mailButtonWrap","activatedString","inputWidth","active","mailList","week","daysInMonth","editMode","treshold","frequencyUnit","frequencyValue","selectedDay","catalogId","app","getCurrentInstance","notificationBaseUrl","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":";;;;;;;;;;;;;;;AA0JA,UAAMA,IAAQC,GAAQ,GAChBC,IAASC,GAAS;AACF,IAAAC,EAAS,MAAMJ,EAAM,QAAQ,oBAAoB,CAAC;AACxE,UAAMK,IAAcD,EAAS,MAAMJ,EAAM,QAAQ,kBAAkB,CAAC,GAC9DM,IAAQF,EAAS,MAAMC,EAAY,MAAM,QAAQ;AAGnC,IAAAE,GAAW,QAAQ;AAAA,MACrC,gBAAgB;AAAA,IAClB,CAAC;UAKKC,IAAe,CAACC,MAAY;AAChC,MAAAT,EAAM,SAAS,yBAAyBS,CAAO;AAAA,IACjD,GAEMC,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,EAAI,EAAK,GAClBE,IAAiBF,EAAI,IAA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('@intlify/core-base').RemoveIndexSignature<{
16
16
  [x: string]: import('../../../vue-i18n/dist/vue-i18n.cjs.js').LocaleMessageValue<import('../../../vue-i18n/dist/vue-i18n.cjs.js').VueMessageType>;
17
17
  }>, never, string, string>;
18
+ catalogId: import('vue').ComputedRef<any>;
18
19
  }, {
19
20
  inputChoice: string;
20
21
  error: string;
@@ -27,7 +28,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
27
28
  fail: boolean;
28
29
  validExtensions: any;
29
30
  }, {
30
- getCatalogue(): unknown;
31
31
  getData: import('vuex').Computed;
32
32
  getIsEditMode: import('vuex').Computed;
33
33
  getUserData: import('vuex').Computed;