diff options
Diffstat (limited to 'plugins')
3 files changed, 19 insertions, 17 deletions
diff --git a/plugins/UsersManager/vue/dist/UsersManager.umd.js b/plugins/UsersManager/vue/dist/UsersManager.umd.js index 6d071e3938..4ca1f4e092 100644 --- a/plugins/UsersManager/vue/dist/UsersManager.umd.js +++ b/plugins/UsersManager/vue/dist/UsersManager.umd.js @@ -587,38 +587,38 @@ CapabilitiesEditvue_type_script_lang_ts.render = render } } })); -// 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/UsersManager/vue/src/UserPermissionsEdit/UserPermissionsEdit.vue?vue&type=template&id=061f5e4b +// 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/UsersManager/vue/src/UserPermissionsEdit/UserPermissionsEdit.vue?vue&type=template&id=01052d27 -var UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_1 = { +var UserPermissionsEditvue_type_template_id_01052d27_hoisted_1 = { key: 0, class: "row" }; -var UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_2 = { +var UserPermissionsEditvue_type_template_id_01052d27_hoisted_2 = { class: "row to-all-websites" }; -var UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_3 = { +var UserPermissionsEditvue_type_template_id_01052d27_hoisted_3 = { class: "col s12" }; -var UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_4 = { +var UserPermissionsEditvue_type_template_id_01052d27_hoisted_4 = { style: { "margin-right": "3.5px" } }; -var UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_5 = { +var UserPermissionsEditvue_type_template_id_01052d27_hoisted_5 = { id: "all-sites-access-select", style: { "margin-right": "3.5px" } }; -var UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_6 = { +var UserPermissionsEditvue_type_template_id_01052d27_hoisted_6 = { style: { "margin-top": "18px" } }; -var UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_7 = { +var UserPermissionsEditvue_type_template_id_01052d27_hoisted_7 = { class: "filters row" }; -var UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_8 = { +var UserPermissionsEditvue_type_template_id_01052d27_hoisted_8 = { class: "col s12 m12 l8" }; var _hoisted_9 = { @@ -769,7 +769,7 @@ var _hoisted_62 = ["innerHTML"]; var _hoisted_63 = { class: "modal-footer" }; -function UserPermissionsEditvue_type_template_id_061f5e4b_render(_ctx, _cache, $props, $setup, $data, $options) { +function UserPermissionsEditvue_type_template_id_01052d27_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_Notification = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Notification"); var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); @@ -784,7 +784,7 @@ function UserPermissionsEditvue_type_template_id_061f5e4b_render(_ctx, _cache, $ class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["userPermissionsEdit", { loading: _ctx.isLoadingAccess }]) - }, [!_ctx.hasAccessToAtLeastOneSite ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Notification, { + }, [!_ctx.hasAccessToAtLeastOneSite ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserPermissionsEditvue_type_template_id_01052d27_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Notification, { context: "warning", type: "transient", noclear: true @@ -793,7 +793,7 @@ function UserPermissionsEditvue_type_template_id_061f5e4b_render(_ctx, _cache, $ return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Warning')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_NoAccessWarning')), 1)]; }), _: 1 - })])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_GiveAccessToAll')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + })])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserPermissionsEditvue_type_template_id_01052d27_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserPermissionsEditvue_type_template_id_01052d27_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", UserPermissionsEditvue_type_template_id_01052d27_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_GiveAccessToAll')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserPermissionsEditvue_type_template_id_01052d27_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { modelValue: _ctx.allWebsitesAccssLevelSet, "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { return _ctx.allWebsitesAccssLevelSet = $event; @@ -809,7 +809,7 @@ function UserPermissionsEditvue_type_template_id_061f5e4b_render(_ctx, _cache, $ onClick: _cache[1] || (_cache[1] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { return _ctx.showChangeAccessAllSitesModal(); }, ["prevent"])) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Apply')), 3)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_OrManageIndividually')) + ":", 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserPermissionsEditvue_type_template_id_061f5e4b_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Apply')), 3)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", UserPermissionsEditvue_type_template_id_01052d27_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_OrManageIndividually')) + ":", 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserPermissionsEditvue_type_template_id_01052d27_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserPermissionsEditvue_type_template_id_01052d27_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["dropdown-trigger btn", { disabled: _ctx.isBulkActionsDisabled }]), @@ -1043,7 +1043,7 @@ function UserPermissionsEditvue_type_template_id_061f5e4b_render(_ctx, _cache, $ }) }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_No')), 1)])], 512)], 2); } -// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/UserPermissionsEdit/UserPermissionsEdit.vue?vue&type=template&id=061f5e4b +// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/UserPermissionsEdit/UserPermissionsEdit.vue?vue&type=template&id=01052d27 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./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/UsersManager/vue/src/UserPermissionsEdit/UserPermissionsEdit.vue?vue&type=script&lang=ts @@ -1276,7 +1276,8 @@ var UserPermissionsEditvue_type_script_lang_ts_window = window, this.isGivingAccessToAllSites = true; external_CoreHome_["AjaxHelper"].fetch({ - method: 'SitesManager.getSitesWithAdminAccess' + method: 'SitesManager.getSitesWithAdminAccess', + filter_limit: -1 }).then(function (allSites) { var idSites = allSites.map(function (s) { return s.idsite; @@ -1408,7 +1409,7 @@ var UserPermissionsEditvue_type_script_lang_ts_window = window, -UserPermissionsEditvue_type_script_lang_ts.render = UserPermissionsEditvue_type_template_id_061f5e4b_render +UserPermissionsEditvue_type_script_lang_ts.render = UserPermissionsEditvue_type_template_id_01052d27_render /* harmony default export */ var UserPermissionsEdit = (UserPermissionsEditvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/UsersManager/vue/src/UserPermissionsEdit/UserPermissionsEdit.adapter.ts diff --git a/plugins/UsersManager/vue/dist/UsersManager.umd.min.js b/plugins/UsersManager/vue/dist/UsersManager.umd.min.js index b7e329b3d1..d9c41d1571 100644 --- a/plugins/UsersManager/vue/dist/UsersManager.umd.min.js +++ b/plugins/UsersManager/vue/dist/UsersManager.umd.min.js @@ -10,7 +10,7 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Re(e,t,n,s,r,i){var o=Object(a["resolveComponent"])("Notification"),l=Object(a["resolveComponent"])("Field"),c=Object(a["resolveComponent"])("CapabilitiesEdit"),d=Object(a["resolveDirective"])("dropdown-menu"),u=Object(a["resolveDirective"])("content-table");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:Object(a["normalizeClass"])(["userPermissionsEdit",{loading:e.isLoadingAccess}])},[e.hasAccessToAtLeastOneSite?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",V,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{context:"warning",type:"transient",noclear:!0},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("strong",null,Object(a["toDisplayString"])(e.translate("General_Warning"))+":",1),Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("UsersManager_NoAccessWarning")),1)]})),_:1})])])),Object(a["createElementVNode"])("div",k,[Object(a["createElementVNode"])("div",A,[Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("span",w,Object(a["toDisplayString"])(e.translate("UsersManager_GiveAccessToAll"))+":",1),Object(a["createElementVNode"])("div",T,[Object(a["createVNode"])(l,{modelValue:e.allWebsitesAccssLevelSet,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.allWebsitesAccssLevelSet=t}),uicontrol:"select",options:e.filteredAccessLevels,"full-width":!0},null,8,["modelValue","options"])]),Object(a["createElementVNode"])("a",{href:"",class:Object(a["normalizeClass"])(["btn",{disabled:e.isGivingAccessToAllSites}]),onClick:t[1]||(t[1]=Object(a["withModifiers"])((function(t){return e.showChangeAccessAllSitesModal()}),["prevent"]))},Object(a["toDisplayString"])(e.translate("General_Apply")),3)]),Object(a["createElementVNode"])("p",B,Object(a["toDisplayString"])(e.translate("UsersManager_OrManageIndividually"))+":",1)])]),Object(a["createElementVNode"])("div",D,[Object(a["createElementVNode"])("div",_,[Object(a["createElementVNode"])("div",L,[Object(a["withDirectives"])(Object(a["createElementVNode"])("a",{class:Object(a["normalizeClass"])(["dropdown-trigger btn",{disabled:e.isBulkActionsDisabled}]),href:"","data-target":"user-permissions-edit-bulk-actions"},[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("UsersManager_BulkActions")),1)],2),[[d,{activates:"#user-permissions-edit-bulk-actions"}]]),Object(a["createElementVNode"])("ul",R,[Object(a["createElementVNode"])("li",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("a",x,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("UsersManager_SetPermission")),1)],512),[[d,{activates:"#user-permissions-bulk-set-access"}]]),Object(a["createElementVNode"])("ul",P,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.filteredAccessLevels,(function(t){return Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{key:t.key},[Object(a["createElementVNode"])("a",{href:"",onClick:Object(a["withModifiers"])((function(n){e.siteAccessToChange=null,e.roleToChangeTo=t.key,e.showChangeAccessConfirm()}),["prevent"])},Object(a["toDisplayString"])(t.value),9,F)])})),128))])]),Object(a["createElementVNode"])("li",null,[Object(a["createElementVNode"])("a",{href:"",onClick:t[2]||(t[2]=Object(a["withModifiers"])((function(t){e.siteAccessToChange=null,e.roleToChangeTo="noaccess",e.showRemoveAccessConfirm()}),["prevent"]))},Object(a["toDisplayString"])(e.translate("UsersManager_RemovePermissions")),1)])])]),Object(a["createElementVNode"])("div",H,[Object(a["createElementVNode"])("input",{type:"text",value:e.siteNameFilter,onKeydown:t[3]||(t[3]=function(t){e.onChangeSiteFilter(t)}),onChange:t[4]||(t[4]=function(t){e.onChangeSiteFilter(t)}),placeholder:e.translate("UsersManager_FilterByWebsite")},null,40,I)]),Object(a["createElementVNode"])("div",J,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(l,{modelValue:e.accessLevelFilter,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.accessLevelFilter=t}),uicontrol:"select",options:e.filteredSelectAccessLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByAccess")},null,8,["modelValue","options","placeholder"])])])]),e.totalEntries>e.limit?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",q,[Object(a["createElementVNode"])("div",$,[Object(a["createElementVNode"])("a",{class:Object(a["normalizeClass"])(["prev",{disabled:e.offset<=0}])},[Object(a["createElementVNode"])("span",{class:"pointer",onClick:t[6]||(t[6]=function(t){return e.gotoPreviousPage()})},"« "+Object(a["toDisplayString"])(e.translate("General_Previous")),1)],2),Object(a["createElementVNode"])("span",G,[Object(a["createElementVNode"])("span",{textContent:Object(a["toDisplayString"])(e.paginationText)},null,8,z)]),Object(a["createElementVNode"])("a",{class:Object(a["normalizeClass"])(["next",{disabled:e.offset+e.limit>=e.totalEntries}])},[Object(a["createElementVNode"])("span",{class:"pointer",onClick:t[7]||(t[7]=function(t){return e.gotoNextPage()})},Object(a["toDisplayString"])(e.translate("General_Next"))+" »",1)],2)])])):Object(a["createCommentVNode"])("",!0)]),Object(a["createElementVNode"])("div",W,[e.isRoleHelpToggled?(Object(a["openBlock"])(),Object(a["createBlock"])(o,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.rolesHelpText)},null,8,Y)]})),_:1})):Object(a["createCommentVNode"])("",!0)]),Object(a["createElementVNode"])("div",X,[e.isCapabilitiesHelpToggled?(Object(a["openBlock"])(),Object(a["createBlock"])(o,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("UsersManager_CapabilitiesHelp")),1)]})),_:1})):Object(a["createCommentVNode"])("",!0)]),Object(a["withDirectives"])(Object(a["createElementVNode"])("table",K,[Object(a["createElementVNode"])("thead",null,[Object(a["createElementVNode"])("tr",null,[Object(a["createElementVNode"])("th",Q,[Object(a["createElementVNode"])("span",Z,[Object(a["createElementVNode"])("label",null,[Object(a["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_all",checked:e.isAllCheckboxSelected,onChange:t[8]||(t[8]=function(t){return e.onAllCheckboxChange(t)})},null,40,ee),te])])]),Object(a["createElementVNode"])("th",null,Object(a["toDisplayString"])(e.translate("General_Name")),1),Object(a["createElementVNode"])("th",ne,[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize("".concat(e.translate("UsersManager_Role")," "))},null,8,se),Object(a["createElementVNode"])("a",{href:"",class:Object(a["normalizeClass"])(["helpIcon",{sticky:e.isRoleHelpToggled}]),onClick:t[9]||(t[9]=Object(a["withModifiers"])((function(t){return e.isRoleHelpToggled=!e.isRoleHelpToggled}),["prevent"]))},ie,2)]),Object(a["createElementVNode"])("th",ae,[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize("".concat(e.translate("UsersManager_Capabilities")," "))},null,8,oe),Object(a["createElementVNode"])("a",{href:"",class:Object(a["normalizeClass"])(["helpIcon",{sticky:e.isCapabilitiesHelpToggled}]),onClick:t[10]||(t[10]=Object(a["withModifiers"])((function(t){return e.isCapabilitiesHelpToggled=!e.isCapabilitiesHelpToggled}),["prevent"]))},ce,2)])])]),Object(a["createElementVNode"])("tbody",null,[e.isAllCheckboxSelected&&e.siteAccess.length<e.totalEntries?(Object(a["openBlock"])(),Object(a["createElementBlock"])("tr",de,[Object(a["createElementVNode"])("td",ue,[e.areAllResultsSelected?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",me,[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.theDisplayedWebsitesAreSelectedText),style:{"margin-right":"3.5px"}},null,8,be),Object(a["createElementVNode"])("a",{href:"#",onClick:t[11]||(t[11]=Object(a["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.clickToSelectAllText)},null,8,pe)])),e.areAllResultsSelected?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",he,[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.allWebsitesAreSelectedText),style:{"margin-right":"3.5px"}},null,8,ge),Object(a["createElementVNode"])("a",{href:"#",onClick:t[12]||(t[12]=Object(a["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.clickToSelectDisplayedWebsitesText)},null,8,fe)])):Object(a["createCommentVNode"])("",!0)])])):Object(a["createCommentVNode"])("",!0),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.siteAccess,(function(n,s){return Object(a["openBlock"])(),Object(a["createElementBlock"])("tr",{key:n.idsite},[Object(a["createElementVNode"])("td",Oe,[Object(a["createElementVNode"])("span",je,[Object(a["createElementVNode"])("label",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_row".concat(s),"onUpdate:modelValue":function(t){return e.selectedRows[s]=t},onClick:t[13]||(t[13]=function(t){return e.onRowSelected()})},null,8,ve),[[a["vModelCheckbox"],e.selectedRows[s]]]),Ce])])]),Object(a["createElementVNode"])("td",null,[Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(n.site_name),1)]),Object(a["createElementVNode"])("td",null,[Object(a["createElementVNode"])("div",Se,[Object(a["createVNode"])(l,{"model-value":n.role,"onUpdate:modelValue":function(t){e.onRoleChange(n,t)},uicontrol:"select",options:e.filteredAccessLevels,"full-width":!0},null,8,["model-value","onUpdate:modelValue","options"])])]),Object(a["createElementVNode"])("td",null,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(c,{idsite:n.idsite,"site-name":n.site_name,"user-login":e.userLogin,"user-role":n.role,capabilities:n.capabilities,onChange:t[14]||(t[14]=function(t){return e.fetchAccess()})},null,8,["idsite","site-name","user-login","user-role","capabilities"])])])])})),128))])],512),[[u]]),Object(a["createElementVNode"])("div",Ne,[Object(a["createElementVNode"])("div",Ue,[e.siteAccessToChange?(Object(a["openBlock"])(),Object(a["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.deletePermConfirmSingleText)},null,8,ye)):Object(a["createCommentVNode"])("",!0),e.siteAccessToChange?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("p",{key:1,innerHTML:e.$sanitize(e.deletePermConfirmMultipleText)},null,8,Ee))]),Object(a["createElementVNode"])("div",Ve,[Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[15]||(t[15]=Object(a["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(a["toDisplayString"])(e.translate("General_Yes")),1),Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[16]||(t[16]=Object(a["withModifiers"])((function(t){e.siteAccessToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(a["toDisplayString"])(e.translate("General_No")),1)])],512),Object(a["createElementVNode"])("div",ke,[Object(a["createElementVNode"])("div",Ae,[e.siteAccessToChange?(Object(a["openBlock"])(),Object(a["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.changePermToSiteConfirmSingleText)},null,8,we)):Object(a["createCommentVNode"])("",!0),e.siteAccessToChange?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("p",{key:1,innerHTML:e.$sanitize(e.changePermToSiteConfirmMultipleText)},null,8,Te))]),Object(a["createElementVNode"])("div",Me,[Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[17]||(t[17]=Object(a["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(a["toDisplayString"])(e.translate("General_Yes")),1),Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[18]||(t[18]=Object(a["withModifiers"])((function(t){e.siteAccessToChange.role=e.previousRole,e.siteAccessToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(a["toDisplayString"])(e.translate("General_No")),1)])],512),Object(a["createElementVNode"])("div",Be,[Object(a["createElementVNode"])("div",De,[Object(a["createElementVNode"])("h3",{innerHTML:e.$sanitize(e.changePermToAllSitesConfirmText)},null,8,_e),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("UsersManager_ChangePermToAllSitesConfirm2")),1)]),Object(a["createElementVNode"])("div",Le,[Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[19]||(t[19]=Object(a["withModifiers"])((function(t){return e.giveAccessToAllSites()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(a["toDisplayString"])(e.translate("General_Yes")),1),Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[20]||(t[20]=function(e){return e.preventDefault()})},Object(a["toDisplayString"])(e.translate("General_No")),1)])],512)],2)}var xe=window,Pe=xe.$,Fe=Object(a["defineComponent"])({props:{userLogin:{type:String,required:!0},limit:{type:Number,default:10},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0}},components:{Notification:i["Notification"],Field:g["Field"],CapabilitiesEdit:E},directives:{DropdownMenu:i["DropdownMenu"],ContentTable:i["ContentTable"]},data:function(){return{siteAccess:[],offset:0,totalEntries:null,accessLevelFilter:"",siteNameFilter:"",isLoadingAccess:!1,allWebsitesAccssLevelSet:"view",isAllCheckboxSelected:!1,selectedRows:{},isBulkActionsDisabled:!0,areAllResultsSelected:!1,previousRole:null,hasAccessToAtLeastOneSite:!0,isRoleHelpToggled:!1,isCapabilitiesHelpToggled:!1,isGivingAccessToAllSites:!1,roleToChangeTo:null,siteAccessToChange:null}},emits:["userHasAccessDetected","accessChanged"],created:function(){var e=this;this.onChangeSiteFilter=Object(i["debounce"])(this.onChangeSiteFilter,300),Object(a["watch"])((function(){return e.allPropsWatch}),(function(){e.limit&&e.fetchAccess()})),this.fetchAccess()},watch:{accessLevelFilter:function(){this.offset=0,this.fetchAccess()}},methods:{onAllCheckboxChange:function(e){var t=this;this.isAllCheckboxSelected=e.target.checked,this.isAllCheckboxSelected?(this.siteAccess.forEach((function(e,n){t.selectedRows[n]=!0})),this.isBulkActionsDisabled=!1):this.clearSelection()},clearSelection:function(){this.selectedRows={},this.areAllResultsSelected=!1,this.isBulkActionsDisabled=!0,this.isAllCheckboxSelected=!1,this.siteAccessToChange=null},onRowSelected:function(){var e=this;setTimeout((function(){var t=e.selectedRowsCount;e.isBulkActionsDisabled=0===t,e.isAllCheckboxSelected=t===e.siteAccess.length}))},fetchAccess:function(){var e=this;return this.isLoadingAccess=!0,i["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",limit:this.limit,offset:this.offset,filter_search:this.siteNameFilter,filter_access:this.accessLevelFilter,userLogin:this.userLogin},{returnResponseObject:!0}).then((function(t){var n=t.getRequestHandle();e.isLoadingAccess=!1,e.siteAccess=n.responseJSON,e.totalEntries=parseInt(n.getResponseHeader("x-matomo-total-results"),10)||0,e.hasAccessToAtLeastOneSite=!!n.getResponseHeader("x-matomo-has-some"),e.$emit("userHasAccessDetected",{hasAccess:e.hasAccessToAtLeastOneSite}),e.clearSelection()})).catch((function(){e.isLoadingAccess=!1,e.clearSelection()}))},gotoPreviousPage:function(){this.offset=Math.max(0,this.offset-this.limit),this.fetchAccess()},gotoNextPage:function(){var e=this.offset+this.limit;e>=(this.totalEntries||0)||(this.offset=e,this.fetchAccess())},showRemoveAccessConfirm:function(){Pe(this.$refs.deleteAccessConfirmModal).modal({dismissible:!1}).modal("open")},changeUserRole:function(){var e=this,t=function(){var t=[];return Object.keys(e.selectedRows).forEach((function(n){e.selectedRows[n]&&e.siteAccess[n]&&t.push(e.siteAccess[n].idsite)})),t},n=function(){return i["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",filter_search:e.siteNameFilter,filter_access:e.accessLevelFilter,userLogin:e.userLogin,filter_limit:"-1"}).then((function(e){return e.map((function(e){return e.idsite}))}))};return this.isLoadingAccess=!0,Promise.resolve().then((function(){return e.siteAccessToChange?[e.siteAccessToChange.idsite]:e.areAllResultsSelected?n():t()})).then((function(t){return i["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.roleToChangeTo,idSites:t})})).catch((function(){})).then((function(){return e.$emit("accessChanged"),e.fetchAccess()}))},showChangeAccessConfirm:function(){Pe(this.$refs.changeAccessConfirmModal).modal({dismissible:!1}).modal("open")},getRoleDisplay:function(e){var t=null;return this.filteredAccessLevels.forEach((function(n){n.key===e&&(t=n.value)})),t},giveAccessToAllSites:function(){var e=this;this.isGivingAccessToAllSites=!0,i["AjaxHelper"].fetch({method:"SitesManager.getSitesWithAdminAccess"}).then((function(t){var n=t.map((function(e){return e.idsite}));return i["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.allWebsitesAccssLevelSet,idSites:n})})).then((function(){return e.fetchAccess()})).finally((function(){e.isGivingAccessToAllSites=!1}))},showChangeAccessAllSitesModal:function(){Pe(this.$refs.confirmGiveAccessAllSitesModal).modal({dismissible:!1}).modal("open")},onChangeSiteFilter:function(e){var t=this;setTimeout((function(){var n=e.target.value;t.siteNameFilter!==n&&(t.siteNameFilter=n,t.offset=0,t.fetchAccess())}))},onRoleChange:function(e,t){this.previousRole=e.role,this.roleToChangeTo=t,this.siteAccessToChange=e,this.showChangeAccessConfirm()}},computed:{rolesHelpText:function(){return Object(i["translate"])("UsersManager_RolesHelp",'<a href="https://matomo.org/faq/general/faq_70/" target="_blank" rel="noreferrer noopener">',"</a>",'<a href="https://matomo.org/faq/general/faq_69/" target="_blank" rel="noreferrer noopener">',"</a>")},theDisplayedWebsitesAreSelectedText:function(){var e=Object(i["translate"])("UsersManager_TheDisplayedWebsitesAreSelected","<strong>".concat(this.siteAccess.length,"</strong>"));return"".concat(e," ")},clickToSelectAllText:function(){return Object(i["translate"])("UsersManager_ClickToSelectAll","<strong>".concat(this.totalEntries,"</strong>"))},allWebsitesAreSelectedText:function(){return Object(i["translate"])("UsersManager_AllWebsitesAreSelected","<strong>".concat(this.totalEntries,"</strong>"))},clickToSelectDisplayedWebsitesText:function(){return Object(i["translate"])("UsersManager_ClickToSelectDisplayedWebsites","<strong>".concat(this.siteAccess.length,"</strong>"))},deletePermConfirmSingleText:function(){return Object(i["translate"])("UsersManager_DeletePermConfirmSingle","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteAccessToChangeName,"</strong>"))},deletePermConfirmMultipleText:function(){return Object(i["translate"])("UsersManager_DeletePermConfirmMultiple","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.affectedSitesCount,"</strong>"))},changePermToSiteConfirmSingleText:function(){return Object(i["translate"])("UsersManager_ChangePermToSiteConfirmSingle","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteAccessToChangeName,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"))},changePermToSiteConfirmMultipleText:function(){return Object(i["translate"])("UsersManager_ChangePermToSiteConfirmMultiple","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.affectedSitesCount,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"))},changePermToAllSitesConfirmText:function(){return Object(i["translate"])("UsersManager_ChangePermToAllSitesConfirm","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.allWebsitesAccssLevelSet),"</strong>"))},paginationLowerBound:function(){return this.offset+1},paginationUpperBound:function(){return this.totalEntries?Math.min(this.offset+this.limit,this.totalEntries):"?"},filteredAccessLevels:function(){return this.accessLevels.filter((function(e){return"superuser"!==e.key}))},filteredSelectAccessLevels:function(){return this.filterAccessLevels.filter((function(e){return"superuser"!==e.key}))},selectedRowsCount:function(){var e=0;return Object.values(this.selectedRows).forEach((function(t){t&&(e+=1)})),e},affectedSitesCount:function(){return this.areAllResultsSelected?this.totalEntries:this.selectedRowsCount},allPropsWatch:function(){return this.userLogin,this.limit,this.accessLevels,this.filterAccessLevels,Date.now()},siteAccessToChangeName:function(){return this.siteAccessToChange?i["Matomo"].helper.htmlEntities(this.siteAccessToChange.site_name):""},paginationText:function(){var e=Object(i["translate"])("General_Pagination","".concat(this.paginationLowerBound),"".concat(this.paginationUpperBound),"".concat(this.totalEntries));return" ".concat(e," ")}}});Fe.render=Re;var He=Fe,Ie=(Object(i["createAngularJsAdapter"])({component:He,scope:{userLogin:{angularJsBind:"<"},limit:{angularJsBind:"<"},onUserHasAccessDetected:{angularJsBind:"&",vue:"userHasAccessDetected"},onAccessChange:{angularJsBind:"&",vue:"accessChanged"},accessLevels:{angularJsBind:"<"},filterAccessLevels:{angularJsBind:"<"}},directiveName:"piwikUserPermissionsEdit",restrict:"E"}),{class:"row"}),Je={key:0,class:"col m2 entityList"},qe={class:"listCircle"},$e={key:0,class:"icon-warning"},Ge=Object(a["createElementVNode"])("div",{class:"save-button-spacer hide-on-small-only"},null,-1),ze={href:"",class:"entityCancelLink"},We={class:"visibleTab col m10"},Ye={key:0,class:"basic-info-tab"},Xe={key:0,class:"entityCancel"},Ke={key:1,class:"user-permissions"},Qe={key:0},Ze={key:1,class:"alert alert-info"},et={key:2,class:"superuser-access"},tt={class:"superuser-confirm-modal modal",ref:"superUserConfirmModal"},nt={class:"modal-content"},st={key:0},rt={key:1},it={class:"modal-footer"},at={key:3,class:"twofa-reset"},ot={class:"resetTwoFa"},lt={class:"twofa-confirm-modal modal",ref:"twofaConfirmModal"},ct={class:"modal-content"},dt={class:"modal-footer"},ut={class:"change-password-modal modal",ref:"changePasswordModal"},mt={class:"modal-content"},bt=["innerHTML"],pt={class:"modal-footer"}; + */function Re(e,t,n,s,r,i){var o=Object(a["resolveComponent"])("Notification"),l=Object(a["resolveComponent"])("Field"),c=Object(a["resolveComponent"])("CapabilitiesEdit"),d=Object(a["resolveDirective"])("dropdown-menu"),u=Object(a["resolveDirective"])("content-table");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:Object(a["normalizeClass"])(["userPermissionsEdit",{loading:e.isLoadingAccess}])},[e.hasAccessToAtLeastOneSite?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",V,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{context:"warning",type:"transient",noclear:!0},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("strong",null,Object(a["toDisplayString"])(e.translate("General_Warning"))+":",1),Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("UsersManager_NoAccessWarning")),1)]})),_:1})])])),Object(a["createElementVNode"])("div",k,[Object(a["createElementVNode"])("div",A,[Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("span",w,Object(a["toDisplayString"])(e.translate("UsersManager_GiveAccessToAll"))+":",1),Object(a["createElementVNode"])("div",T,[Object(a["createVNode"])(l,{modelValue:e.allWebsitesAccssLevelSet,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.allWebsitesAccssLevelSet=t}),uicontrol:"select",options:e.filteredAccessLevels,"full-width":!0},null,8,["modelValue","options"])]),Object(a["createElementVNode"])("a",{href:"",class:Object(a["normalizeClass"])(["btn",{disabled:e.isGivingAccessToAllSites}]),onClick:t[1]||(t[1]=Object(a["withModifiers"])((function(t){return e.showChangeAccessAllSitesModal()}),["prevent"]))},Object(a["toDisplayString"])(e.translate("General_Apply")),3)]),Object(a["createElementVNode"])("p",B,Object(a["toDisplayString"])(e.translate("UsersManager_OrManageIndividually"))+":",1)])]),Object(a["createElementVNode"])("div",D,[Object(a["createElementVNode"])("div",_,[Object(a["createElementVNode"])("div",L,[Object(a["withDirectives"])(Object(a["createElementVNode"])("a",{class:Object(a["normalizeClass"])(["dropdown-trigger btn",{disabled:e.isBulkActionsDisabled}]),href:"","data-target":"user-permissions-edit-bulk-actions"},[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("UsersManager_BulkActions")),1)],2),[[d,{activates:"#user-permissions-edit-bulk-actions"}]]),Object(a["createElementVNode"])("ul",R,[Object(a["createElementVNode"])("li",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("a",x,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("UsersManager_SetPermission")),1)],512),[[d,{activates:"#user-permissions-bulk-set-access"}]]),Object(a["createElementVNode"])("ul",P,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.filteredAccessLevels,(function(t){return Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{key:t.key},[Object(a["createElementVNode"])("a",{href:"",onClick:Object(a["withModifiers"])((function(n){e.siteAccessToChange=null,e.roleToChangeTo=t.key,e.showChangeAccessConfirm()}),["prevent"])},Object(a["toDisplayString"])(t.value),9,F)])})),128))])]),Object(a["createElementVNode"])("li",null,[Object(a["createElementVNode"])("a",{href:"",onClick:t[2]||(t[2]=Object(a["withModifiers"])((function(t){e.siteAccessToChange=null,e.roleToChangeTo="noaccess",e.showRemoveAccessConfirm()}),["prevent"]))},Object(a["toDisplayString"])(e.translate("UsersManager_RemovePermissions")),1)])])]),Object(a["createElementVNode"])("div",H,[Object(a["createElementVNode"])("input",{type:"text",value:e.siteNameFilter,onKeydown:t[3]||(t[3]=function(t){e.onChangeSiteFilter(t)}),onChange:t[4]||(t[4]=function(t){e.onChangeSiteFilter(t)}),placeholder:e.translate("UsersManager_FilterByWebsite")},null,40,I)]),Object(a["createElementVNode"])("div",J,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(l,{modelValue:e.accessLevelFilter,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.accessLevelFilter=t}),uicontrol:"select",options:e.filteredSelectAccessLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByAccess")},null,8,["modelValue","options","placeholder"])])])]),e.totalEntries>e.limit?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",q,[Object(a["createElementVNode"])("div",$,[Object(a["createElementVNode"])("a",{class:Object(a["normalizeClass"])(["prev",{disabled:e.offset<=0}])},[Object(a["createElementVNode"])("span",{class:"pointer",onClick:t[6]||(t[6]=function(t){return e.gotoPreviousPage()})},"« "+Object(a["toDisplayString"])(e.translate("General_Previous")),1)],2),Object(a["createElementVNode"])("span",G,[Object(a["createElementVNode"])("span",{textContent:Object(a["toDisplayString"])(e.paginationText)},null,8,z)]),Object(a["createElementVNode"])("a",{class:Object(a["normalizeClass"])(["next",{disabled:e.offset+e.limit>=e.totalEntries}])},[Object(a["createElementVNode"])("span",{class:"pointer",onClick:t[7]||(t[7]=function(t){return e.gotoNextPage()})},Object(a["toDisplayString"])(e.translate("General_Next"))+" »",1)],2)])])):Object(a["createCommentVNode"])("",!0)]),Object(a["createElementVNode"])("div",W,[e.isRoleHelpToggled?(Object(a["openBlock"])(),Object(a["createBlock"])(o,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.rolesHelpText)},null,8,Y)]})),_:1})):Object(a["createCommentVNode"])("",!0)]),Object(a["createElementVNode"])("div",X,[e.isCapabilitiesHelpToggled?(Object(a["openBlock"])(),Object(a["createBlock"])(o,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("UsersManager_CapabilitiesHelp")),1)]})),_:1})):Object(a["createCommentVNode"])("",!0)]),Object(a["withDirectives"])(Object(a["createElementVNode"])("table",K,[Object(a["createElementVNode"])("thead",null,[Object(a["createElementVNode"])("tr",null,[Object(a["createElementVNode"])("th",Q,[Object(a["createElementVNode"])("span",Z,[Object(a["createElementVNode"])("label",null,[Object(a["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_all",checked:e.isAllCheckboxSelected,onChange:t[8]||(t[8]=function(t){return e.onAllCheckboxChange(t)})},null,40,ee),te])])]),Object(a["createElementVNode"])("th",null,Object(a["toDisplayString"])(e.translate("General_Name")),1),Object(a["createElementVNode"])("th",ne,[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize("".concat(e.translate("UsersManager_Role")," "))},null,8,se),Object(a["createElementVNode"])("a",{href:"",class:Object(a["normalizeClass"])(["helpIcon",{sticky:e.isRoleHelpToggled}]),onClick:t[9]||(t[9]=Object(a["withModifiers"])((function(t){return e.isRoleHelpToggled=!e.isRoleHelpToggled}),["prevent"]))},ie,2)]),Object(a["createElementVNode"])("th",ae,[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize("".concat(e.translate("UsersManager_Capabilities")," "))},null,8,oe),Object(a["createElementVNode"])("a",{href:"",class:Object(a["normalizeClass"])(["helpIcon",{sticky:e.isCapabilitiesHelpToggled}]),onClick:t[10]||(t[10]=Object(a["withModifiers"])((function(t){return e.isCapabilitiesHelpToggled=!e.isCapabilitiesHelpToggled}),["prevent"]))},ce,2)])])]),Object(a["createElementVNode"])("tbody",null,[e.isAllCheckboxSelected&&e.siteAccess.length<e.totalEntries?(Object(a["openBlock"])(),Object(a["createElementBlock"])("tr",de,[Object(a["createElementVNode"])("td",ue,[e.areAllResultsSelected?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",me,[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.theDisplayedWebsitesAreSelectedText),style:{"margin-right":"3.5px"}},null,8,be),Object(a["createElementVNode"])("a",{href:"#",onClick:t[11]||(t[11]=Object(a["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.clickToSelectAllText)},null,8,pe)])),e.areAllResultsSelected?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",he,[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.allWebsitesAreSelectedText),style:{"margin-right":"3.5px"}},null,8,ge),Object(a["createElementVNode"])("a",{href:"#",onClick:t[12]||(t[12]=Object(a["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.clickToSelectDisplayedWebsitesText)},null,8,fe)])):Object(a["createCommentVNode"])("",!0)])])):Object(a["createCommentVNode"])("",!0),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.siteAccess,(function(n,s){return Object(a["openBlock"])(),Object(a["createElementBlock"])("tr",{key:n.idsite},[Object(a["createElementVNode"])("td",Oe,[Object(a["createElementVNode"])("span",je,[Object(a["createElementVNode"])("label",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_row".concat(s),"onUpdate:modelValue":function(t){return e.selectedRows[s]=t},onClick:t[13]||(t[13]=function(t){return e.onRowSelected()})},null,8,ve),[[a["vModelCheckbox"],e.selectedRows[s]]]),Ce])])]),Object(a["createElementVNode"])("td",null,[Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(n.site_name),1)]),Object(a["createElementVNode"])("td",null,[Object(a["createElementVNode"])("div",Se,[Object(a["createVNode"])(l,{"model-value":n.role,"onUpdate:modelValue":function(t){e.onRoleChange(n,t)},uicontrol:"select",options:e.filteredAccessLevels,"full-width":!0},null,8,["model-value","onUpdate:modelValue","options"])])]),Object(a["createElementVNode"])("td",null,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(c,{idsite:n.idsite,"site-name":n.site_name,"user-login":e.userLogin,"user-role":n.role,capabilities:n.capabilities,onChange:t[14]||(t[14]=function(t){return e.fetchAccess()})},null,8,["idsite","site-name","user-login","user-role","capabilities"])])])])})),128))])],512),[[u]]),Object(a["createElementVNode"])("div",Ne,[Object(a["createElementVNode"])("div",Ue,[e.siteAccessToChange?(Object(a["openBlock"])(),Object(a["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.deletePermConfirmSingleText)},null,8,ye)):Object(a["createCommentVNode"])("",!0),e.siteAccessToChange?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("p",{key:1,innerHTML:e.$sanitize(e.deletePermConfirmMultipleText)},null,8,Ee))]),Object(a["createElementVNode"])("div",Ve,[Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[15]||(t[15]=Object(a["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(a["toDisplayString"])(e.translate("General_Yes")),1),Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[16]||(t[16]=Object(a["withModifiers"])((function(t){e.siteAccessToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(a["toDisplayString"])(e.translate("General_No")),1)])],512),Object(a["createElementVNode"])("div",ke,[Object(a["createElementVNode"])("div",Ae,[e.siteAccessToChange?(Object(a["openBlock"])(),Object(a["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.changePermToSiteConfirmSingleText)},null,8,we)):Object(a["createCommentVNode"])("",!0),e.siteAccessToChange?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("p",{key:1,innerHTML:e.$sanitize(e.changePermToSiteConfirmMultipleText)},null,8,Te))]),Object(a["createElementVNode"])("div",Me,[Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[17]||(t[17]=Object(a["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(a["toDisplayString"])(e.translate("General_Yes")),1),Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[18]||(t[18]=Object(a["withModifiers"])((function(t){e.siteAccessToChange.role=e.previousRole,e.siteAccessToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(a["toDisplayString"])(e.translate("General_No")),1)])],512),Object(a["createElementVNode"])("div",Be,[Object(a["createElementVNode"])("div",De,[Object(a["createElementVNode"])("h3",{innerHTML:e.$sanitize(e.changePermToAllSitesConfirmText)},null,8,_e),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("UsersManager_ChangePermToAllSitesConfirm2")),1)]),Object(a["createElementVNode"])("div",Le,[Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[19]||(t[19]=Object(a["withModifiers"])((function(t){return e.giveAccessToAllSites()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(a["toDisplayString"])(e.translate("General_Yes")),1),Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[20]||(t[20]=function(e){return e.preventDefault()})},Object(a["toDisplayString"])(e.translate("General_No")),1)])],512)],2)}var xe=window,Pe=xe.$,Fe=Object(a["defineComponent"])({props:{userLogin:{type:String,required:!0},limit:{type:Number,default:10},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0}},components:{Notification:i["Notification"],Field:g["Field"],CapabilitiesEdit:E},directives:{DropdownMenu:i["DropdownMenu"],ContentTable:i["ContentTable"]},data:function(){return{siteAccess:[],offset:0,totalEntries:null,accessLevelFilter:"",siteNameFilter:"",isLoadingAccess:!1,allWebsitesAccssLevelSet:"view",isAllCheckboxSelected:!1,selectedRows:{},isBulkActionsDisabled:!0,areAllResultsSelected:!1,previousRole:null,hasAccessToAtLeastOneSite:!0,isRoleHelpToggled:!1,isCapabilitiesHelpToggled:!1,isGivingAccessToAllSites:!1,roleToChangeTo:null,siteAccessToChange:null}},emits:["userHasAccessDetected","accessChanged"],created:function(){var e=this;this.onChangeSiteFilter=Object(i["debounce"])(this.onChangeSiteFilter,300),Object(a["watch"])((function(){return e.allPropsWatch}),(function(){e.limit&&e.fetchAccess()})),this.fetchAccess()},watch:{accessLevelFilter:function(){this.offset=0,this.fetchAccess()}},methods:{onAllCheckboxChange:function(e){var t=this;this.isAllCheckboxSelected=e.target.checked,this.isAllCheckboxSelected?(this.siteAccess.forEach((function(e,n){t.selectedRows[n]=!0})),this.isBulkActionsDisabled=!1):this.clearSelection()},clearSelection:function(){this.selectedRows={},this.areAllResultsSelected=!1,this.isBulkActionsDisabled=!0,this.isAllCheckboxSelected=!1,this.siteAccessToChange=null},onRowSelected:function(){var e=this;setTimeout((function(){var t=e.selectedRowsCount;e.isBulkActionsDisabled=0===t,e.isAllCheckboxSelected=t===e.siteAccess.length}))},fetchAccess:function(){var e=this;return this.isLoadingAccess=!0,i["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",limit:this.limit,offset:this.offset,filter_search:this.siteNameFilter,filter_access:this.accessLevelFilter,userLogin:this.userLogin},{returnResponseObject:!0}).then((function(t){var n=t.getRequestHandle();e.isLoadingAccess=!1,e.siteAccess=n.responseJSON,e.totalEntries=parseInt(n.getResponseHeader("x-matomo-total-results"),10)||0,e.hasAccessToAtLeastOneSite=!!n.getResponseHeader("x-matomo-has-some"),e.$emit("userHasAccessDetected",{hasAccess:e.hasAccessToAtLeastOneSite}),e.clearSelection()})).catch((function(){e.isLoadingAccess=!1,e.clearSelection()}))},gotoPreviousPage:function(){this.offset=Math.max(0,this.offset-this.limit),this.fetchAccess()},gotoNextPage:function(){var e=this.offset+this.limit;e>=(this.totalEntries||0)||(this.offset=e,this.fetchAccess())},showRemoveAccessConfirm:function(){Pe(this.$refs.deleteAccessConfirmModal).modal({dismissible:!1}).modal("open")},changeUserRole:function(){var e=this,t=function(){var t=[];return Object.keys(e.selectedRows).forEach((function(n){e.selectedRows[n]&&e.siteAccess[n]&&t.push(e.siteAccess[n].idsite)})),t},n=function(){return i["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",filter_search:e.siteNameFilter,filter_access:e.accessLevelFilter,userLogin:e.userLogin,filter_limit:"-1"}).then((function(e){return e.map((function(e){return e.idsite}))}))};return this.isLoadingAccess=!0,Promise.resolve().then((function(){return e.siteAccessToChange?[e.siteAccessToChange.idsite]:e.areAllResultsSelected?n():t()})).then((function(t){return i["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.roleToChangeTo,idSites:t})})).catch((function(){})).then((function(){return e.$emit("accessChanged"),e.fetchAccess()}))},showChangeAccessConfirm:function(){Pe(this.$refs.changeAccessConfirmModal).modal({dismissible:!1}).modal("open")},getRoleDisplay:function(e){var t=null;return this.filteredAccessLevels.forEach((function(n){n.key===e&&(t=n.value)})),t},giveAccessToAllSites:function(){var e=this;this.isGivingAccessToAllSites=!0,i["AjaxHelper"].fetch({method:"SitesManager.getSitesWithAdminAccess",filter_limit:-1}).then((function(t){var n=t.map((function(e){return e.idsite}));return i["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.allWebsitesAccssLevelSet,idSites:n})})).then((function(){return e.fetchAccess()})).finally((function(){e.isGivingAccessToAllSites=!1}))},showChangeAccessAllSitesModal:function(){Pe(this.$refs.confirmGiveAccessAllSitesModal).modal({dismissible:!1}).modal("open")},onChangeSiteFilter:function(e){var t=this;setTimeout((function(){var n=e.target.value;t.siteNameFilter!==n&&(t.siteNameFilter=n,t.offset=0,t.fetchAccess())}))},onRoleChange:function(e,t){this.previousRole=e.role,this.roleToChangeTo=t,this.siteAccessToChange=e,this.showChangeAccessConfirm()}},computed:{rolesHelpText:function(){return Object(i["translate"])("UsersManager_RolesHelp",'<a href="https://matomo.org/faq/general/faq_70/" target="_blank" rel="noreferrer noopener">',"</a>",'<a href="https://matomo.org/faq/general/faq_69/" target="_blank" rel="noreferrer noopener">',"</a>")},theDisplayedWebsitesAreSelectedText:function(){var e=Object(i["translate"])("UsersManager_TheDisplayedWebsitesAreSelected","<strong>".concat(this.siteAccess.length,"</strong>"));return"".concat(e," ")},clickToSelectAllText:function(){return Object(i["translate"])("UsersManager_ClickToSelectAll","<strong>".concat(this.totalEntries,"</strong>"))},allWebsitesAreSelectedText:function(){return Object(i["translate"])("UsersManager_AllWebsitesAreSelected","<strong>".concat(this.totalEntries,"</strong>"))},clickToSelectDisplayedWebsitesText:function(){return Object(i["translate"])("UsersManager_ClickToSelectDisplayedWebsites","<strong>".concat(this.siteAccess.length,"</strong>"))},deletePermConfirmSingleText:function(){return Object(i["translate"])("UsersManager_DeletePermConfirmSingle","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteAccessToChangeName,"</strong>"))},deletePermConfirmMultipleText:function(){return Object(i["translate"])("UsersManager_DeletePermConfirmMultiple","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.affectedSitesCount,"</strong>"))},changePermToSiteConfirmSingleText:function(){return Object(i["translate"])("UsersManager_ChangePermToSiteConfirmSingle","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteAccessToChangeName,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"))},changePermToSiteConfirmMultipleText:function(){return Object(i["translate"])("UsersManager_ChangePermToSiteConfirmMultiple","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.affectedSitesCount,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"))},changePermToAllSitesConfirmText:function(){return Object(i["translate"])("UsersManager_ChangePermToAllSitesConfirm","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.allWebsitesAccssLevelSet),"</strong>"))},paginationLowerBound:function(){return this.offset+1},paginationUpperBound:function(){return this.totalEntries?Math.min(this.offset+this.limit,this.totalEntries):"?"},filteredAccessLevels:function(){return this.accessLevels.filter((function(e){return"superuser"!==e.key}))},filteredSelectAccessLevels:function(){return this.filterAccessLevels.filter((function(e){return"superuser"!==e.key}))},selectedRowsCount:function(){var e=0;return Object.values(this.selectedRows).forEach((function(t){t&&(e+=1)})),e},affectedSitesCount:function(){return this.areAllResultsSelected?this.totalEntries:this.selectedRowsCount},allPropsWatch:function(){return this.userLogin,this.limit,this.accessLevels,this.filterAccessLevels,Date.now()},siteAccessToChangeName:function(){return this.siteAccessToChange?i["Matomo"].helper.htmlEntities(this.siteAccessToChange.site_name):""},paginationText:function(){var e=Object(i["translate"])("General_Pagination","".concat(this.paginationLowerBound),"".concat(this.paginationUpperBound),"".concat(this.totalEntries));return" ".concat(e," ")}}});Fe.render=Re;var He=Fe,Ie=(Object(i["createAngularJsAdapter"])({component:He,scope:{userLogin:{angularJsBind:"<"},limit:{angularJsBind:"<"},onUserHasAccessDetected:{angularJsBind:"&",vue:"userHasAccessDetected"},onAccessChange:{angularJsBind:"&",vue:"accessChanged"},accessLevels:{angularJsBind:"<"},filterAccessLevels:{angularJsBind:"<"}},directiveName:"piwikUserPermissionsEdit",restrict:"E"}),{class:"row"}),Je={key:0,class:"col m2 entityList"},qe={class:"listCircle"},$e={key:0,class:"icon-warning"},Ge=Object(a["createElementVNode"])("div",{class:"save-button-spacer hide-on-small-only"},null,-1),ze={href:"",class:"entityCancelLink"},We={class:"visibleTab col m10"},Ye={key:0,class:"basic-info-tab"},Xe={key:0,class:"entityCancel"},Ke={key:1,class:"user-permissions"},Qe={key:0},Ze={key:1,class:"alert alert-info"},et={key:2,class:"superuser-access"},tt={class:"superuser-confirm-modal modal",ref:"superUserConfirmModal"},nt={class:"modal-content"},st={key:0},rt={key:1},it={class:"modal-footer"},at={key:3,class:"twofa-reset"},ot={class:"resetTwoFa"},lt={class:"twofa-confirm-modal modal",ref:"twofaConfirmModal"},ct={class:"modal-content"},dt={class:"modal-footer"},ut={class:"change-password-modal modal",ref:"changePasswordModal"},mt={class:"modal-content"},bt=["innerHTML"],pt={class:"modal-footer"}; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/UsersManager/vue/src/UserPermissionsEdit/UserPermissionsEdit.vue b/plugins/UsersManager/vue/src/UserPermissionsEdit/UserPermissionsEdit.vue index 79ad0ec68d..2f3b6b3848 100644 --- a/plugins/UsersManager/vue/src/UserPermissionsEdit/UserPermissionsEdit.vue +++ b/plugins/UsersManager/vue/src/UserPermissionsEdit/UserPermissionsEdit.vue @@ -637,6 +637,7 @@ export default defineComponent({ this.isGivingAccessToAllSites = true; AjaxHelper.fetch<Site[]>({ method: 'SitesManager.getSitesWithAdminAccess', + filter_limit: -1, }).then((allSites) => { const idSites = allSites.map((s) => s.idsite); return AjaxHelper.post( |