diff options
14 files changed, 862 insertions, 323 deletions
diff --git a/plugins/CoreUpdater/templates/updateSuccess.twig b/plugins/CoreUpdater/templates/updateSuccess.twig index 818c537f50..0b7fb02087 100644 --- a/plugins/CoreUpdater/templates/updateSuccess.twig +++ b/plugins/CoreUpdater/templates/updateSuccess.twig @@ -22,7 +22,7 @@ <div class="row"> <div class="col s5 offset-s1"> - <a href="https://matomo.org/support-plans/?pk_medium=Update_Success_button&pk_source=Matomo_App&pk_campaign=App_Updated" class="btn btn-block">{{ 'CoreUpdater_ServicesSupport'|translate }}</a> + <a href="https://matomo.org/support-plans/?pk_medium=Update_Success_button&pk_source=Matomo_App&pk_campaign=App_Updated" class="btn btn-block">{{ 'CoreUpdater_ServicesSupport'|translate|raw }}</a> </div> <div class="col s5"> <a href="https://matomo.org/hosting/?pk_medium=App_Cloud_button&pk_source=Matomo_App&pk_campaign=App_Updated" class="btn btn-block">{{ 'CoreUpdater_CloudHosting'|translate }}</a> diff --git a/plugins/Installation/tests/UI/expected-screenshots/Installation_superuser_de.png b/plugins/Installation/tests/UI/expected-screenshots/Installation_superuser_de.png index 225ca5760d..3f08ece153 100644 --- a/plugins/Installation/tests/UI/expected-screenshots/Installation_superuser_de.png +++ b/plugins/Installation/tests/UI/expected-screenshots/Installation_superuser_de.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:effe088d45a5f90d2f2b9dc10269234fe8b148cbd02514f68adbb8465a967193 -size 112113 +oid sha256:c61dd7375e60550d9a2d1653900dbf6969b1425274980304f6423ef2e7ca5da5 +size 113621 diff --git a/plugins/PrivacyManager/PrivacyManager.php b/plugins/PrivacyManager/PrivacyManager.php index 3d0e364659..2e04d85055 100644 --- a/plugins/PrivacyManager/PrivacyManager.php +++ b/plugins/PrivacyManager/PrivacyManager.php @@ -326,8 +326,6 @@ class PrivacyManager extends Plugin $jsFiles[] = "plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.js"; $jsFiles[] = "plugins/PrivacyManager/angularjs/manage-gdpr/managegdpr.controller.js"; $jsFiles[] = "plugins/PrivacyManager/angularjs/manage-gdpr/managegdpr.directive.js"; - $jsFiles[] = "plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.controller.js"; - $jsFiles[] = "plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.directive.js"; } public function getStylesheetFiles(&$stylesheets) @@ -335,7 +333,7 @@ class PrivacyManager extends Plugin $stylesheets[] = "plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.less"; $stylesheets[] = "plugins/PrivacyManager/angularjs/manage-gdpr/managegdpr.directive.less"; $stylesheets[] = "plugins/PrivacyManager/stylesheets/gdprOverview.less"; - $stylesheets[] = "plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.directive.less"; + $stylesheets[] = "plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.less"; $stylesheets[] = "plugins/PrivacyManager/stylesheets/footerLinks.less"; } diff --git a/plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.controller.js b/plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.controller.js deleted file mode 100644 index 4ae473318c..0000000000 --- a/plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.controller.js +++ /dev/null @@ -1,145 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp').controller('AnonymizeLogDataController', AnonymizeLogDataController); - - AnonymizeLogDataController.$inject = ["$scope", "piwikApi", "piwik", "$timeout"]; - - function AnonymizeLogDataController($scope, piwikApi, piwik, $timeout) { - function sub(value) - { - if (value < 10) { - return '0' + value; - } - return value; - } - - var self = this; - var now = new Date(); - this.isLoading = false; - this.isDeleting = false; - this.anonymizeIp = false; - this.anonymizeLocation = false; - this.anonymizeUserId = false; - this.site = {id: 'all', name: 'All Websites'}; - this.availableVisitColumns = []; - this.availableActionColumns = []; - this.selectedVisitColumns = [{column: ''}]; - this.selectedActionColumns = [{column: ''}]; - this.start_date = now.getFullYear() + '-' + sub(now.getMonth() + 1) + '-' + sub(now.getDay() + 1); - this.end_date = this.start_date; - - piwikApi.fetch({method: 'PrivacyManager.getAvailableVisitColumnsToAnonymize'}).then(function (columns) { - self.availableVisitColumns = []; - angular.forEach(columns, function (column) { - self.availableVisitColumns.push({key: column.column_name, value: column.column_name}); - }); - }); - - piwikApi.fetch({method: 'PrivacyManager.getAvailableLinkVisitActionColumnsToAnonymize'}).then(function (columns) { - self.availableActionColumns = []; - - angular.forEach(columns, function (column) { - self.availableActionColumns.push({key: column.column_name, value: column.column_name}); - }); - }); - - this.onVisitColumnChange = function () { - var hasAll = true; - angular.forEach(this.selectedVisitColumns, function (visitColumn) { - if (!visitColumn || !visitColumn.column) { - hasAll = false; - } - }); - if (hasAll) { - this.addVisitColumn(); - } - }; - - this.addVisitColumn = function () { - this.selectedVisitColumns.push({column: ''}); - }; - - this.removeVisitColumn = function (index) { - if (index > -1) { - var lastIndex = this.selectedVisitColumns.length - 1; - if (lastIndex === index) { - this.selectedVisitColumns[index] = {column: ''}; - } else { - this.selectedVisitColumns.splice(index, 1); - } - } - }; - - this.onActionColumnChange = function () { - var hasAll = true; - angular.forEach(this.selectedActionColumns, function (actionColumn) { - if (!actionColumn || !actionColumn.column) { - hasAll = false; - } - }); - if (hasAll) { - this.addActionColumn(); - } - }; - - this.addActionColumn = function () { - this.selectedActionColumns.push({column: ''}); - }; - - this.removeActionColumn = function (index) { - if (index > -1) { - var lastIndex = this.selectedActionColumns.length - 1; - if (lastIndex === index) { - this.selectedActionColumns[index] = {column: ''}; - } else { - this.selectedActionColumns.splice(index, 1); - } - } - }; - - this.scheduleAnonymization = function () { - var date = this.start_date + ',' + this.end_date; - if (this.start_date === this.end_date) { - date = this.start_date; - } - - var params = {date: date}; - params.idSites = this.site.id; - params.anonymizeIp = this.anonymizeIp ? '1' : '0'; - params.anonymizeLocation = this.anonymizeLocation ? '1' : '0'; - params.anonymizeUserId = this.anonymizeUserId ? '1' : '0'; - params.unsetVisitColumns = []; - params.unsetLinkVisitActionColumns = []; - angular.forEach(this.selectedVisitColumns, function (column) { - if (column.column) { - params.unsetVisitColumns.push(column.column); - } - }); - angular.forEach(this.selectedActionColumns, function (column) { - if (column.column) { - params.unsetLinkVisitActionColumns.push(column.column); - } - }); - - piwik.helper.modalConfirm('#confirmAnonymizeLogData', {yes: function () { - piwikApi.post({method: 'PrivacyManager.anonymizeSomeRawData'}, params).then(function () { - location.reload(true); - }); - }}); - }; - - $timeout(function () { - var options1 = piwik.getBaseDatePickerOptions(null); - var options2 = piwik.getBaseDatePickerOptions(null); - - $(".anonymizeStartDate").datepicker(options1); - $(".anonymizeEndDate").datepicker(options2); - }); - - } -})(); diff --git a/plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.directive.html b/plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.directive.html deleted file mode 100644 index 00b699fd85..0000000000 --- a/plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.directive.html +++ /dev/null @@ -1,136 +0,0 @@ -<div class="anonymizeLogData"> - - <div class="form-group row"> - <div class="col s12 input-field"> - <div> - <label for="anonymizeSite" class="siteSelectorLabel">{{ 'PrivacyManager_AnonymizeSites'|translate }}</label> - <div piwik-siteselector - class="sites_autocomplete" - ng-model="anonymizeLogData.site" - id="anonymizeSite" - show-all-sites-item="true" - switch-site-on-select="false" - show-selected-site="true"></div> - </div> - </div> - </div> - - <div class="form-group row"> - <div class="col s6 input-field"> - <div> - <label for="anonymizeStartDate" class="active">{{ 'PrivacyManager_AnonymizeRowDataFrom'|translate }}</label> - <input type="text" ng-model="anonymizeLogData.start_date" - class="anonymizeStartDate" - name="anonymizeStartDate"> - </div> - </div> - <div class="col s6 input-field"> - <div> - <label for="anonymizeEndDate" class="active">{{ 'PrivacyManager_AnonymizeRowDataTo'|translate }}</label> - <input type="text" ng-model="anonymizeLogData.end_date" - class="anonymizeEndDate" - name="anonymizeEndDate"> - </div> - </div> - </div> - - <div piwik-field uicontrol="checkbox" name="anonymizeIp" - data-title="{{ 'PrivacyManager_AnonymizeIp'|translate }}" - ng-model="anonymizeLogData.anonymizeIp" - introduction="{{ 'General_Visit'|translate }}" - inline-help="{{ 'PrivacyManager_AnonymizeIpHelp'|translate }}"> - </div> - - <div piwik-field uicontrol="checkbox" name="anonymizeLocation" - data-title="{{ 'PrivacyManager_AnonymizeLocation'|translate }}" - ng-model="anonymizeLogData.anonymizeLocation" - inline-help="{{ 'PrivacyManager_AnonymizeLocationHelp'|translate }}"> - </div> - - <div piwik-field uicontrol="checkbox" name="anonymizeTheUserId" - data-title="{{ 'PrivacyManager_AnonymizeUserId'|translate }}" - ng-model="anonymizeLogData.anonymizeUserId" - inline-help="{{ 'PrivacyManager_AnonymizeUserIdHelp'|translate }}"> - </div> - - <div class="form-group row"> - <div class="col s12 m6"> - <div> - <label for="visit_columns">{{ 'PrivacyManager_UnsetVisitColumns'|translate }}</label> - - <div ng-repeat="(index, visitColumn) in anonymizeLogData.selectedVisitColumns" - class="selectedVisitColumns selectedVisitColumns{{ index }} multiple valign-wrapper"> - - <div piwik-field uicontrol="select" name="visit_columns" - class="innerFormField" - full-width="true" - ng-model="anonymizeLogData.selectedVisitColumns[index].column" - ng-change="anonymizeLogData.onVisitColumnChange();" - options="anonymizeLogData.availableVisitColumns"> - </div> - - <span ng-click="anonymizeLogData.removeVisitColumn(index)" - title="{{ 'General_Remove'|translate }}" - ng-hide="(index + 1) == (anonymizeLogData.selectedVisitColumns|length)" - class="icon-minus valign"></span> - </div> - </div> - </div> - - <div class="col s12 m6"> - <div class="form-help"> - <span class="inline-help">{{ 'PrivacyManager_UnsetVisitColumnsHelp'|translate }}</span> - </div> - </div> - </div> - - <div class="form-group row"> - <div class="col s12"><h3>{{ 'General_Action'|translate }}</h3></div> - </div> - - <div class="form-group row"> - <div class="col s12 m6"> - <div> - <label for="action_columns">{{ 'PrivacyManager_UnsetActionColumns'|translate }}</label> - - <div ng-repeat="(index, actionColumn) in anonymizeLogData.selectedActionColumns" - class="selectedActionColumns selectedActionColumns{{ index }} multiple valign-wrapper"> - - <div piwik-field uicontrol="select" name="action_columns" - class="innerFormField" - full-width="true" - ng-model="anonymizeLogData.selectedActionColumns[index].column" - ng-change="anonymizeLogData.onActionColumnChange();" - options="anonymizeLogData.availableActionColumns"> - </div> - - <span ng-click="anonymizeLogData.removeActionColumn(index)" - title="{{ 'General_Remove'|translate }}" - ng-hide="(index + 1) == (anonymizeLogData.selectedActionColumns|length)" - class="icon-minus valign"></span> - </div> - </div> - </div> - - <div class="col s12 m6"> - <div class="form-help"> - <span class="inline-help">{{ 'PrivacyManager_UnsetActionColumnsHelp'|translate }}</span> - </div> - </div> - </div> - - <p><span class="icon-info"></span> {{ 'PrivacyManager_AnonymizeProcessInfo'|translate }}</p> - - <div piwik-save-button - class="anonymizePastData" - onconfirm="anonymizeLogData.scheduleAnonymization()" - data-disabled="!anonymizeLogData.anonymizeIp && !anonymizeLogData.anonymizeLocation && !anonymizeLogData.selectedVisitColumns && !anonymizeLogData.selectedActionColumns" - value="{{ 'PrivacyManager_AnonymizeDataNow'|translate }}"> - </div> - - <div class="ui-confirm" id="confirmAnonymizeLogData"> - <h2>{{ 'PrivacyManager_AnonymizeDataConfirm'|translate }}</h2> - <input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/> - <input role="no" type="button" value="{{ 'General_No'|translate }}"/> - </div> -</div> diff --git a/plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.directive.js b/plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.directive.js deleted file mode 100644 index ae990dc7a3..0000000000 --- a/plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.directive.js +++ /dev/null @@ -1,29 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -/** - * Usage: - * <div matomo-anonymize-log-data> - */ -(function () { - angular.module('piwikApp').directive('matomoAnonymizeLogData', anonymizeLogData); - - anonymizeLogData.$inject = ['piwik']; - - function anonymizeLogData(piwik){ - return { - restrict: 'A', - scope: {}, - templateUrl: 'plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.directive.html?cb=' + piwik.cacheBuster, - controller: 'AnonymizeLogDataController', - controllerAs: 'anonymizeLogData', - compile: function (element, attrs) { - - } - }; - } -})();
\ No newline at end of file diff --git a/plugins/PrivacyManager/templates/privacySettings.twig b/plugins/PrivacyManager/templates/privacySettings.twig index 485935f99b..1d3d85530e 100644 --- a/plugins/PrivacyManager/templates/privacySettings.twig +++ b/plugins/PrivacyManager/templates/privacySettings.twig @@ -262,7 +262,7 @@ </p> {% if isSuperUser %} - <div matomo-anonymize-log-data></div> + <div vue-entry="PrivacyManager.AnonymizeLogData"></div> {% else %} <p>Only a user with Super User access can anonymize previously tracked raw data.</p> {% endif %} diff --git a/plugins/PrivacyManager/tests/UI/PrivacyManager_spec.js b/plugins/PrivacyManager/tests/UI/PrivacyManager_spec.js index 75a7fb496a..a13e37bf35 100644 --- a/plugins/PrivacyManager/tests/UI/PrivacyManager_spec.js +++ b/plugins/PrivacyManager/tests/UI/PrivacyManager_spec.js @@ -24,14 +24,21 @@ describe("PrivacyManager", function () { { // make sure tests do not fail every day await page.waitForSelector('input.anonymizeStartDate'); + await page.waitForSelector('input.anonymizeEndDate'); + await page.waitForTimeout(100); await page.evaluate(function () { $('input.anonymizeStartDate').val('2018-03-02').change(); + }); + await page.waitForTimeout(100); + await page.evaluate(function () { $('input.anonymizeEndDate').val('2018-03-02').change(); }); + await page.waitForTimeout(100); } async function loadActionPage(action) { + await page.goto('about:blank'); await page.goto(urlBase + action); await page.waitForNetworkIdle(); @@ -78,18 +85,20 @@ describe("PrivacyManager", function () { async function selectVisitColumn(title) { + await page.waitForTimeout(100); await page.evaluate(function () { $('.selectedVisitColumns:last input.select-dropdown').click(); }); - var selector = '.selectedVisitColumns:last .dropdown-content li:contains(' + title + ')'; - await page.waitForFunction('$("'+selector+'").length > 0'); - var elem = await page.jQuery(selector); - await elem.click(); + await page.waitForTimeout(100); + await page.evaluate(title => { + $('.selectedVisitColumns:last .dropdown-content li:contains(' + title + ')').click(); + }, title); await page.waitForTimeout(100); } async function selectActionColumn(title) { + await page.waitForTimeout(100); await page.evaluate(function () { $('.selectedActionColumns:last input.select-dropdown').click(); }); @@ -206,9 +215,13 @@ describe("PrivacyManager", function () { await page.waitForTimeout(1000); await page.click(".form-group #anonymizeSite [title='Site 1']"); await page.click('[name="anonymizeIp"] label'); + await page.waitForTimeout(100); await page.evaluate(function () { $('input.anonymizeStartDate').val('2017-01-01').change(); - $('input.anonymizeEndDate').val('2017-02-14').change(); + }); + await page.waitForTimeout(100); + await page.evaluate(function () { + $('input.anonymizeEndDate').val('2017-02-14').change(); }); await page.waitForTimeout(100); diff --git a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js index 9d0537df4e..4f91d6a889 100644 --- a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js +++ b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js @@ -126,6 +126,7 @@ __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, "AnonymizeIp", function() { return /* reexport */ AnonymizeIp; }); +__webpack_require__.d(__webpack_exports__, "AnonymizeLogData", function() { return /* reexport */ AnonymizeLogData; }); __webpack_require__.d(__webpack_exports__, "DoNotTrackPreference", function() { return /* reexport */ DoNotTrackPreference; }); // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js @@ -367,6 +368,438 @@ var external_CorePluginsAdmin_ = __webpack_require__("a5a2"); AnonymizeIpvue_type_script_lang_ts.render = render /* harmony default export */ var AnonymizeIp = (AnonymizeIpvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.vue?vue&type=template&id=bdf32a0e + +var AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_1 = { + class: "anonymizeLogData" +}; +var AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_2 = { + class: "form-group row" +}; +var AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_3 = { + class: "col s12 input-field" +}; +var AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_4 = { + for: "anonymizeSite", + class: "siteSelectorLabel" +}; +var AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_5 = { + class: "sites_autocomplete" +}; +var AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_6 = { + class: "form-group row" +}; +var AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_7 = { + class: "col s6 input-field" +}; +var AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_8 = { + for: "anonymizeStartDate", + class: "active" +}; +var _hoisted_9 = ["value"]; +var _hoisted_10 = { + class: "col s6 input-field" +}; +var _hoisted_11 = { + for: "anonymizeEndDate", + class: "active" +}; +var _hoisted_12 = ["value"]; +var _hoisted_13 = { + name: "anonymizeIp" +}; +var _hoisted_14 = { + name: "anonymizeLocation" +}; +var _hoisted_15 = { + name: "anonymizeTheUserId" +}; +var _hoisted_16 = { + class: "form-group row" +}; +var _hoisted_17 = { + class: "col s12 m6" +}; +var _hoisted_18 = { + for: "visit_columns" +}; +var _hoisted_19 = { + class: "innerFormField", + name: "visit_columns" +}; +var _hoisted_20 = ["onClick", "title"]; +var _hoisted_21 = { + class: "col s12 m6" +}; +var _hoisted_22 = { + class: "form-help" +}; +var _hoisted_23 = { + class: "inline-help" +}; +var _hoisted_24 = { + class: "form-group row" +}; +var _hoisted_25 = { + class: "col s12" +}; +var _hoisted_26 = { + class: "form-group row" +}; +var _hoisted_27 = { + class: "col s12 m6" +}; +var _hoisted_28 = { + for: "action_columns" +}; +var _hoisted_29 = { + class: "innerFormField", + name: "action_columns" +}; +var _hoisted_30 = ["onClick", "title"]; +var _hoisted_31 = { + class: "col s12 m6" +}; +var _hoisted_32 = { + class: "form-help" +}; +var _hoisted_33 = { + class: "inline-help" +}; + +var _hoisted_34 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-info" +}, null, -1); + +var _hoisted_35 = { + class: "ui-confirm", + id: "confirmAnonymizeLogData", + ref: "confirmAnonymizeLogData" +}; +var _hoisted_36 = ["value"]; +var _hoisted_37 = ["value"]; +function AnonymizeLogDatavue_type_template_id_bdf32a0e_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_SiteSelector = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("SiteSelector"); + + var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); + + var _component_SaveButton = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("SaveButton"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_AnonymizeSites')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SiteSelector, { + id: "anonymizeSite", + modelValue: _ctx.site, + "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { + return _ctx.site = $event; + }), + "show-all-sites-item": true, + "switch-site-on-select": false, + "show-selected-site": true + }, null, 8, ["modelValue"])])])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_8, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_AnonymizeRowDataFrom')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "text", + id: "anonymizeStartDate", + class: "anonymizeStartDate", + ref: "anonymizeStartDate", + name: "anonymizeStartDate", + value: _ctx.startDate, + onKeydown: _cache[1] || (_cache[1] = function ($event) { + return _ctx.onKeydownStartDate($event); + }), + onChange: _cache[2] || (_cache[2] = function ($event) { + return _ctx.onKeydownStartDate($event); + }) + }, null, 40, _hoisted_9)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", _hoisted_11, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_AnonymizeRowDataTo')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "text", + class: "anonymizeEndDate", + id: "anonymizeEndDate", + ref: "anonymizeEndDate", + name: "anonymizeEndDate", + value: _ctx.endDate, + onKeydown: _cache[3] || (_cache[3] = function ($event) { + return _ctx.onKeydownEndDate($event); + }), + onChange: _cache[4] || (_cache[4] = function ($event) { + return _ctx.onKeydownEndDate($event); + }) + }, null, 40, _hoisted_12)])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "checkbox", + name: "anonymizeIp", + title: _ctx.translate('PrivacyManager_AnonymizeIp'), + modelValue: _ctx.anonymizeIp, + "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) { + return _ctx.anonymizeIp = $event; + }), + introduction: _ctx.translate('General_Visit'), + "inline-help": _ctx.translate('PrivacyManager_AnonymizeIpHelp') + }, null, 8, ["title", "modelValue", "introduction", "inline-help"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "checkbox", + name: "anonymizeLocation", + title: _ctx.translate('PrivacyManager_AnonymizeLocation'), + modelValue: _ctx.anonymizeLocation, + "onUpdate:modelValue": _cache[6] || (_cache[6] = function ($event) { + return _ctx.anonymizeLocation = $event; + }), + "inline-help": _ctx.translate('PrivacyManager_AnonymizeLocationHelp') + }, null, 8, ["title", "modelValue", "inline-help"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "checkbox", + name: "anonymizeTheUserId", + title: _ctx.translate('PrivacyManager_AnonymizeUserId'), + modelValue: _ctx.anonymizeUserId, + "onUpdate:modelValue": _cache[7] || (_cache[7] = function ($event) { + return _ctx.anonymizeUserId = $event; + }), + "inline-help": _ctx.translate('PrivacyManager_AnonymizeUserIdHelp') + }, null, 8, ["title", "modelValue", "inline-help"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_16, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_17, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", _hoisted_18, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_UnsetVisitColumns')), 1), (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.selectedVisitColumns, function (visitColumn, index) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])("selectedVisitColumns selectedVisitColumns".concat(index, " multiple valign-wrapper")), + key: index + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_19, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "select", + name: "visit_columns", + "model-value": visitColumn.column, + "onUpdate:modelValue": function onUpdateModelValue($event) { + visitColumn.column = $event; + + _ctx.onVisitColumnChange(); + }, + "full-width": true, + options: _ctx.availableVisitColumns + }, null, 8, ["model-value", "onUpdate:modelValue", "options"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-minus valign", + onClick: function onClick($event) { + return _ctx.removeVisitColumn(index); + }, + title: _ctx.translate('General_Remove') + }, null, 8, _hoisted_20), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], index + 1 !== _ctx.selectedVisitColumns.length]])], 2); + }), 128))])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_21, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_22, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_23, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_UnsetVisitColumnsHelp')), 1)])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_24, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_25, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Action')), 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_26, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_27, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", _hoisted_28, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_UnsetActionColumns')), 1), (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.selectedActionColumns, function (actionColumn, index) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])("selectedActionColumns selectedActionColumns".concat(index, " multiple valign-wrapper")), + key: index + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_29, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "select", + name: "action_columns", + "model-value": actionColumn.column, + "onUpdate:modelValue": function onUpdateModelValue($event) { + actionColumn.column = $event; + + _ctx.onActionColumnChange(); + }, + "full-width": true, + options: _ctx.availableActionColumns + }, null, 8, ["model-value", "onUpdate:modelValue", "options"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-minus valign", + onClick: function onClick($event) { + return _ctx.removeActionColumn(index); + }, + title: _ctx.translate('General_Remove') + }, null, 8, _hoisted_30), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], index + 1 !== _ctx.selectedActionColumns.length]])], 2); + }), 128))])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_31, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_32, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_33, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_UnsetActionColumnsHelp')), 1)])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [_hoisted_34, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_AnonymizeProcessInfo')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SaveButton, { + class: "anonymizePastData", + onConfirm: _cache[8] || (_cache[8] = function ($event) { + return _ctx.scheduleAnonymization(); + }), + disabled: _ctx.isAnonymizePastDataDisabled, + value: _ctx.translate('PrivacyManager_AnonymizeDataNow') + }, null, 8, ["disabled", "value"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_35, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_AnonymizeDataConfirm')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + role: "yes", + type: "button", + value: _ctx.translate('General_Yes') + }, null, 8, _hoisted_36), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + role: "no", + type: "button", + value: _ctx.translate('General_No') + }, null, 8, _hoisted_37)], 512)]); +} +// CONCATENATED MODULE: ./plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.vue?vue&type=template&id=bdf32a0e + +// 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/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.vue?vue&type=script&lang=ts + + + + +function sub(value) { + if (value < 10) { + return "0".concat(value); + } + + return value; +} + +/* harmony default export */ var AnonymizeLogDatavue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + components: { + SiteSelector: external_CoreHome_["SiteSelector"], + Field: external_CorePluginsAdmin_["Field"], + SaveButton: external_CorePluginsAdmin_["SaveButton"] + }, + data: function data() { + var now = new Date(); + var startDate = "".concat(now.getFullYear(), "-").concat(sub(now.getMonth() + 1), "-").concat(sub(now.getDay() + 1)); + return { + isLoading: false, + isDeleting: false, + anonymizeIp: false, + anonymizeLocation: false, + anonymizeUserId: false, + site: { + id: 'all', + name: 'All Websites' + }, + availableVisitColumns: [], + availableActionColumns: [], + selectedVisitColumns: [{ + column: '' + }], + selectedActionColumns: [{ + column: '' + }], + startDate: startDate, + endDate: startDate + }; + }, + created: function created() { + var _this = this; + + this.onKeydownStartDate = Object(external_CoreHome_["debounce"])(this.onKeydownStartDate, 50); + this.onKeydownEndDate = Object(external_CoreHome_["debounce"])(this.onKeydownEndDate, 50); + external_CoreHome_["AjaxHelper"].fetch({ + method: 'PrivacyManager.getAvailableVisitColumnsToAnonymize' + }).then(function (columns) { + _this.availableVisitColumns = []; + columns.forEach(function (column) { + _this.availableVisitColumns.push({ + key: column.column_name, + value: column.column_name + }); + }); + }); + external_CoreHome_["AjaxHelper"].fetch({ + method: 'PrivacyManager.getAvailableLinkVisitActionColumnsToAnonymize' + }).then(function (columns) { + _this.availableActionColumns = []; + columns.forEach(function (column) { + _this.availableActionColumns.push({ + key: column.column_name, + value: column.column_name + }); + }); + }); + setTimeout(function () { + var options1 = external_CoreHome_["Matomo"].getBaseDatePickerOptions(null); + var options2 = external_CoreHome_["Matomo"].getBaseDatePickerOptions(null); + $(_this.$refs.anonymizeStartDate).datepicker(options1); + $(_this.$refs.anonymizeEndDate).datepicker(options2); + }); + }, + methods: { + onVisitColumnChange: function onVisitColumnChange() { + var hasAll = this.selectedVisitColumns.every(function (col) { + return !!(col !== null && col !== void 0 && col.column); + }); + + if (hasAll) { + this.addVisitColumn(); + } + }, + addVisitColumn: function addVisitColumn() { + this.selectedVisitColumns.push({ + column: '' + }); + }, + removeVisitColumn: function removeVisitColumn(index) { + if (index > -1) { + var lastIndex = this.selectedVisitColumns.length - 1; + + if (lastIndex === index) { + this.selectedVisitColumns[index] = { + column: '' + }; + } else { + this.selectedVisitColumns.splice(index, 1); + } + } + }, + onActionColumnChange: function onActionColumnChange() { + var hasAll = this.selectedActionColumns.every(function (col) { + return !!(col !== null && col !== void 0 && col.column); + }); + + if (hasAll) { + this.addActionColumn(); + } + }, + addActionColumn: function addActionColumn() { + this.selectedActionColumns.push({ + column: '' + }); + }, + removeActionColumn: function removeActionColumn(index) { + if (index > -1) { + var lastIndex = this.selectedActionColumns.length - 1; + + if (lastIndex === index) { + this.selectedActionColumns[index] = { + column: '' + }; + } else { + this.selectedActionColumns.splice(index, 1); + } + } + }, + scheduleAnonymization: function scheduleAnonymization() { + var date = "".concat(this.startDate, ",").concat(this.endDate); + + if (this.startDate === this.endDate) { + date = this.startDate; + } + + var params = { + date: date + }; + params.idSites = this.site.id; + params.anonymizeIp = this.anonymizeIp ? '1' : '0'; + params.anonymizeLocation = this.anonymizeLocation ? '1' : '0'; + params.anonymizeUserId = this.anonymizeUserId ? '1' : '0'; + params.unsetVisitColumns = this.selectedVisitColumns.filter(function (c) { + return !!(c !== null && c !== void 0 && c.column); + }).map(function (c) { + return c.column; + }); + params.unsetLinkVisitActionColumns = this.selectedActionColumns.filter(function (c) { + return !!(c !== null && c !== void 0 && c.column); + }).map(function (c) { + return c.column; + }); + external_CoreHome_["Matomo"].helper.modalConfirm(this.$refs.confirmAnonymizeLogData, { + yes: function yes() { + external_CoreHome_["AjaxHelper"].post({ + method: 'PrivacyManager.anonymizeSomeRawData' + }, params).then(function () { + window.location.reload(true); + }); + } + }); + }, + onKeydownStartDate: function onKeydownStartDate(event) { + this.startDate = event.target.value; + }, + onKeydownEndDate: function onKeydownEndDate(event) { + this.endDate = event.target.value; + } + }, + computed: { + isAnonymizePastDataDisabled: function isAnonymizePastDataDisabled() { + return !this.anonymizeIp && !this.anonymizeLocation && !this.selectedVisitColumns && !this.selectedActionColumns; + } + } +})); +// CONCATENATED MODULE: ./plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.vue + + + +AnonymizeLogDatavue_type_script_lang_ts.render = AnonymizeLogDatavue_type_template_id_bdf32a0e_render + +/* harmony default export */ var AnonymizeLogData = (AnonymizeLogDatavue_type_script_lang_ts); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/PrivacyManager/vue/src/DoNotTrackPreference/DoNotTrackPreference.vue?vue&type=template&id=0506d6be function DoNotTrackPreferencevue_type_template_id_0506d6be_render(_ctx, _cache, $props, $setup, $data, $options) { @@ -465,6 +898,7 @@ DoNotTrackPreferencevue_type_script_lang_ts.render = DoNotTrackPreferencevue_typ */ + // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js diff --git a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.min.js b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.min.js index cc86b2a4d1..d254c575bb 100644 --- a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.min.js +++ b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.min.js @@ -1,4 +1,4 @@ -(function(e,n){"object"===typeof exports&&"object"===typeof module?module.exports=n(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],n):"object"===typeof exports?exports["PrivacyManager"]=n(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["PrivacyManager"]=n(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,n,t){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="plugins/PrivacyManager/vue/dist/",t(t.s="fae3")}({"19dc":function(n,t){n.exports=e},"8bbf":function(e,t){e.exports=n},a5a2:function(e,n){e.exports=t},fae3:function(e,n,t){"use strict";if(t.r(n),t.d(n,"AnonymizeIp",(function(){return g})),t.d(n,"DoNotTrackPreference",(function(){return j})),"undefined"!==typeof window){var r=window.document.currentScript,o=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(t.p=o[1])}var i=t("8bbf"),a=Object(i["createElementVNode"])("br",null,null,-1),l=Object(i["createElementVNode"])("br",null,null,-1),c=Object(i["createElementVNode"])("br",null,null,-1),s=Object(i["createElementVNode"])("br",null,null,-1),u={key:0},d=Object(i["createElementVNode"])("br",null,null,-1),m=Object(i["createElementVNode"])("br",null,null,-1),p={class:"alert-warning alert"};function y(e,n,t,r,o,y){var b=Object(i["resolveComponent"])("Field"),f=Object(i["resolveComponent"])("SaveButton"),v=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"checkbox",name:"anonymizeIpSettings",title:e.translate("PrivacyManager_UseAnonymizeIp"),modelValue:e.actualEnabled,"onUpdate:modelValue":n[0]||(n[0]=function(n){return e.actualEnabled=n}),"inline-help":e.anonymizeIpEnabledHelp},null,8,["title","modelValue","inline-help"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"radio",name:"maskLength",title:e.translate("PrivacyManager_AnonymizeIpMaskLengtDescription"),modelValue:e.actualMaskLength,"onUpdate:modelValue":n[1]||(n[1]=function(n){return e.actualMaskLength=n}),options:e.maskLengthOptions,"inline-help":e.translate("PrivacyManager_GeolocationAnonymizeIpNote")},null,8,["title","modelValue","options","inline-help"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"radio",name:"useAnonymizedIpForVisitEnrichment",title:e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichment"),modelValue:e.actualUseAnonymizedIpForVisitEnrichment,"onUpdate:modelValue":n[2]||(n[2]=function(n){return e.actualUseAnonymizedIpForVisitEnrichment=n}),options:e.useAnonymizedIpForVisitEnrichmentOptions,"inline-help":e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichmentNote")},null,8,["title","modelValue","options","inline-help"])])],512),[[i["vShow"],e.actualEnabled]]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"checkbox",name:"anonymizeUserId",title:e.translate("PrivacyManager_PseudonymizeUserId"),modelValue:e.actualAnonymizeUserId,"onUpdate:modelValue":n[3]||(n[3]=function(n){return e.actualAnonymizeUserId=n})},{"inline-help":Object(i["withCtx"])((function(){return[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote"))+" ",1),a,l,Object(i["createElementVNode"])("em",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote2")),1)]})),_:1},8,["title","modelValue"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"checkbox",name:"anonymizeOrderId",title:e.translate("PrivacyManager_UseAnonymizeOrderId"),modelValue:e.actualAnonymizeOrderId,"onUpdate:modelValue":n[4]||(n[4]=function(n){return e.actualAnonymizeOrderId=n}),"inline-help":e.translate("PrivacyManager_AnonymizeOrderIdNote")},null,8,["title","modelValue","inline-help"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"checkbox",name:"forceCookielessTracking",title:e.translate("PrivacyManager_ForceCookielessTracking"),modelValue:e.actualForceCookielessTracking,"onUpdate:modelValue":n[5]||(n[5]=function(n){return e.actualForceCookielessTracking=n})},{"inline-help":Object(i["withCtx"])((function(){return[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription",e.trackerFileName))+" ",1),c,s,Object(i["createElementVNode"])("em",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription2")),1),e.trackerWritable?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",u,[d,m,Object(i["createElementVNode"])("p",p,Object(i["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescriptionNotWritable",e.trackerFileName)),1)]))]})),_:1},8,["title","modelValue"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"select",name:"anonymizeReferrer",title:e.translate("PrivacyManager_AnonymizeReferrer"),modelValue:e.actualAnonymizeReferrer,"onUpdate:modelValue":n[6]||(n[6]=function(n){return e.actualAnonymizeReferrer=n}),options:e.referrerAnonymizationOptions,"inline-help":e.translate("PrivacyManager_AnonymizeReferrerNote")},null,8,["title","modelValue","options","inline-help"])]),Object(i["createVNode"])(f,{onConfirm:n[7]||(n[7]=function(n){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[v]])}var b=t("19dc"),f=t("a5a2"),v=Object(i["defineComponent"])({props:{anonymizeIpEnabled:Boolean,anonymizeUserId:Boolean,maskLength:{type:Number,required:!0},useAnonymizedIpForVisitEnrichment:Boolean,anonymizeOrderId:Boolean,forceCookielessTracking:Boolean,anonymizeReferrer:String,maskLengthOptions:{type:Array,required:!0},useAnonymizedIpForVisitEnrichmentOptions:{type:Array,required:!0},trackerFileName:{type:String,required:!0},trackerWritable:{type:Boolean,required:!0},referrerAnonymizationOptions:{type:Object,required:!0}},components:{Field:f["Field"],SaveButton:f["SaveButton"]},directives:{Form:f["Form"]},data:function(){return{isLoading:!1,actualEnabled:!!this.anonymizeIpEnabled,actualMaskLength:this.maskLength,actualUseAnonymizedIpForVisitEnrichment:this.useAnonymizedIpForVisitEnrichment?"1":"0",actualAnonymizeUserId:!!this.anonymizeUserId,actualAnonymizeOrderId:!!this.anonymizeOrderId,actualForceCookielessTracking:!!this.forceCookielessTracking,actualAnonymizeReferrer:this.anonymizeReferrer}},methods:{save:function(){var e=this;this.isLoading=!0,b["AjaxHelper"].post({module:"API",method:"PrivacyManager.setAnonymizeIpSettings"},{anonymizeIPEnable:this.actualEnabled?"1":"0",anonymizeUserId:this.actualAnonymizeUserId?"1":"0",anonymizeOrderId:this.actualAnonymizeOrderId?"1":"0",forceCookielessTracking:this.actualForceCookielessTracking?"1":"0",anonymizeReferrer:this.actualAnonymizeReferrer?this.actualAnonymizeReferrer:"",maskLength:this.actualMaskLength,useAnonymizedIpForVisitEnrichment:this.actualUseAnonymizedIpForVisitEnrichment?"1":"0"}).then((function(){var e=b["NotificationsStore"].show({message:Object(b["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"toast"});b["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}},computed:{anonymizeIpEnabledHelp:function(){var e=Object(b["translate"])("PrivacyManager_AnonymizeIpInlineHelp"),n=Object(b["translate"])("PrivacyManager_AnonymizeIpDescription");return"".concat(e," ").concat(n)}}});v.render=y;var g=v;function O(e,n,t,r,o,a){var l=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton"),s=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{uicontrol:"radio",name:"doNotTrack",modelValue:e.enabled,"onUpdate:modelValue":n[0]||(n[0]=function(n){return e.enabled=n}),options:e.doNotTrackOptions,"inline-help":e.translate("PrivacyManager_DoNotTrack_Description")},null,8,["modelValue","options","inline-help"])]),Object(i["createVNode"])(c,{onConfirm:n[1]||(n[1]=function(n){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}var h=Object(i["defineComponent"])({props:{dntSupport:Boolean,doNotTrackOptions:{type:Array,required:!0}},components:{Field:f["Field"],SaveButton:f["SaveButton"]},directives:{Form:f["Form"]},data:function(){return{isLoading:!1,enabled:this.dntSupport?1:0}},methods:{save:function(){var e=this;this.isLoading=!0;var n="deactivateDoNotTrack";this.enabled&&"0"!==this.enabled&&(n="activateDoNotTrack"),b["AjaxHelper"].post({module:"API",method:"PrivacyManager.".concat(n)}).then((function(){var e=b["NotificationsStore"].show({message:Object(b["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"transient"});b["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}}});h.render=O;var j=h; +(function(e,n){"object"===typeof exports&&"object"===typeof module?module.exports=n(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],n):"object"===typeof exports?exports["PrivacyManager"]=n(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["PrivacyManager"]=n(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,n,t){return function(e){var n={};function t(o){if(n[o])return n[o].exports;var a=n[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},t.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var a in e)t.d(o,a,function(n){return e[n]}.bind(null,a));return o},t.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="plugins/PrivacyManager/vue/dist/",t(t.s="fae3")}({"19dc":function(n,t){n.exports=e},"8bbf":function(e,t){e.exports=n},a5a2:function(e,n){e.exports=t},fae3:function(e,n,t){"use strict";if(t.r(n),t.d(n,"AnonymizeIp",(function(){return O})),t.d(n,"AnonymizeLogData",(function(){return le})),t.d(n,"DoNotTrackPreference",(function(){return se})),"undefined"!==typeof window){var o=window.document.currentScript,a=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(t.p=a[1])}var i=t("8bbf"),l=Object(i["createElementVNode"])("br",null,null,-1),r=Object(i["createElementVNode"])("br",null,null,-1),c=Object(i["createElementVNode"])("br",null,null,-1),s=Object(i["createElementVNode"])("br",null,null,-1),u={key:0},m=Object(i["createElementVNode"])("br",null,null,-1),d=Object(i["createElementVNode"])("br",null,null,-1),p={class:"alert-warning alert"};function y(e,n,t,o,a,y){var b=Object(i["resolveComponent"])("Field"),v=Object(i["resolveComponent"])("SaveButton"),f=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"checkbox",name:"anonymizeIpSettings",title:e.translate("PrivacyManager_UseAnonymizeIp"),modelValue:e.actualEnabled,"onUpdate:modelValue":n[0]||(n[0]=function(n){return e.actualEnabled=n}),"inline-help":e.anonymizeIpEnabledHelp},null,8,["title","modelValue","inline-help"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"radio",name:"maskLength",title:e.translate("PrivacyManager_AnonymizeIpMaskLengtDescription"),modelValue:e.actualMaskLength,"onUpdate:modelValue":n[1]||(n[1]=function(n){return e.actualMaskLength=n}),options:e.maskLengthOptions,"inline-help":e.translate("PrivacyManager_GeolocationAnonymizeIpNote")},null,8,["title","modelValue","options","inline-help"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"radio",name:"useAnonymizedIpForVisitEnrichment",title:e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichment"),modelValue:e.actualUseAnonymizedIpForVisitEnrichment,"onUpdate:modelValue":n[2]||(n[2]=function(n){return e.actualUseAnonymizedIpForVisitEnrichment=n}),options:e.useAnonymizedIpForVisitEnrichmentOptions,"inline-help":e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichmentNote")},null,8,["title","modelValue","options","inline-help"])])],512),[[i["vShow"],e.actualEnabled]]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"checkbox",name:"anonymizeUserId",title:e.translate("PrivacyManager_PseudonymizeUserId"),modelValue:e.actualAnonymizeUserId,"onUpdate:modelValue":n[3]||(n[3]=function(n){return e.actualAnonymizeUserId=n})},{"inline-help":Object(i["withCtx"])((function(){return[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote"))+" ",1),l,r,Object(i["createElementVNode"])("em",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote2")),1)]})),_:1},8,["title","modelValue"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"checkbox",name:"anonymizeOrderId",title:e.translate("PrivacyManager_UseAnonymizeOrderId"),modelValue:e.actualAnonymizeOrderId,"onUpdate:modelValue":n[4]||(n[4]=function(n){return e.actualAnonymizeOrderId=n}),"inline-help":e.translate("PrivacyManager_AnonymizeOrderIdNote")},null,8,["title","modelValue","inline-help"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"checkbox",name:"forceCookielessTracking",title:e.translate("PrivacyManager_ForceCookielessTracking"),modelValue:e.actualForceCookielessTracking,"onUpdate:modelValue":n[5]||(n[5]=function(n){return e.actualForceCookielessTracking=n})},{"inline-help":Object(i["withCtx"])((function(){return[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription",e.trackerFileName))+" ",1),c,s,Object(i["createElementVNode"])("em",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription2")),1),e.trackerWritable?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",u,[m,d,Object(i["createElementVNode"])("p",p,Object(i["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescriptionNotWritable",e.trackerFileName)),1)]))]})),_:1},8,["title","modelValue"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(b,{uicontrol:"select",name:"anonymizeReferrer",title:e.translate("PrivacyManager_AnonymizeReferrer"),modelValue:e.actualAnonymizeReferrer,"onUpdate:modelValue":n[6]||(n[6]=function(n){return e.actualAnonymizeReferrer=n}),options:e.referrerAnonymizationOptions,"inline-help":e.translate("PrivacyManager_AnonymizeReferrerNote")},null,8,["title","modelValue","options","inline-help"])]),Object(i["createVNode"])(v,{onConfirm:n[7]||(n[7]=function(n){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[f]])}var b=t("19dc"),v=t("a5a2"),f=Object(i["defineComponent"])({props:{anonymizeIpEnabled:Boolean,anonymizeUserId:Boolean,maskLength:{type:Number,required:!0},useAnonymizedIpForVisitEnrichment:Boolean,anonymizeOrderId:Boolean,forceCookielessTracking:Boolean,anonymizeReferrer:String,maskLengthOptions:{type:Array,required:!0},useAnonymizedIpForVisitEnrichmentOptions:{type:Array,required:!0},trackerFileName:{type:String,required:!0},trackerWritable:{type:Boolean,required:!0},referrerAnonymizationOptions:{type:Object,required:!0}},components:{Field:v["Field"],SaveButton:v["SaveButton"]},directives:{Form:v["Form"]},data:function(){return{isLoading:!1,actualEnabled:!!this.anonymizeIpEnabled,actualMaskLength:this.maskLength,actualUseAnonymizedIpForVisitEnrichment:this.useAnonymizedIpForVisitEnrichment?"1":"0",actualAnonymizeUserId:!!this.anonymizeUserId,actualAnonymizeOrderId:!!this.anonymizeOrderId,actualForceCookielessTracking:!!this.forceCookielessTracking,actualAnonymizeReferrer:this.anonymizeReferrer}},methods:{save:function(){var e=this;this.isLoading=!0,b["AjaxHelper"].post({module:"API",method:"PrivacyManager.setAnonymizeIpSettings"},{anonymizeIPEnable:this.actualEnabled?"1":"0",anonymizeUserId:this.actualAnonymizeUserId?"1":"0",anonymizeOrderId:this.actualAnonymizeOrderId?"1":"0",forceCookielessTracking:this.actualForceCookielessTracking?"1":"0",anonymizeReferrer:this.actualAnonymizeReferrer?this.actualAnonymizeReferrer:"",maskLength:this.actualMaskLength,useAnonymizedIpForVisitEnrichment:this.actualUseAnonymizedIpForVisitEnrichment?"1":"0"}).then((function(){var e=b["NotificationsStore"].show({message:Object(b["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"toast"});b["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}},computed:{anonymizeIpEnabledHelp:function(){var e=Object(b["translate"])("PrivacyManager_AnonymizeIpInlineHelp"),n=Object(b["translate"])("PrivacyManager_AnonymizeIpDescription");return"".concat(e," ").concat(n)}}});f.render=y;var O=f,h={class:"anonymizeLogData"},V={class:"form-group row"},j={class:"col s12 input-field"},g={for:"anonymizeSite",class:"siteSelectorLabel"},z={class:"sites_autocomplete"},N={class:"form-group row"},A={class:"col s6 input-field"},E={for:"anonymizeStartDate",class:"active"},C=["value"],k={class:"col s6 input-field"},D={for:"anonymizeEndDate",class:"active"},S=["value"],I={name:"anonymizeIp"},P={name:"anonymizeLocation"},_={name:"anonymizeTheUserId"},M={class:"form-group row"},w={class:"col s12 m6"},U={for:"visit_columns"},F={class:"innerFormField",name:"visit_columns"},L=["onClick","title"],B={class:"col s12 m6"},x={class:"form-help"},T={class:"inline-help"},H={class:"form-group row"},R={class:"col s12"},q={class:"form-group row"},K={class:"col s12 m6"},G={for:"action_columns"},W={class:"innerFormField",name:"action_columns"},Y=["onClick","title"],J={class:"col s12 m6"},Q={class:"form-help"},X={class:"inline-help"},Z=Object(i["createElementVNode"])("span",{class:"icon-info"},null,-1),ee={class:"ui-confirm",id:"confirmAnonymizeLogData",ref:"confirmAnonymizeLogData"},ne=["value"],te=["value"];function oe(e,n,t,o,a,l){var r=Object(i["resolveComponent"])("SiteSelector"),c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SaveButton");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",h,[Object(i["createElementVNode"])("div",V,[Object(i["createElementVNode"])("div",j,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",g,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeSites")),1),Object(i["createElementVNode"])("div",z,[Object(i["createVNode"])(r,{id:"anonymizeSite",modelValue:e.site,"onUpdate:modelValue":n[0]||(n[0]=function(n){return e.site=n}),"show-all-sites-item":!0,"switch-site-on-select":!1,"show-selected-site":!0},null,8,["modelValue"])])])])]),Object(i["createElementVNode"])("div",N,[Object(i["createElementVNode"])("div",A,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",E,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeRowDataFrom")),1),Object(i["createElementVNode"])("input",{type:"text",id:"anonymizeStartDate",class:"anonymizeStartDate",ref:"anonymizeStartDate",name:"anonymizeStartDate",value:e.startDate,onKeydown:n[1]||(n[1]=function(n){return e.onKeydownStartDate(n)}),onChange:n[2]||(n[2]=function(n){return e.onKeydownStartDate(n)})},null,40,C)])]),Object(i["createElementVNode"])("div",k,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",D,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeRowDataTo")),1),Object(i["createElementVNode"])("input",{type:"text",class:"anonymizeEndDate",id:"anonymizeEndDate",ref:"anonymizeEndDate",name:"anonymizeEndDate",value:e.endDate,onKeydown:n[3]||(n[3]=function(n){return e.onKeydownEndDate(n)}),onChange:n[4]||(n[4]=function(n){return e.onKeydownEndDate(n)})},null,40,S)])])]),Object(i["createElementVNode"])("div",I,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeIp",title:e.translate("PrivacyManager_AnonymizeIp"),modelValue:e.anonymizeIp,"onUpdate:modelValue":n[5]||(n[5]=function(n){return e.anonymizeIp=n}),introduction:e.translate("General_Visit"),"inline-help":e.translate("PrivacyManager_AnonymizeIpHelp")},null,8,["title","modelValue","introduction","inline-help"])]),Object(i["createElementVNode"])("div",P,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeLocation",title:e.translate("PrivacyManager_AnonymizeLocation"),modelValue:e.anonymizeLocation,"onUpdate:modelValue":n[6]||(n[6]=function(n){return e.anonymizeLocation=n}),"inline-help":e.translate("PrivacyManager_AnonymizeLocationHelp")},null,8,["title","modelValue","inline-help"])]),Object(i["createElementVNode"])("div",_,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeTheUserId",title:e.translate("PrivacyManager_AnonymizeUserId"),modelValue:e.anonymizeUserId,"onUpdate:modelValue":n[7]||(n[7]=function(n){return e.anonymizeUserId=n}),"inline-help":e.translate("PrivacyManager_AnonymizeUserIdHelp")},null,8,["title","modelValue","inline-help"])]),Object(i["createElementVNode"])("div",M,[Object(i["createElementVNode"])("div",w,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",U,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumns")),1),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.selectedVisitColumns,(function(n,t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])("selectedVisitColumns selectedVisitColumns".concat(t," multiple valign-wrapper")),key:t},[Object(i["createElementVNode"])("div",F,[Object(i["createVNode"])(c,{uicontrol:"select",name:"visit_columns","model-value":n.column,"onUpdate:modelValue":function(t){n.column=t,e.onVisitColumnChange()},"full-width":!0,options:e.availableVisitColumns},null,8,["model-value","onUpdate:modelValue","options"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(n){return e.removeVisitColumn(t)},title:e.translate("General_Remove")},null,8,L),[[i["vShow"],t+1!==e.selectedVisitColumns.length]])],2)})),128))])]),Object(i["createElementVNode"])("div",B,[Object(i["createElementVNode"])("div",x,[Object(i["createElementVNode"])("span",T,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumnsHelp")),1)])])]),Object(i["createElementVNode"])("div",H,[Object(i["createElementVNode"])("div",R,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("General_Action")),1)])]),Object(i["createElementVNode"])("div",q,[Object(i["createElementVNode"])("div",K,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",G,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumns")),1),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.selectedActionColumns,(function(n,t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])("selectedActionColumns selectedActionColumns".concat(t," multiple valign-wrapper")),key:t},[Object(i["createElementVNode"])("div",W,[Object(i["createVNode"])(c,{uicontrol:"select",name:"action_columns","model-value":n.column,"onUpdate:modelValue":function(t){n.column=t,e.onActionColumnChange()},"full-width":!0,options:e.availableActionColumns},null,8,["model-value","onUpdate:modelValue","options"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(n){return e.removeActionColumn(t)},title:e.translate("General_Remove")},null,8,Y),[[i["vShow"],t+1!==e.selectedActionColumns.length]])],2)})),128))])]),Object(i["createElementVNode"])("div",J,[Object(i["createElementVNode"])("div",Q,[Object(i["createElementVNode"])("span",X,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumnsHelp")),1)])])]),Object(i["createElementVNode"])("p",null,[Z,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeProcessInfo")),1)]),Object(i["createVNode"])(s,{class:"anonymizePastData",onConfirm:n[8]||(n[8]=function(n){return e.scheduleAnonymization()}),disabled:e.isAnonymizePastDataDisabled,value:e.translate("PrivacyManager_AnonymizeDataNow")},null,8,["disabled","value"]),Object(i["createElementVNode"])("div",ee,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeDataConfirm")),1),Object(i["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,ne),Object(i["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,te)],512)])}function ae(e){return e<10?"0".concat(e):e}var ie=Object(i["defineComponent"])({components:{SiteSelector:b["SiteSelector"],Field:v["Field"],SaveButton:v["SaveButton"]},data:function(){var e=new Date,n="".concat(e.getFullYear(),"-").concat(ae(e.getMonth()+1),"-").concat(ae(e.getDay()+1));return{isLoading:!1,isDeleting:!1,anonymizeIp:!1,anonymizeLocation:!1,anonymizeUserId:!1,site:{id:"all",name:"All Websites"},availableVisitColumns:[],availableActionColumns:[],selectedVisitColumns:[{column:""}],selectedActionColumns:[{column:""}],startDate:n,endDate:n}},created:function(){var e=this;this.onKeydownStartDate=Object(b["debounce"])(this.onKeydownStartDate,50),this.onKeydownEndDate=Object(b["debounce"])(this.onKeydownEndDate,50),b["AjaxHelper"].fetch({method:"PrivacyManager.getAvailableVisitColumnsToAnonymize"}).then((function(n){e.availableVisitColumns=[],n.forEach((function(n){e.availableVisitColumns.push({key:n.column_name,value:n.column_name})}))})),b["AjaxHelper"].fetch({method:"PrivacyManager.getAvailableLinkVisitActionColumnsToAnonymize"}).then((function(n){e.availableActionColumns=[],n.forEach((function(n){e.availableActionColumns.push({key:n.column_name,value:n.column_name})}))})),setTimeout((function(){var n=b["Matomo"].getBaseDatePickerOptions(null),t=b["Matomo"].getBaseDatePickerOptions(null);$(e.$refs.anonymizeStartDate).datepicker(n),$(e.$refs.anonymizeEndDate).datepicker(t)}))},methods:{onVisitColumnChange:function(){var e=this.selectedVisitColumns.every((function(e){return!(null===e||void 0===e||!e.column)}));e&&this.addVisitColumn()},addVisitColumn:function(){this.selectedVisitColumns.push({column:""})},removeVisitColumn:function(e){if(e>-1){var n=this.selectedVisitColumns.length-1;n===e?this.selectedVisitColumns[e]={column:""}:this.selectedVisitColumns.splice(e,1)}},onActionColumnChange:function(){var e=this.selectedActionColumns.every((function(e){return!(null===e||void 0===e||!e.column)}));e&&this.addActionColumn()},addActionColumn:function(){this.selectedActionColumns.push({column:""})},removeActionColumn:function(e){if(e>-1){var n=this.selectedActionColumns.length-1;n===e?this.selectedActionColumns[e]={column:""}:this.selectedActionColumns.splice(e,1)}},scheduleAnonymization:function(){var e="".concat(this.startDate,",").concat(this.endDate);this.startDate===this.endDate&&(e=this.startDate);var n={date:e};n.idSites=this.site.id,n.anonymizeIp=this.anonymizeIp?"1":"0",n.anonymizeLocation=this.anonymizeLocation?"1":"0",n.anonymizeUserId=this.anonymizeUserId?"1":"0",n.unsetVisitColumns=this.selectedVisitColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),n.unsetLinkVisitActionColumns=this.selectedActionColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),b["Matomo"].helper.modalConfirm(this.$refs.confirmAnonymizeLogData,{yes:function(){b["AjaxHelper"].post({method:"PrivacyManager.anonymizeSomeRawData"},n).then((function(){window.location.reload(!0)}))}})},onKeydownStartDate:function(e){this.startDate=e.target.value},onKeydownEndDate:function(e){this.endDate=e.target.value}},computed:{isAnonymizePastDataDisabled:function(){return!this.anonymizeIp&&!this.anonymizeLocation&&!this.selectedVisitColumns&&!this.selectedActionColumns}}});ie.render=oe;var le=ie;function re(e,n,t,o,a,l){var r=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton"),s=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"radio",name:"doNotTrack",modelValue:e.enabled,"onUpdate:modelValue":n[0]||(n[0]=function(n){return e.enabled=n}),options:e.doNotTrackOptions,"inline-help":e.translate("PrivacyManager_DoNotTrack_Description")},null,8,["modelValue","options","inline-help"])]),Object(i["createVNode"])(c,{onConfirm:n[1]||(n[1]=function(n){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}var ce=Object(i["defineComponent"])({props:{dntSupport:Boolean,doNotTrackOptions:{type:Array,required:!0}},components:{Field:v["Field"],SaveButton:v["SaveButton"]},directives:{Form:v["Form"]},data:function(){return{isLoading:!1,enabled:this.dntSupport?1:0}},methods:{save:function(){var e=this;this.isLoading=!0;var n="deactivateDoNotTrack";this.enabled&&"0"!==this.enabled&&(n="activateDoNotTrack"),b["AjaxHelper"].post({module:"API",method:"PrivacyManager.".concat(n)}).then((function(){var e=b["NotificationsStore"].show({message:Object(b["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"transient"});b["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}}});ce.render=re;var se=ce; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.adapter.ts b/plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.adapter.ts new file mode 100644 index 0000000000..63402964f7 --- /dev/null +++ b/plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.adapter.ts @@ -0,0 +1,14 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { createAngularJsAdapter } from 'CoreHome'; +import AnonymizeLogData from './AnonymizeLogData.vue'; + +export default createAngularJsAdapter({ + component: AnonymizeLogData, + directiveName: 'matomoAnonymizeLogData', +}); diff --git a/plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.directive.less b/plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.less index 2bc7410a2c..2bc7410a2c 100644 --- a/plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.directive.less +++ b/plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.less diff --git a/plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.vue b/plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.vue new file mode 100644 index 0000000000..f98122e9d2 --- /dev/null +++ b/plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.vue @@ -0,0 +1,389 @@ +<!-- + Matomo - free/libre analytics platform + @link https://matomo.org + @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later +--> + +<template> + <div class="anonymizeLogData"> + <div class="form-group row"> + <div class="col s12 input-field"> + <div> + <label + for="anonymizeSite" + class="siteSelectorLabel" + >{{ translate('PrivacyManager_AnonymizeSites') }}</label> + <div class="sites_autocomplete"> + <SiteSelector + id="anonymizeSite" + v-model="site" + :show-all-sites-item="true" + :switch-site-on-select="false" + :show-selected-site="true" + /> + </div> + </div> + </div> + </div> + <div class="form-group row"> + <div class="col s6 input-field"> + <div> + <label + for="anonymizeStartDate" + class="active" + >{{ translate('PrivacyManager_AnonymizeRowDataFrom') }}</label> + <input + type="text" + id="anonymizeStartDate" + class="anonymizeStartDate" + ref="anonymizeStartDate" + name="anonymizeStartDate" + :value="startDate" + @keydown="onKeydownStartDate($event)" + @change="onKeydownStartDate($event)" + /> + </div> + </div> + <div class="col s6 input-field"> + <div> + <label + for="anonymizeEndDate" + class="active" + >{{ translate('PrivacyManager_AnonymizeRowDataTo') }}</label> + <input + type="text" + class="anonymizeEndDate" + id="anonymizeEndDate" + ref="anonymizeEndDate" + name="anonymizeEndDate" + :value="endDate" + @keydown="onKeydownEndDate($event)" + @change="onKeydownEndDate($event)" + /> + </div> + </div> + </div> + <div name="anonymizeIp"> + <Field + uicontrol="checkbox" + name="anonymizeIp" + :title="translate('PrivacyManager_AnonymizeIp')" + v-model="anonymizeIp" + :introduction="translate('General_Visit')" + :inline-help="translate('PrivacyManager_AnonymizeIpHelp')" + > + </Field> + </div> + <div name="anonymizeLocation"> + <Field + uicontrol="checkbox" + name="anonymizeLocation" + :title="translate('PrivacyManager_AnonymizeLocation')" + v-model="anonymizeLocation" + :inline-help="translate('PrivacyManager_AnonymizeLocationHelp')" + > + </Field> + </div> + <div name="anonymizeTheUserId"> + <Field + uicontrol="checkbox" + name="anonymizeTheUserId" + :title="translate('PrivacyManager_AnonymizeUserId')" + v-model="anonymizeUserId" + :inline-help="translate('PrivacyManager_AnonymizeUserIdHelp')" + > + </Field> + </div> + <div class="form-group row"> + <div class="col s12 m6"> + <div> + <label for="visit_columns">{{ translate('PrivacyManager_UnsetVisitColumns') }}</label> + <div + :class="`selectedVisitColumns selectedVisitColumns${index} multiple valign-wrapper`" + v-for="(visitColumn, index) in selectedVisitColumns" + :key="index" + > + <div class="innerFormField" name="visit_columns"> + <Field + uicontrol="select" + name="visit_columns" + :model-value="visitColumn.column" + @update:model-value="visitColumn.column = $event; onVisitColumnChange()" + :full-width="true" + :options="availableVisitColumns" + > + </Field> + </div> + <span + class="icon-minus valign" + @click="removeVisitColumn(index)" + v-show="index + 1 !== selectedVisitColumns.length" + :title="translate('General_Remove')" + /> + </div> + </div> + </div> + <div class="col s12 m6"> + <div class="form-help"> + <span class="inline-help">{{ translate('PrivacyManager_UnsetVisitColumnsHelp') }}</span> + </div> + </div> + </div> + <div class="form-group row"> + <div class="col s12"> + <h3>{{ translate('General_Action') }}</h3> + </div> + </div> + <div class="form-group row"> + <div class="col s12 m6"> + <div> + <label for="action_columns">{{ translate('PrivacyManager_UnsetActionColumns') }}</label> + <div + :class="`selectedActionColumns selectedActionColumns${index} multiple valign-wrapper`" + v-for="(actionColumn, index) in selectedActionColumns" + :key="index" + > + <div class="innerFormField" name="action_columns"> + <Field + uicontrol="select" + name="action_columns" + :model-value="actionColumn.column" + @update:model-value="actionColumn.column = $event; onActionColumnChange()" + :full-width="true" + :options="availableActionColumns" + > + </Field> + </div> + <span + class="icon-minus valign" + @click="removeActionColumn(index)" + v-show="index + 1 !== selectedActionColumns.length" + :title="translate('General_Remove')" + /> + </div> + </div> + </div> + <div class="col s12 m6"> + <div class="form-help"> + <span class="inline-help">{{ translate('PrivacyManager_UnsetActionColumnsHelp') }}</span> + </div> + </div> + </div> + <p><span class="icon-info" /> {{ translate('PrivacyManager_AnonymizeProcessInfo') }}</p> + <SaveButton + class="anonymizePastData" + @confirm="scheduleAnonymization()" + :disabled="isAnonymizePastDataDisabled" + :value="translate('PrivacyManager_AnonymizeDataNow')" + > + </SaveButton> + <div + class="ui-confirm" + id="confirmAnonymizeLogData" + ref="confirmAnonymizeLogData" + > + <h2>{{ translate('PrivacyManager_AnonymizeDataConfirm') }}</h2> + <input + role="yes" + type="button" + :value="translate('General_Yes')" + /> + <input + role="no" + type="button" + :value="translate('General_No')" + /> + </div> + </div> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; +import { + Matomo, + AjaxHelper, + SiteSelector, + debounce, +} from 'CoreHome'; +import { Field, SaveButton } from 'CorePluginsAdmin'; + +interface Option { + key: string; + value: string; +} + +interface AnonymizeLogDataState { + isLoading: boolean; + isDeleting: boolean; + anonymizeIp: boolean; + anonymizeLocation: boolean; + anonymizeUserId: boolean; + site: Record<string, string>; + availableVisitColumns: Option[]; + availableActionColumns: Option[]; + selectedVisitColumns: Record<string, string>[]; + selectedActionColumns: Record<string, string>[]; + startDate: string; + endDate: string; +} + +function sub(value: number) { + if (value < 10) { + return `0${value}`; + } + return value; +} + +export default defineComponent({ + components: { + SiteSelector, + Field, + SaveButton, + }, + data(): AnonymizeLogDataState { + const now = new Date(); + const startDate = `${now.getFullYear()}-${sub(now.getMonth() + 1)}-${sub(now.getDay() + 1)}`; + return { + isLoading: false, + isDeleting: false, + anonymizeIp: false, + anonymizeLocation: false, + anonymizeUserId: false, + site: { + id: 'all', + name: 'All Websites', + }, + availableVisitColumns: [], + availableActionColumns: [], + selectedVisitColumns: [{ + column: '', + }], + selectedActionColumns: [{ + column: '', + }], + startDate, + endDate: startDate, + }; + }, + created() { + this.onKeydownStartDate = debounce(this.onKeydownStartDate, 50); + this.onKeydownEndDate = debounce(this.onKeydownEndDate, 50); + + AjaxHelper.fetch<{ column_name: string }[]>({ + method: 'PrivacyManager.getAvailableVisitColumnsToAnonymize', + }).then((columns) => { + this.availableVisitColumns = []; + columns.forEach((column) => { + this.availableVisitColumns.push({ + key: column.column_name, + value: column.column_name, + }); + }); + }); + + AjaxHelper.fetch<{ column_name: string }[]>({ + method: 'PrivacyManager.getAvailableLinkVisitActionColumnsToAnonymize', + }).then((columns) => { + this.availableActionColumns = []; + columns.forEach((column) => { + this.availableActionColumns.push({ + key: column.column_name, + value: column.column_name, + }); + }); + }); + + setTimeout(() => { + const options1 = Matomo.getBaseDatePickerOptions(null); + const options2 = Matomo.getBaseDatePickerOptions(null); + $(this.$refs.anonymizeStartDate as HTMLElement).datepicker(options1); + $(this.$refs.anonymizeEndDate as HTMLElement).datepicker(options2); + }); + }, + methods: { + onVisitColumnChange() { + const hasAll = this.selectedVisitColumns.every((col) => !!col?.column); + if (hasAll) { + this.addVisitColumn(); + } + }, + addVisitColumn() { + this.selectedVisitColumns.push({ column: '' }); + }, + removeVisitColumn(index: number) { + if (index > -1) { + const lastIndex = this.selectedVisitColumns.length - 1; + + if (lastIndex === index) { + this.selectedVisitColumns[index] = { column: '' }; + } else { + this.selectedVisitColumns.splice(index, 1); + } + } + }, + onActionColumnChange() { + const hasAll = this.selectedActionColumns.every((col) => !!col?.column); + if (hasAll) { + this.addActionColumn(); + } + }, + addActionColumn() { + this.selectedActionColumns.push({ column: '' }); + }, + removeActionColumn(index: number) { + if (index > -1) { + const lastIndex = this.selectedActionColumns.length - 1; + + if (lastIndex === index) { + this.selectedActionColumns[index] = { + column: '', + }; + } else { + this.selectedActionColumns.splice(index, 1); + } + } + }, + scheduleAnonymization() { + let date = `${this.startDate},${this.endDate}`; + + if (this.startDate === this.endDate) { + date = this.startDate; + } + + const params: QueryParameters = { date }; + params.idSites = this.site.id; + params.anonymizeIp = this.anonymizeIp ? '1' : '0'; + params.anonymizeLocation = this.anonymizeLocation ? '1' : '0'; + params.anonymizeUserId = this.anonymizeUserId ? '1' : '0'; + params.unsetVisitColumns = this.selectedVisitColumns.filter( + (c) => !!c?.column, + ).map((c) => c.column); + params.unsetLinkVisitActionColumns = this.selectedActionColumns.filter( + (c) => !!c?.column, + ).map((c) => c.column); + + Matomo.helper.modalConfirm(this.$refs.confirmAnonymizeLogData as HTMLElement, { + yes: () => { + AjaxHelper.post({ + method: 'PrivacyManager.anonymizeSomeRawData', + }, params).then(() => { + window.location.reload(true); + }); + }, + }); + }, + onKeydownStartDate(event: Event) { + this.startDate = (event.target as HTMLInputElement).value; + }, + onKeydownEndDate(event: Event) { + this.endDate = (event.target as HTMLInputElement).value; + }, + }, + computed: { + isAnonymizePastDataDisabled(): boolean { + return !this.anonymizeIp && !this.anonymizeLocation && !this.selectedVisitColumns + && !this.selectedActionColumns; + }, + }, +}); +</script> diff --git a/plugins/PrivacyManager/vue/src/index.ts b/plugins/PrivacyManager/vue/src/index.ts index ea5555c68b..876fcab45c 100644 --- a/plugins/PrivacyManager/vue/src/index.ts +++ b/plugins/PrivacyManager/vue/src/index.ts @@ -6,4 +6,5 @@ */ export { default as AnonymizeIp } from './AnonymizeIp/AnonymizeIp.vue'; +export { default as AnonymizeLogData } from './AnonymizeLogData/AnonymizeLogData.vue'; export { default as DoNotTrackPreference } from './DoNotTrackPreference/DoNotTrackPreference.vue'; |