diff options
author | Stefan Giehl <stefan@matomo.org> | 2022-04-08 16:36:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-08 16:36:51 +0300 |
commit | f8267dfed779e06f7483d9d952700e8c819cafba (patch) | |
tree | 8da2ab318e6d92d380ee27006485386f9cbf3cc7 /plugins | |
parent | 7e0fe791ec5ba786ba1e0a6d4a66cdff9d1917b9 (diff) |
Disable datatable PostProcessor for PrivacyManager.findDataSubjects API method (#19054)
* Disable datatable PostProcessor for PrivacyManager API
* Adds some API tests for PrivacyManager.findDataSubjects
* apply PSR12 code formatting
* fix region not displayed correctly in tooltip
Diffstat (limited to 'plugins')
8 files changed, 429 insertions, 35 deletions
diff --git a/plugins/PrivacyManager/API.php b/plugins/PrivacyManager/API.php index e18d6f09a6..0ca559f6e1 100644 --- a/plugins/PrivacyManager/API.php +++ b/plugins/PrivacyManager/API.php @@ -126,6 +126,7 @@ class API extends \Piwik\Plugin\API } } + // Note: Datatable PostProcessor is disabled for this method in PrivacyManager::shouldDisablePostProcessing return $result; } diff --git a/plugins/PrivacyManager/PrivacyManager.php b/plugins/PrivacyManager/PrivacyManager.php index 96c234e628..130175589d 100644 --- a/plugins/PrivacyManager/PrivacyManager.php +++ b/plugins/PrivacyManager/PrivacyManager.php @@ -190,10 +190,21 @@ class PrivacyManager extends Plugin 'Template.pageFooter' => 'renderPrivacyPolicyLinks', 'Db.getTablesInstalled' => 'getTablesInstalled', 'Visualization.beforeRender' => 'onConfigureVisualisation', - 'CustomJsTracker.shouldAddTrackerFile' => 'shouldAddTrackerFile' + 'CustomJsTracker.shouldAddTrackerFile' => 'shouldAddTrackerFile', + 'Request.shouldDisablePostProcessing' => 'shouldDisablePostProcessing' ]; } + public function shouldDisablePostProcessing(&$shouldDisable, $request) + { + // We disable the post processor for this API method as it passes through the results of + // `Live.getLastVisitsDetails`, which is already post processed. + // Otherwise, the PostProcessor would trigger warning when trying to calculate a totals row. + if ($request['method'] === 'PrivacyManager.findDataSubjects') { + $shouldDisable = true; + } + } + public function onConfigureVisualisation(Plugin\Visualization $view) { if ($view->requestConfig->getApiModuleToRequest() === 'Referrers' && !$view->requestConfig->idSubtable) { diff --git a/plugins/PrivacyManager/tests/System/APITest.php b/plugins/PrivacyManager/tests/System/APITest.php index 7c117f0ccd..83a275392d 100644 --- a/plugins/PrivacyManager/tests/System/APITest.php +++ b/plugins/PrivacyManager/tests/System/APITest.php @@ -1,4 +1,5 @@ <?php + /** * Matomo - free/libre analytics platform * @@ -37,7 +38,7 @@ class APITest extends SystemTestCase $this->api = API::getInstance(); } - public function test_exportDataSubjects_failsWhenNoVisitsGiven() + public function testExportDataSubjectsFailsWhenNoVisitsGiven() { $this->expectException(\Exception::class); $this->expectExceptionMessage('No list of visits given'); @@ -45,26 +46,26 @@ class APITest extends SystemTestCase $this->assertNull($this->api->exportDataSubjects(false)); } - public function test_exportDataSubjects_whenOneVisitGiven() + public function testExportDataSubjectsWhenOneVisitGiven() { $result = $this->api->exportDataSubjects([['idsite' => '1', 'idvisit' => '1']]); $this->assertJsonResponse('exportDataSubject_oneVisitGiven', $result); } - public function test_exportDataSubjects_whenNotMatchingVisitGiven() + public function testExportDataSubjectsWhenNotMatchingVisitGiven() { $noMatch = $this->api->exportDataSubjects([['idsite' => '9999', 'idvisit' => '9999']]); $this->assertJsonResponse('exportDataSubject_noMatch', $noMatch); } - public function test_exportDataSubjects_whenAllVisitsGiven() + public function testExportDataSubjectsWhenAllVisitsGiven() { $rows = Db::fetchAll('SELECT idsite, idvisit from ' . Common::prefixTable('log_visit')); $result = $this->api->exportDataSubjects($rows); $this->assertJsonResponse('exportDataSubject_allVisits', $result); } - public function test_exportDataSubjects_failsWhenMissingIdSite() + public function testExportDataSubjectsFailsWhenMissingIdSite() { $this->expectException(\Exception::class); $this->expectExceptionMessage('No idsite key set for visit at index 1'); @@ -89,50 +90,66 @@ class APITest extends SystemTestCase */ public function testApi($api, $params) { - $params['xmlFieldsToRemove'] = array('totalEcommerceRevenue', 'revenue', 'revenueDiscount'); + $params['xmlFieldsToRemove'] = ['totalEcommerceRevenue', 'revenue', 'revenueDiscount']; $this->runApiTests($api, $params); } public function getApiForTesting() { - $api = array( + $api = [ 'PrivacyManager.getAvailableVisitColumnsToAnonymize', 'PrivacyManager.getAvailableLinkVisitActionColumnsToAnonymize', - ); + ]; - $apiToTest = array(); - $apiToTest[] = array($api, - array( + $apiToTest = []; + $apiToTest[] = [$api, + [ 'idSite' => 1, 'date' => self::$fixture->dateTime, - 'periods' => array('day'), + 'periods' => ['day'], 'testSuffix' => '' - ) - ); + ] + ]; - $apiToTest[] = array(array('Live.getLastVisitsDetails'), - array( + $apiToTest[] = [['Live.getLastVisitsDetails'], + [ 'idSite' => 'all', 'date' => self::$fixture->dateTime, - 'periods' => array('year'), - 'otherRequestParameters' => array('filter_limit' => '-1'), + 'periods' => ['year'], + 'otherRequestParameters' => ['filter_limit' => '-1'], 'testSuffix' => 'allSites' - ) - ); + ] + ]; - $apiToTest[] = array(array('Live.getLastVisitsDetails'), - array( + $apiToTest[] = [['Live.getLastVisitsDetails'], + [ 'idSite' => 'all', 'date' => self::$fixture->dateTime, - 'periods' => array('year'), - 'otherRequestParameters' => array('doNotFetchActions' => '1', 'filter_limit' => '-1'), + 'periods' => ['year'], + 'otherRequestParameters' => ['doNotFetchActions' => '1', 'filter_limit' => '-1'], 'testSuffix' => 'allSites_noActions' - ) - ); + ] + ]; return $apiToTest; } + public function testFindDataSubjectsAllSites() + { + $this->runAnyApiTest('PrivacyManager.findDataSubjects', 'allSites', [ + 'idSite' => 'all', + 'segment' => 'countryCode==CN', + ]); + } + + public function testFindDataSubjectsSpecificSite() + { + $this->runAnyApiTest('PrivacyManager.findDataSubjects', 'specificSite', [ + 'idSite' => '5', + 'segment' => 'countryCode==CN', + ]); + } + public static function getOutputPrefix() { return ''; @@ -142,7 +159,6 @@ class APITest extends SystemTestCase { return dirname(__FILE__); } - } -APITest::$fixture = new MultipleSitesMultipleVisitsFixture();
\ No newline at end of file +APITest::$fixture = new MultipleSitesMultipleVisitsFixture(); diff --git a/plugins/PrivacyManager/tests/System/expected/test___PrivacyManager.findDataSubjects_allSites.xml b/plugins/PrivacyManager/tests/System/expected/test___PrivacyManager.findDataSubjects_allSites.xml new file mode 100644 index 0000000000..901ca53eef --- /dev/null +++ b/plugins/PrivacyManager/tests/System/expected/test___PrivacyManager.findDataSubjects_allSites.xml @@ -0,0 +1,283 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <idSite>1</idSite> + <idVisit>122</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-11 03:10:05</lastActionDateTime> + <siteName>Site 1</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>3</idSite> + <idVisit>154</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-11 03:10:05</lastActionDateTime> + <siteName>Site 3</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>5</idSite> + <idVisit>186</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-11 03:10:05</lastActionDateTime> + <siteName>Site 5</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>1</idSite> + <idVisit>121</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-11 01:10:05</lastActionDateTime> + <siteName>Site 1</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>3</idSite> + <idVisit>153</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-11 01:10:05</lastActionDateTime> + <siteName>Site 3</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>5</idSite> + <idVisit>185</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-11 01:10:05</lastActionDateTime> + <siteName>Site 5</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>1</idSite> + <idVisit>90</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-08 03:10:05</lastActionDateTime> + <siteName>Site 1</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>1</idSite> + <idVisit>89</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-08 01:10:05</lastActionDateTime> + <siteName>Site 1</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>1</idSite> + <idVisit>58</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-05 03:10:05</lastActionDateTime> + <siteName>Site 1</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>5</idSite> + <idVisit>218</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-05 03:10:05</lastActionDateTime> + <siteName>Site 5</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>1</idSite> + <idVisit>57</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-05 01:10:05</lastActionDateTime> + <siteName>Site 1</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>5</idSite> + <idVisit>217</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-05 01:10:05</lastActionDateTime> + <siteName>Site 5</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>1</idSite> + <idVisit>26</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-02 03:10:05</lastActionDateTime> + <siteName>Site 1</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>1</idSite> + <idVisit>25</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-02 01:10:05</lastActionDateTime> + <siteName>Site 1</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> +</result>
\ No newline at end of file diff --git a/plugins/PrivacyManager/tests/System/expected/test___PrivacyManager.findDataSubjects_specificSite.xml b/plugins/PrivacyManager/tests/System/expected/test___PrivacyManager.findDataSubjects_specificSite.xml new file mode 100644 index 0000000000..6cc2520366 --- /dev/null +++ b/plugins/PrivacyManager/tests/System/expected/test___PrivacyManager.findDataSubjects_specificSite.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <idSite>5</idSite> + <idVisit>186</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-11 03:10:05</lastActionDateTime> + <siteName>Site 5</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>5</idSite> + <idVisit>185</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-11 01:10:05</lastActionDateTime> + <siteName>Site 5</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>5</idSite> + <idVisit>218</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-05 03:10:05</lastActionDateTime> + <siteName>Site 5</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> + <row> + <idSite>5</idSite> + <idVisit>217</idVisit> + <visitIp>156.5.3.209</visitIp> + + <lastActionDateTime>2017-01-05 01:10:05</lastActionDateTime> + <siteName>Site 5</siteName> + <userId>userId209</userId> + <deviceType>Unknown</deviceType> + <deviceTypeIcon>plugins/Morpheus/icons/dist/devices/unknown.png</deviceTypeIcon> + <deviceModel>Unknown</deviceModel> + <operatingSystem>Unknown</operatingSystem> + <operatingSystemIcon>plugins/Morpheus/icons/dist/os/UNK.png</operatingSystemIcon> + <browserFamilyDescription>Unknown</browserFamilyDescription> + <browser>Unknown</browser> + <browserIcon>plugins/Morpheus/icons/dist/browsers/UNK.png</browserIcon> + <country>China</country> + <countryFlag>plugins/Morpheus/icons/dist/flags/cn.png</countryFlag> + <region /> + </row> +</result>
\ No newline at end of file diff --git a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js index 5335e3a519..7c48fb405b 100644 --- a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js +++ b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js @@ -160,7 +160,7 @@ if (typeof window !== 'undefined') { // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/PrivacyManager/vue/src/ManageGdpr/ManageGdpr.vue?vue&type=template&id=eef82860 +// 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/ManageGdpr/ManageGdpr.vue?vue&type=template&id=ef410c26 var _hoisted_1 = { class: "manageGdpr" @@ -375,7 +375,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { height: "16", src: dataSubject.browserIcon }, null, 8, _hoisted_37)], 8, _hoisted_36), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - title: "".concat(dataSubject.country, " ").concat(dataSubject.region) + title: "".concat(dataSubject.country, " ").concat(dataSubject.region || '') }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { height: "16", src: dataSubject.countryFlag @@ -413,7 +413,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { value: _ctx.translate('General_No') }, null, 8, _hoisted_44)], 512)]); } -// CONCATENATED MODULE: ./plugins/PrivacyManager/vue/src/ManageGdpr/ManageGdpr.vue?vue&type=template&id=eef82860 +// CONCATENATED MODULE: ./plugins/PrivacyManager/vue/src/ManageGdpr/ManageGdpr.vue?vue&type=template&id=ef410c26 // EXTERNAL MODULE: external "CoreHome" var external_CoreHome_ = __webpack_require__("19dc"); diff --git a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.min.js b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.min.js index 9349aa9da0..6d27e42721 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,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin"),require("SegmentEditor")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin","SegmentEditor"],t):"object"===typeof exports?exports["PrivacyManager"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin"),require("SegmentEditor")):e["PrivacyManager"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"],e["SegmentEditor"])})("undefined"!==typeof self?self:this,(function(e,t,n,a){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/PrivacyManager/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},f06f:function(e,t){e.exports=a},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"ManageGdpr",(function(){return ne})),n.d(t,"AnonymizeIp",(function(){return be})),n.d(t,"AnonymizeLogData",(function(){return et})),n.d(t,"DoNotTrackPreference",(function(){return at})),n.d(t,"ReportDeletionSettings",(function(){return st})),n.d(t,"DeleteOldLogs",(function(){return Ot})),n.d(t,"DeleteOldReports",(function(){return Mt})),n.d(t,"ScheduleReportDeletion",(function(){return Yt})),"undefined"!==typeof window){var a=window.document.currentScript,i=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var o=n("8bbf"),l={class:"manageGdpr"},r={class:"intro"},c=Object(o["createElementVNode"])("br",null,null,-1),s=Object(o["createElementVNode"])("br",null,null,-1),d=Object(o["createElementVNode"])("br",null,null,-1),u=Object(o["createElementVNode"])("br",null,null,-1),m=["innerHTML"],b={class:"form-group row"},p={class:"col s12 input-field"},v={for:"gdprsite",class:"siteSelectorLabel"},g={class:"sites_autocomplete"},j={class:"form-group row segmentFilterGroup"},h={class:"col s12"},O={style:{margin:"8px 0",display:"inline-block"}},f=Object(o["createElementVNode"])("br",null,null,-1),y=Object(o["createTextVNode"])(),V=Object(o["createElementVNode"])("br",null,null,-1),D=Object(o["createElementVNode"])("br",null,null,-1),S=Object(o["createElementVNode"])("br",null,null,-1),N={class:"checkInclude"},E={colspan:"8"},_=["title"],k={class:"checkInclude"},P=["title"],C={class:"visitId"},M={class:"visitorId"},w=["title","onClick"],A={class:"visitorIp"},I=["title","onClick"],z={class:"userId"},L=["title","onClick"],T=["title"],F=["src"],x=["title"],B=["src"],R=["title"],U=["src"],G=["title"],H=["src"],q=["onClick"],K=Object(o["createElementVNode"])("img",{src:"plugins/Live/images/visitorProfileLaunch.png",style:{"margin-right":"3.5px"}},null,-1),W={class:"ui-confirm",id:"confirmDeleteDataSubject",ref:"confirmDeleteDataSubject"},Y=["value"],J=["value"];function Q(e,t,n,a,i,$){var Q=Object(o["resolveComponent"])("SiteSelector"),X=Object(o["resolveComponent"])("SegmentGenerator"),Z=Object(o["resolveComponent"])("SaveButton"),ee=Object(o["resolveComponent"])("ContentBlock"),te=Object(o["resolveComponent"])("Field"),ne=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",l,[Object(o["createVNode"])(ee,{"content-title":e.translate("PrivacyManager_GdprTools")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",r,[Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntro1"))+" ",1),c,s,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntro2"))+" ",1),d]),Object(o["createElementVNode"])("ol",null,[Object(o["createElementVNode"])("li",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntroAccessRight")),1),Object(o["createElementVNode"])("li",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntroEraseRight")),1)]),Object(o["createElementVNode"])("p",null,[u,Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.overviewHintText)},null,8,m)])]),Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_SearchForDataSubject")),1),Object(o["createElementVNode"])("div",b,[Object(o["createElementVNode"])("div",p,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",v,Object(o["toDisplayString"])(e.translate("PrivacyManager_SelectWebsite")),1),Object(o["createElementVNode"])("div",g,[Object(o["createVNode"])(Q,{id:"gdprsite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),"show-all-sites-item":!0,"switch-site-on-select":!1,"show-selected-site":!0},null,8,["modelValue"])])])])]),Object(o["createElementVNode"])("div",j,[Object(o["createElementVNode"])("div",h,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",O,Object(o["toDisplayString"])(e.translate("PrivacyManager_FindDataSubjectsBy")),1),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(X,{modelValue:e.segment_filter,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.segment_filter=t}),"visit-segments-only":!0,idsite:e.site.id},null,8,["modelValue","idsite"])])])])]),Object(o["createVNode"])(Z,{class:"findDataSubjects",value:e.translate("PrivacyManager_FindMatchingDataSubjects"),onConfirm:t[2]||(t[2]=function(t){return e.findDataSubjects()}),disabled:!e.segment_filter,saving:e.isLoading},null,8,["value","disabled","saving"])]})),_:1},8,["content-title"]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_NoDataSubjectsFound")),1)],512),[[o["vShow"],!e.dataSubjects.length&&e.hasSearched]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_MatchingDataSubjects")),1),Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("PrivacyManager_VisitsMatchedCriteria"))+" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_ExportingNote"))+" ",1),f,y,V,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_DeletionFromMatomoOnly"))+" ",1),D,S,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_ResultIncludesAllVisits")),1)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("table",null,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",N,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(te,{uicontrol:"checkbox",name:"activateAll","model-value":e.toggleAll,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.toggleAll=t,e.toggleActivateAll()}),"full-width":!0},null,8,["model-value"])])]),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Website")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_VisitId")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_VisitorID")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_VisitorIP")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_UserId")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Details")),1),Object(o["withDirectives"])(Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Action")),513),[[o["vShow"],e.profileEnabled]])])]),Object(o["createElementVNode"])("tbody",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",E,Object(o["toDisplayString"])(e.translate("PrivacyManager_ResultTruncated","400")),1)],512),[[o["vShow"],e.dataSubjects.length>400]]),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.dataSubjects,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{title:"".concat(e.translate("PrivacyManager_LastAction"),": ").concat(t.lastActionDateTime),key:n},[Object(o["createElementVNode"])("td",k,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(te,{uicontrol:"checkbox",name:"subject".concat(t.idVisit),modelValue:e.dataSubjectsActive[n],"onUpdate:modelValue":function(t){return e.dataSubjectsActive[n]=t},"full-width":!0},null,8,["name","modelValue","onUpdate:modelValue"])])]),Object(o["createElementVNode"])("td",{class:"site",title:"(".concat(e.translate("General_Id")," ").concat(t.idSite,")")},Object(o["toDisplayString"])(t.siteName),9,P),Object(o["createElementVNode"])("td",C,Object(o["toDisplayString"])(t.idVisit),1),Object(o["createElementVNode"])("td",M,[Object(o["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddVisitorIdToSearch"),onClick:function(n){return e.addFilter("visitorId",t.visitorId)}},Object(o["toDisplayString"])(t.visitorId),9,w)]),Object(o["createElementVNode"])("td",A,[Object(o["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddVisitorIPToSearch"),onClick:function(n){return e.addFilter("visitIp",t.visitIp)}},Object(o["toDisplayString"])(t.visitIp),9,I)]),Object(o["createElementVNode"])("td",z,[Object(o["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddUserIdToSearch"),onClick:function(n){return e.addFilter("userId",t.userId)}},Object(o["toDisplayString"])(t.userId),9,L)]),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("span",{title:"".concat(t.deviceType," ").concat(t.deviceModel),style:{"margin-right":"3.5px"}},[Object(o["createElementVNode"])("img",{height:"16",src:t.deviceTypeIcon},null,8,F)],8,T),Object(o["createElementVNode"])("span",{title:t.operatingSystem,style:{"margin-right":"3.5px"}},[Object(o["createElementVNode"])("img",{height:"16",src:t.operatingSystemIcon},null,8,B)],8,x),Object(o["createElementVNode"])("span",{title:"".concat(t.browser," ").concat(t.browserFamilyDescription),style:{"margin-right":"3.5px"}},[Object(o["createElementVNode"])("img",{height:"16",src:t.browserIcon},null,8,U)],8,R),Object(o["createElementVNode"])("span",{title:"".concat(t.country," ").concat(t.region)},[Object(o["createElementVNode"])("img",{height:"16",src:t.countryFlag},null,8,H)],8,G)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("a",{class:"visitorLogTooltip",title:"View visitor profile",onClick:function(n){return e.showProfile(t.visitorId,t.idSite)}},[K,Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.translate("Live_ViewVisitorProfile")),1)],8,q)],512),[[o["vShow"],e.profileEnabled]])],8,_)})),128))])],512),[[ne]]),Object(o["createVNode"])(Z,{class:"exportDataSubjects",style:{"margin-right":"3.5px"},onConfirm:t[4]||(t[4]=function(t){return e.exportDataSubject()}),disabled:!e.hasActiveDataSubjects,value:e.translate("PrivacyManager_ExportSelectedVisits")},null,8,["disabled","value"]),Object(o["createVNode"])(Z,{class:"deleteDataSubjects",onConfirm:t[5]||(t[5]=function(t){return e.deleteDataSubject()}),disabled:!e.hasActiveDataSubjects||e.isDeleting,value:e.translate("PrivacyManager_DeleteSelectedVisits")},null,8,["disabled","value"])],512),[[o["vShow"],e.dataSubjects.length]]),Object(o["createElementVNode"])("div",W,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_DeleteVisitsConfirm")),1),Object(o["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Y),Object(o["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,J)],512)])}var X=n("19dc"),Z=n("f06f"),ee=n("a5a2"),te=Object(o["defineComponent"])({components:{ContentBlock:X["ContentBlock"],SiteSelector:X["SiteSelector"],SegmentGenerator:Z["SegmentGenerator"],SaveButton:ee["SaveButton"],Field:ee["Field"]},directives:{ContentTable:X["ContentTable"]},data:function(){return{isLoading:!1,isDeleting:!1,site:{id:"all",name:Object(X["translate"])("UsersManager_AllWebsites")},segment_filter:"userId==",dataSubjects:[],toggleAll:!0,hasSearched:!1,profileEnabled:X["Matomo"].visitorProfileEnabled,dataSubjectsActive:[]}},setup:function(){var e=X["AjaxHelper"].fetch({method:"SitesManager.getSitesIdWithAdminAccess",filter_limit:"-1"});return{getSites:function(){return e}}},methods:{showSuccessNotification:function(e){var t=X["NotificationsStore"].show({message:e,context:"success",id:"manageGdpr",type:"transient"});setTimeout((function(){X["NotificationsStore"].scrollToNotification(t)}),200)},linkTo:function(e){return"?".concat(X["MatomoUrl"].stringify(Object.assign(Object.assign({},X["MatomoUrl"].urlParsed.value),{},{module:"PrivacyManager",action:e})))},toggleActivateAll:function(){this.dataSubjectsActive.fill(this.toggleAll)},showProfile:function(e,t){X["Matomo"].helper.showVisitorProfilePopup(e,t)},exportDataSubject:function(){var e=this,t=this.activatedDataSubjects;X["AjaxHelper"].post({module:"API",method:"PrivacyManager.exportDataSubjects",format:"json",filter_limit:-1},{visits:t}).then((function(t){e.showSuccessNotification(Object(X["translate"])("PrivacyManager_VisitsSuccessfullyExported")),X["Matomo"].helper.sendContentAsDownload("exported_data_subjects.json",JSON.stringify(t))}))},deleteDataSubject:function(){var e=this;X["Matomo"].helper.modalConfirm(this.$refs.confirmDeleteDataSubject,{yes:function(){e.isDeleting=!0;var t=e.activatedDataSubjects;X["AjaxHelper"].post({module:"API",method:"PrivacyManager.deleteDataSubjects",filter_limit:-1},{visits:t}).then((function(){e.dataSubjects=[],e.showSuccessNotification(Object(X["translate"])("PrivacyManager_VisitsSuccessfullyDeleted")),e.findDataSubjects()})).finally((function(){e.isDeleting=!1}))}})},addFilter:function(e,t){this.segment_filter+=",".concat(e,"==").concat(t),this.findDataSubjects()},findDataSubjects:function(){var e=this;this.dataSubjects=[],this.dataSubjectsActive=[],this.isLoading=!0,this.toggleAll=!0,this.hasSearched=!1,this.getSites().then((function(t){var n=e.site.id;"all"!==n||X["Matomo"].hasSuperUserAccess||(n=t,Array.isArray(t)&&(n=t.join(","))),X["AjaxHelper"].fetch({idSite:n,module:"API",method:"PrivacyManager.findDataSubjects",segment:e.segment_filter}).then((function(t){e.hasSearched=!0,e.dataSubjectsActive=t.map((function(){return!0})),e.dataSubjects=t})).finally((function(){e.isLoading=!1}))}))}},computed:{hasActiveDataSubjects:function(){return!!this.activatedDataSubjects.length},activatedDataSubjects:function(){var e=this;return this.dataSubjects.filter((function(t,n){return e.dataSubjectsActive[n]})).map((function(e){return{idsite:e.idSite,idvisit:e.idVisit}}))},overviewHintText:function(){return Object(X["translate"])("PrivacyManager_GdprToolsOverviewHint",'<a href="'.concat(this.linkTo("gdprOverview"),'">'),"</a>")}}});te.render=Q;var ne=te,ae=Object(o["createElementVNode"])("br",null,null,-1),ie=Object(o["createElementVNode"])("br",null,null,-1),oe=Object(o["createElementVNode"])("br",null,null,-1),le=Object(o["createElementVNode"])("br",null,null,-1),re={key:0},ce=Object(o["createElementVNode"])("br",null,null,-1),se=Object(o["createElementVNode"])("br",null,null,-1),de={class:"alert-warning alert"};function ue(e,t,n,a,i,l){var r=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("SaveButton"),s=Object(o["resolveDirective"])("form");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeIpSettings",title:e.translate("PrivacyManager_UseAnonymizeIp"),modelValue:e.actualEnabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.actualEnabled=t}),"inline-help":e.anonymizeIpEnabledHelp},null,8,["title","modelValue","inline-help"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"radio",name:"maskLength",title:e.translate("PrivacyManager_AnonymizeIpMaskLengtDescription"),modelValue:e.actualMaskLength,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.actualMaskLength=t}),options:e.maskLengthOptions,"inline-help":e.translate("PrivacyManager_GeolocationAnonymizeIpNote")},null,8,["title","modelValue","options","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"radio",name:"useAnonymizedIpForVisitEnrichment",title:e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichment"),modelValue:e.actualUseAnonymizedIpForVisitEnrichment,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.actualUseAnonymizedIpForVisitEnrichment=t}),options:e.useAnonymizedIpForVisitEnrichmentOptions,"inline-help":e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichmentNote")},null,8,["title","modelValue","options","inline-help"])])],512),[[o["vShow"],e.actualEnabled]]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeUserId",title:e.translate("PrivacyManager_PseudonymizeUserId"),modelValue:e.actualAnonymizeUserId,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.actualAnonymizeUserId=t})},{"inline-help":Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote"))+" ",1),ae,ie,Object(o["createElementVNode"])("em",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote2")),1)]})),_:1},8,["title","modelValue"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeOrderId",title:e.translate("PrivacyManager_UseAnonymizeOrderId"),modelValue:e.actualAnonymizeOrderId,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.actualAnonymizeOrderId=t}),"inline-help":e.translate("PrivacyManager_AnonymizeOrderIdNote")},null,8,["title","modelValue","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"forceCookielessTracking",title:e.translate("PrivacyManager_ForceCookielessTracking"),modelValue:e.actualForceCookielessTracking,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.actualForceCookielessTracking=t})},{"inline-help":Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription",e.trackerFileName))+" ",1),oe,le,Object(o["createElementVNode"])("em",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription2")),1),e.trackerWritable?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",re,[ce,se,Object(o["createElementVNode"])("p",de,Object(o["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescriptionNotWritable",e.trackerFileName)),1)]))]})),_:1},8,["title","modelValue"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"select",name:"anonymizeReferrer",title:e.translate("PrivacyManager_AnonymizeReferrer"),modelValue:e.actualAnonymizeReferrer,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.actualAnonymizeReferrer=t}),options:e.referrerAnonymizationOptions,"inline-help":e.translate("PrivacyManager_AnonymizeReferrerNote")},null,8,["title","modelValue","options","inline-help"])]),Object(o["createVNode"])(c,{onConfirm:t[7]||(t[7]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}var me=Object(o["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:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["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,X["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=X["NotificationsStore"].show({message:Object(X["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"toast"});X["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}},computed:{anonymizeIpEnabledHelp:function(){var e=Object(X["translate"])("PrivacyManager_AnonymizeIpInlineHelp"),t=Object(X["translate"])("PrivacyManager_AnonymizeIpDescription");return"".concat(e," ").concat(t)}}});me.render=ue;var be=me,pe={class:"anonymizeLogData"},ve={class:"form-group row"},ge={class:"col s12 input-field"},je={for:"anonymizeSite",class:"siteSelectorLabel"},he={class:"sites_autocomplete"},Oe={class:"form-group row"},fe={class:"col s6 input-field"},ye={for:"anonymizeStartDate",class:"active"},Ve=["value"],De={class:"col s6 input-field"},Se={for:"anonymizeEndDate",class:"active"},Ne=["value"],Ee={name:"anonymizeIp"},_e={name:"anonymizeLocation"},ke={name:"anonymizeTheUserId"},Pe={class:"form-group row"},Ce={class:"col s12 m6"},Me={for:"visit_columns"},we={class:"innerFormField",name:"visit_columns"},Ae=["onClick","title"],Ie={class:"col s12 m6"},ze={class:"form-help"},Le={class:"inline-help"},Te={class:"form-group row"},Fe={class:"col s12"},xe={class:"form-group row"},Be={class:"col s12 m6"},Re={for:"action_columns"},Ue={class:"innerFormField",name:"action_columns"},Ge=["onClick","title"],He={class:"col s12 m6"},qe={class:"form-help"},Ke={class:"inline-help"},We=Object(o["createElementVNode"])("span",{class:"icon-info"},null,-1),$e={class:"ui-confirm",id:"confirmAnonymizeLogData",ref:"confirmAnonymizeLogData"},Ye=["value"],Je=["value"];function Qe(e,t,n,a,i,l){var r=Object(o["resolveComponent"])("SiteSelector"),c=Object(o["resolveComponent"])("Field"),s=Object(o["resolveComponent"])("SaveButton");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",pe,[Object(o["createElementVNode"])("div",ve,[Object(o["createElementVNode"])("div",ge,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",je,Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeSites")),1),Object(o["createElementVNode"])("div",he,[Object(o["createVNode"])(r,{id:"anonymizeSite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),"show-all-sites-item":!0,"switch-site-on-select":!1,"show-selected-site":!0},null,8,["modelValue"])])])])]),Object(o["createElementVNode"])("div",Oe,[Object(o["createElementVNode"])("div",fe,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",ye,Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeRowDataFrom")),1),Object(o["createElementVNode"])("input",{type:"text",id:"anonymizeStartDate",class:"anonymizeStartDate",ref:"anonymizeStartDate",name:"anonymizeStartDate",value:e.startDate,onKeydown:t[1]||(t[1]=function(t){return e.onKeydownStartDate(t)}),onChange:t[2]||(t[2]=function(t){return e.onKeydownStartDate(t)})},null,40,Ve)])]),Object(o["createElementVNode"])("div",De,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",Se,Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeRowDataTo")),1),Object(o["createElementVNode"])("input",{type:"text",class:"anonymizeEndDate",id:"anonymizeEndDate",ref:"anonymizeEndDate",name:"anonymizeEndDate",value:e.endDate,onKeydown:t[3]||(t[3]=function(t){return e.onKeydownEndDate(t)}),onChange:t[4]||(t[4]=function(t){return e.onKeydownEndDate(t)})},null,40,Ne)])])]),Object(o["createElementVNode"])("div",Ee,[Object(o["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeIp",title:e.translate("PrivacyManager_AnonymizeIp"),modelValue:e.anonymizeIp,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.anonymizeIp=t}),introduction:e.translate("General_Visit"),"inline-help":e.translate("PrivacyManager_AnonymizeIpHelp")},null,8,["title","modelValue","introduction","inline-help"])]),Object(o["createElementVNode"])("div",_e,[Object(o["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeLocation",title:e.translate("PrivacyManager_AnonymizeLocation"),modelValue:e.anonymizeLocation,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.anonymizeLocation=t}),"inline-help":e.translate("PrivacyManager_AnonymizeLocationHelp")},null,8,["title","modelValue","inline-help"])]),Object(o["createElementVNode"])("div",ke,[Object(o["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeTheUserId",title:e.translate("PrivacyManager_AnonymizeUserId"),modelValue:e.anonymizeUserId,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.anonymizeUserId=t}),"inline-help":e.translate("PrivacyManager_AnonymizeUserIdHelp")},null,8,["title","modelValue","inline-help"])]),Object(o["createElementVNode"])("div",Pe,[Object(o["createElementVNode"])("div",Ce,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",Me,Object(o["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumns")),1),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.selectedVisitColumns,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])("selectedVisitColumns selectedVisitColumns".concat(n," multiple valign-wrapper")),key:n},[Object(o["createElementVNode"])("div",we,[Object(o["createVNode"])(c,{uicontrol:"select",name:"visit_columns","model-value":t.column,"onUpdate:modelValue":function(n){t.column=n,e.onVisitColumnChange()},"full-width":!0,options:e.availableVisitColumns},null,8,["model-value","onUpdate:modelValue","options"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(t){return e.removeVisitColumn(n)},title:e.translate("General_Remove")},null,8,Ae),[[o["vShow"],n+1!==e.selectedVisitColumns.length]])],2)})),128))])]),Object(o["createElementVNode"])("div",Ie,[Object(o["createElementVNode"])("div",ze,[Object(o["createElementVNode"])("span",Le,Object(o["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumnsHelp")),1)])])]),Object(o["createElementVNode"])("div",Te,[Object(o["createElementVNode"])("div",Fe,[Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("General_Action")),1)])]),Object(o["createElementVNode"])("div",xe,[Object(o["createElementVNode"])("div",Be,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",Re,Object(o["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumns")),1),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.selectedActionColumns,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])("selectedActionColumns selectedActionColumns".concat(n," multiple valign-wrapper")),key:n},[Object(o["createElementVNode"])("div",Ue,[Object(o["createVNode"])(c,{uicontrol:"select",name:"action_columns","model-value":t.column,"onUpdate:modelValue":function(n){t.column=n,e.onActionColumnChange()},"full-width":!0,options:e.availableActionColumns},null,8,["model-value","onUpdate:modelValue","options"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(t){return e.removeActionColumn(n)},title:e.translate("General_Remove")},null,8,Ge),[[o["vShow"],n+1!==e.selectedActionColumns.length]])],2)})),128))])]),Object(o["createElementVNode"])("div",He,[Object(o["createElementVNode"])("div",qe,[Object(o["createElementVNode"])("span",Ke,Object(o["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumnsHelp")),1)])])]),Object(o["createElementVNode"])("p",null,[We,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeProcessInfo")),1)]),Object(o["createVNode"])(s,{class:"anonymizePastData",onConfirm:t[8]||(t[8]=function(t){return e.scheduleAnonymization()}),disabled:e.isAnonymizePastDataDisabled,value:e.translate("PrivacyManager_AnonymizeDataNow")},null,8,["disabled","value"]),Object(o["createElementVNode"])("div",$e,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeDataConfirm")),1),Object(o["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Ye),Object(o["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,Je)],512)])}function Xe(e){return e<10?"0".concat(e):e}var Ze=Object(o["defineComponent"])({components:{SiteSelector:X["SiteSelector"],Field:ee["Field"],SaveButton:ee["SaveButton"]},data:function(){var e=new Date,t="".concat(e.getFullYear(),"-").concat(Xe(e.getMonth()+1),"-").concat(Xe(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:t,endDate:t}},created:function(){var e=this;this.onKeydownStartDate=Object(X["debounce"])(this.onKeydownStartDate,50),this.onKeydownEndDate=Object(X["debounce"])(this.onKeydownEndDate,50),X["AjaxHelper"].fetch({method:"PrivacyManager.getAvailableVisitColumnsToAnonymize"}).then((function(t){e.availableVisitColumns=[],t.forEach((function(t){e.availableVisitColumns.push({key:t.column_name,value:t.column_name})}))})),X["AjaxHelper"].fetch({method:"PrivacyManager.getAvailableLinkVisitActionColumnsToAnonymize"}).then((function(t){e.availableActionColumns=[],t.forEach((function(t){e.availableActionColumns.push({key:t.column_name,value:t.column_name})}))})),setTimeout((function(){var t=X["Matomo"].getBaseDatePickerOptions(null),n=X["Matomo"].getBaseDatePickerOptions(null);$(e.$refs.anonymizeStartDate).datepicker(t),$(e.$refs.anonymizeEndDate).datepicker(n)}))},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 t=this.selectedVisitColumns.length-1;t===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 t=this.selectedActionColumns.length-1;t===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 t={date:e};t.idSites=this.site.id,t.anonymizeIp=this.anonymizeIp?"1":"0",t.anonymizeLocation=this.anonymizeLocation?"1":"0",t.anonymizeUserId=this.anonymizeUserId?"1":"0",t.unsetVisitColumns=this.selectedVisitColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),t.unsetLinkVisitActionColumns=this.selectedActionColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),X["Matomo"].helper.modalConfirm(this.$refs.confirmAnonymizeLogData,{yes:function(){X["AjaxHelper"].post({method:"PrivacyManager.anonymizeSomeRawData"},t).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}}});Ze.render=Qe;var et=Ze;function tt(e,t,n,a,i,l){var r=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("SaveButton"),s=Object(o["resolveDirective"])("form");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"radio",name:"doNotTrack",modelValue:e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enabled=t}),options:e.doNotTrackOptions,"inline-help":e.translate("PrivacyManager_DoNotTrack_Description")},null,8,["modelValue","options","inline-help"])]),Object(o["createVNode"])(c,{onConfirm:t[1]||(t[1]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}var nt=Object(o["defineComponent"])({props:{dntSupport:Boolean,doNotTrackOptions:{type:Array,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,enabled:this.dntSupport?1:0}},methods:{save:function(){var e=this;this.isLoading=!0;var t="deactivateDoNotTrack";this.enabled&&"0"!==this.enabled&&(t="activateDoNotTrack"),X["AjaxHelper"].post({module:"API",method:"PrivacyManager.".concat(t)}).then((function(){var e=X["NotificationsStore"].show({message:Object(X["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"transient"});X["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}}});nt.render=tt;var at=nt;function it(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ot(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function lt(e,t,n){return t&&ot(e.prototype,t),n&&ot(e,n),e}function rt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin"),require("SegmentEditor")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin","SegmentEditor"],t):"object"===typeof exports?exports["PrivacyManager"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin"),require("SegmentEditor")):e["PrivacyManager"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"],e["SegmentEditor"])})("undefined"!==typeof self?self:this,(function(e,t,n,a){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/PrivacyManager/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},f06f:function(e,t){e.exports=a},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"ManageGdpr",(function(){return ne})),n.d(t,"AnonymizeIp",(function(){return be})),n.d(t,"AnonymizeLogData",(function(){return et})),n.d(t,"DoNotTrackPreference",(function(){return at})),n.d(t,"ReportDeletionSettings",(function(){return st})),n.d(t,"DeleteOldLogs",(function(){return Ot})),n.d(t,"DeleteOldReports",(function(){return Mt})),n.d(t,"ScheduleReportDeletion",(function(){return Yt})),"undefined"!==typeof window){var a=window.document.currentScript,i=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var o=n("8bbf"),l={class:"manageGdpr"},r={class:"intro"},c=Object(o["createElementVNode"])("br",null,null,-1),s=Object(o["createElementVNode"])("br",null,null,-1),d=Object(o["createElementVNode"])("br",null,null,-1),u=Object(o["createElementVNode"])("br",null,null,-1),m=["innerHTML"],b={class:"form-group row"},p={class:"col s12 input-field"},v={for:"gdprsite",class:"siteSelectorLabel"},g={class:"sites_autocomplete"},j={class:"form-group row segmentFilterGroup"},h={class:"col s12"},O={style:{margin:"8px 0",display:"inline-block"}},f=Object(o["createElementVNode"])("br",null,null,-1),y=Object(o["createTextVNode"])(),V=Object(o["createElementVNode"])("br",null,null,-1),D=Object(o["createElementVNode"])("br",null,null,-1),S=Object(o["createElementVNode"])("br",null,null,-1),N={class:"checkInclude"},E={colspan:"8"},_=["title"],k={class:"checkInclude"},P=["title"],C={class:"visitId"},M={class:"visitorId"},w=["title","onClick"],A={class:"visitorIp"},I=["title","onClick"],z={class:"userId"},L=["title","onClick"],T=["title"],F=["src"],x=["title"],B=["src"],R=["title"],U=["src"],G=["title"],H=["src"],q=["onClick"],K=Object(o["createElementVNode"])("img",{src:"plugins/Live/images/visitorProfileLaunch.png",style:{"margin-right":"3.5px"}},null,-1),W={class:"ui-confirm",id:"confirmDeleteDataSubject",ref:"confirmDeleteDataSubject"},Y=["value"],J=["value"];function Q(e,t,n,a,i,$){var Q=Object(o["resolveComponent"])("SiteSelector"),X=Object(o["resolveComponent"])("SegmentGenerator"),Z=Object(o["resolveComponent"])("SaveButton"),ee=Object(o["resolveComponent"])("ContentBlock"),te=Object(o["resolveComponent"])("Field"),ne=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",l,[Object(o["createVNode"])(ee,{"content-title":e.translate("PrivacyManager_GdprTools")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",r,[Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntro1"))+" ",1),c,s,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntro2"))+" ",1),d]),Object(o["createElementVNode"])("ol",null,[Object(o["createElementVNode"])("li",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntroAccessRight")),1),Object(o["createElementVNode"])("li",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntroEraseRight")),1)]),Object(o["createElementVNode"])("p",null,[u,Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.overviewHintText)},null,8,m)])]),Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_SearchForDataSubject")),1),Object(o["createElementVNode"])("div",b,[Object(o["createElementVNode"])("div",p,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",v,Object(o["toDisplayString"])(e.translate("PrivacyManager_SelectWebsite")),1),Object(o["createElementVNode"])("div",g,[Object(o["createVNode"])(Q,{id:"gdprsite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),"show-all-sites-item":!0,"switch-site-on-select":!1,"show-selected-site":!0},null,8,["modelValue"])])])])]),Object(o["createElementVNode"])("div",j,[Object(o["createElementVNode"])("div",h,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",O,Object(o["toDisplayString"])(e.translate("PrivacyManager_FindDataSubjectsBy")),1),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(X,{modelValue:e.segment_filter,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.segment_filter=t}),"visit-segments-only":!0,idsite:e.site.id},null,8,["modelValue","idsite"])])])])]),Object(o["createVNode"])(Z,{class:"findDataSubjects",value:e.translate("PrivacyManager_FindMatchingDataSubjects"),onConfirm:t[2]||(t[2]=function(t){return e.findDataSubjects()}),disabled:!e.segment_filter,saving:e.isLoading},null,8,["value","disabled","saving"])]})),_:1},8,["content-title"]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_NoDataSubjectsFound")),1)],512),[[o["vShow"],!e.dataSubjects.length&&e.hasSearched]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_MatchingDataSubjects")),1),Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("PrivacyManager_VisitsMatchedCriteria"))+" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_ExportingNote"))+" ",1),f,y,V,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_DeletionFromMatomoOnly"))+" ",1),D,S,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_ResultIncludesAllVisits")),1)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("table",null,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",N,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(te,{uicontrol:"checkbox",name:"activateAll","model-value":e.toggleAll,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.toggleAll=t,e.toggleActivateAll()}),"full-width":!0},null,8,["model-value"])])]),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Website")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_VisitId")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_VisitorID")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_VisitorIP")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_UserId")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Details")),1),Object(o["withDirectives"])(Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Action")),513),[[o["vShow"],e.profileEnabled]])])]),Object(o["createElementVNode"])("tbody",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",E,Object(o["toDisplayString"])(e.translate("PrivacyManager_ResultTruncated","400")),1)],512),[[o["vShow"],e.dataSubjects.length>400]]),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.dataSubjects,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{title:"".concat(e.translate("PrivacyManager_LastAction"),": ").concat(t.lastActionDateTime),key:n},[Object(o["createElementVNode"])("td",k,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(te,{uicontrol:"checkbox",name:"subject".concat(t.idVisit),modelValue:e.dataSubjectsActive[n],"onUpdate:modelValue":function(t){return e.dataSubjectsActive[n]=t},"full-width":!0},null,8,["name","modelValue","onUpdate:modelValue"])])]),Object(o["createElementVNode"])("td",{class:"site",title:"(".concat(e.translate("General_Id")," ").concat(t.idSite,")")},Object(o["toDisplayString"])(t.siteName),9,P),Object(o["createElementVNode"])("td",C,Object(o["toDisplayString"])(t.idVisit),1),Object(o["createElementVNode"])("td",M,[Object(o["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddVisitorIdToSearch"),onClick:function(n){return e.addFilter("visitorId",t.visitorId)}},Object(o["toDisplayString"])(t.visitorId),9,w)]),Object(o["createElementVNode"])("td",A,[Object(o["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddVisitorIPToSearch"),onClick:function(n){return e.addFilter("visitIp",t.visitIp)}},Object(o["toDisplayString"])(t.visitIp),9,I)]),Object(o["createElementVNode"])("td",z,[Object(o["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddUserIdToSearch"),onClick:function(n){return e.addFilter("userId",t.userId)}},Object(o["toDisplayString"])(t.userId),9,L)]),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("span",{title:"".concat(t.deviceType," ").concat(t.deviceModel),style:{"margin-right":"3.5px"}},[Object(o["createElementVNode"])("img",{height:"16",src:t.deviceTypeIcon},null,8,F)],8,T),Object(o["createElementVNode"])("span",{title:t.operatingSystem,style:{"margin-right":"3.5px"}},[Object(o["createElementVNode"])("img",{height:"16",src:t.operatingSystemIcon},null,8,B)],8,x),Object(o["createElementVNode"])("span",{title:"".concat(t.browser," ").concat(t.browserFamilyDescription),style:{"margin-right":"3.5px"}},[Object(o["createElementVNode"])("img",{height:"16",src:t.browserIcon},null,8,U)],8,R),Object(o["createElementVNode"])("span",{title:"".concat(t.country," ").concat(t.region||"")},[Object(o["createElementVNode"])("img",{height:"16",src:t.countryFlag},null,8,H)],8,G)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("a",{class:"visitorLogTooltip",title:"View visitor profile",onClick:function(n){return e.showProfile(t.visitorId,t.idSite)}},[K,Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.translate("Live_ViewVisitorProfile")),1)],8,q)],512),[[o["vShow"],e.profileEnabled]])],8,_)})),128))])],512),[[ne]]),Object(o["createVNode"])(Z,{class:"exportDataSubjects",style:{"margin-right":"3.5px"},onConfirm:t[4]||(t[4]=function(t){return e.exportDataSubject()}),disabled:!e.hasActiveDataSubjects,value:e.translate("PrivacyManager_ExportSelectedVisits")},null,8,["disabled","value"]),Object(o["createVNode"])(Z,{class:"deleteDataSubjects",onConfirm:t[5]||(t[5]=function(t){return e.deleteDataSubject()}),disabled:!e.hasActiveDataSubjects||e.isDeleting,value:e.translate("PrivacyManager_DeleteSelectedVisits")},null,8,["disabled","value"])],512),[[o["vShow"],e.dataSubjects.length]]),Object(o["createElementVNode"])("div",W,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_DeleteVisitsConfirm")),1),Object(o["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Y),Object(o["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,J)],512)])}var X=n("19dc"),Z=n("f06f"),ee=n("a5a2"),te=Object(o["defineComponent"])({components:{ContentBlock:X["ContentBlock"],SiteSelector:X["SiteSelector"],SegmentGenerator:Z["SegmentGenerator"],SaveButton:ee["SaveButton"],Field:ee["Field"]},directives:{ContentTable:X["ContentTable"]},data:function(){return{isLoading:!1,isDeleting:!1,site:{id:"all",name:Object(X["translate"])("UsersManager_AllWebsites")},segment_filter:"userId==",dataSubjects:[],toggleAll:!0,hasSearched:!1,profileEnabled:X["Matomo"].visitorProfileEnabled,dataSubjectsActive:[]}},setup:function(){var e=X["AjaxHelper"].fetch({method:"SitesManager.getSitesIdWithAdminAccess",filter_limit:"-1"});return{getSites:function(){return e}}},methods:{showSuccessNotification:function(e){var t=X["NotificationsStore"].show({message:e,context:"success",id:"manageGdpr",type:"transient"});setTimeout((function(){X["NotificationsStore"].scrollToNotification(t)}),200)},linkTo:function(e){return"?".concat(X["MatomoUrl"].stringify(Object.assign(Object.assign({},X["MatomoUrl"].urlParsed.value),{},{module:"PrivacyManager",action:e})))},toggleActivateAll:function(){this.dataSubjectsActive.fill(this.toggleAll)},showProfile:function(e,t){X["Matomo"].helper.showVisitorProfilePopup(e,t)},exportDataSubject:function(){var e=this,t=this.activatedDataSubjects;X["AjaxHelper"].post({module:"API",method:"PrivacyManager.exportDataSubjects",format:"json",filter_limit:-1},{visits:t}).then((function(t){e.showSuccessNotification(Object(X["translate"])("PrivacyManager_VisitsSuccessfullyExported")),X["Matomo"].helper.sendContentAsDownload("exported_data_subjects.json",JSON.stringify(t))}))},deleteDataSubject:function(){var e=this;X["Matomo"].helper.modalConfirm(this.$refs.confirmDeleteDataSubject,{yes:function(){e.isDeleting=!0;var t=e.activatedDataSubjects;X["AjaxHelper"].post({module:"API",method:"PrivacyManager.deleteDataSubjects",filter_limit:-1},{visits:t}).then((function(){e.dataSubjects=[],e.showSuccessNotification(Object(X["translate"])("PrivacyManager_VisitsSuccessfullyDeleted")),e.findDataSubjects()})).finally((function(){e.isDeleting=!1}))}})},addFilter:function(e,t){this.segment_filter+=",".concat(e,"==").concat(t),this.findDataSubjects()},findDataSubjects:function(){var e=this;this.dataSubjects=[],this.dataSubjectsActive=[],this.isLoading=!0,this.toggleAll=!0,this.hasSearched=!1,this.getSites().then((function(t){var n=e.site.id;"all"!==n||X["Matomo"].hasSuperUserAccess||(n=t,Array.isArray(t)&&(n=t.join(","))),X["AjaxHelper"].fetch({idSite:n,module:"API",method:"PrivacyManager.findDataSubjects",segment:e.segment_filter}).then((function(t){e.hasSearched=!0,e.dataSubjectsActive=t.map((function(){return!0})),e.dataSubjects=t})).finally((function(){e.isLoading=!1}))}))}},computed:{hasActiveDataSubjects:function(){return!!this.activatedDataSubjects.length},activatedDataSubjects:function(){var e=this;return this.dataSubjects.filter((function(t,n){return e.dataSubjectsActive[n]})).map((function(e){return{idsite:e.idSite,idvisit:e.idVisit}}))},overviewHintText:function(){return Object(X["translate"])("PrivacyManager_GdprToolsOverviewHint",'<a href="'.concat(this.linkTo("gdprOverview"),'">'),"</a>")}}});te.render=Q;var ne=te,ae=Object(o["createElementVNode"])("br",null,null,-1),ie=Object(o["createElementVNode"])("br",null,null,-1),oe=Object(o["createElementVNode"])("br",null,null,-1),le=Object(o["createElementVNode"])("br",null,null,-1),re={key:0},ce=Object(o["createElementVNode"])("br",null,null,-1),se=Object(o["createElementVNode"])("br",null,null,-1),de={class:"alert-warning alert"};function ue(e,t,n,a,i,l){var r=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("SaveButton"),s=Object(o["resolveDirective"])("form");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeIpSettings",title:e.translate("PrivacyManager_UseAnonymizeIp"),modelValue:e.actualEnabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.actualEnabled=t}),"inline-help":e.anonymizeIpEnabledHelp},null,8,["title","modelValue","inline-help"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"radio",name:"maskLength",title:e.translate("PrivacyManager_AnonymizeIpMaskLengtDescription"),modelValue:e.actualMaskLength,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.actualMaskLength=t}),options:e.maskLengthOptions,"inline-help":e.translate("PrivacyManager_GeolocationAnonymizeIpNote")},null,8,["title","modelValue","options","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"radio",name:"useAnonymizedIpForVisitEnrichment",title:e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichment"),modelValue:e.actualUseAnonymizedIpForVisitEnrichment,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.actualUseAnonymizedIpForVisitEnrichment=t}),options:e.useAnonymizedIpForVisitEnrichmentOptions,"inline-help":e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichmentNote")},null,8,["title","modelValue","options","inline-help"])])],512),[[o["vShow"],e.actualEnabled]]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeUserId",title:e.translate("PrivacyManager_PseudonymizeUserId"),modelValue:e.actualAnonymizeUserId,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.actualAnonymizeUserId=t})},{"inline-help":Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote"))+" ",1),ae,ie,Object(o["createElementVNode"])("em",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote2")),1)]})),_:1},8,["title","modelValue"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeOrderId",title:e.translate("PrivacyManager_UseAnonymizeOrderId"),modelValue:e.actualAnonymizeOrderId,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.actualAnonymizeOrderId=t}),"inline-help":e.translate("PrivacyManager_AnonymizeOrderIdNote")},null,8,["title","modelValue","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"forceCookielessTracking",title:e.translate("PrivacyManager_ForceCookielessTracking"),modelValue:e.actualForceCookielessTracking,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.actualForceCookielessTracking=t})},{"inline-help":Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription",e.trackerFileName))+" ",1),oe,le,Object(o["createElementVNode"])("em",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription2")),1),e.trackerWritable?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",re,[ce,se,Object(o["createElementVNode"])("p",de,Object(o["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescriptionNotWritable",e.trackerFileName)),1)]))]})),_:1},8,["title","modelValue"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"select",name:"anonymizeReferrer",title:e.translate("PrivacyManager_AnonymizeReferrer"),modelValue:e.actualAnonymizeReferrer,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.actualAnonymizeReferrer=t}),options:e.referrerAnonymizationOptions,"inline-help":e.translate("PrivacyManager_AnonymizeReferrerNote")},null,8,["title","modelValue","options","inline-help"])]),Object(o["createVNode"])(c,{onConfirm:t[7]||(t[7]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}var me=Object(o["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:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["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,X["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=X["NotificationsStore"].show({message:Object(X["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"toast"});X["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}},computed:{anonymizeIpEnabledHelp:function(){var e=Object(X["translate"])("PrivacyManager_AnonymizeIpInlineHelp"),t=Object(X["translate"])("PrivacyManager_AnonymizeIpDescription");return"".concat(e," ").concat(t)}}});me.render=ue;var be=me,pe={class:"anonymizeLogData"},ve={class:"form-group row"},ge={class:"col s12 input-field"},je={for:"anonymizeSite",class:"siteSelectorLabel"},he={class:"sites_autocomplete"},Oe={class:"form-group row"},fe={class:"col s6 input-field"},ye={for:"anonymizeStartDate",class:"active"},Ve=["value"],De={class:"col s6 input-field"},Se={for:"anonymizeEndDate",class:"active"},Ne=["value"],Ee={name:"anonymizeIp"},_e={name:"anonymizeLocation"},ke={name:"anonymizeTheUserId"},Pe={class:"form-group row"},Ce={class:"col s12 m6"},Me={for:"visit_columns"},we={class:"innerFormField",name:"visit_columns"},Ae=["onClick","title"],Ie={class:"col s12 m6"},ze={class:"form-help"},Le={class:"inline-help"},Te={class:"form-group row"},Fe={class:"col s12"},xe={class:"form-group row"},Be={class:"col s12 m6"},Re={for:"action_columns"},Ue={class:"innerFormField",name:"action_columns"},Ge=["onClick","title"],He={class:"col s12 m6"},qe={class:"form-help"},Ke={class:"inline-help"},We=Object(o["createElementVNode"])("span",{class:"icon-info"},null,-1),$e={class:"ui-confirm",id:"confirmAnonymizeLogData",ref:"confirmAnonymizeLogData"},Ye=["value"],Je=["value"];function Qe(e,t,n,a,i,l){var r=Object(o["resolveComponent"])("SiteSelector"),c=Object(o["resolveComponent"])("Field"),s=Object(o["resolveComponent"])("SaveButton");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",pe,[Object(o["createElementVNode"])("div",ve,[Object(o["createElementVNode"])("div",ge,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",je,Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeSites")),1),Object(o["createElementVNode"])("div",he,[Object(o["createVNode"])(r,{id:"anonymizeSite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),"show-all-sites-item":!0,"switch-site-on-select":!1,"show-selected-site":!0},null,8,["modelValue"])])])])]),Object(o["createElementVNode"])("div",Oe,[Object(o["createElementVNode"])("div",fe,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",ye,Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeRowDataFrom")),1),Object(o["createElementVNode"])("input",{type:"text",id:"anonymizeStartDate",class:"anonymizeStartDate",ref:"anonymizeStartDate",name:"anonymizeStartDate",value:e.startDate,onKeydown:t[1]||(t[1]=function(t){return e.onKeydownStartDate(t)}),onChange:t[2]||(t[2]=function(t){return e.onKeydownStartDate(t)})},null,40,Ve)])]),Object(o["createElementVNode"])("div",De,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",Se,Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeRowDataTo")),1),Object(o["createElementVNode"])("input",{type:"text",class:"anonymizeEndDate",id:"anonymizeEndDate",ref:"anonymizeEndDate",name:"anonymizeEndDate",value:e.endDate,onKeydown:t[3]||(t[3]=function(t){return e.onKeydownEndDate(t)}),onChange:t[4]||(t[4]=function(t){return e.onKeydownEndDate(t)})},null,40,Ne)])])]),Object(o["createElementVNode"])("div",Ee,[Object(o["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeIp",title:e.translate("PrivacyManager_AnonymizeIp"),modelValue:e.anonymizeIp,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.anonymizeIp=t}),introduction:e.translate("General_Visit"),"inline-help":e.translate("PrivacyManager_AnonymizeIpHelp")},null,8,["title","modelValue","introduction","inline-help"])]),Object(o["createElementVNode"])("div",_e,[Object(o["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeLocation",title:e.translate("PrivacyManager_AnonymizeLocation"),modelValue:e.anonymizeLocation,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.anonymizeLocation=t}),"inline-help":e.translate("PrivacyManager_AnonymizeLocationHelp")},null,8,["title","modelValue","inline-help"])]),Object(o["createElementVNode"])("div",ke,[Object(o["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeTheUserId",title:e.translate("PrivacyManager_AnonymizeUserId"),modelValue:e.anonymizeUserId,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.anonymizeUserId=t}),"inline-help":e.translate("PrivacyManager_AnonymizeUserIdHelp")},null,8,["title","modelValue","inline-help"])]),Object(o["createElementVNode"])("div",Pe,[Object(o["createElementVNode"])("div",Ce,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",Me,Object(o["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumns")),1),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.selectedVisitColumns,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])("selectedVisitColumns selectedVisitColumns".concat(n," multiple valign-wrapper")),key:n},[Object(o["createElementVNode"])("div",we,[Object(o["createVNode"])(c,{uicontrol:"select",name:"visit_columns","model-value":t.column,"onUpdate:modelValue":function(n){t.column=n,e.onVisitColumnChange()},"full-width":!0,options:e.availableVisitColumns},null,8,["model-value","onUpdate:modelValue","options"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(t){return e.removeVisitColumn(n)},title:e.translate("General_Remove")},null,8,Ae),[[o["vShow"],n+1!==e.selectedVisitColumns.length]])],2)})),128))])]),Object(o["createElementVNode"])("div",Ie,[Object(o["createElementVNode"])("div",ze,[Object(o["createElementVNode"])("span",Le,Object(o["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumnsHelp")),1)])])]),Object(o["createElementVNode"])("div",Te,[Object(o["createElementVNode"])("div",Fe,[Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("General_Action")),1)])]),Object(o["createElementVNode"])("div",xe,[Object(o["createElementVNode"])("div",Be,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",Re,Object(o["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumns")),1),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.selectedActionColumns,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])("selectedActionColumns selectedActionColumns".concat(n," multiple valign-wrapper")),key:n},[Object(o["createElementVNode"])("div",Ue,[Object(o["createVNode"])(c,{uicontrol:"select",name:"action_columns","model-value":t.column,"onUpdate:modelValue":function(n){t.column=n,e.onActionColumnChange()},"full-width":!0,options:e.availableActionColumns},null,8,["model-value","onUpdate:modelValue","options"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(t){return e.removeActionColumn(n)},title:e.translate("General_Remove")},null,8,Ge),[[o["vShow"],n+1!==e.selectedActionColumns.length]])],2)})),128))])]),Object(o["createElementVNode"])("div",He,[Object(o["createElementVNode"])("div",qe,[Object(o["createElementVNode"])("span",Ke,Object(o["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumnsHelp")),1)])])]),Object(o["createElementVNode"])("p",null,[We,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeProcessInfo")),1)]),Object(o["createVNode"])(s,{class:"anonymizePastData",onConfirm:t[8]||(t[8]=function(t){return e.scheduleAnonymization()}),disabled:e.isAnonymizePastDataDisabled,value:e.translate("PrivacyManager_AnonymizeDataNow")},null,8,["disabled","value"]),Object(o["createElementVNode"])("div",$e,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeDataConfirm")),1),Object(o["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Ye),Object(o["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,Je)],512)])}function Xe(e){return e<10?"0".concat(e):e}var Ze=Object(o["defineComponent"])({components:{SiteSelector:X["SiteSelector"],Field:ee["Field"],SaveButton:ee["SaveButton"]},data:function(){var e=new Date,t="".concat(e.getFullYear(),"-").concat(Xe(e.getMonth()+1),"-").concat(Xe(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:t,endDate:t}},created:function(){var e=this;this.onKeydownStartDate=Object(X["debounce"])(this.onKeydownStartDate,50),this.onKeydownEndDate=Object(X["debounce"])(this.onKeydownEndDate,50),X["AjaxHelper"].fetch({method:"PrivacyManager.getAvailableVisitColumnsToAnonymize"}).then((function(t){e.availableVisitColumns=[],t.forEach((function(t){e.availableVisitColumns.push({key:t.column_name,value:t.column_name})}))})),X["AjaxHelper"].fetch({method:"PrivacyManager.getAvailableLinkVisitActionColumnsToAnonymize"}).then((function(t){e.availableActionColumns=[],t.forEach((function(t){e.availableActionColumns.push({key:t.column_name,value:t.column_name})}))})),setTimeout((function(){var t=X["Matomo"].getBaseDatePickerOptions(null),n=X["Matomo"].getBaseDatePickerOptions(null);$(e.$refs.anonymizeStartDate).datepicker(t),$(e.$refs.anonymizeEndDate).datepicker(n)}))},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 t=this.selectedVisitColumns.length-1;t===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 t=this.selectedActionColumns.length-1;t===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 t={date:e};t.idSites=this.site.id,t.anonymizeIp=this.anonymizeIp?"1":"0",t.anonymizeLocation=this.anonymizeLocation?"1":"0",t.anonymizeUserId=this.anonymizeUserId?"1":"0",t.unsetVisitColumns=this.selectedVisitColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),t.unsetLinkVisitActionColumns=this.selectedActionColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),X["Matomo"].helper.modalConfirm(this.$refs.confirmAnonymizeLogData,{yes:function(){X["AjaxHelper"].post({method:"PrivacyManager.anonymizeSomeRawData"},t).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}}});Ze.render=Qe;var et=Ze;function tt(e,t,n,a,i,l){var r=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("SaveButton"),s=Object(o["resolveDirective"])("form");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"radio",name:"doNotTrack",modelValue:e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enabled=t}),options:e.doNotTrackOptions,"inline-help":e.translate("PrivacyManager_DoNotTrack_Description")},null,8,["modelValue","options","inline-help"])]),Object(o["createVNode"])(c,{onConfirm:t[1]||(t[1]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}var nt=Object(o["defineComponent"])({props:{dntSupport:Boolean,doNotTrackOptions:{type:Array,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,enabled:this.dntSupport?1:0}},methods:{save:function(){var e=this;this.isLoading=!0;var t="deactivateDoNotTrack";this.enabled&&"0"!==this.enabled&&(t="activateDoNotTrack"),X["AjaxHelper"].post({module:"API",method:"PrivacyManager.".concat(t)}).then((function(){var e=X["NotificationsStore"].show({message:Object(X["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"transient"});X["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}}});nt.render=tt;var at=nt;function it(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ot(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function lt(e,t,n){return t&&ot(e.prototype,t),n&&ot(e,n),e}function rt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * diff --git a/plugins/PrivacyManager/vue/src/ManageGdpr/ManageGdpr.vue b/plugins/PrivacyManager/vue/src/ManageGdpr/ManageGdpr.vue index 91fb1ded0a..09a543b336 100644 --- a/plugins/PrivacyManager/vue/src/ManageGdpr/ManageGdpr.vue +++ b/plugins/PrivacyManager/vue/src/ManageGdpr/ManageGdpr.vue @@ -180,7 +180,7 @@ /> </span> <span - :title="`${dataSubject.country} ${dataSubject.region}`" + :title="`${dataSubject.country} ${dataSubject.region || ''}`" > <img height="16" @@ -266,7 +266,7 @@ interface DataSubject { lastActionDateTime: string; operatingSystem: string; operatingSystemIcon: string; - region: string; + region: string|null; siteName: string; userId: string|null; visitIp: string; |