diff --git a/tests/UI/expected-ui-screenshots/CustomAlerts_delete.png b/tests/UI/expected-ui-screenshots/CustomAlerts_delete.png index 8f2209f..5cc9cf4 100644 Binary files a/tests/UI/expected-ui-screenshots/CustomAlerts_delete.png and b/tests/UI/expected-ui-screenshots/CustomAlerts_delete.png differ diff --git a/tests/UI/expected-ui-screenshots/CustomAlerts_edit.png b/tests/UI/expected-ui-screenshots/CustomAlerts_edit.png index 0826709..390bfd0 100644 Binary files a/tests/UI/expected-ui-screenshots/CustomAlerts_edit.png and b/tests/UI/expected-ui-screenshots/CustomAlerts_edit.png differ diff --git a/vue/dist/CustomAlerts.umd.js b/vue/dist/CustomAlerts.umd.js index 0efd8c6..7aa31ff 100644 --- a/vue/dist/CustomAlerts.umd.js +++ b/vue/dist/CustomAlerts.umd.js @@ -149,7 +149,7 @@ if (typeof window !== 'undefined') { // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CustomAlerts/vue/src/ListAlerts/ListAlerts.vue?vue&type=template&id=017eaa07 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CustomAlerts/vue/src/ListAlerts/ListAlerts.vue?vue&type=template&id=38f90d41 var _hoisted_1 = { key: 0 @@ -180,34 +180,28 @@ var _hoisted_10 = { class: "edit" }; var _hoisted_11 = ["href", "title"]; - -var _hoisted_12 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - class: "icon-edit" -}, null, -1); - -var _hoisted_13 = [_hoisted_12]; -var _hoisted_14 = { +var _hoisted_12 = { class: "delete" }; -var _hoisted_15 = ["onClick", "id", "title"]; +var _hoisted_13 = ["onClick", "id", "title"]; -var _hoisted_16 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { +var _hoisted_14 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon-delete" }, null, -1); -var _hoisted_17 = [_hoisted_16]; -var _hoisted_18 = { +var _hoisted_15 = [_hoisted_14]; +var _hoisted_16 = { class: "tableActionBar" }; -var _hoisted_19 = ["href"]; +var _hoisted_17 = ["href"]; -var _hoisted_20 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { +var _hoisted_18 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon-add" }, null, -1); -var _hoisted_21 = ["href"]; +var _hoisted_19 = ["href"]; -var _hoisted_22 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { +var _hoisted_20 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon-table" }, null, -1); @@ -220,34 +214,34 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", { key: alert.idalert }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(alert.name), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.decode(alert.siteName)), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_8, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.ucfirst(_ctx.translate("Intl_Period".concat(_ctx.ucfirst(alert.period))))), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(alert.reportName || '-'), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - class: "table-action", + class: "table-action icon-edit", href: _ctx.linkTo({ 'module': 'CustomAlerts', 'action': 'editAlert', 'idAlert': alert.idalert }), title: _ctx.translate('General_Edit') - }, _hoisted_13, 8, _hoisted_11)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { + }, null, 8, _hoisted_11)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { class: "deleteAlert table-action", onClick: function onClick($event) { return _ctx.deleteAlert(alert.idalert); }, id: alert.idalert, title: _ctx.translate('General_Delete') - }, _hoisted_17, 8, _hoisted_15)])]); - }), 128))])], 512), [[_directive_content_table]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_18, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, _hoisted_15, 8, _hoisted_13)])]); + }), 128))])], 512), [[_directive_content_table]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_16, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: _ctx.linkTo({ 'module': 'CustomAlerts', 'action': 'addNewAlert' }) - }, [_hoisted_20, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomAlerts_CreateNewAlert')), 1)], 8, _hoisted_19), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, [_hoisted_18, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomAlerts_CreateNewAlert')), 1)], 8, _hoisted_17), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: _ctx.linkTo({ 'module': 'CustomAlerts', 'action': 'historyTriggeredAlerts' }) - }, [_hoisted_22, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomAlerts_AlertsHistory')), 1)], 8, _hoisted_21)])]); + }, [_hoisted_20, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomAlerts_AlertsHistory')), 1)], 8, _hoisted_19)])]); } -// CONCATENATED MODULE: ./plugins/CustomAlerts/vue/src/ListAlerts/ListAlerts.vue?vue&type=template&id=017eaa07 +// CONCATENATED MODULE: ./plugins/CustomAlerts/vue/src/ListAlerts/ListAlerts.vue?vue&type=template&id=38f90d41 // EXTERNAL MODULE: external "CoreHome" var external_CoreHome_ = __webpack_require__("19dc"); diff --git a/vue/dist/CustomAlerts.umd.min.js b/vue/dist/CustomAlerts.umd.min.js index aed1846..ec5d441 100644 --- a/vue/dist/CustomAlerts.umd.min.js +++ b/vue/dist/CustomAlerts.umd.min.js @@ -1,4 +1,4 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["CustomAlerts"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["CustomAlerts"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,r){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var l=t[n]={i:n,l:!1,exports:{}};return e[n].call(l.exports,l,l.exports,r),l.l=!0,l.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)r.d(n,l,function(t){return e[t]}.bind(null,l));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="plugins/CustomAlerts/vue/dist/",r(r.s="fae3")}({"19dc":function(t,r){t.exports=e},"8bbf":function(e,r){e.exports=t},a5a2:function(e,t){e.exports=r},fae3:function(e,t,r){"use strict";if(r.r(t),r.d(t,"ListAlerts",(function(){return x})),r.d(t,"EditAlert",(function(){return ie})),r.d(t,"HistoryTriggeredAlerts",(function(){return pe})),r.d(t,"ListAlertsPage",(function(){return ve})),"undefined"!==typeof window){var n=window.document.currentScript,l=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);l&&(r.p=l[1])}var o=r("8bbf"),a={key:0},i={colspan:"6"},c=Object(o["createElementVNode"])("br",null,null,-1),u=Object(o["createElementVNode"])("br",null,null,-1),s=Object(o["createElementVNode"])("br",null,null,-1),d={class:"name"},m={class:"site"},p={class:"period"},b={class:"reportName"},O={class:"edit"},f=["href","title"],j=Object(o["createElementVNode"])("span",{class:"icon-edit"},null,-1),h=[j],v={class:"delete"},A=["onClick","id","title"],V=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1),g=[V],y={class:"tableActionBar"},N=["href"],C=Object(o["createElementVNode"])("span",{class:"icon-add"},null,-1),_=["href"],E=Object(o["createElementVNode"])("span",{class:"icon-table"},null,-1);function S(e,t,r,n,l,j){var V,S=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("table",null,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Name")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Website")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Period")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Report")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Edit")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Delete")),1)])]),Object(o["createElementVNode"])("tbody",null,[null!==(V=e.alerts)&&void 0!==V&&V.length?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",a,[Object(o["createElementVNode"])("td",i,[c,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("CustomAlerts_NoAlertsDefined"))+" ",1),u,s])])),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.alerts,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{key:t.idalert},[Object(o["createElementVNode"])("td",d,Object(o["toDisplayString"])(t.name),1),Object(o["createElementVNode"])("td",m,Object(o["toDisplayString"])(e.decode(t.siteName)),1),Object(o["createElementVNode"])("td",p,Object(o["toDisplayString"])(e.ucfirst(e.translate("Intl_Period".concat(e.ucfirst(t.period))))),1),Object(o["createElementVNode"])("td",b,Object(o["toDisplayString"])(t.reportName||"-"),1),Object(o["createElementVNode"])("td",O,[Object(o["createElementVNode"])("a",{class:"table-action",href:e.linkTo({module:"CustomAlerts",action:"editAlert",idAlert:t.idalert}),title:e.translate("General_Edit")},h,8,f)]),Object(o["createElementVNode"])("td",v,[Object(o["createElementVNode"])("button",{class:"deleteAlert table-action",onClick:function(r){return e.deleteAlert(t.idalert)},id:t.idalert,title:e.translate("General_Delete")},g,8,A)])])})),128))])],512),[[S]]),Object(o["createElementVNode"])("div",y,[Object(o["createElementVNode"])("a",{href:e.linkTo({module:"CustomAlerts",action:"addNewAlert"})},[C,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("CustomAlerts_CreateNewAlert")),1)],8,N),Object(o["createElementVNode"])("a",{href:e.linkTo({module:"CustomAlerts",action:"historyTriggeredAlerts"})},[E,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("CustomAlerts_AlertsHistory")),1)],8,_)])])}var M=r("19dc"),k=Object(o["defineComponent"])({props:{alerts:{type:Array,default:function(){return[]}}},directives:{ContentTable:M["ContentTable"]},methods:{deleteAlert:function(e){M["Matomo"].helper.modalConfirm("#confirm",{yes:function(){M["AjaxHelper"].fetch({method:"CustomAlerts.deleteAlert",idAlert:e}).then((function(){M["Matomo"].helper.redirect()}))}})},ucfirst:function(e){return"".concat(e[0].toUpperCase()).concat(e.substr(1))},linkTo:function(e){return"?".concat(M["MatomoUrl"].stringify(Object.assign(Object.assign({},M["MatomoUrl"].urlParsed.value),e)))},decode:function(e){return M["Matomo"].helper.htmlDecode(e)}}});k.render=S;var x=k,D={id:"customAlertPeriodHelp",class:"inline-help-node"},B={key:0},w={key:1,class:"row"},T={class:"col s12"},R=Object(o["createTextVNode"])(": "),P=["innerHTML"],U={class:"row"},L={class:"col s12"},q={class:"row conditionAndValue"},I={class:"col s12 m6"},G={class:"col s12 m6"},H={class:"ui-autocomplete-input",ref:"reportValue"},F={class:"row conditionAndValue"},$={class:"col s12 m6"},W={class:"col s12 m6"},z=["innerHTML"];function Y(e,t,r,n,l,a){var i=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("SelectPhoneNumbers"),u=Object(o["resolveComponent"])("Alert"),s=Object(o["resolveComponent"])("ActivityIndicator"),d=Object(o["resolveComponent"])("SaveButton"),m=Object(o["resolveComponent"])("ContentBlock"),p=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(m,{class:"alerts","content-title":e.headline},{default:Object(o["withCtx"])((function(){var r,n,l;return[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"text",name:"alertName",modelValue:e.actualAlert.name,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.actualAlert.name=t}),maxlength:100,title:e.translate("CustomAlerts_AlertName")},null,8,["modelValue","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"site",name:"idSite","model-value":{id:null===(r=e.actualAlert.id_sites)||void 0===r?void 0:r[0],name:e.actualCurrentSite.name},"onUpdate:modelValue":t[1]||(t[1]=function(t){e.actualAlert.id_sites=[t.id],e.actualCurrentSite=t,e.changeReport()}),title:e.translate("General_Website"),introduction:e.translate("CustomAlerts_ApplyTo")},null,8,["model-value","title","introduction"])]),Object(o["createElementVNode"])("div",D,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("CustomAlerts_YouCanChoosePeriodFrom"))+": ",1),Object(o["createElementVNode"])("ul",null,[Object(o["createElementVNode"])("li",null,"• "+Object(o["toDisplayString"])(e.translate("CustomAlerts_PeriodDayDescription")),1),Object(o["createElementVNode"])("li",null,"• "+Object(o["toDisplayString"])(e.translate("CustomAlerts_PeriodWeekDescription")),1),Object(o["createElementVNode"])("li",null,"• "+Object(o["toDisplayString"])(e.translate("CustomAlerts_PeriodMonthDescription")),1)])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"select",name:"period","inline-help":"#customAlertPeriodHelp","model-value":e.actualAlert.period,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.actualAlert.period=t,e.changeReport()}),title:e.translate("General_Period"),options:e.periodOptions},null,8,["model-value","title","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"checkbox",name:"report_email_me",modelValue:e.actualAlert.email_me,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.actualAlert.email_me=t}),introduction:e.translate("ScheduledReports_SendReportTo"),title:"".concat(e.translate("ScheduledReports_SentToMe")," (").concat(e.currentUserEmail,")")},null,8,["modelValue","introduction","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"textarea",modelValue:e.actualAlert.additional_emails,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.actualAlert.additional_emails=t}),"var-type":"array",title:e.translate("ScheduledReports_AlsoSendReportToTheseEmails")},null,8,["modelValue","title"])]),e.supportsSMS?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",B,[Object(o["createVNode"])(c,{"phone-numbers":e.phoneNumbers||[],modelValue:e.actualAlert.phone_numbers,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.actualAlert.phone_numbers=t})},null,8,["phone-numbers","modelValue"])])):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",w,[Object(o["createElementVNode"])("div",T,[Object(o["createVNode"])(u,{severity:"info"},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("MobileMessaging_PhoneNumbers")),1),R,Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.mobileMessagingNotActivated)},null,8,P)]})),_:1})])])),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"expandable-select",name:"report","model-value":e.actualAlert.report,"onUpdate:modelValue":t[6]||(t[6]=function(t){e.actualAlert.report=t,e.changeReport()}),options:e.reportOptions,title:"".concat(e.translate("CustomAlerts_ThisAppliesTo"),": ").concat(null===(n=e.actualReportMetadata)||void 0===n?void 0:n.name),introduction:e.translate("CustomAlerts_AlertCondition")},null,8,["model-value","options","title","introduction"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",U,[Object(o["createElementVNode"])("div",L,[Object(o["createVNode"])(s,{loading:e.isLoadingReport},null,8,["loading"])])],512),[[o["vShow"],e.isLoadingReport]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",q,[Object(o["createElementVNode"])("div",I,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"select",name:"reportCondition",modelValue:e.actualAlert.report_condition,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.actualAlert.report_condition=t}),"full-width":!0,title:e.reportConditionTitle,options:e.alertGroupConditions},null,8,["modelValue","title","options"])])]),Object(o["createElementVNode"])("div",G,[Object(o["createElementVNode"])("div",H,[Object(o["withDirectives"])(Object(o["createVNode"])(i,{uicontrol:"text",role:"textbox",name:"reportValue",modelValue:e.actualAlert.report_matched,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.actualAlert.report_matched=t}),"full-width":!0,autocomplete:"off",maxlength:255,title:e.translate("General_Value")},null,8,["modelValue","title"]),[[o["vShow"],"matches_any"!==e.actualAlert.report_condition]])],512)])],512),[[o["vShow"],e.hasReportDimension]]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"select",name:"metric","model-value":e.actualAlert.metric,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.actualAlert.metric=t}),options:e.metricOptions,introduction:e.translate("CustomAlerts_AlertMeWhen")},null,8,["model-value","options","introduction"])]),Object(o["createElementVNode"])("div",F,[Object(o["createElementVNode"])("div",$,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"select",name:"metricCondition","model-value":e.actualAlert.metric_condition,"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.actualAlert.metric_condition=t}),"full-width":!0,options:e.metricConditionOptions},null,8,["model-value","options"])])]),Object(o["createElementVNode"])("div",W,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"text",name:"metricValue",class:Object(o["normalizeClass"])({invalid:e.isMetricValueInvalid}),modelValue:e.actualAlert.metric_matched,"onUpdate:modelValue":t[11]||(t[11]=function(t){return e.actualAlert.metric_matched=t}),title:"".concat(e.metricDescription,""),"full-width":!0},null,8,["class","modelValue","title"])])])]),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.comparablesDates,(function(t,r){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:r},[Object(o["withDirectives"])(Object(o["createVNode"])(i,{uicontrol:"select",name:"compared_to",modelValue:e.comparedTo[r],"onUpdate:modelValue":function(t){return e.comparedTo[r]=t},disabled:Object.keys(t).length<=1,options:t,introduction:e.translate("CustomAlerts_ComparedToThe")},null,8,["modelValue","onUpdate:modelValue","disabled","options","introduction"]),[[o["vShow"],r===e.actualAlert.period&&e.isComparable]])])})),128)),null!==(l=e.actualAlert)&&void 0!==l&&l.idalert?(Object(o["openBlock"])(),Object(o["createBlock"])(d,{key:2,onClick:t[12]||(t[12]=function(t){return e.updateAlert(e.actualAlert.idalert)}),saving:e.isLoading},null,8,["saving"])):(Object(o["openBlock"])(),Object(o["createBlock"])(d,{key:3,onClick:t[13]||(t[13]=function(t){return e.createAlert()}),saving:e.isLoading},null,8,["saving"])),Object(o["createElementVNode"])("div",{class:"entityCancel",innerHTML:e.$sanitize(e.cancelLink)},null,8,z)],512),[[p]])]})),_:1},8,["content-title"])}var J=r("a5a2");function K(e,t){return te(e)||ee(e,t)||X(e,t)||Q()}function Q(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function X(e,t){if(e){if("string"===typeof e)return Z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Z(e,t):void 0}}function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r'),"")},cancelLink:function(){var e="?".concat(M["MatomoUrl"].stringify(Object.assign(Object.assign({},M["MatomoUrl"].urlParsed.value),{},{module:"CustomAlerts",action:"index"})));return Object(M["translate"])("General_OrCancel",''),"")},metricOptions:function(){var e;return Object.entries((null===(e=this.actualReportMetadata)||void 0===e?void 0:e.metrics)||{}).map((function(e){var t=K(e,2),r=t[0],n=t[1];return{key:r,value:n}}))},hasReportDimension:function(){var e;return!(null===(e=this.actualReportMetadata)||void 0===e||!e.dimension)},reportConditionTitle:function(){var e,t=null===(e=this.actualReportMetadata)||void 0===e?void 0:e.dimension;return"".concat(Object(M["translate"])("CustomAlerts_When")," ").concat(t,"")},isComparable:function(){var e=this.actualAlert.metric_condition;return!!e&&-1!==e.indexOf("_more_than")},metricDescription:function(){var e=this.actualAlert.metric_condition,t=this.actualAlert.metric,r=e&&0===e.indexOf("percentage_"),n=t&&-1!==t.indexOf("_rate"),l=t&&-1!==t.indexOf("_time_");return r||n?"%":l?"s":Object(M["translate"])("General_Value")}}});ae.render=Y;var ie=ae,ce={class:"tableActionBar"},ue=["href"],se=Object(o["createElementVNode"])("span",{class:"icon-table"},null,-1);function de(e,t,r,n,l,a){var i=Object(o["resolveComponent"])("ContentBlock");return Object(o["openBlock"])(),Object(o["createBlock"])(i,{class:"alerts","content-title":e.translate("CustomAlerts_AlertsHistory")},{default:Object(o["withCtx"])((function(){return[Object(o["renderSlot"])(e.$slots,"default"),Object(o["createElementVNode"])("div",ce,[Object(o["createElementVNode"])("a",{href:e.customAlertsIndexLink},[se,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("CustomAlerts_ManageAlerts")),1)],8,ue)])]})),_:3},8,["content-title"])}var me=Object(o["defineComponent"])({props:{},components:{ContentBlock:M["ContentBlock"]},computed:{customAlertsIndexLink:function(){return"?".concat(M["MatomoUrl"].stringify(Object.assign(Object.assign({},M["MatomoUrl"].urlParsed.value),{},{module:"CustomAlerts",action:"index"})))}}});me.render=de;var pe=me,be={class:"ui-confirm",id:"confirm"},Oe=["value"],fe=["value"];function je(e,t,r,n,l,a){var i=Object(o["resolveComponent"])("ListAlerts"),c=Object(o["resolveComponent"])("ContentBlock");return Object(o["openBlock"])(),Object(o["createBlock"])(c,{class:"alerts","content-title":e.title},{default:Object(o["withCtx"])((function(){return[Object(o["createVNode"])(i,{alerts:e.alerts},null,8,["alerts"]),Object(o["createElementVNode"])("div",be,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("CustomAlerts_AreYouSureDeleteAlert")),1),Object(o["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Oe),Object(o["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,fe)])]})),_:1},8,["content-title"])}var he=Object(o["defineComponent"])({props:{title:{type:String,required:!0},alerts:{type:Array,default:function(){return[]}}},components:{ContentBlock:M["ContentBlock"],ListAlerts:x}});he.render=je;var ve=he; +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["CustomAlerts"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["CustomAlerts"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,r){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var l=t[n]={i:n,l:!1,exports:{}};return e[n].call(l.exports,l,l.exports,r),l.l=!0,l.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)r.d(n,l,function(t){return e[t]}.bind(null,l));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="plugins/CustomAlerts/vue/dist/",r(r.s="fae3")}({"19dc":function(t,r){t.exports=e},"8bbf":function(e,r){e.exports=t},a5a2:function(e,t){e.exports=r},fae3:function(e,t,r){"use strict";if(r.r(t),r.d(t,"ListAlerts",(function(){return M})),r.d(t,"EditAlert",(function(){return oe})),r.d(t,"HistoryTriggeredAlerts",(function(){return de})),r.d(t,"ListAlertsPage",(function(){return je})),"undefined"!==typeof window){var n=window.document.currentScript,l=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);l&&(r.p=l[1])}var o=r("8bbf"),a={key:0},i={colspan:"6"},c=Object(o["createElementVNode"])("br",null,null,-1),u=Object(o["createElementVNode"])("br",null,null,-1),s=Object(o["createElementVNode"])("br",null,null,-1),d={class:"name"},m={class:"site"},p={class:"period"},b={class:"reportName"},O={class:"edit"},f=["href","title"],j={class:"delete"},h=["onClick","id","title"],v=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1),A=[v],V={class:"tableActionBar"},g=["href"],y=Object(o["createElementVNode"])("span",{class:"icon-add"},null,-1),N=["href"],C=Object(o["createElementVNode"])("span",{class:"icon-table"},null,-1);function _(e,t,r,n,l,v){var _,E=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("table",null,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Name")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Website")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Period")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Report")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Edit")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Delete")),1)])]),Object(o["createElementVNode"])("tbody",null,[null!==(_=e.alerts)&&void 0!==_&&_.length?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",a,[Object(o["createElementVNode"])("td",i,[c,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("CustomAlerts_NoAlertsDefined"))+" ",1),u,s])])),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.alerts,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{key:t.idalert},[Object(o["createElementVNode"])("td",d,Object(o["toDisplayString"])(t.name),1),Object(o["createElementVNode"])("td",m,Object(o["toDisplayString"])(e.decode(t.siteName)),1),Object(o["createElementVNode"])("td",p,Object(o["toDisplayString"])(e.ucfirst(e.translate("Intl_Period".concat(e.ucfirst(t.period))))),1),Object(o["createElementVNode"])("td",b,Object(o["toDisplayString"])(t.reportName||"-"),1),Object(o["createElementVNode"])("td",O,[Object(o["createElementVNode"])("a",{class:"table-action icon-edit",href:e.linkTo({module:"CustomAlerts",action:"editAlert",idAlert:t.idalert}),title:e.translate("General_Edit")},null,8,f)]),Object(o["createElementVNode"])("td",j,[Object(o["createElementVNode"])("button",{class:"deleteAlert table-action",onClick:function(r){return e.deleteAlert(t.idalert)},id:t.idalert,title:e.translate("General_Delete")},A,8,h)])])})),128))])],512),[[E]]),Object(o["createElementVNode"])("div",V,[Object(o["createElementVNode"])("a",{href:e.linkTo({module:"CustomAlerts",action:"addNewAlert"})},[y,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("CustomAlerts_CreateNewAlert")),1)],8,g),Object(o["createElementVNode"])("a",{href:e.linkTo({module:"CustomAlerts",action:"historyTriggeredAlerts"})},[C,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("CustomAlerts_AlertsHistory")),1)],8,N)])])}var E=r("19dc"),S=Object(o["defineComponent"])({props:{alerts:{type:Array,default:function(){return[]}}},directives:{ContentTable:E["ContentTable"]},methods:{deleteAlert:function(e){E["Matomo"].helper.modalConfirm("#confirm",{yes:function(){E["AjaxHelper"].fetch({method:"CustomAlerts.deleteAlert",idAlert:e}).then((function(){E["Matomo"].helper.redirect()}))}})},ucfirst:function(e){return"".concat(e[0].toUpperCase()).concat(e.substr(1))},linkTo:function(e){return"?".concat(E["MatomoUrl"].stringify(Object.assign(Object.assign({},E["MatomoUrl"].urlParsed.value),e)))},decode:function(e){return E["Matomo"].helper.htmlDecode(e)}}});S.render=_;var M=S,k={id:"customAlertPeriodHelp",class:"inline-help-node"},x={key:0},D={key:1,class:"row"},B={class:"col s12"},w=Object(o["createTextVNode"])(": "),T=["innerHTML"],R={class:"row"},P={class:"col s12"},U={class:"row conditionAndValue"},L={class:"col s12 m6"},q={class:"col s12 m6"},I={class:"ui-autocomplete-input",ref:"reportValue"},G={class:"row conditionAndValue"},H={class:"col s12 m6"},F={class:"col s12 m6"},$=["innerHTML"];function W(e,t,r,n,l,a){var i=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("SelectPhoneNumbers"),u=Object(o["resolveComponent"])("Alert"),s=Object(o["resolveComponent"])("ActivityIndicator"),d=Object(o["resolveComponent"])("SaveButton"),m=Object(o["resolveComponent"])("ContentBlock"),p=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(m,{class:"alerts","content-title":e.headline},{default:Object(o["withCtx"])((function(){var r,n,l;return[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"text",name:"alertName",modelValue:e.actualAlert.name,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.actualAlert.name=t}),maxlength:100,title:e.translate("CustomAlerts_AlertName")},null,8,["modelValue","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"site",name:"idSite","model-value":{id:null===(r=e.actualAlert.id_sites)||void 0===r?void 0:r[0],name:e.actualCurrentSite.name},"onUpdate:modelValue":t[1]||(t[1]=function(t){e.actualAlert.id_sites=[t.id],e.actualCurrentSite=t,e.changeReport()}),title:e.translate("General_Website"),introduction:e.translate("CustomAlerts_ApplyTo")},null,8,["model-value","title","introduction"])]),Object(o["createElementVNode"])("div",k,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("CustomAlerts_YouCanChoosePeriodFrom"))+": ",1),Object(o["createElementVNode"])("ul",null,[Object(o["createElementVNode"])("li",null,"• "+Object(o["toDisplayString"])(e.translate("CustomAlerts_PeriodDayDescription")),1),Object(o["createElementVNode"])("li",null,"• "+Object(o["toDisplayString"])(e.translate("CustomAlerts_PeriodWeekDescription")),1),Object(o["createElementVNode"])("li",null,"• "+Object(o["toDisplayString"])(e.translate("CustomAlerts_PeriodMonthDescription")),1)])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"select",name:"period","inline-help":"#customAlertPeriodHelp","model-value":e.actualAlert.period,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.actualAlert.period=t,e.changeReport()}),title:e.translate("General_Period"),options:e.periodOptions},null,8,["model-value","title","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"checkbox",name:"report_email_me",modelValue:e.actualAlert.email_me,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.actualAlert.email_me=t}),introduction:e.translate("ScheduledReports_SendReportTo"),title:"".concat(e.translate("ScheduledReports_SentToMe")," (").concat(e.currentUserEmail,")")},null,8,["modelValue","introduction","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"textarea",modelValue:e.actualAlert.additional_emails,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.actualAlert.additional_emails=t}),"var-type":"array",title:e.translate("ScheduledReports_AlsoSendReportToTheseEmails")},null,8,["modelValue","title"])]),e.supportsSMS?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",x,[Object(o["createVNode"])(c,{"phone-numbers":e.phoneNumbers||[],modelValue:e.actualAlert.phone_numbers,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.actualAlert.phone_numbers=t})},null,8,["phone-numbers","modelValue"])])):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",D,[Object(o["createElementVNode"])("div",B,[Object(o["createVNode"])(u,{severity:"info"},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("MobileMessaging_PhoneNumbers")),1),w,Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.mobileMessagingNotActivated)},null,8,T)]})),_:1})])])),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"expandable-select",name:"report","model-value":e.actualAlert.report,"onUpdate:modelValue":t[6]||(t[6]=function(t){e.actualAlert.report=t,e.changeReport()}),options:e.reportOptions,title:"".concat(e.translate("CustomAlerts_ThisAppliesTo"),": ").concat(null===(n=e.actualReportMetadata)||void 0===n?void 0:n.name),introduction:e.translate("CustomAlerts_AlertCondition")},null,8,["model-value","options","title","introduction"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",R,[Object(o["createElementVNode"])("div",P,[Object(o["createVNode"])(s,{loading:e.isLoadingReport},null,8,["loading"])])],512),[[o["vShow"],e.isLoadingReport]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",U,[Object(o["createElementVNode"])("div",L,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"select",name:"reportCondition",modelValue:e.actualAlert.report_condition,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.actualAlert.report_condition=t}),"full-width":!0,title:e.reportConditionTitle,options:e.alertGroupConditions},null,8,["modelValue","title","options"])])]),Object(o["createElementVNode"])("div",q,[Object(o["createElementVNode"])("div",I,[Object(o["withDirectives"])(Object(o["createVNode"])(i,{uicontrol:"text",role:"textbox",name:"reportValue",modelValue:e.actualAlert.report_matched,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.actualAlert.report_matched=t}),"full-width":!0,autocomplete:"off",maxlength:255,title:e.translate("General_Value")},null,8,["modelValue","title"]),[[o["vShow"],"matches_any"!==e.actualAlert.report_condition]])],512)])],512),[[o["vShow"],e.hasReportDimension]]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"select",name:"metric","model-value":e.actualAlert.metric,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.actualAlert.metric=t}),options:e.metricOptions,introduction:e.translate("CustomAlerts_AlertMeWhen")},null,8,["model-value","options","introduction"])]),Object(o["createElementVNode"])("div",G,[Object(o["createElementVNode"])("div",H,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"select",name:"metricCondition","model-value":e.actualAlert.metric_condition,"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.actualAlert.metric_condition=t}),"full-width":!0,options:e.metricConditionOptions},null,8,["model-value","options"])])]),Object(o["createElementVNode"])("div",F,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(i,{uicontrol:"text",name:"metricValue",class:Object(o["normalizeClass"])({invalid:e.isMetricValueInvalid}),modelValue:e.actualAlert.metric_matched,"onUpdate:modelValue":t[11]||(t[11]=function(t){return e.actualAlert.metric_matched=t}),title:"".concat(e.metricDescription,""),"full-width":!0},null,8,["class","modelValue","title"])])])]),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.comparablesDates,(function(t,r){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:r},[Object(o["withDirectives"])(Object(o["createVNode"])(i,{uicontrol:"select",name:"compared_to",modelValue:e.comparedTo[r],"onUpdate:modelValue":function(t){return e.comparedTo[r]=t},disabled:Object.keys(t).length<=1,options:t,introduction:e.translate("CustomAlerts_ComparedToThe")},null,8,["modelValue","onUpdate:modelValue","disabled","options","introduction"]),[[o["vShow"],r===e.actualAlert.period&&e.isComparable]])])})),128)),null!==(l=e.actualAlert)&&void 0!==l&&l.idalert?(Object(o["openBlock"])(),Object(o["createBlock"])(d,{key:2,onClick:t[12]||(t[12]=function(t){return e.updateAlert(e.actualAlert.idalert)}),saving:e.isLoading},null,8,["saving"])):(Object(o["openBlock"])(),Object(o["createBlock"])(d,{key:3,onClick:t[13]||(t[13]=function(t){return e.createAlert()}),saving:e.isLoading},null,8,["saving"])),Object(o["createElementVNode"])("div",{class:"entityCancel",innerHTML:e.$sanitize(e.cancelLink)},null,8,$)],512),[[p]])]})),_:1},8,["content-title"])}var z=r("a5a2");function Y(e,t){return Z(e)||X(e,t)||K(e,t)||J()}function J(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function K(e,t){if(e){if("string"===typeof e)return Q(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Q(e,t):void 0}}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r'),"")},cancelLink:function(){var e="?".concat(E["MatomoUrl"].stringify(Object.assign(Object.assign({},E["MatomoUrl"].urlParsed.value),{},{module:"CustomAlerts",action:"index"})));return Object(E["translate"])("General_OrCancel",''),"")},metricOptions:function(){var e;return Object.entries((null===(e=this.actualReportMetadata)||void 0===e?void 0:e.metrics)||{}).map((function(e){var t=Y(e,2),r=t[0],n=t[1];return{key:r,value:n}}))},hasReportDimension:function(){var e;return!(null===(e=this.actualReportMetadata)||void 0===e||!e.dimension)},reportConditionTitle:function(){var e,t=null===(e=this.actualReportMetadata)||void 0===e?void 0:e.dimension;return"".concat(Object(E["translate"])("CustomAlerts_When")," ").concat(t,"")},isComparable:function(){var e=this.actualAlert.metric_condition;return!!e&&-1!==e.indexOf("_more_than")},metricDescription:function(){var e=this.actualAlert.metric_condition,t=this.actualAlert.metric,r=e&&0===e.indexOf("percentage_"),n=t&&-1!==t.indexOf("_rate"),l=t&&-1!==t.indexOf("_time_");return r||n?"%":l?"s":Object(E["translate"])("General_Value")}}});le.render=W;var oe=le,ae={class:"tableActionBar"},ie=["href"],ce=Object(o["createElementVNode"])("span",{class:"icon-table"},null,-1);function ue(e,t,r,n,l,a){var i=Object(o["resolveComponent"])("ContentBlock");return Object(o["openBlock"])(),Object(o["createBlock"])(i,{class:"alerts","content-title":e.translate("CustomAlerts_AlertsHistory")},{default:Object(o["withCtx"])((function(){return[Object(o["renderSlot"])(e.$slots,"default"),Object(o["createElementVNode"])("div",ae,[Object(o["createElementVNode"])("a",{href:e.customAlertsIndexLink},[ce,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("CustomAlerts_ManageAlerts")),1)],8,ie)])]})),_:3},8,["content-title"])}var se=Object(o["defineComponent"])({props:{},components:{ContentBlock:E["ContentBlock"]},computed:{customAlertsIndexLink:function(){return"?".concat(E["MatomoUrl"].stringify(Object.assign(Object.assign({},E["MatomoUrl"].urlParsed.value),{},{module:"CustomAlerts",action:"index"})))}}});se.render=ue;var de=se,me={class:"ui-confirm",id:"confirm"},pe=["value"],be=["value"];function Oe(e,t,r,n,l,a){var i=Object(o["resolveComponent"])("ListAlerts"),c=Object(o["resolveComponent"])("ContentBlock");return Object(o["openBlock"])(),Object(o["createBlock"])(c,{class:"alerts","content-title":e.title},{default:Object(o["withCtx"])((function(){return[Object(o["createVNode"])(i,{alerts:e.alerts},null,8,["alerts"]),Object(o["createElementVNode"])("div",me,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("CustomAlerts_AreYouSureDeleteAlert")),1),Object(o["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,pe),Object(o["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,be)])]})),_:1},8,["content-title"])}var fe=Object(o["defineComponent"])({props:{title:{type:String,required:!0},alerts:{type:Array,default:function(){return[]}}},components:{ContentBlock:E["ContentBlock"],ListAlerts:M}});fe.render=Oe;var je=fe; /*! * Matomo - free/libre analytics platform * diff --git a/vue/src/ListAlerts/ListAlerts.vue b/vue/src/ListAlerts/ListAlerts.vue index 683d314..f98559a 100644 --- a/vue/src/ListAlerts/ListAlerts.vue +++ b/vue/src/ListAlerts/ListAlerts.vue @@ -32,14 +32,14 @@ {{ alert.reportName || '-' }} + >