From 668af717bbdcc0b987273913c24eb37b6ab17e21 Mon Sep 17 00:00:00 2001 From: Jacob Ransom Date: Wed, 3 Jul 2024 16:06:27 +1200 Subject: [PATCH 1/8] Update MTM tag to see what test cases fail --- plugins/TagManager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/TagManager b/plugins/TagManager index 07d0d63747a..34dc11ee9f1 160000 --- a/plugins/TagManager +++ b/plugins/TagManager @@ -1 +1 @@ -Subproject commit 07d0d63747a79cd8628bf94f3a5e476834506aa2 +Subproject commit 34dc11ee9f1a509d7ec16873d945272d3cf8cbf2 From 7dbbe8b40790d3e8ac8f5c441e70b5caf1cdd79c Mon Sep 17 00:00:00 2001 From: Jacob Ransom Date: Thu, 4 Jul 2024 13:44:37 +1200 Subject: [PATCH 2/8] Tagging latest changes to MTM --- plugins/TagManager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/TagManager b/plugins/TagManager index 34dc11ee9f1..925c73459d6 160000 --- a/plugins/TagManager +++ b/plugins/TagManager @@ -1 +1 @@ -Subproject commit 34dc11ee9f1a509d7ec16873d945272d3cf8cbf2 +Subproject commit 925c73459d6b11f88814603fcc025c534e653848 From a6cf8b2f012337c2c6f8ba75f8198fa54e949847 Mon Sep 17 00:00:00 2001 From: Jacob Ransom Date: Thu, 4 Jul 2024 14:13:31 +1200 Subject: [PATCH 3/8] Updating expected screenshot after recent UI change --- .../UI/expected-screenshots/TrackingCodeGenerator_initial.png | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png b/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png index d63e5bbd2d5..eadbe75cea1 100644 --- a/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png +++ b/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ab42b2c346014fe81d777b4584383068cfc269206216db084d8da07bb738c3b5 -size 499738 +oid sha256:9a04171bdff839f08ed5d43514101e8895d200f325df3a4d57f08842c2ab36a0 +size 482458 From 503a95f13dd0593d6573a7ee0918f2ad657e6ec1 Mon Sep 17 00:00:00 2001 From: Jacob Ransom Date: Fri, 5 Jul 2024 17:04:43 +1200 Subject: [PATCH 4/8] Updating after minor UI change --- .../UI/expected-screenshots/TrackingCodeGenerator_initial.png | 4 ++-- plugins/TagManager | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png b/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png index eadbe75cea1..d053e9eeeac 100644 --- a/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png +++ b/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9a04171bdff839f08ed5d43514101e8895d200f325df3a4d57f08842c2ab36a0 -size 482458 +oid sha256:671f44a89955046e24087d06760aadc99088baaff76115d33bf7ff071597ec21 +size 514835 diff --git a/plugins/TagManager b/plugins/TagManager index 925c73459d6..d80e9f2dd98 160000 --- a/plugins/TagManager +++ b/plugins/TagManager @@ -1 +1 @@ -Subproject commit 925c73459d6b11f88814603fcc025c534e653848 +Subproject commit d80e9f2dd98563ab532b9593ce6c2b97851ff051 From 38e56fb16bfa118f419f638c7f3f9e631375cf78 Mon Sep 17 00:00:00 2001 From: Jacob Ransom Date: Mon, 8 Jul 2024 13:41:30 +1200 Subject: [PATCH 5/8] Updating after wording change --- plugins/TagManager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/TagManager b/plugins/TagManager index d80e9f2dd98..d7920c03858 160000 --- a/plugins/TagManager +++ b/plugins/TagManager @@ -1 +1 @@ -Subproject commit d80e9f2dd98563ab532b9593ce6c2b97851ff051 +Subproject commit d7920c038587ca4feb0106541a478e54bdf17461 From 1c92acc5d5d9cfc7fc8ebd74082123638cfc8057 Mon Sep 17 00:00:00 2001 From: Jacob Ransom Date: Mon, 8 Jul 2024 14:04:40 +1200 Subject: [PATCH 6/8] Updating screenshot after recent change --- .../UI/expected-screenshots/TrackingCodeGenerator_initial.png | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png b/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png index d053e9eeeac..34dd312aef9 100644 --- a/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png +++ b/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:671f44a89955046e24087d06760aadc99088baaff76115d33bf7ff071597ec21 -size 514835 +oid sha256:c1bc348dda221b950c58639555ee90c70909d93432668dc669bb032121838757 +size 481142 From 4ca0f85e8e8caa92424375a8088f1c0a042d7ed8 Mon Sep 17 00:00:00 2001 From: Jacob Ransom Date: Tue, 9 Jul 2024 12:14:03 +1200 Subject: [PATCH 7/8] Making change requested by Product --- plugins/JsTrackerInstallCheck/JsTrackerInstallCheck.php | 2 +- plugins/JsTrackerInstallCheck/lang/en.json | 2 +- .../vue/dist/JsTrackerInstallCheck.umd.js | 6 +++--- .../vue/dist/JsTrackerInstallCheck.umd.min.js | 2 +- .../vue/src/JsTrackerInstallCheck/JsTrackerInstallCheck.vue | 2 +- plugins/TagManager | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/JsTrackerInstallCheck/JsTrackerInstallCheck.php b/plugins/JsTrackerInstallCheck/JsTrackerInstallCheck.php index d7e74bfacc5..a0421eca753 100644 --- a/plugins/JsTrackerInstallCheck/JsTrackerInstallCheck.php +++ b/plugins/JsTrackerInstallCheck/JsTrackerInstallCheck.php @@ -30,7 +30,7 @@ public function registerEvents() public function getClientSideTranslationKeys(&$translationKeys) { - $translationKeys[] = 'JsTrackerInstallCheck_TestInstallationDescription'; + $translationKeys[] = 'JsTrackerInstallCheck_OptionalTestInstallationDescription'; $translationKeys[] = 'JsTrackerInstallCheck_TestInstallationBtnText'; $translationKeys[] = 'JsTrackerInstallCheck_JsTrackingCodeInstallCheckSuccessMessage'; $translationKeys[] = 'JsTrackerInstallCheck_JsTrackingCodeInstallCheckFailureMessage'; diff --git a/plugins/JsTrackerInstallCheck/lang/en.json b/plugins/JsTrackerInstallCheck/lang/en.json index ff6d648d493..a4c09f23235 100644 --- a/plugins/JsTrackerInstallCheck/lang/en.json +++ b/plugins/JsTrackerInstallCheck/lang/en.json @@ -1,7 +1,7 @@ { "JsTrackerInstallCheck": { "PluginDescription": "Validate whether the tracking code has been installed on your site and that it can send tracking requests back to your Matomo instance", - "TestInstallationDescription": "To test that the tracking code is able to send requests to your Matomo instance, enter the exact URL you are tracking and click on \"Test installation\". A new tab will open, and should close within 10 seconds.", + "OptionalTestInstallationDescription": "Optional: To test that the tracking code is able to send requests to your Matomo instance, enter the exact URL you are tracking and click on \"Test installation\". A new tab will open, and should close within 10 seconds.", "TestInstallationBtnText": "Test installation", "JsTrackingCodeInstallCheckSuccessMessage": "The tracking code is installed successfully! This screen will disappear as soon as some data is tracked for your website.", "JsTrackingCodeInstallCheckFailureMessage": "Tracking code verification failed. Please verify that you have installed the code correctly. %1$sLearn more%2$s.", diff --git a/plugins/JsTrackerInstallCheck/vue/dist/JsTrackerInstallCheck.umd.js b/plugins/JsTrackerInstallCheck/vue/dist/JsTrackerInstallCheck.umd.js index 9c2fdf1dce7..8efcabbe1be 100644 --- a/plugins/JsTrackerInstallCheck/vue/dist/JsTrackerInstallCheck.umd.js +++ b/plugins/JsTrackerInstallCheck/vue/dist/JsTrackerInstallCheck.umd.js @@ -146,7 +146,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/JsTrackerInstallCheck/vue/src/JsTrackerInstallCheck/JsTrackerInstallCheck.vue?vue&type=template&id=33ad0370 +// 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/JsTrackerInstallCheck/vue/src/JsTrackerInstallCheck/JsTrackerInstallCheck.vue?vue&type=template&id=dd44ee20 var _hoisted_1 = { class: "jsTrackerInstallCheck" @@ -185,7 +185,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { var _component_ActivityIndicator = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ActivityIndicator"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('JsTrackerInstallCheck_TestInstallationDescription')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('JsTrackerInstallCheck_OptionalTestInstallationDescription')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { uicontrol: "url", name: "baseUrl", placeholder: "https://example.com", @@ -210,7 +210,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { innerHTML: _ctx.$sanitize(_ctx.getTestFailureMessage) }, null, 8, _hoisted_11)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.isTestComplete && !_ctx.isTestSuccess]])])], 64); } -// CONCATENATED MODULE: ./plugins/JsTrackerInstallCheck/vue/src/JsTrackerInstallCheck/JsTrackerInstallCheck.vue?vue&type=template&id=33ad0370 +// CONCATENATED MODULE: ./plugins/JsTrackerInstallCheck/vue/src/JsTrackerInstallCheck/JsTrackerInstallCheck.vue?vue&type=template&id=dd44ee20 // EXTERNAL MODULE: external "CoreHome" var external_CoreHome_ = __webpack_require__("19dc"); diff --git a/plugins/JsTrackerInstallCheck/vue/dist/JsTrackerInstallCheck.umd.min.js b/plugins/JsTrackerInstallCheck/vue/dist/JsTrackerInstallCheck.umd.min.js index b2fd02f1f79..b5b77ef24c5 100644 --- a/plugins/JsTrackerInstallCheck/vue/dist/JsTrackerInstallCheck.umd.min.js +++ b/plugins/JsTrackerInstallCheck/vue/dist/JsTrackerInstallCheck.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["JsTrackerInstallCheck"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["JsTrackerInstallCheck"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,s){return function(e){var t={};function s(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,s),r.l=!0,r.exports}return s.m=e,s.c=t,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)s.d(n,r,function(t){return e[t]}.bind(null,r));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="plugins/JsTrackerInstallCheck/vue/dist/",s(s.s="fae3")}({"19dc":function(t,s){t.exports=e},"8bbf":function(e,s){e.exports=t},a5a2:function(e,t){e.exports=s},fae3:function(e,t,s){"use strict";if(s.r(t),s.d(t,"JsTrackerInstallCheck",(function(){return O})),"undefined"!==typeof window){var n=window.document.currentScript,r=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(s.p=r[1])}var c=s("8bbf"),i={class:"jsTrackerInstallCheck"},o={class:"row testInstallFields"},a={class:"col s2"},l={class:"col s10"},u=["disabled","value"],d={class:"system-success success-message"},h=Object(c["createElementVNode"])("span",{class:"icon-ok"},null,-1),f={class:"system-errors test-error"},p=Object(c["createElementVNode"])("span",{class:"icon-warning"},null,-1),m=Object(c["createTextVNode"])("  "),T=["innerHTML"];function b(e,t,s,n,r,b){var k=Object(c["resolveComponent"])("Field"),g=Object(c["resolveComponent"])("ActivityIndicator");return Object(c["openBlock"])(),Object(c["createElementBlock"])(c["Fragment"],null,[Object(c["createElementVNode"])("span",null,Object(c["toDisplayString"])(e.translate("JsTrackerInstallCheck_TestInstallationDescription")),1),Object(c["createElementVNode"])("div",i,[Object(c["createElementVNode"])("div",o,[Object(c["createElementVNode"])("div",a,[Object(c["createVNode"])(k,{uicontrol:"url",name:"baseUrl",placeholder:"https://example.com",modelValue:e.baseUrl,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.baseUrl=t}),"full-width":!0,disabled:e.isTesting},null,8,["modelValue","disabled"])]),Object(c["createElementVNode"])("div",l,[Object(c["createElementVNode"])("input",{type:"button",class:"btn testInstallBtn",onClick:t[1]||(t[1]=function(){return e.initiateTrackerTest&&e.initiateTrackerTest.apply(e,arguments)}),disabled:!e.baseUrl||e.isTesting,value:e.translate("JsTrackerInstallCheck_TestInstallationBtnText")},null,8,u)])]),Object(c["createVNode"])(g,{loading:e.isTesting,loadingMessage:e.translate("General_Testing")},null,8,["loading","loadingMessage"]),Object(c["withDirectives"])(Object(c["createElementVNode"])("div",d,[h,Object(c["createTextVNode"])(" "+Object(c["toDisplayString"])(e.translate("JsTrackerInstallCheck_JsTrackingCodeInstallCheckSuccessMessage")),1)],512),[[c["vShow"],e.isTestSuccess]]),Object(c["withDirectives"])(Object(c["createElementVNode"])("div",f,[p,m,Object(c["createElementVNode"])("span",{innerHTML:e.$sanitize(e.getTestFailureMessage)},null,8,T)],512),[[c["vShow"],e.isTestComplete&&!e.isTestSuccess]])])],64)}var k=s("19dc"),g=s("a5a2"),C=10,j=1e3,v=Object(c["defineComponent"])({components:{Field:g["Field"],ActivityIndicator:k["ActivityIndicator"]},data:function(){return{checkNonce:"",isTesting:!1,isTestComplete:!1,isTestSuccess:!1,testTimeoutCount:0,baseUrl:""}},props:{site:{type:Object,required:!0},isWordpress:{type:Boolean,required:!1,default:!1}},created:function(){this.checkWhetherSuccessWasRecorded()},watch:{site:function(){this.onSiteChange()}},methods:{onSiteChange:function(){this.checkNonce="",this.isTesting=!1,this.isTestComplete=!1,this.isTestSuccess=!1,this.testTimeoutCount=0,this.checkWhetherSuccessWasRecorded()},initiateTrackerTest:function(){var e=this;this.isTesting=!0,this.isTestComplete=!1,this.isTestSuccess=!1,this.testTimeoutCount=0;var t=this.site,s={idSite:t.id,url:""};this.baseUrl&&(s.url=this.baseUrl),k["AjaxHelper"].post({module:"API",method:"JsTrackerInstallCheck.initiateJsTrackerInstallTest"},s).then((function(t){var s=t&&t.url&&t.nonce;if(s){e.checkNonce=t.nonce;var n=window.open(t.url);e.setCheckInTime(),setTimeout((function(){n&&!n.closed&&(n.close(),e.testTimeoutCount=C)}),C*j)}})).catch((function(){e.isTesting=!1}))},setCheckInTime:function(){setTimeout(this.checkWhetherSuccessWasRecorded,j)},checkWhetherSuccessWasRecorded:function(){var e=this,t=this.site,s={idSite:t.id,nonce:""};this.checkNonce&&(s.nonce=this.checkNonce),k["AjaxHelper"].post({module:"API",method:"JsTrackerInstallCheck.wasJsTrackerInstallTestSuccessful"},s).then((function(t){if(t&&t.mainUrl&&!e.baseUrl&&(e.baseUrl=t.mainUrl),e.isTestSuccess=t&&t.isSuccess,e.checkNonce&&!e.isTestSuccess&&e.testTimeoutCount";return this.isWordpress?Object(k["translate"])("JsTrackerInstallCheck_JsTrackingCodeInstallCheckFailureMessageWordpress",'WP-Matomo Integration (WP-Piwik)',e,t):Object(k["translate"])("JsTrackerInstallCheck_JsTrackingCodeInstallCheckFailureMessage",e,t)}}});v.render=b;var O=v; +(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["JsTrackerInstallCheck"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["JsTrackerInstallCheck"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,s){return function(e){var t={};function s(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,s),r.l=!0,r.exports}return s.m=e,s.c=t,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)s.d(n,r,function(t){return e[t]}.bind(null,r));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="plugins/JsTrackerInstallCheck/vue/dist/",s(s.s="fae3")}({"19dc":function(t,s){t.exports=e},"8bbf":function(e,s){e.exports=t},a5a2:function(e,t){e.exports=s},fae3:function(e,t,s){"use strict";if(s.r(t),s.d(t,"JsTrackerInstallCheck",(function(){return O})),"undefined"!==typeof window){var n=window.document.currentScript,r=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(s.p=r[1])}var c=s("8bbf"),i={class:"jsTrackerInstallCheck"},o={class:"row testInstallFields"},a={class:"col s2"},l={class:"col s10"},u=["disabled","value"],d={class:"system-success success-message"},h=Object(c["createElementVNode"])("span",{class:"icon-ok"},null,-1),p={class:"system-errors test-error"},f=Object(c["createElementVNode"])("span",{class:"icon-warning"},null,-1),m=Object(c["createTextVNode"])("  "),T=["innerHTML"];function b(e,t,s,n,r,b){var k=Object(c["resolveComponent"])("Field"),g=Object(c["resolveComponent"])("ActivityIndicator");return Object(c["openBlock"])(),Object(c["createElementBlock"])(c["Fragment"],null,[Object(c["createElementVNode"])("span",null,Object(c["toDisplayString"])(e.translate("JsTrackerInstallCheck_OptionalTestInstallationDescription")),1),Object(c["createElementVNode"])("div",i,[Object(c["createElementVNode"])("div",o,[Object(c["createElementVNode"])("div",a,[Object(c["createVNode"])(k,{uicontrol:"url",name:"baseUrl",placeholder:"https://example.com",modelValue:e.baseUrl,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.baseUrl=t}),"full-width":!0,disabled:e.isTesting},null,8,["modelValue","disabled"])]),Object(c["createElementVNode"])("div",l,[Object(c["createElementVNode"])("input",{type:"button",class:"btn testInstallBtn",onClick:t[1]||(t[1]=function(){return e.initiateTrackerTest&&e.initiateTrackerTest.apply(e,arguments)}),disabled:!e.baseUrl||e.isTesting,value:e.translate("JsTrackerInstallCheck_TestInstallationBtnText")},null,8,u)])]),Object(c["createVNode"])(g,{loading:e.isTesting,loadingMessage:e.translate("General_Testing")},null,8,["loading","loadingMessage"]),Object(c["withDirectives"])(Object(c["createElementVNode"])("div",d,[h,Object(c["createTextVNode"])(" "+Object(c["toDisplayString"])(e.translate("JsTrackerInstallCheck_JsTrackingCodeInstallCheckSuccessMessage")),1)],512),[[c["vShow"],e.isTestSuccess]]),Object(c["withDirectives"])(Object(c["createElementVNode"])("div",p,[f,m,Object(c["createElementVNode"])("span",{innerHTML:e.$sanitize(e.getTestFailureMessage)},null,8,T)],512),[[c["vShow"],e.isTestComplete&&!e.isTestSuccess]])])],64)}var k=s("19dc"),g=s("a5a2"),C=10,j=1e3,v=Object(c["defineComponent"])({components:{Field:g["Field"],ActivityIndicator:k["ActivityIndicator"]},data:function(){return{checkNonce:"",isTesting:!1,isTestComplete:!1,isTestSuccess:!1,testTimeoutCount:0,baseUrl:""}},props:{site:{type:Object,required:!0},isWordpress:{type:Boolean,required:!1,default:!1}},created:function(){this.checkWhetherSuccessWasRecorded()},watch:{site:function(){this.onSiteChange()}},methods:{onSiteChange:function(){this.checkNonce="",this.isTesting=!1,this.isTestComplete=!1,this.isTestSuccess=!1,this.testTimeoutCount=0,this.checkWhetherSuccessWasRecorded()},initiateTrackerTest:function(){var e=this;this.isTesting=!0,this.isTestComplete=!1,this.isTestSuccess=!1,this.testTimeoutCount=0;var t=this.site,s={idSite:t.id,url:""};this.baseUrl&&(s.url=this.baseUrl),k["AjaxHelper"].post({module:"API",method:"JsTrackerInstallCheck.initiateJsTrackerInstallTest"},s).then((function(t){var s=t&&t.url&&t.nonce;if(s){e.checkNonce=t.nonce;var n=window.open(t.url);e.setCheckInTime(),setTimeout((function(){n&&!n.closed&&(n.close(),e.testTimeoutCount=C)}),C*j)}})).catch((function(){e.isTesting=!1}))},setCheckInTime:function(){setTimeout(this.checkWhetherSuccessWasRecorded,j)},checkWhetherSuccessWasRecorded:function(){var e=this,t=this.site,s={idSite:t.id,nonce:""};this.checkNonce&&(s.nonce=this.checkNonce),k["AjaxHelper"].post({module:"API",method:"JsTrackerInstallCheck.wasJsTrackerInstallTestSuccessful"},s).then((function(t){if(t&&t.mainUrl&&!e.baseUrl&&(e.baseUrl=t.mainUrl),e.isTestSuccess=t&&t.isSuccess,e.checkNonce&&!e.isTestSuccess&&e.testTimeoutCount";return this.isWordpress?Object(k["translate"])("JsTrackerInstallCheck_JsTrackingCodeInstallCheckFailureMessageWordpress",'WP-Matomo Integration (WP-Piwik)',e,t):Object(k["translate"])("JsTrackerInstallCheck_JsTrackingCodeInstallCheckFailureMessage",e,t)}}});v.render=b;var O=v; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/JsTrackerInstallCheck/vue/src/JsTrackerInstallCheck/JsTrackerInstallCheck.vue b/plugins/JsTrackerInstallCheck/vue/src/JsTrackerInstallCheck/JsTrackerInstallCheck.vue index e1b2b8a8643..1071a1988c1 100644 --- a/plugins/JsTrackerInstallCheck/vue/src/JsTrackerInstallCheck/JsTrackerInstallCheck.vue +++ b/plugins/JsTrackerInstallCheck/vue/src/JsTrackerInstallCheck/JsTrackerInstallCheck.vue @@ -1,5 +1,5 @@