diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index 54eab06c748..9cc010fa514 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -9449,25 +9449,25 @@ function findContainer(widgetsByCategory, containerId) { Widgetvue_type_script_lang_ts.render = Widgetvue_type_template_id_33b06f02_render /* harmony default export */ var Widget_Widget = (Widgetvue_type_script_lang_ts); -// 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/CoreHome/vue/src/ReportingPage/ReportingPage.vue?vue&type=template&id=08ed243e +// 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/CoreHome/vue/src/ReportingPage/ReportingPage.vue?vue&type=template&id=e7476c22 -var ReportingPagevue_type_template_id_08ed243e_hoisted_1 = { +var ReportingPagevue_type_template_id_e7476c22_hoisted_1 = { class: "reporting-page" }; -var ReportingPagevue_type_template_id_08ed243e_hoisted_2 = { +var ReportingPagevue_type_template_id_e7476c22_hoisted_2 = { key: 1, class: "col s12 l6 leftWidgetColumn" }; -var ReportingPagevue_type_template_id_08ed243e_hoisted_3 = { +var ReportingPagevue_type_template_id_e7476c22_hoisted_3 = { key: 2, class: "col s12 l6 rightWidgetColumn" }; -function ReportingPagevue_type_template_id_08ed243e_render(_ctx, _cache, $props, $setup, $data, $options) { +function ReportingPagevue_type_template_id_e7476c22_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_ActivityIndicator = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ActivityIndicator"); var _component_Widget = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Widget"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ReportingPagevue_type_template_id_08ed243e_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ReportingPagevue_type_template_id_e7476c22_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, { loading: _ctx.loading }, null, 8, ["loading"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreHome_NoSuchPage')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasNoPage]]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), 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_["renderList"])(_ctx.widgets, function (widget) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { @@ -9477,12 +9477,12 @@ function ReportingPagevue_type_template_id_08ed243e_render(_ctx, _cache, $props, key: 0, class: "col s12 fullWidgetColumn", widget: widget - }, null, 8, ["widget"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), widget.group ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ReportingPagevue_type_template_id_08ed243e_hoisted_2, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), 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_["renderList"])(widget.left, function (widgetInGroup) { + }, null, 8, ["widget"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), widget.group ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ReportingPagevue_type_template_id_e7476c22_hoisted_2, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), 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_["renderList"])(widget.left, function (widgetInGroup) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_Widget, { widget: widgetInGroup, key: widgetInGroup.uniqueId }, null, 8, ["widget"]); - }), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), widget.group ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ReportingPagevue_type_template_id_08ed243e_hoisted_3, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), 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_["renderList"])(widget.right, function (widgetInGroup) { + }), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), widget.group ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ReportingPagevue_type_template_id_e7476c22_hoisted_3, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), 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_["renderList"])(widget.right, function (widgetInGroup) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_Widget, { widget: widgetInGroup, key: widgetInGroup.uniqueId @@ -9490,7 +9490,7 @@ function ReportingPagevue_type_template_id_08ed243e_render(_ctx, _cache, $props, }), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]); }), 128))]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue?vue&type=template&id=08ed243e +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue?vue&type=template&id=e7476c22 // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPage/ReportingPage.store.ts function ReportingPage_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -9833,6 +9833,10 @@ function hideOnlyRawDataNoticifation() { showOnlyRawDataMessageIfRequired: function showOnlyRawDataMessageIfRequired() { var _this3 = this; + if (!Matomo_Matomo.visitorLogEnabled) { + return; + } + if (this.hasRawData && this.hasNoVisits) { showOnlyRawDataNotification(); } @@ -9903,7 +9907,7 @@ function hideOnlyRawDataNoticifation() { -ReportingPagevue_type_script_lang_ts.render = ReportingPagevue_type_template_id_08ed243e_render +ReportingPagevue_type_script_lang_ts.render = ReportingPagevue_type_template_id_e7476c22_render /* harmony default export */ var ReportingPage = (ReportingPagevue_type_script_lang_ts); // 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/CoreHome/vue/src/ReportExport/ReportExportPopover.vue?vue&type=template&id=3d203950 diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js index e25a7853aba..5e728262b81 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -257,7 +257,7 @@ function mn(e){e.classList.add("expanded");var t=e.querySelector(".dropdown.posi * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function ms(e){return!!(e.isContainer&&e.layout&&"ByDimension"===e.layout||"bydimension"===e.viewDataTable)||(!!e.isWide||e.viewDataTable&&("tableAllColumns"===e.viewDataTable||"sparklines"===e.viewDataTable||"graphEvolution"===e.viewDataTable))}function ps(e){if(e&&e[0]){var t=is(e),n=e[0];return n.group?t[0]=Object.assign(Object.assign({},t[0]),{},{left:ps(n.left||[]),right:ps(n.right||[])}):t[0]=Object.assign(Object.assign({},t[0]),{},{isFirstInPage:!0}),t}return e}var fs=function(){function e(){var t=this;ns(this,e),as(this,"privateState",Object(K["reactive"])({})),as(this,"state",Object(K["computed"])((function(){return Object(K["readonly"])(t.privateState)}))),as(this,"page",Object(K["computed"])((function(){return t.state.value.page}))),as(this,"widgets",Object(K["computed"])((function(){var e=t.page.value;if(!e)return[];var n=[],r={},o=function(e){return e.isReport&&r["".concat(e.module,".").concat(e.action)]},a=function(e){if(!e.isReport)return[];var t=oc.findReport(e.module,e.action);return t&&t.relatedReports?t.relatedReports:[]};if((e.widgets||[]).forEach((function(e){o(e)||(a(e).forEach((function(e){r["".concat(e.module,".").concat(e.action)]=!0})),n.push(e))})),n=Il(n),1===n.length)return ps(n);for(var i=[],l=0;l'),""),type:"transient"})}function gs(){Wo.remove("onlyRawData")}var vs=Object(K["defineComponent"])({components:{ActivityIndicator:xt,Widget:Qc},data:function(){return{loading:!1,hasRawData:!1,hasNoVisits:!1,dateLastChecked:null,hasNoPage:!1}},created:function(){var e=this;hs.resetPage(),this.loading=!0,this.renderInitialPage(),Object(K["watch"])((function(){return Ce.parsed.value}),(function(t,n){t.category===n.category&&t.subcategory===n.subcategory&&t.period===n.period&&t.date===n.date&&t.segment===n.segment&&JSON.stringify(t.compareDates)===JSON.stringify(n.compareDates)&&JSON.stringify(t.comparePeriods)===JSON.stringify(n.comparePeriods)&&JSON.stringify(t.compareSegments)===JSON.stringify(n.compareSegments)&&JSON.stringify(t.columns||"")===JSON.stringify(n.columns||"")||(t.date===n.date&&t.period===n.period||(gs(),e.dateLastChecked=null,e.hasRawData=!1,e.hasNoVisits=!1),e.renderPage(t.category,t.subcategory))})),ce.on("loadPage",(function(t,n){e.renderPage(t,n)}))},computed:{widgets:function(){return hs.widgets.value}},methods:{renderPage:function(e,t){var n=this;if(!e||!t)return hs.resetPage(),void(this.loading=!1);var r=Ce.parsed.value,o=r.period,i=r.date;try{m.parse(o,i)}catch(c){return Wo.show({id:"invalidDate",animate:!1,context:"error",message:a("CoreHome_DateInvalid"),type:"transient"}),hs.resetPage(),void(this.loading=!1)}Wo.remove("invalidDate"),ce.postEvent("matomoPageChange",{}),Wo.clearTransientNotifications(),m.parse(o,i).containsToday()&&this.showOnlyRawDataMessageIfRequired();var l={category:e,subcategory:t};if(ce.postEvent("ReportingPage.loadPage",l),l.promise)return this.loading=!0,void Promise.resolve(l.promise).finally((function(){n.loading=!1}));hs.fetchPage(e,t).then((function(){var t=!hs.page.value;if(t){var r=Cl.findPageInCategory(e);if(r&&r.subcategory)return void Ce.updateHash(Object.assign(Object.assign({},Ce.hashParsed.value),{},{subcategory:r.subcategory.id}))}n.hasNoPage=t,n.loading=!1}))},renderInitialPage:function(){var e=Ce.parsed.value;this.renderPage(e.category,e.subcategory)},showOnlyRawDataMessageIfRequired:function(){var e=this;this.hasRawData&&this.hasNoVisits&&bs();var t=Ce.parsed.value,n=t.segment;if(n)gs();else{var r=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],o=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"],a=t.subcategory,i=t.category;if(-1===r.indexOf(a)&&-1===o.indexOf(i)&&-1===a.toLowerCase().indexOf("manage")){var l=6e4;this.dateLastChecked&&(new Date).valueOf()-this.dateLastChecked.valueOf()0?(e.hasNoVisits=!1,void gs()):(e.hasNoVisits=!0,e.hasRawData?void bs():Qe.fetch({method:"Live.getLastVisitsDetails",filter_limit:1,doNotFetchActions:1}).then((function(t){if(!t||0===t.length)return e.hasRawData=!1,void gs();e.hasRawData=!0,bs()})))}))}else gs()}}}});vs.render=ts;var ys=vs,Os={class:"report-export-popover row",id:"reportExport"},js={class:"col l6"},ws={name:"format"},ks={name:"option_flat"},Ss={name:"option_expanded"},Cs={name:"option_format_metrics"},Es={class:"col l6"},Ds={name:"filter_type"},Ps={class:"filter_limit"},Ts={name:"filter_limit_all"},Vs={key:0,name:"filter_limit"},Ns={key:1,name:"filter_limit"},Is={class:"col l12"},xs=["value"],Bs=Object(K["createTextVNode"])("\n "),As=[Bs],Ls=["innerHTML"],Ms={class:"col l12"},_s=["href","title"];function Fs(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("Field"),l=Object(K["resolveDirective"])("select-on-focus");return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Os,[Object(K["createElementVNode"])("div",js,[Object(K["createElementVNode"])("div",ws,[Object(K["createVNode"])(i,{uicontrol:"radio",name:"format",title:e.translate("CoreHome_ExportFormat"),modelValue:e.reportFormat,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.reportFormat=t}),"full-width":!0,options:e.availableReportFormats[e.reportType]},null,8,["title","modelValue","options"])]),Object(K["createElementVNode"])("div",null,[Object(K["createElementVNode"])("div",ks,[Object(K["withDirectives"])(Object(K["createVNode"])(i,{uicontrol:"checkbox",name:"option_flat",title:e.translate("CoreHome_FlattenReport"),modelValue:e.optionFlat,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.optionFlat=t})},null,8,["title","modelValue"]),[[K["vShow"],e.hasSubtables]])])]),Object(K["createElementVNode"])("div",null,[Object(K["createElementVNode"])("div",Ss,[Object(K["withDirectives"])(Object(K["createVNode"])(i,{uicontrol:"checkbox",name:"option_expanded",title:e.translate("CoreHome_ExpandSubtables"),modelValue:e.optionExpanded,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.optionExpanded=t})},null,8,["title","modelValue"]),[[K["vShow"],e.hasSubtables&&!e.optionFlat]])])]),Object(K["createElementVNode"])("div",null,[Object(K["createElementVNode"])("div",Cs,[Object(K["createVNode"])(i,{uicontrol:"checkbox",name:"option_format_metrics",title:e.translate("CoreHome_FormatMetrics"),modelValue:e.optionFormatMetrics,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.optionFormatMetrics=t})},null,8,["title","modelValue"])])])]),Object(K["createElementVNode"])("div",Es,[Object(K["createElementVNode"])("div",null,[Object(K["createElementVNode"])("div",Ds,[Object(K["createVNode"])(i,{uicontrol:"radio",name:"filter_type",title:e.translate("CoreHome_ReportType"),modelValue:e.reportType,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.reportType=t}),"full-width":!0,options:e.availableReportTypes},null,8,["title","modelValue","options"])])]),Object(K["createElementVNode"])("div",Ps,[Object(K["withDirectives"])(Object(K["createElementVNode"])("div",Ts,[Object(K["createVNode"])(i,{uicontrol:"radio",name:"filter_limit_all",title:e.translate("CoreHome_RowLimit"),modelValue:e.reportLimitAll,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.reportLimitAll=t}),"full-width":!0,options:e.limitAllOptions},null,8,["title","modelValue","options"])],512),[[K["vShow"],!e.maxFilterLimit||e.maxFilterLimit<=0]]),"no"===e.reportLimitAll&&e.maxFilterLimit<=0?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Vs,[Object(K["createVNode"])(i,{uicontrol:"number",name:"filter_limit",min:1,modelValue:e.reportLimit,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.reportLimit=t}),"full-width":!0},null,8,["modelValue"])])):Object(K["createCommentVNode"])("",!0),"no"===e.reportLimitAll&&e.maxFilterLimit>0?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Ns,[Object(K["createVNode"])(i,{uicontrol:"number",name:"filter_limit",min:1,max:e.maxFilterLimit,modelValue:e.reportLimit,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.reportLimit=t}),value:e.reportLimit,"full-width":!0,title:e.filterLimitTooltip},null,8,["max","modelValue","value","title"])])):Object(K["createCommentVNode"])("",!0)])]),Object(K["withDirectives"])(Object(K["createElementVNode"])("div",Is,[Object(K["withDirectives"])(Object(K["createElementVNode"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},As,8,xs),[[l,{}]]),Object(K["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","","","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,Ls)],512),[[K["vShow"],e.showUrl]]),Object(K["createElementVNode"])("div",Ms,[Object(K["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(K["toDisplayString"])(e.translate("General_Export")),9,_s),Object(K["createElementVNode"])("a",{href:"javascript:",onClick:t[8]||(t[8]=function(t){return e.showUrl=!e.showUrl}),class:"toggle-export-url"},[Object(K["withDirectives"])(Object(K["createElementVNode"])("span",null,Object(K["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[K["vShow"],!e.showUrl]]),Object(K["withDirectives"])(Object(K["createElementVNode"])("span",null,Object(K["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[K["vShow"],e.showUrl]])])])])}function Rs(e,t){return Ws(e)||qs(e,t)||Us(e,t)||Hs()}function Hs(){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 Us(e,t){if(e){if("string"===typeof e)return $s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$s(e,t):void 0}}function $s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e>this.maxFilterLimit&&(this.reportLimit=t)}},computed:{filterLimitTooltip:function(){var e=a("CoreHome_RowLimit"),t=this.maxFilterLimit?a("General_ComputedMetricMax",this.maxFilterLimit.toString()):"";return"".concat(e," (").concat(t,")")},exportLink:function(){return this.getExportLink(!0)},exportLinkWithoutToken:function(){return this.getExportLink(!1)}},methods:{getExportLink:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.reportFormat,n=this.apiMethod,r=this.reportType,o=this.dataTable;if(t){var a={},i="yes"===this.reportLimitAll?-1:this.reportLimit;this.requestParams&&"string"===typeof this.requestParams&&(a=JSON.parse(this.requestParams));var l=o.param,c=l.segment,s=l.label,u=l.idGoal,d=l.idDimension,m=l.idSite,p=o.param,f=p.date,h=p.period;"RSS"===t&&(f="last10"),"undefined"!==typeof o.param.dateUsedInGraph&&(f=o.param.dateUsedInGraph);var b=ce.config.datatable_export_range_as_day.toLowerCase();-1!==b.indexOf(t.toLowerCase())&&"range"===o.param.period&&(h="day"),"range"===o.param.period&&"graphEvolution"===o.param.viewDataTable&&(h="day");var g={module:"API",format:t,idSite:m,period:h,date:f};if("processed"===r){g.method="API.getProcessedReport";var v=n.split("."),y=Rs(v,2);g.apiModule=y[0],g.apiAction=y[1]}else g.method=n;if(o.param.compareDates&&o.param.compareDates.length&&(g.compareDates=o.param.compareDates,g.compare="1"),o.param.comparePeriods&&o.param.comparePeriods.length&&(g.comparePeriods=o.param.comparePeriods,g.compare="1"),o.param.compareSegments&&o.param.compareSegments.length&&(g.compareSegments=o.param.compareSegments,g.compare="1"),"undefined"!==typeof o.param.filter_pattern&&(g.filter_pattern=o.param.filter_pattern),"undefined"!==typeof o.param.filter_pattern_recursive&&(g.filter_pattern_recursive=o.param.filter_pattern_recursive),window.$.isPlainObject(a)&&Object.entries(a).forEach((function(e){var t=Rs(e,2),n=t[0],r=t[1],o=r;!0===o?o=1:!1===o&&(o=0),g[n]=o})),this.optionFlat&&(g.flat=1,"undefined"!==typeof o.param.include_aggregate_rows&&"1"===o.param.include_aggregate_rows&&(g.include_aggregate_rows=1)),!this.optionFlat&&this.optionExpanded&&(g.expanded=1),this.optionFormatMetrics&&(g.format_metrics=1),o.param.pivotBy&&(g.pivotBy=o.param.pivotBy,g.pivotByColumnLimit=20,o.props.pivot_by_column&&(g.pivotByColumn=o.props.pivot_by_column)),"CSV"!==t&&"TSV"!==t&&"RSS"!==t||(g.translateColumnNames=1,g.language=ce.language),"undefined"!==typeof c&&(g.segment=decodeURIComponent(c)),"undefined"!==typeof u&&"-1"!==u&&(g.idGoal=u),"undefined"!==typeof d&&"-1"!==d&&(g.idDimension=d),s){var O=s.split(",");if(O.length>1)g.label=O;else{var j=Rs(O,1);g.label=j[0]}}g.token_auth="ENTER_YOUR_TOKEN_AUTH_HERE",!0===e&&(g.token_auth=ce.token_auth,g.force_api_session=1),g.filter_limit=i;var w=window.location.href.split("?")[0];return"".concat(w,"?").concat(Ce.stringify(g))}}}});Gs.render=Fs;var Ys=Gs,Js=window,Ks=Js.$,Qs={mounted:function(e,t){e.addEventListener("click",(function(){var n=Ce.hashParsed.value.popover,r=Ks(e).closest("[data-report]").data("uiControlObject"),o=window.Piwik_Popover.showLoading("Export"),i=t.value.reportFormats,l=r.param.filter_limit;t.value.maxFilterLimit>0&&(l=Math.min(l,t.value.maxFilterLimit));var c=!0===r.param.flat||1===r.param.flat||"1"===r.param.flat,s={initialReportType:"default",initialReportLimit:l>0?l:100,initialReportLimitAll:-1===l?"yes":"no",initialOptionFlat:c,initialOptionExpanded:!0,initialOptionFormatMetrics:!1,hasSubtables:c||r.numberOfSubtables>0,availableReportFormats:{default:i,processed:{XML:i.XML,JSON:i.JSON}},availableReportTypes:{default:a("CoreHome_StandardReport"),processed:a("CoreHome_ReportWithMetadata")},limitAllOptions:{yes:a("General_All"),no:a("CoreHome_CustomLimit")},maxFilterLimit:t.value.maxFilterLimit,dataTable:r,requestParams:t.value.requestParams,apiMethod:t.value.apiMethod},u=ut({template:'\n ',data:function(){return{bind:s}}});u.component("popover",Ys);var d=document.createElement("div");u.mount(d);var m=t.value.reportTitle;window.Piwik_Popover.setTitle("".concat(a("General_Export")," ").concat(ce.helper.htmlEntities(m))),window.Piwik_Popover.setContent(d),window.Piwik_Popover.onClose((function(){u.unmount(),""!==n&&setTimeout((function(){Ce.updateHash(Object.assign(Object.assign({},Ce.hashParsed.value),{},{popover:n})),t.value.onClose&&t.value.onClose()}),100)})),setTimeout((function(){o.dialog(),Ks(".exportFullUrl, .btn",o).tooltip({track:!0,show:!1,hide:!1})}),100)}))}},Xs=["src","width","height"]; + */function ms(e){return!!(e.isContainer&&e.layout&&"ByDimension"===e.layout||"bydimension"===e.viewDataTable)||(!!e.isWide||e.viewDataTable&&("tableAllColumns"===e.viewDataTable||"sparklines"===e.viewDataTable||"graphEvolution"===e.viewDataTable))}function ps(e){if(e&&e[0]){var t=is(e),n=e[0];return n.group?t[0]=Object.assign(Object.assign({},t[0]),{},{left:ps(n.left||[]),right:ps(n.right||[])}):t[0]=Object.assign(Object.assign({},t[0]),{},{isFirstInPage:!0}),t}return e}var fs=function(){function e(){var t=this;ns(this,e),as(this,"privateState",Object(K["reactive"])({})),as(this,"state",Object(K["computed"])((function(){return Object(K["readonly"])(t.privateState)}))),as(this,"page",Object(K["computed"])((function(){return t.state.value.page}))),as(this,"widgets",Object(K["computed"])((function(){var e=t.page.value;if(!e)return[];var n=[],r={},o=function(e){return e.isReport&&r["".concat(e.module,".").concat(e.action)]},a=function(e){if(!e.isReport)return[];var t=oc.findReport(e.module,e.action);return t&&t.relatedReports?t.relatedReports:[]};if((e.widgets||[]).forEach((function(e){o(e)||(a(e).forEach((function(e){r["".concat(e.module,".").concat(e.action)]=!0})),n.push(e))})),n=Il(n),1===n.length)return ps(n);for(var i=[],l=0;l'),""),type:"transient"})}function gs(){Wo.remove("onlyRawData")}var vs=Object(K["defineComponent"])({components:{ActivityIndicator:xt,Widget:Qc},data:function(){return{loading:!1,hasRawData:!1,hasNoVisits:!1,dateLastChecked:null,hasNoPage:!1}},created:function(){var e=this;hs.resetPage(),this.loading=!0,this.renderInitialPage(),Object(K["watch"])((function(){return Ce.parsed.value}),(function(t,n){t.category===n.category&&t.subcategory===n.subcategory&&t.period===n.period&&t.date===n.date&&t.segment===n.segment&&JSON.stringify(t.compareDates)===JSON.stringify(n.compareDates)&&JSON.stringify(t.comparePeriods)===JSON.stringify(n.comparePeriods)&&JSON.stringify(t.compareSegments)===JSON.stringify(n.compareSegments)&&JSON.stringify(t.columns||"")===JSON.stringify(n.columns||"")||(t.date===n.date&&t.period===n.period||(gs(),e.dateLastChecked=null,e.hasRawData=!1,e.hasNoVisits=!1),e.renderPage(t.category,t.subcategory))})),ce.on("loadPage",(function(t,n){e.renderPage(t,n)}))},computed:{widgets:function(){return hs.widgets.value}},methods:{renderPage:function(e,t){var n=this;if(!e||!t)return hs.resetPage(),void(this.loading=!1);var r=Ce.parsed.value,o=r.period,i=r.date;try{m.parse(o,i)}catch(c){return Wo.show({id:"invalidDate",animate:!1,context:"error",message:a("CoreHome_DateInvalid"),type:"transient"}),hs.resetPage(),void(this.loading=!1)}Wo.remove("invalidDate"),ce.postEvent("matomoPageChange",{}),Wo.clearTransientNotifications(),m.parse(o,i).containsToday()&&this.showOnlyRawDataMessageIfRequired();var l={category:e,subcategory:t};if(ce.postEvent("ReportingPage.loadPage",l),l.promise)return this.loading=!0,void Promise.resolve(l.promise).finally((function(){n.loading=!1}));hs.fetchPage(e,t).then((function(){var t=!hs.page.value;if(t){var r=Cl.findPageInCategory(e);if(r&&r.subcategory)return void Ce.updateHash(Object.assign(Object.assign({},Ce.hashParsed.value),{},{subcategory:r.subcategory.id}))}n.hasNoPage=t,n.loading=!1}))},renderInitialPage:function(){var e=Ce.parsed.value;this.renderPage(e.category,e.subcategory)},showOnlyRawDataMessageIfRequired:function(){var e=this;if(ce.visitorLogEnabled){this.hasRawData&&this.hasNoVisits&&bs();var t=Ce.parsed.value,n=t.segment;if(n)gs();else{var r=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],o=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"],a=t.subcategory,i=t.category;if(-1===r.indexOf(a)&&-1===o.indexOf(i)&&-1===a.toLowerCase().indexOf("manage")){var l=6e4;this.dateLastChecked&&(new Date).valueOf()-this.dateLastChecked.valueOf()0?(e.hasNoVisits=!1,void gs()):(e.hasNoVisits=!0,e.hasRawData?void bs():Qe.fetch({method:"Live.getLastVisitsDetails",filter_limit:1,doNotFetchActions:1}).then((function(t){if(!t||0===t.length)return e.hasRawData=!1,void gs();e.hasRawData=!0,bs()})))}))}else gs()}}}}});vs.render=ts;var ys=vs,Os={class:"report-export-popover row",id:"reportExport"},js={class:"col l6"},ws={name:"format"},ks={name:"option_flat"},Ss={name:"option_expanded"},Cs={name:"option_format_metrics"},Es={class:"col l6"},Ds={name:"filter_type"},Ps={class:"filter_limit"},Ts={name:"filter_limit_all"},Vs={key:0,name:"filter_limit"},Ns={key:1,name:"filter_limit"},Is={class:"col l12"},xs=["value"],Bs=Object(K["createTextVNode"])("\n "),As=[Bs],Ls=["innerHTML"],Ms={class:"col l12"},_s=["href","title"];function Fs(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("Field"),l=Object(K["resolveDirective"])("select-on-focus");return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Os,[Object(K["createElementVNode"])("div",js,[Object(K["createElementVNode"])("div",ws,[Object(K["createVNode"])(i,{uicontrol:"radio",name:"format",title:e.translate("CoreHome_ExportFormat"),modelValue:e.reportFormat,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.reportFormat=t}),"full-width":!0,options:e.availableReportFormats[e.reportType]},null,8,["title","modelValue","options"])]),Object(K["createElementVNode"])("div",null,[Object(K["createElementVNode"])("div",ks,[Object(K["withDirectives"])(Object(K["createVNode"])(i,{uicontrol:"checkbox",name:"option_flat",title:e.translate("CoreHome_FlattenReport"),modelValue:e.optionFlat,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.optionFlat=t})},null,8,["title","modelValue"]),[[K["vShow"],e.hasSubtables]])])]),Object(K["createElementVNode"])("div",null,[Object(K["createElementVNode"])("div",Ss,[Object(K["withDirectives"])(Object(K["createVNode"])(i,{uicontrol:"checkbox",name:"option_expanded",title:e.translate("CoreHome_ExpandSubtables"),modelValue:e.optionExpanded,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.optionExpanded=t})},null,8,["title","modelValue"]),[[K["vShow"],e.hasSubtables&&!e.optionFlat]])])]),Object(K["createElementVNode"])("div",null,[Object(K["createElementVNode"])("div",Cs,[Object(K["createVNode"])(i,{uicontrol:"checkbox",name:"option_format_metrics",title:e.translate("CoreHome_FormatMetrics"),modelValue:e.optionFormatMetrics,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.optionFormatMetrics=t})},null,8,["title","modelValue"])])])]),Object(K["createElementVNode"])("div",Es,[Object(K["createElementVNode"])("div",null,[Object(K["createElementVNode"])("div",Ds,[Object(K["createVNode"])(i,{uicontrol:"radio",name:"filter_type",title:e.translate("CoreHome_ReportType"),modelValue:e.reportType,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.reportType=t}),"full-width":!0,options:e.availableReportTypes},null,8,["title","modelValue","options"])])]),Object(K["createElementVNode"])("div",Ps,[Object(K["withDirectives"])(Object(K["createElementVNode"])("div",Ts,[Object(K["createVNode"])(i,{uicontrol:"radio",name:"filter_limit_all",title:e.translate("CoreHome_RowLimit"),modelValue:e.reportLimitAll,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.reportLimitAll=t}),"full-width":!0,options:e.limitAllOptions},null,8,["title","modelValue","options"])],512),[[K["vShow"],!e.maxFilterLimit||e.maxFilterLimit<=0]]),"no"===e.reportLimitAll&&e.maxFilterLimit<=0?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Vs,[Object(K["createVNode"])(i,{uicontrol:"number",name:"filter_limit",min:1,modelValue:e.reportLimit,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.reportLimit=t}),"full-width":!0},null,8,["modelValue"])])):Object(K["createCommentVNode"])("",!0),"no"===e.reportLimitAll&&e.maxFilterLimit>0?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Ns,[Object(K["createVNode"])(i,{uicontrol:"number",name:"filter_limit",min:1,max:e.maxFilterLimit,modelValue:e.reportLimit,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.reportLimit=t}),value:e.reportLimit,"full-width":!0,title:e.filterLimitTooltip},null,8,["max","modelValue","value","title"])])):Object(K["createCommentVNode"])("",!0)])]),Object(K["withDirectives"])(Object(K["createElementVNode"])("div",Is,[Object(K["withDirectives"])(Object(K["createElementVNode"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},As,8,xs),[[l,{}]]),Object(K["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","","","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,Ls)],512),[[K["vShow"],e.showUrl]]),Object(K["createElementVNode"])("div",Ms,[Object(K["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(K["toDisplayString"])(e.translate("General_Export")),9,_s),Object(K["createElementVNode"])("a",{href:"javascript:",onClick:t[8]||(t[8]=function(t){return e.showUrl=!e.showUrl}),class:"toggle-export-url"},[Object(K["withDirectives"])(Object(K["createElementVNode"])("span",null,Object(K["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[K["vShow"],!e.showUrl]]),Object(K["withDirectives"])(Object(K["createElementVNode"])("span",null,Object(K["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[K["vShow"],e.showUrl]])])])])}function Rs(e,t){return Ws(e)||qs(e,t)||Us(e,t)||Hs()}function Hs(){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 Us(e,t){if(e){if("string"===typeof e)return $s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$s(e,t):void 0}}function $s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e>this.maxFilterLimit&&(this.reportLimit=t)}},computed:{filterLimitTooltip:function(){var e=a("CoreHome_RowLimit"),t=this.maxFilterLimit?a("General_ComputedMetricMax",this.maxFilterLimit.toString()):"";return"".concat(e," (").concat(t,")")},exportLink:function(){return this.getExportLink(!0)},exportLinkWithoutToken:function(){return this.getExportLink(!1)}},methods:{getExportLink:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.reportFormat,n=this.apiMethod,r=this.reportType,o=this.dataTable;if(t){var a={},i="yes"===this.reportLimitAll?-1:this.reportLimit;this.requestParams&&"string"===typeof this.requestParams&&(a=JSON.parse(this.requestParams));var l=o.param,c=l.segment,s=l.label,u=l.idGoal,d=l.idDimension,m=l.idSite,p=o.param,f=p.date,h=p.period;"RSS"===t&&(f="last10"),"undefined"!==typeof o.param.dateUsedInGraph&&(f=o.param.dateUsedInGraph);var b=ce.config.datatable_export_range_as_day.toLowerCase();-1!==b.indexOf(t.toLowerCase())&&"range"===o.param.period&&(h="day"),"range"===o.param.period&&"graphEvolution"===o.param.viewDataTable&&(h="day");var g={module:"API",format:t,idSite:m,period:h,date:f};if("processed"===r){g.method="API.getProcessedReport";var v=n.split("."),y=Rs(v,2);g.apiModule=y[0],g.apiAction=y[1]}else g.method=n;if(o.param.compareDates&&o.param.compareDates.length&&(g.compareDates=o.param.compareDates,g.compare="1"),o.param.comparePeriods&&o.param.comparePeriods.length&&(g.comparePeriods=o.param.comparePeriods,g.compare="1"),o.param.compareSegments&&o.param.compareSegments.length&&(g.compareSegments=o.param.compareSegments,g.compare="1"),"undefined"!==typeof o.param.filter_pattern&&(g.filter_pattern=o.param.filter_pattern),"undefined"!==typeof o.param.filter_pattern_recursive&&(g.filter_pattern_recursive=o.param.filter_pattern_recursive),window.$.isPlainObject(a)&&Object.entries(a).forEach((function(e){var t=Rs(e,2),n=t[0],r=t[1],o=r;!0===o?o=1:!1===o&&(o=0),g[n]=o})),this.optionFlat&&(g.flat=1,"undefined"!==typeof o.param.include_aggregate_rows&&"1"===o.param.include_aggregate_rows&&(g.include_aggregate_rows=1)),!this.optionFlat&&this.optionExpanded&&(g.expanded=1),this.optionFormatMetrics&&(g.format_metrics=1),o.param.pivotBy&&(g.pivotBy=o.param.pivotBy,g.pivotByColumnLimit=20,o.props.pivot_by_column&&(g.pivotByColumn=o.props.pivot_by_column)),"CSV"!==t&&"TSV"!==t&&"RSS"!==t||(g.translateColumnNames=1,g.language=ce.language),"undefined"!==typeof c&&(g.segment=decodeURIComponent(c)),"undefined"!==typeof u&&"-1"!==u&&(g.idGoal=u),"undefined"!==typeof d&&"-1"!==d&&(g.idDimension=d),s){var O=s.split(",");if(O.length>1)g.label=O;else{var j=Rs(O,1);g.label=j[0]}}g.token_auth="ENTER_YOUR_TOKEN_AUTH_HERE",!0===e&&(g.token_auth=ce.token_auth,g.force_api_session=1),g.filter_limit=i;var w=window.location.href.split("?")[0];return"".concat(w,"?").concat(Ce.stringify(g))}}}});Gs.render=Fs;var Ys=Gs,Js=window,Ks=Js.$,Qs={mounted:function(e,t){e.addEventListener("click",(function(){var n=Ce.hashParsed.value.popover,r=Ks(e).closest("[data-report]").data("uiControlObject"),o=window.Piwik_Popover.showLoading("Export"),i=t.value.reportFormats,l=r.param.filter_limit;t.value.maxFilterLimit>0&&(l=Math.min(l,t.value.maxFilterLimit));var c=!0===r.param.flat||1===r.param.flat||"1"===r.param.flat,s={initialReportType:"default",initialReportLimit:l>0?l:100,initialReportLimitAll:-1===l?"yes":"no",initialOptionFlat:c,initialOptionExpanded:!0,initialOptionFormatMetrics:!1,hasSubtables:c||r.numberOfSubtables>0,availableReportFormats:{default:i,processed:{XML:i.XML,JSON:i.JSON}},availableReportTypes:{default:a("CoreHome_StandardReport"),processed:a("CoreHome_ReportWithMetadata")},limitAllOptions:{yes:a("General_All"),no:a("CoreHome_CustomLimit")},maxFilterLimit:t.value.maxFilterLimit,dataTable:r,requestParams:t.value.requestParams,apiMethod:t.value.apiMethod},u=ut({template:'\n ',data:function(){return{bind:s}}});u.component("popover",Ys);var d=document.createElement("div");u.mount(d);var m=t.value.reportTitle;window.Piwik_Popover.setTitle("".concat(a("General_Export")," ").concat(ce.helper.htmlEntities(m))),window.Piwik_Popover.setContent(d),window.Piwik_Popover.onClose((function(){u.unmount(),""!==n&&setTimeout((function(){Ce.updateHash(Object.assign(Object.assign({},Ce.hashParsed.value),{},{popover:n})),t.value.onClose&&t.value.onClose()}),100)})),setTimeout((function(){o.dialog(),Ks(".exportFullUrl, .btn",o).tooltip({track:!0,show:!1,hide:!1})}),100)}))}},Xs=["src","width","height"]; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue b/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue index d3786a14b72..c5421e8b503 100644 --- a/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue +++ b/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue @@ -211,6 +211,10 @@ export default defineComponent({ this.renderPage(parsed.category as string, parsed.subcategory as string); }, showOnlyRawDataMessageIfRequired() { + if (!Matomo.visitorLogEnabled) { + return; + } + if (this.hasRawData && this.hasNoVisits) { showOnlyRawDataNotification(); } diff --git a/plugins/CoreVue/types/index.d.ts b/plugins/CoreVue/types/index.d.ts index d163947ce15..7a00610c25e 100644 --- a/plugins/CoreVue/types/index.d.ts +++ b/plugins/CoreVue/types/index.d.ts @@ -171,6 +171,7 @@ declare global { userHasSomeAdminAccess: boolean; requiresPasswordConfirmation: boolean; + visitorLogEnabled: boolean; updatePeriodParamsFromUrl(): void; updateDateInTitle(date: string, period: string): void; hasUserCapability(capability: string): boolean;