From 44ea2ed2e55b62b6c7ec35986aaceebc9283921d Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sat, 6 Jan 2024 19:06:12 +0100 Subject: [PATCH] Update translation files Updated by "Squash Git commits" hook in Weblate. Translation: Matomo/CommunityPlugin GroupPermissions Translate-URL: https://hosted.weblate.org/projects/matomo/communityplugin-grouppermissions/ [ci skip] --- Controller.php | 6 +- GroupPermissions.php | 11 + README.md | 3 + javascripts/groupPermissions.js | 80 ++-- plugin.json | 4 +- stylesheets/groupPermissions.less | 11 +- templates/_groups.twig | 66 +--- vue/dist/GroupPermissions.umd.js | 484 +++++++++++++++++++++++ vue/dist/GroupPermissions.umd.js.map | 1 + vue/dist/GroupPermissions.umd.min.js | 14 + vue/dist/GroupPermissions.umd.min.js.map | 1 + vue/dist/umd.metadata.json | 6 + vue/src/Users/ManageGroupMembers.vue | 176 +++++++++ vue/src/index.ts | 8 + 14 files changed, 770 insertions(+), 101 deletions(-) create mode 100644 vue/dist/GroupPermissions.umd.js create mode 100644 vue/dist/GroupPermissions.umd.js.map create mode 100644 vue/dist/GroupPermissions.umd.min.js create mode 100644 vue/dist/GroupPermissions.umd.min.js.map create mode 100644 vue/dist/umd.metadata.json create mode 100644 vue/src/Users/ManageGroupMembers.vue create mode 100644 vue/src/index.ts diff --git a/Controller.php b/Controller.php index 8ec6b7c..38795d5 100644 --- a/Controller.php +++ b/Controller.php @@ -8,7 +8,6 @@ */ namespace Piwik\Plugins\GroupPermissions; -use Exception; use Piwik\API\Request; use Piwik\Common; use Piwik\Piwik; @@ -150,6 +149,11 @@ private function tabGroups(&$view) else { $view->groupUsers = array(); } + + $allUsers = Request::processRequest('UsersManager.getUsersLogin', ['filter_limit' => '-1']); + // Create a named array using the user login as the key as well as the value + $allUsers = array_combine($allUsers, $allUsers); + $view->users = $allUsers; $view->selectedIdGroup = $idGroup; $view->selectedGroupName = isset($groups[$idGroup]) ? $groups[$idGroup] : ''; diff --git a/GroupPermissions.php b/GroupPermissions.php index 4cb7ce4..aaee0a8 100644 --- a/GroupPermissions.php +++ b/GroupPermissions.php @@ -34,6 +34,7 @@ public function registerEvents() 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', 'SitesManager.deleteSite.end' => 'deleteSite', 'UsersManager.deleteUser' => 'deleteUser', + 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', ); } @@ -59,6 +60,16 @@ public function getStylesheetFiles(&$stylesheetFiles) $stylesheetFiles[] = "plugins/GroupPermissions/stylesheets/choices.less"; } + public function getClientSideTranslationKeys(&$translations) + { + $translations[] = 'GroupPermissions_AddUserToGroup'; + $translations[] = 'GroupPermissions_AddUserToGroupButton'; + $translations[] = 'GroupPermissions_ManageGroupMembers'; + $translations[] = 'GroupPermissions_RemoveFromGroup'; + $translations[] = 'GroupPermissions_RemoveFromGroupConfirm'; + $translations[] = 'GroupPermissions_SelectNewUser'; + } + /** * Delete group preferences associated with a particular site */ diff --git a/README.md b/README.md index a065d9b..4fe5e53 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,9 @@ Copy it into the plugins folder. GPL v3 or later ## Changelog +- 5.0.0 + - Compatibility with Matomo 5 + - 4.0.5 - Fix js crash diff --git a/javascripts/groupPermissions.js b/javascripts/groupPermissions.js index f7c36ff..19fc70b 100644 --- a/javascripts/groupPermissions.js +++ b/javascripts/groupPermissions.js @@ -6,17 +6,17 @@ */ $(document).ready(function () { - + function getSelectedIdSite() { return $('#groupPermissionsSiteSelect').attr('siteid'); } - + function sendUpdateGroupPermissionAccess(name, access, successCallback) { var parameters = {}; parameters.name = name; parameters.access = access; parameters.idSites = getSelectedIdSite(); - + var ajaxHandler = new ajaxHelper(); ajaxHandler.addParams({ module: 'API', @@ -29,7 +29,7 @@ $(document).ready(function () { ajaxHandler.setErrorElement('#ajaxErrorGroupPermissions'); ajaxHandler.send(true); } - + function callSendUpdateGroupPermissionAccess(self, successCallback) { sendUpdateGroupPermissionAccess( $(self).parent().parent().find('#group').html(), //if changed change also the modal @@ -37,7 +37,7 @@ $(document).ready(function () { successCallback ); } - + function bindUpdateGroupPermissions() { var self = this; // callback called when the ajax request Update the group permissions is successful @@ -53,7 +53,7 @@ $(document).ready(function () { .attr('src', "plugins/UsersManager/images/ok.png") .attr('class', "accessGranted") ; - + var UI = require('piwik/UI'); var notification = new UI.Notification(); notification.show(_pk_translate('General_Done'), { @@ -65,26 +65,26 @@ $(document).ready(function () { id: 'groupPermissionsAccessUpdated' }); } - + var idSite = getSelectedIdSite(); if (idSite == 'all') { var target = this; - + //ask confirmation var group = $(this).parent().parent().find('#group').text(); $('#confirmGroupPermissions').find('#group').text(group); - + function onValidate() { callSendUpdateGroupPermissionAccess(target, successCallback); } - + piwikHelper.modalConfirm('#confirmGroupPermissions', {yes: onValidate}) } else { callSendUpdateGroupPermissionAccess(this, successCallback); } } - + function sendAddGroupMember(idGroup, login, successCallback) { var parameters = {}; parameters.idGroup = idGroup; @@ -102,7 +102,7 @@ $(document).ready(function () { ajaxHandler.setErrorElement('#ajaxErrorManageGroupMember'); ajaxHandler.send(true); } - + function sendRemoveGroupMember(idGroup, login, successCallback) { var parameters = {}; parameters.idGroup = idGroup; @@ -120,7 +120,7 @@ $(document).ready(function () { ajaxHandler.setErrorElement('#ajaxErrorManageGroupMember'); ajaxHandler.send(true); } - + function bindRemoveGroupMember() { var idGroup = $('#groupPermissionsCurrentIdGroup').val(); var name = $('#groupPermissionsCurrentGroupName').val(); @@ -130,15 +130,15 @@ $(document).ready(function () { function successCallback(response) { line.remove(); } - + $('#confirmRemoveUserFromGroup').find('#login').text(login); - $('#confirmRemoveUserFromGroup').find('#group').text(name); - + $('#confirmRemoveUserFromGroup').find('#group').text(name); + piwikHelper.modalConfirm('#confirmRemoveUserFromGroup', {yes: function() { sendRemoveGroupMember(idGroup, login, successCallback); }}); } - + function sendCreateGroup(groupName, successCallback) { var parameters = {}; parameters.groupName = groupName; @@ -155,15 +155,15 @@ $(document).ready(function () { ajaxHandler.setErrorElement('#ajaxErrorCreateGroup'); ajaxHandler.send(true); } - + function bindCreateGroup() { var groupName = $('#groupPermissionsGroupCreateGroup').val(); function successCallback(response) { location.reload(); } - - sendCreateGroup(groupName, successCallback); + + sendCreateGroup(groupName, successCallback); } @@ -184,7 +184,7 @@ $(document).ready(function () { ajaxHandler.setErrorElement('#ajaxErrorManageGroupRename'); ajaxHandler.send(true); } - + function bindRenameGroup() { var idGroup = $('#groupPermissionsCurrentIdGroup').val(); var name = $('#groupPermissionsCurrentGroupName').val(); @@ -193,10 +193,10 @@ $(document).ready(function () { function successCallback(response) { location.reload(); } - + $('#confirmRenameGroup').find('#confirmOldGroupName').text(name); - $('#confirmRenameGroup').find('#confirmNewGroupName').text(newName); - + $('#confirmRenameGroup').find('#confirmNewGroupName').text(newName); + piwikHelper.modalConfirm('#confirmRenameGroup', {yes: function() { sendRenameGroup(idGroup, newName, successCallback); }}); @@ -218,24 +218,24 @@ $(document).ready(function () { ajaxHandler.setErrorElement('#ajaxErrorManageGroupDelete'); ajaxHandler.send(true); } - + function bindDeleteGroup() { var idGroup = $('#groupPermissionsCurrentIdGroup').val(); var name = $('#groupPermissionsCurrentGroupName').val(); - + function successCallback(response) { location.reload(); } - + $('#confirmDeleteGroup').find('#confirmDeleteGroupName').text(name); - + piwikHelper.modalConfirm('#confirmDeleteGroup', {yes: function() { sendDeleteGroup(idGroup, successCallback); }}); } function initializeUserSelect() { - + var userSelect = new Choices('#groupPermissionsGroupAddUserSelect', { allowHTML: false, searchPlaceholderValue: 'Search for a user', @@ -273,11 +273,11 @@ $(document).ready(function () { tableBody.append(''+login+'' +'' +''); - + userSelect.setChoiceByValue(''); } - - sendAddGroupMember(idGroup, login, successCallback); + + sendAddGroupMember(idGroup, login, successCallback); } $('#groupPermissionsGroupAddUserButton').click(bindAddGroupMember); @@ -293,19 +293,19 @@ $(document).ready(function () { // when a group is selected, reload the page w/o showing the ajax loading element $('#groupPermissionsGroupSelect').bind('change', function (e) { piwik.broadcast.propagateNewPage('idGroup=' + encodeURIComponent($('#groupPermissionsGroupSelect').val()), false); - }); - + }); + $('#groupPermissions .updateAccess').click(bindUpdateGroupPermissions); - - $('#groupPermissionsGroup').on("click", ".groupPermissionsRemoveUser", bindRemoveGroupMember); - + + // $('#groupPermissionsGroup').on("click", ".groupPermissionsRemoveUser", bindRemoveGroupMember); + $('#groupPermissionsGroupRenameGroupButton').click(bindRenameGroup); - + $('#groupPermissionsGroupDeleteGroupButton').click(bindDeleteGroup); - + $('#groupPermissionsGroupCreateGroupButton').click(bindCreateGroup); if ($('#groupPermissionsGroupAddUserSelect').length) { - initializeUserSelect(); + // initializeUserSelect(); } }); diff --git a/plugin.json b/plugin.json index a375c03..7f0157b 100644 --- a/plugin.json +++ b/plugin.json @@ -7,10 +7,10 @@ "email": "michael.roosz@web.de" }], "description": "Manage user permissions with groups.", - "version": "4.0.5", + "version": "5.0.0", "theme": false, "require": { - "matomo": ">=4.0.0-b1,<5.0.0-b1" + "matomo": ">=5.0.0-b1,<6.0.0-b1" }, "keywords": [ "GroupPermissions", diff --git a/stylesheets/groupPermissions.less b/stylesheets/groupPermissions.less index b44ccb8..993f9e3 100644 --- a/stylesheets/groupPermissions.less +++ b/stylesheets/groupPermissions.less @@ -3,11 +3,12 @@ font-weight: 700; } -.groupPermissionsGroupAddUserWrapper .select-wrapper { +.groupPermissionsGroupAddUserWrapper { + .form-group, .row, .input-field { + margin: 0; + } - margin-bottom: 20px; - - input.select-dropdown { - display: none; + .input-field { + padding-left: 0; } } diff --git a/templates/_groups.twig b/templates/_groups.twig index b8762bb..3efd717 100644 --- a/templates/_groups.twig +++ b/templates/_groups.twig @@ -22,61 +22,21 @@
-

{{ 'GroupPermissions_ManageGroup'|translate }}

- - +

{{ 'GroupPermissions_ManageGroup'|translate }}

+ -

{{ 'GroupPermissions_ManageGroupMembers'|translate }}

- -
- - - - - - - - - - - - - - {% for login in groupUsers %} - - - - - {% endfor %} - -
{{ 'General_Username'|translate }}{{ 'GroupPermissions_RemoveFromGroup'|translate }}
- -
-
-
- -
-

{{ 'GroupPermissions_RemoveFromGroupConfirm'|translate("", "")|raw }}

- - -
- -
-

{{ 'GroupPermissions_AddUserToGroup'|translate }}

-
- - -
-
+
{% import 'ajaxMacros.twig' as ajax %} diff --git a/vue/dist/GroupPermissions.umd.js b/vue/dist/GroupPermissions.umd.js new file mode 100644 index 0000000..f9e13de --- /dev/null +++ b/vue/dist/GroupPermissions.umd.js @@ -0,0 +1,484 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("CoreHome"), require("vue"), require("CorePluginsAdmin")); + else if(typeof define === 'function' && define.amd) + define(["CoreHome", , "CorePluginsAdmin"], factory); + else if(typeof exports === 'object') + exports["GroupPermissions"] = factory(require("CoreHome"), require("vue"), require("CorePluginsAdmin")); + else + root["GroupPermissions"] = factory(root["CoreHome"], root["Vue"], root["CorePluginsAdmin"]); +})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "plugins/GroupPermissions/vue/dist/"; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "fae3"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "19dc": +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__; + +/***/ }), + +/***/ "8bbf": +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__; + +/***/ }), + +/***/ "a5a2": +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__; + +/***/ }), + +/***/ "fae3": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +// ESM COMPAT FLAG +__webpack_require__.r(__webpack_exports__); + +// EXPORTS +__webpack_require__.d(__webpack_exports__, "ManageGroupMembers", function() { return /* reexport */ ManageGroupMembers; }); + +// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js +// This file is imported into lib/wc client bundles. + +if (typeof window !== 'undefined') { + var currentScript = window.document.currentScript + if (false) { var getCurrentScript; } + + var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/) + if (src) { + __webpack_require__.p = src[1] // eslint-disable-line + } +} + +// Indicate to webpack that this file can be concatenated +/* harmony default export */ var setPublicPath = (null); + +// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} +var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/GroupPermissions/vue/src/Users/ManageGroupMembers.vue?vue&type=template&id=685022fc + +var _hoisted_1 = { + class: "entityContainer", + style: { + "width": "600px", + "margin-top": "16px" + } +}; +var _hoisted_2 = ["value"]; +var _hoisted_3 = ["value"]; +var _hoisted_4 = { + class: "entityTable dataTable", + id: "groupPermissionsGroup", + style: { + "display": "inline-table", + "width": "550px" + } +}; +var _hoisted_5 = { + class: "login" +}; +var _hoisted_6 = { + class: "text-center" +}; +var _hoisted_7 = ["onClick", "title"]; + +var _hoisted_8 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-delete" +}, null, -1); + +var _hoisted_9 = [_hoisted_8]; + +var _hoisted_10 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + id: "accessUpdated", + style: { + "vertical-align": "top" + } +}, null, -1); + +var _hoisted_11 = { + style: { + "margin-top": "70px" + } +}; +var _hoisted_12 = { + class: "groupPermissionsGroupAddUserWrapper" +}; +var _hoisted_13 = ["value"]; +var _hoisted_14 = { + class: "ui-confirm", + id: "confirmRemoveUser", + ref: "confirmRemoveUser" +}; +var _hoisted_15 = ["textContent"]; +var _hoisted_16 = ["value"]; +var _hoisted_17 = ["value"]; +function render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); + + var _component_ActivityIndicator = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ActivityIndicator"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GroupPermissions_ManageGroupMembers')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "hidden", + id: "groupPermissionsCurrentIdGroup", + value: _ctx.selectedIdGroup + }, null, 8, _hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "hidden", + id: "groupPermissionsCurrentGroupName", + value: _ctx.selectedGroupName + }, null, 8, _hoisted_3), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("table", _hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("thead", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Username')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GroupPermissions_RemoveFromGroup')), 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tbody", null, [(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.assignedUsers, function (login) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", { + key: login + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(login), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { + class: "groupPermissionsRemoveUser btn btn-flat", + onClick: function onClick($event) { + return _ctx.removeUser(login); + }, + title: _ctx.translate('GroupPermissions_RemoveFromGroup'), + "data-login": "{{ login }}" + }, _hoisted_9, 8, _hoisted_7)])]); + }), 128))])]), _hoisted_10]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GroupPermissions_AddUserToGroup')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "select", + id: "groupPermissionsGroupAddUserSelect", + options: _ctx.users, + placeholder: _ctx.translate('GroupPermissions_SelectNewUser'), + modelValue: _ctx.addUserName, + "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { + return _ctx.addUserName = $event; + }) + }, null, 8, ["options", "placeholder", "modelValue"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + id: "groupPermissionsGroupAddUserButton", + type: "button", + onClick: _cache[1] || (_cache[1] = function () { + return _ctx.addUser && _ctx.addUser.apply(_ctx, arguments); + }), + value: _ctx.translate('GroupPermissions_AddUserToGroupButton'), + style: { + "padding": "8px" + } + }, null, 8, _hoisted_13)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, { + loading: _ctx.isLoading, + style: { + "padding-top": "10px" + } + }, null, 8, ["loading"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", { + textContent: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.getConfirmText) + }, null, 8, _hoisted_15), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + role: "yes", + type: "button", + value: _ctx.translate('General_Yes') + }, null, 8, _hoisted_16), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + role: "no", + type: "button", + value: _ctx.translate('General_No') + }, null, 8, _hoisted_17)], 512)], 64); +} +// CONCATENATED MODULE: ./plugins/GroupPermissions/vue/src/Users/ManageGroupMembers.vue?vue&type=template&id=685022fc + +// EXTERNAL MODULE: external "CorePluginsAdmin" +var external_CorePluginsAdmin_ = __webpack_require__("a5a2"); + +// EXTERNAL MODULE: external "CoreHome" +var external_CoreHome_ = __webpack_require__("19dc"); + +// 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/ActivityIndicator/ActivityIndicator.vue?vue&type=template&id=7c5fe406 + +var ActivityIndicatorvue_type_template_id_7c5fe406_hoisted_1 = { + class: "loadingPiwik" +}; + +var ActivityIndicatorvue_type_template_id_7c5fe406_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { + src: "plugins/Morpheus/images/loading-blue.gif", + alt: "" +}, null, -1); + +function ActivityIndicatorvue_type_template_id_7c5fe406_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ActivityIndicatorvue_type_template_id_7c5fe406_hoisted_1, [ActivityIndicatorvue_type_template_id_7c5fe406_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.loadingMessage), 1)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.loading]]); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=template&id=7c5fe406 + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/translate.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +function translate(translationStringId) { + if (!translationStringId) { + return ''; + } + + for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + values[_key - 1] = arguments[_key]; + } + + var pkArgs = values; // handle variadic args AND single array of values (to match _pk_translate signature) + + if (values.length === 1 && values[0] && Array.isArray(values[0])) { + pkArgs = values[0]; + } + + return window._pk_translate(translationStringId, pkArgs); // eslint-disable-line +} +function translateOrDefault(translationStringIdOrText) { + if (!translationStringIdOrText || !window.piwik_translations[translationStringIdOrText]) { + return translationStringIdOrText; + } + + for (var _len2 = arguments.length, values = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + values[_key2 - 1] = arguments[_key2]; + } + + return translate.apply(void 0, [translationStringIdOrText].concat(values)); +} +// 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/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=script&lang=ts + + +/* harmony default export */ var ActivityIndicatorvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + loading: { + type: Boolean, + required: true, + default: false + }, + loadingMessage: { + type: String, + required: false, + default: translate('General_LoadingData') + } + } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue + + + +ActivityIndicatorvue_type_script_lang_ts.render = ActivityIndicatorvue_type_template_id_7c5fe406_render + +/* harmony default export */ var ActivityIndicator = (ActivityIndicatorvue_type_script_lang_ts); +// 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/GroupPermissions/vue/src/Users/ManageGroupMembers.vue?vue&type=script&lang=ts + + + + +/* harmony default export */ var ManageGroupMembersvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + components: { + ActivityIndicator: ActivityIndicator, + Field: external_CorePluginsAdmin_["Field"] + }, + data: function data() { + return { + addUserName: '', + removeUserName: '', + assignedUsers: [], + isLoading: false + }; + }, + props: { + selectedIdGroup: { + type: Number, + required: true + }, + selectedGroupName: { + type: String, + required: true + }, + users: { + type: Object, + required: true + }, + groupUsers: { + type: Object, + required: true + } + }, + methods: { + addUser: function addUser() { + var _this = this; + + this.isLoading = true; // Add the user + + external_CoreHome_["AjaxHelper"].post({ + module: 'API', + format: 'json', + method: 'GroupPermissions.addUserToGroup' + }, { + idGroup: this.selectedIdGroup, + login: this.addUserName + }, { + errorElement: '#ajaxErrorManageGroupMember' + }).then(function () { + _this.assignedUsers.push(_this.addUserName); + + _this.assignedUsers.sort(); + + _this.addUserName = ''; + }).finally(function () { + _this.isLoading = false; + }); + }, + removeUser: function removeUser(user) { + var _this2 = this; + + this.removeUserName = user; + + var doRemoval = function doRemoval() { + _this2.isLoading = true; // Remove the user + + external_CoreHome_["AjaxHelper"].post({ + module: 'API', + format: 'json', + method: 'GroupPermissions.removeUserFromGroup' + }, { + idGroup: _this2.selectedIdGroup, + login: user + }, { + errorElement: '#ajaxErrorManageGroupMember' + }).then(function () { + var index = _this2.assignedUsers.indexOf(user); + + _this2.assignedUsers.splice(index, 1); + + _this2.removeUserName = ''; + }).finally(function () { + _this2.isLoading = false; + }); + }; + + external_CoreHome_["Matomo"].helper.modalConfirm('#confirmRemoveUser', { + yes: doRemoval + }); + } + }, + computed: { + getConfirmText: function getConfirmText() { + return Object(external_CoreHome_["translate"])('GroupPermissions_RemoveFromGroupConfirm', this.removeUserName, this.selectedGroupName); + } + }, + created: function created() { + var _this3 = this; + + this.groupUsers.forEach(function (value) { + _this3.assignedUsers.push(value); + }); + } +})); +// CONCATENATED MODULE: ./plugins/GroupPermissions/vue/src/Users/ManageGroupMembers.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/GroupPermissions/vue/src/Users/ManageGroupMembers.vue + + + +ManageGroupMembersvue_type_script_lang_ts.render = render + +/* harmony default export */ var ManageGroupMembers = (ManageGroupMembersvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/GroupPermissions/vue/src/index.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js + + + + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=GroupPermissions.umd.js.map \ No newline at end of file diff --git a/vue/dist/GroupPermissions.umd.js.map b/vue/dist/GroupPermissions.umd.js.map new file mode 100644 index 0000000..16e7791 --- /dev/null +++ b/vue/dist/GroupPermissions.umd.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://GroupPermissions/webpack/universalModuleDefinition","webpack://GroupPermissions/webpack/bootstrap","webpack://GroupPermissions/external \"CoreHome\"","webpack://GroupPermissions/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://GroupPermissions/external \"CorePluginsAdmin\"","webpack://GroupPermissions/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://GroupPermissions/./plugins/GroupPermissions/vue/src/Users/ManageGroupMembers.vue","webpack://GroupPermissions/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue","webpack://GroupPermissions/./plugins/CoreHome/vue/src/translate.ts","webpack://GroupPermissions/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?0bf6","webpack://GroupPermissions/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?e347","webpack://GroupPermissions/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?6f80","webpack://GroupPermissions/./plugins/GroupPermissions/vue/src/Users/ManageGroupMembers.vue?f1b6","webpack://GroupPermissions/./plugins/GroupPermissions/vue/src/Users/ManageGroupMembers.vue?1187","webpack://GroupPermissions/./plugins/GroupPermissions/vue/src/Users/ManageGroupMembers.vue?7278","webpack://GroupPermissions/./plugins/GroupPermissions/vue/src/index.ts","webpack://GroupPermissions/./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA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BAAM,EAAE,KADM;AAEd,gBAAM,EAAE,MAFM;AAGd,gBAAM,EAAE;AAHM,SAAhB,EAIG;AACD,iBAAO,EAAE,MAAI,CAAC,eADb;AAED,eAAK,EAAE;AAFN,SAJH,EAQA;AACE,sBAAY,EAAE;AADhB,SARA,EAUG,IAVH,CAUQ,YAAK;AACX,cAAM,KAAK,GAAG,MAAI,CAAC,aAAL,CAAmB,OAAnB,CAA2B,IAA3B,CAAd;;AACA,gBAAI,CAAC,aAAL,CAAmB,MAAnB,CAA0B,KAA1B,EAAiC,CAAjC;;AACA,gBAAI,CAAC,cAAL,GAAsB,EAAtB;AACD,SAdD,EAcG,OAdH,CAcW,YAAK;AACd,gBAAI,CAAC,SAAL,GAAiB,KAAjB;AACD,SAhBD;AAiBD,OApBD;;AAsBA,kCAAM,CAAC,MAAP,CAAc,YAAd,CAA2B,oBAA3B,EAAiD;AAC/C,WAAG,EAAE;AAD0C,OAAjD;AAGD;AAnDM,GA/BoB;AAoF7B,UAAQ,EAAE;AACR,kBADQ,4BACM;AACZ,aAAO,uCAAS,CAAC,yCAAD,EAA4C,KAAK,cAAjD,EAAiE,KAAK,iBAAtE,CAAhB;AACD;AAHO,GApFmB;AAyF7B,SAzF6B,qBAyFtB;AAAA;;AACL,SAAK,UAAL,CAAgB,OAAhB,CAAwB,UAAC,KAAD,EAAkB;AACxC,YAAI,CAAC,aAAL,CAAmB,IAAnB,CAAwB,KAAxB;AACD,KAFD;AAGD;AA7F4B,CAAD,CAA9B,E;;ACV2gB,C;;ACA5b;AACV;AACL;AAChE,yCAAM,UAAU,MAAM;;AAEP,gG;;ACLf;;;;;AAKG;;;ACLqB;AACF","file":"GroupPermissions.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"CoreHome\", , \"CorePluginsAdmin\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"GroupPermissions\"] = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse\n\t\troot[\"GroupPermissions\"] = factory(root[\"CoreHome\"], root[\"Vue\"], root[\"CorePluginsAdmin\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"plugins/GroupPermissions/vue/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","\n\n\n","\n\n\n\n\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nexport function translate(\n translationStringId: string,\n ...values: (string|string[]|number|number[]|boolean|boolean[])[]\n): string {\n if (!translationStringId) {\n return '';\n }\n\n let pkArgs = values as (string|number|boolean)[];\n // handle variadic args AND single array of values (to match _pk_translate signature)\n if (values.length === 1 && values[0] && Array.isArray(values[0])) {\n [pkArgs] = values as (string|number|boolean)[][];\n }\n return window._pk_translate(translationStringId, pkArgs); // eslint-disable-line\n}\n\nexport function translateOrDefault(\n translationStringIdOrText?: string,\n ...values: (string|string[]|number|number[]|boolean|boolean[])[]\n): string {\n if (!translationStringIdOrText || !window.piwik_translations[translationStringIdOrText]) {\n return translationStringIdOrText!;\n }\n\n return translate(translationStringIdOrText!, ...values);\n}\n","\nimport { defineComponent } from 'vue';\nimport { translate } from '../translate';\n\nexport default defineComponent({\n props: {\n loading: {\n type: Boolean,\n required: true,\n default: false,\n },\n loadingMessage: {\n type: String,\n required: false,\n default: translate('General_LoadingData'),\n },\n },\n});\n","export { default } from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??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/index.js??ref--0-1!./ActivityIndicator.vue?vue&type=script&lang=ts\"; export * from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??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/index.js??ref--0-1!./ActivityIndicator.vue?vue&type=script&lang=ts\"","import { render } from \"./ActivityIndicator.vue?vue&type=template&id=7c5fe406\"\nimport script from \"./ActivityIndicator.vue?vue&type=script&lang=ts\"\nexport * from \"./ActivityIndicator.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","\nimport { defineComponent } from 'vue';\nimport { Field } from 'CorePluginsAdmin';\nimport {\n AjaxHelper,\n Matomo,\n translate,\n} from 'CoreHome';\nimport ActivityIndicator from '../../../../CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue';\n\nexport default defineComponent({\n components: {\n ActivityIndicator,\n Field,\n },\n data() {\n return {\n addUserName: '',\n removeUserName: '',\n assignedUsers: [] as string[],\n isLoading: false,\n };\n },\n props: {\n selectedIdGroup: {\n type: Number,\n required: true,\n },\n selectedGroupName: {\n type: String,\n required: true,\n },\n users: {\n type: Object,\n required: true,\n },\n groupUsers: {\n type: Object,\n required: true,\n },\n },\n methods: {\n addUser() {\n this.isLoading = true;\n\n // Add the user\n AjaxHelper.post({\n module: 'API',\n format: 'json',\n method: 'GroupPermissions.addUserToGroup',\n }, {\n idGroup: this.selectedIdGroup,\n login: this.addUserName,\n },\n {\n errorElement: '#ajaxErrorManageGroupMember',\n }).then(() => {\n this.assignedUsers.push(this.addUserName);\n this.assignedUsers.sort();\n this.addUserName = '';\n }).finally(() => {\n this.isLoading = false;\n });\n },\n removeUser(user: string) {\n this.removeUserName = user;\n\n const doRemoval = () => {\n this.isLoading = true;\n // Remove the user\n AjaxHelper.post({\n module: 'API',\n format: 'json',\n method: 'GroupPermissions.removeUserFromGroup',\n }, {\n idGroup: this.selectedIdGroup,\n login: user,\n },\n {\n errorElement: '#ajaxErrorManageGroupMember',\n }).then(() => {\n const index = this.assignedUsers.indexOf(user);\n this.assignedUsers.splice(index, 1);\n this.removeUserName = '';\n }).finally(() => {\n this.isLoading = false;\n });\n };\n\n Matomo.helper.modalConfirm('#confirmRemoveUser', {\n yes: doRemoval,\n });\n },\n },\n computed: {\n getConfirmText() {\n return translate('GroupPermissions_RemoveFromGroupConfirm', this.removeUserName, this.selectedGroupName);\n },\n },\n created() {\n this.groupUsers.forEach((value: string) => {\n this.assignedUsers.push(value);\n });\n },\n});\n","export { default } from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??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/index.js??ref--0-1!./ManageGroupMembers.vue?vue&type=script&lang=ts\"; export * from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??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/index.js??ref--0-1!./ManageGroupMembers.vue?vue&type=script&lang=ts\"","import { render } from \"./ManageGroupMembers.vue?vue&type=template&id=685022fc\"\nimport script from \"./ManageGroupMembers.vue?vue&type=script&lang=ts\"\nexport * from \"./ManageGroupMembers.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nexport { default as ManageGroupMembers } from './Users/ManageGroupMembers.vue';\n","import './setPublicPath'\nexport * from '~entry'\n"],"sourceRoot":""} \ No newline at end of file diff --git a/vue/dist/GroupPermissions.umd.min.js b/vue/dist/GroupPermissions.umd.min.js new file mode 100644 index 0000000..7bfc3e5 --- /dev/null +++ b/vue/dist/GroupPermissions.umd.min.js @@ -0,0 +1,14 @@ +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["GroupPermissions"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["GroupPermissions"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,r){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="plugins/GroupPermissions/vue/dist/",r(r.s="fae3")}({"19dc":function(t,r){t.exports=e},"8bbf":function(e,r){e.exports=t},a5a2:function(e,t){e.exports=r},fae3:function(e,t,r){"use strict";if(r.r(t),r.d(t,"ManageGroupMembers",(function(){return M})),"undefined"!==typeof window){var n=window.document.currentScript,o=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(r.p=o[1])}var i=r("8bbf"),s={class:"entityContainer",style:{width:"600px","margin-top":"16px"}},a=["value"],l=["value"],u={class:"entityTable dataTable",id:"groupPermissionsGroup",style:{display:"inline-table",width:"550px"}},d={class:"login"},c={class:"text-center"},p=["onClick","title"],m=Object(i["createElementVNode"])("span",{class:"icon-delete"},null,-1),f=[m],b=Object(i["createElementVNode"])("div",{id:"accessUpdated",style:{"vertical-align":"top"}},null,-1),g={style:{"margin-top":"70px"}},j={class:"groupPermissionsGroupAddUserWrapper"},v=["value"],O={class:"ui-confirm",id:"confirmRemoveUser",ref:"confirmRemoveUser"},y=["textContent"],N=["value"],G=["value"];function h(e,t,r,n,o,m){var h=Object(i["resolveComponent"])("Field"),U=Object(i["resolveComponent"])("ActivityIndicator");return Object(i["openBlock"])(),Object(i["createElementBlock"])(i["Fragment"],null,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("GroupPermissions_ManageGroupMembers")),1),Object(i["createElementVNode"])("div",s,[Object(i["createElementVNode"])("input",{type:"hidden",id:"groupPermissionsCurrentIdGroup",value:e.selectedIdGroup},null,8,a),Object(i["createElementVNode"])("input",{type:"hidden",id:"groupPermissionsCurrentGroupName",value:e.selectedGroupName},null,8,l),Object(i["createElementVNode"])("table",u,[Object(i["createElementVNode"])("thead",null,[Object(i["createElementVNode"])("tr",null,[Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_Username")),1),Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("GroupPermissions_RemoveFromGroup")),1)])]),Object(i["createElementVNode"])("tbody",null,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.assignedUsers,(function(t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("tr",{key:t},[Object(i["createElementVNode"])("td",d,Object(i["toDisplayString"])(t),1),Object(i["createElementVNode"])("td",c,[Object(i["createElementVNode"])("button",{class:"groupPermissionsRemoveUser btn btn-flat",onClick:function(r){return e.removeUser(t)},title:e.translate("GroupPermissions_RemoveFromGroup"),"data-login":"{{ login }}"},f,8,p)])])})),128))])]),b]),Object(i["createElementVNode"])("div",g,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("GroupPermissions_AddUserToGroup")),1),Object(i["createElementVNode"])("div",j,[Object(i["createVNode"])(h,{uicontrol:"select",id:"groupPermissionsGroupAddUserSelect",options:e.users,placeholder:e.translate("GroupPermissions_SelectNewUser"),modelValue:e.addUserName,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.addUserName=t})},null,8,["options","placeholder","modelValue"]),Object(i["createElementVNode"])("input",{id:"groupPermissionsGroupAddUserButton",type:"button",onClick:t[1]||(t[1]=function(){return e.addUser&&e.addUser.apply(e,arguments)}),value:e.translate("GroupPermissions_AddUserToGroupButton"),style:{padding:"8px"}},null,8,v)])]),Object(i["createVNode"])(U,{loading:e.isLoading,style:{"padding-top":"10px"}},null,8,["loading"]),Object(i["createElementVNode"])("div",O,[Object(i["createElementVNode"])("h2",{textContent:Object(i["toDisplayString"])(e.getConfirmText)},null,8,y),Object(i["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,N),Object(i["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,G)],512)],64)}var U=r("a5a2"),E=r("19dc"),P={class:"loadingPiwik"},V=Object(i["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1);function x(e,t,r,n,o,s){return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",P,[V,Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.loadingMessage),1)],512)),[[i["vShow"],e.loading]])} +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */function C(e){if(!e)return"";for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n\n

{{ translate('GroupPermissions_ManageGroupMembers') }}

\n\n
\n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n
{{ translate('General_Username') }}{{ translate('GroupPermissions_RemoveFromGroup') }}
\n \n
\n
\n
\n
\n

{{ translate('GroupPermissions_AddUserToGroup') }}

\n
\n \n \n
\n
\n \n \n

\n \n \n
\n\n\n\n","\n\n\n\n\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nexport function translate(\n translationStringId: string,\n ...values: (string|string[]|number|number[]|boolean|boolean[])[]\n): string {\n if (!translationStringId) {\n return '';\n }\n\n let pkArgs = values as (string|number|boolean)[];\n // handle variadic args AND single array of values (to match _pk_translate signature)\n if (values.length === 1 && values[0] && Array.isArray(values[0])) {\n [pkArgs] = values as (string|number|boolean)[][];\n }\n return window._pk_translate(translationStringId, pkArgs); // eslint-disable-line\n}\n\nexport function translateOrDefault(\n translationStringIdOrText?: string,\n ...values: (string|string[]|number|number[]|boolean|boolean[])[]\n): string {\n if (!translationStringIdOrText || !window.piwik_translations[translationStringIdOrText]) {\n return translationStringIdOrText!;\n }\n\n return translate(translationStringIdOrText!, ...values);\n}\n","\nimport { defineComponent } from 'vue';\nimport { translate } from '../translate';\n\nexport default defineComponent({\n props: {\n loading: {\n type: Boolean,\n required: true,\n default: false,\n },\n loadingMessage: {\n type: String,\n required: false,\n default: translate('General_LoadingData'),\n },\n },\n});\n","import { render } from \"./ActivityIndicator.vue?vue&type=template&id=7c5fe406\"\nimport script from \"./ActivityIndicator.vue?vue&type=script&lang=ts\"\nexport * from \"./ActivityIndicator.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","\nimport { defineComponent } from 'vue';\nimport { Field } from 'CorePluginsAdmin';\nimport {\n AjaxHelper,\n Matomo,\n translate,\n} from 'CoreHome';\nimport ActivityIndicator from '../../../../CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue';\n\nexport default defineComponent({\n components: {\n ActivityIndicator,\n Field,\n },\n data() {\n return {\n addUserName: '',\n removeUserName: '',\n assignedUsers: [] as string[],\n isLoading: false,\n };\n },\n props: {\n selectedIdGroup: {\n type: Number,\n required: true,\n },\n selectedGroupName: {\n type: String,\n required: true,\n },\n users: {\n type: Object,\n required: true,\n },\n groupUsers: {\n type: Object,\n required: true,\n },\n },\n methods: {\n addUser() {\n this.isLoading = true;\n\n // Add the user\n AjaxHelper.post({\n module: 'API',\n format: 'json',\n method: 'GroupPermissions.addUserToGroup',\n }, {\n idGroup: this.selectedIdGroup,\n login: this.addUserName,\n },\n {\n errorElement: '#ajaxErrorManageGroupMember',\n }).then(() => {\n this.assignedUsers.push(this.addUserName);\n this.assignedUsers.sort();\n this.addUserName = '';\n }).finally(() => {\n this.isLoading = false;\n });\n },\n removeUser(user: string) {\n this.removeUserName = user;\n\n const doRemoval = () => {\n this.isLoading = true;\n // Remove the user\n AjaxHelper.post({\n module: 'API',\n format: 'json',\n method: 'GroupPermissions.removeUserFromGroup',\n }, {\n idGroup: this.selectedIdGroup,\n login: user,\n },\n {\n errorElement: '#ajaxErrorManageGroupMember',\n }).then(() => {\n const index = this.assignedUsers.indexOf(user);\n this.assignedUsers.splice(index, 1);\n this.removeUserName = '';\n }).finally(() => {\n this.isLoading = false;\n });\n };\n\n Matomo.helper.modalConfirm('#confirmRemoveUser', {\n yes: doRemoval,\n });\n },\n },\n computed: {\n getConfirmText() {\n return translate('GroupPermissions_RemoveFromGroupConfirm', this.removeUserName, this.selectedGroupName);\n },\n },\n created() {\n this.groupUsers.forEach((value: string) => {\n this.assignedUsers.push(value);\n });\n },\n});\n","import { render } from \"./ManageGroupMembers.vue?vue&type=template&id=685022fc\"\nimport script from \"./ManageGroupMembers.vue?vue&type=script&lang=ts\"\nexport * from \"./ManageGroupMembers.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script"],"sourceRoot":""} \ No newline at end of file diff --git a/vue/dist/umd.metadata.json b/vue/dist/umd.metadata.json new file mode 100644 index 0000000..6eb1c55 --- /dev/null +++ b/vue/dist/umd.metadata.json @@ -0,0 +1,6 @@ +{ + "dependsOn": [ + "CorePluginsAdmin", + "CoreHome" + ] +} \ No newline at end of file diff --git a/vue/src/Users/ManageGroupMembers.vue b/vue/src/Users/ManageGroupMembers.vue new file mode 100644 index 0000000..f101f0c --- /dev/null +++ b/vue/src/Users/ManageGroupMembers.vue @@ -0,0 +1,176 @@ + + + diff --git a/vue/src/index.ts b/vue/src/index.ts new file mode 100644 index 0000000..a44abd4 --- /dev/null +++ b/vue/src/index.ts @@ -0,0 +1,8 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +export { default as ManageGroupMembers } from './Users/ManageGroupMembers.vue';