diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2018-11-09 09:04:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-09 09:04:27 +0300 |
commit | 6c0b49387d58768d0cbbd0a50ea1b4b4b83b15e1 (patch) | |
tree | c9c80921fca2910699395b8675aaed4a8644b2ec | |
parent | 3bc57d6e4df80ff1969151d75a378ab2233f8067 (diff) |
Add Matomo Tag Manager to core (#13402)
77 files changed, 1663 insertions, 57 deletions
diff --git a/.gitmodules b/.gitmodules index 9dba8f8fe1..4d30b7ac0b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -54,6 +54,10 @@ path = plugins/MarketingCampaignsReporting url = https://github.com/matomo-org/plugin-MarketingCampaignsReporting.git branch = master +[submodule "plugins/TagManager"] + path = plugins/TagManager + url = https://github.com/matomo-org/tag-manager.git + branch = master # Add new Plugin submodule above this line ^^ # diff --git a/plugins/CoreAdminHome/tests/UI/expected-screenshots/CustomLogo_admin.png b/plugins/CoreAdminHome/tests/UI/expected-screenshots/CustomLogo_admin.png index a71548b992..d4fb6dfc2c 100644 --- a/plugins/CoreAdminHome/tests/UI/expected-screenshots/CustomLogo_admin.png +++ b/plugins/CoreAdminHome/tests/UI/expected-screenshots/CustomLogo_admin.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d42f6de432ddd4c1a02cb399afdc631e602ce70e5b68109ef437e045fdb5adfb -size 8428 +oid sha256:5e2810836dd85734c1e403e431ba08bbe9977f0fbbeb4cef6a6104b193a84f36 +size 10065 diff --git a/plugins/CoreAdminHome/tests/UI/expected-screenshots/CustomLogo_admin_svg.png b/plugins/CoreAdminHome/tests/UI/expected-screenshots/CustomLogo_admin_svg.png index a3cfbf300b..3449754eef 100644 --- a/plugins/CoreAdminHome/tests/UI/expected-screenshots/CustomLogo_admin_svg.png +++ b/plugins/CoreAdminHome/tests/UI/expected-screenshots/CustomLogo_admin_svg.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5e3741105c1068d6ecf66a66c0fa3717c5c10166130bd85063dc4e37ef06ccfb -size 9917 +oid sha256:ebe0e33b75e10316a639e154146b57fe9c40595f9c17e332d20604bead5299ee +size 11479 diff --git a/plugins/CorePluginsAdmin/Controller.php b/plugins/CorePluginsAdmin/Controller.php index e9b8c59669..695cfef33f 100644 --- a/plugins/CorePluginsAdmin/Controller.php +++ b/plugins/CorePluginsAdmin/Controller.php @@ -20,9 +20,11 @@ use Piwik\Nonce; use Piwik\Notification; use Piwik\Piwik; use Piwik\Plugin; +use Piwik\Plugins\CorePluginsAdmin\Model\TagManagerTeaser; use Piwik\Plugins\Marketplace\Marketplace; use Piwik\Plugins\Marketplace\Controller as MarketplaceController; use Piwik\Plugins\Marketplace\Plugins; +use Piwik\Settings\Storage\Backend\PluginSettingsTable; use Piwik\SettingsPiwik; use Piwik\Translation\Translator; use Piwik\Url; @@ -144,8 +146,52 @@ class Controller extends Plugin\ControllerAdmin $this->redirectToIndex('Marketplace', 'overview', null, null, null, array('show' => 'themes')); } + public function tagManagerTeaser() + { + $this->dieIfPluginsAdminIsDisabled(); + Piwik::checkUserHasSomeAdminAccess(); + + $tagManagerTeaser = new TagManagerTeaser(Piwik::getCurrentUserLogin()); + + if (!$tagManagerTeaser->shouldShowTeaser()) { + $this->redirectToIndex('CoreHome', 'index'); + return; + } + + $nonce = ''; + if (Piwik::hasUserSuperUserAccess()) { + $nonce = Nonce::getNonce(static::ACTIVATE_NONCE); + } + + $superUsers = Request::processRequest('UsersManager.getUsersHavingSuperUserAccess', [], []); + $emails = implode(',', array_column($superUsers, 'email')); + + $view = new View('@CorePluginsAdmin/tagManagerTeaser'); + $this->setGeneralVariablesView($view); + $view->superUserEmails = $emails; + $view->nonce = $nonce; + return $view->render(); + } + + public function disableActivateTagManagerPage() + { + $this->dieIfPluginsAdminIsDisabled(); + Piwik::checkUserHasSomeAdminAccess(); + + $tagManagerTeaser = new TagManagerTeaser(Piwik::getCurrentUserLogin()); + + if (Piwik::hasUserSuperUserAccess()) { + $tagManagerTeaser->disableGlobally(); + } else { + $tagManagerTeaser->disableForUser(); + } + + $this->redirectToIndex('CoreHome', 'index'); + } + private function dieIfPluginsAdminIsDisabled() { + Piwik::checkUserIsNotAnonymous(); if (!CorePluginsAdmin::isPluginsAdminEnabled()) { throw new \Exception('Enabling, disabling and uninstalling plugins has been disabled by Piwik admins. Please contact your Piwik admins with your request so they can assist you.'); @@ -395,6 +441,8 @@ class Controller extends Plugin\ControllerAdmin $redirectTo = Common::getRequestVar('redirectTo', '', 'string'); if (!empty($redirectTo) && $redirectTo === 'marketplace') { $this->redirectToIndex('Marketplace', 'overview'); + } elseif (!empty($redirectTo) && $redirectTo === 'tagmanager') { + $this->redirectToIndex('TagManager', 'gettingStarted'); } elseif (!empty($redirectTo) && $redirectTo === 'referrer') { $this->redirectAfterModification($redirectAfter); } else { diff --git a/plugins/CorePluginsAdmin/CorePluginsAdmin.php b/plugins/CorePluginsAdmin/CorePluginsAdmin.php index c12ad281bd..b83efbbb83 100644 --- a/plugins/CorePluginsAdmin/CorePluginsAdmin.php +++ b/plugins/CorePluginsAdmin/CorePluginsAdmin.php @@ -12,6 +12,7 @@ use Piwik\Config; use Piwik\Piwik; use Piwik\Plugin; use Piwik\Plugins\CoreHome\SystemSummary; +use Piwik\Plugins\CorePluginsAdmin\Model\TagManagerTeaser; class CorePluginsAdmin extends Plugin { @@ -24,10 +25,20 @@ class CorePluginsAdmin extends Plugin 'AssetManager.getJavaScriptFiles' => 'getJsFiles', 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', 'System.addSystemSummaryItems' => 'addSystemSummaryItems', - 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys' + 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', + 'PluginManager.pluginActivated' => 'onPluginActivated' ); } + public function onPluginActivated($pluginName) + { + if ($pluginName === 'TagManager') { + // make sure once activated once, it won't appear when disabling Tag Manager later + $tagManagerTeaser = new TagManagerTeaser(Piwik::getCurrentUserLogin()); + $tagManagerTeaser->disableGlobally(); + } + } + public function addSystemSummaryItems(&$systemSummary) { $numPlugins = Plugin\Manager::getInstance()->getNumberOfActivatedPluginsExcludingAlwaysActivated(); diff --git a/plugins/CorePluginsAdmin/Menu.php b/plugins/CorePluginsAdmin/Menu.php index 8e1b57ef40..b858db7e8f 100644 --- a/plugins/CorePluginsAdmin/Menu.php +++ b/plugins/CorePluginsAdmin/Menu.php @@ -10,7 +10,10 @@ namespace Piwik\Plugins\CorePluginsAdmin; use Piwik\Container\StaticContainer; use Piwik\Menu\MenuAdmin; +use Piwik\Menu\MenuTop; use Piwik\Piwik; +use Piwik\Plugin; +use Piwik\Plugins\CorePluginsAdmin\Model\TagManagerTeaser; use Piwik\Plugins\Marketplace\Marketplace; use Piwik\Plugins\Marketplace\Plugins; @@ -32,6 +35,15 @@ class Menu extends \Piwik\Plugin\Menu } } + public function configureTopMenu(MenuTop $menu) + { + $tagManagerTeaser = new TagManagerTeaser(Piwik::getCurrentUserLogin()); + + if ($tagManagerTeaser->shouldShowTeaser()) { + $menu->addItem('Tag Manager', null, $this->urlForAction('tagManagerTeaser')); + } + } + public function configureAdminMenu(MenuAdmin $menu) { $hasSuperUserAcess = Piwik::hasUserSuperUserAccess(); diff --git a/plugins/CorePluginsAdmin/Model/TagManagerTeaser.php b/plugins/CorePluginsAdmin/Model/TagManagerTeaser.php new file mode 100644 index 0000000000..54fdb1e9b1 --- /dev/null +++ b/plugins/CorePluginsAdmin/Model/TagManagerTeaser.php @@ -0,0 +1,85 @@ +<?php +/** + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ +namespace Piwik\Plugins\CorePluginsAdmin\Model; + +use Piwik\Plugin; +use Piwik\Option; +use Piwik\Piwik; +use Piwik\Plugins\CorePluginsAdmin\CorePluginsAdmin; +use Piwik\Settings\Storage\Backend\PluginSettingsTable; + +class TagManagerTeaser +{ + const DISABLE_GLOBALLY_KEY = 'CorePluginsAdmin.disableTagManagerTeaser'; + + /** + * @var string + */ + private $login; + + public function __construct($login) + { + $this->login = $login; + } + + public function shouldShowTeaser() + { + $pluginManager = Plugin\Manager::getInstance(); + + return CorePluginsAdmin::isPluginsAdminEnabled() + && (!$pluginManager->isPluginActivated('TagManager') + || !$pluginManager->isPluginLoaded('TagManager')) + && $pluginManager->isPluginInFilesystem('TagManager') + && Piwik::isUserHasSomeAdminAccess() + && $this->isEnabledGlobally() + && $this->isEnabledForUser(); + } + + public function disableForUser() + { + $table = $this->getTable(); + $settings = $table->load(); + $settings['disable_activate_tag_manager_page'] = 1; + $table->save($settings); + } + + public function isEnabledForUser() + { + $pluginSettingsTable = $this->getTable(); + $settings = $pluginSettingsTable->load(); + + return empty($settings['disable_activate_tag_manager_page']); + } + + public function disableGlobally() + { + $this->reset(); + Option::set(self::DISABLE_GLOBALLY_KEY, 1, true); + } + + public function reset() + { + Option::delete(self::DISABLE_GLOBALLY_KEY); + + // no need to keep any old login entries + $this->getTable()->save(array()); + } + + public function isEnabledGlobally() + { + $value = Option::get(self::DISABLE_GLOBALLY_KEY); + return empty($value); + } + + private function getTable() + { + return new PluginSettingsTable('CorePluginsAdmin', $this->login); + } + +} diff --git a/plugins/CorePluginsAdmin/config/test.php b/plugins/CorePluginsAdmin/config/test.php new file mode 100644 index 0000000000..71cc69dda5 --- /dev/null +++ b/plugins/CorePluginsAdmin/config/test.php @@ -0,0 +1,19 @@ +<?php + +return array( + 'observers.global' => DI\add(array( + array('Request.dispatchCoreAndPluginUpdatesScreen', function () { + $pluginName = 'TagManager'; + $unloadTagManager = \Piwik\Container\StaticContainer::get('test.vars.unloadTagManager'); + $tagManagerTeaser = new \Piwik\Plugins\CorePluginsAdmin\Model\TagManagerTeaser(\Piwik\Piwik::getCurrentUserLogin()); + if ($unloadTagManager) { + $pluginManager = \Piwik\Plugin\Manager::getInstance(); + if ($pluginManager->isPluginActivated($pluginName) + && $pluginManager->isPluginLoaded($pluginName)) { + $pluginManager->unloadPlugin($pluginName); + } + $tagManagerTeaser->reset(); + } + }), + )) +); diff --git a/plugins/CorePluginsAdmin/lang/en.json b/plugins/CorePluginsAdmin/lang/en.json index eab5ce5052..8ab8ca0948 100644 --- a/plugins/CorePluginsAdmin/lang/en.json +++ b/plugins/CorePluginsAdmin/lang/en.json @@ -57,6 +57,24 @@ "TeaserExtendPiwikByPlugin": "Extend Matomo by %1$sinstalling plugins from the Marketplace%2$s or %3$supload a plugin in .zip format%4$s.", "TeaserExtendPiwikByTheme": "Enjoy another look & feel by %1$sinstalling a new theme%2$s.", "InstallingNewPluginViaMarketplaceOrUpload": "You may automatically install plugins from the Marketplace or %1$supload a plugin%2$s in .zip format.", + "TagManagerNowAvailableTitle": "Matomo Tag Manager is now available", + "TagManagerNowAvailableSubtitle": "Manage all your tags easily through one platform to get the insights you want, the opportunities are endless!", + "ActivateTagManagerNow": "Activate Tag Manager now", + "TagManagerEmailSuperUserToActivate": "Email Super Users to activate this new feature", + "TagManagerTeaserHideSuperUser": "Do not show this page to any user", + "TagManagerTeaserHideNonSuperUser": "Not interested, do not show this page again", + "TagManagerTeaserEmailSuperUserBody": "Hi,%1$sMatomo Tag Manager is now available within Matomo and I would love to use this new feature. As you have Super User access, could you activate this feature through the Tag Manager page in the top menu?%2$sThe Matomo URL is %3$s.%4$sThanks", + "WhatIsTagManager": "What is a Tag Manager?", + "WhatIsTagManagerDetails1": "Similar to how a Content Management System (CMS) brings you all the flexibility to publish content for your website without having the technical HTML/CSS knowledge, a Tag Management System (TMS) is your go-to for simplifying the process of embedding first and third-party application tracking tags (also known as snippets or pixels) on your website.", + "WhatIsTagManagerDetails2": "Say you want to see the results of your conversions/goals, newsletter signups, social widgets, exit popups and remarketing campaigns; what was once a highly technical and time consuming process is now easily done within the TMS and takes only a few clicks to implement.", + "TagManagerLearnMoreInUserGuide": "Learn more in the Tag Manager User Guide", + "WhyUsingATagManager": "Why a Tag Manager?", + "WhyUsingATagManagerDetails1": "A Tag Manager makes your life easier! You no longer need to wait on a developer to modify any first or third-party snippets on your website as the Tag Manager gives you a stress-free experience to make these changes and deploy your website yourself.", + "WhyUsingATagManagerDetails2": "It couldn't be more convenient and it not only lets you bring changes to the market faster, but also reduces cost.", + "WhyUsingATagManagerDetails3": "This keeps the marketing teams, digital teams and the IT guys happy... It’s a win-win for everyone!", + "AreThereAnyRisks": "Are there any risks?", + "AreThereAnyRisksDetails1": "When you activate the Tag Manager, users with admin access will be able to create custom HTML tags, triggers, and variables that may execute JavaScript on your website. These custom templates could be misused to steal, for example, sensitive information from your website visitors (known as %1$sXSS%2$s).", + "AreThereAnyRisksDetails2": "You can disable these custom templates under \"Administration => General Settings\" once you have activated the Tag Manager. Alternatively, you can also restrict the usage of these templates to specific users or super users only.", "Theme": "Theme", "Themes": "Themes", "ThemesDescription": "Themes can change the appearance of Matomo user interface, and provide a completely new visual experience to enjoy your analytics reports.", diff --git a/plugins/CorePluginsAdmin/stylesheets/plugins_admin.less b/plugins/CorePluginsAdmin/stylesheets/plugins_admin.less index 0adcbc1216..3c30b98226 100644 --- a/plugins/CorePluginsAdmin/stylesheets/plugins_admin.less +++ b/plugins/CorePluginsAdmin/stylesheets/plugins_admin.less @@ -142,3 +142,10 @@ table.entityTable tr td a.uninstall { margin-left: 20px; } } + + +.activateTagManager { + .dontShowAgainBtn { + background-color: @theme-color-text-lighter; + } +} diff --git a/plugins/CorePluginsAdmin/templates/tagManagerTeaser.twig b/plugins/CorePluginsAdmin/templates/tagManagerTeaser.twig new file mode 100644 index 0000000000..1aa9f62a85 --- /dev/null +++ b/plugins/CorePluginsAdmin/templates/tagManagerTeaser.twig @@ -0,0 +1,73 @@ +{% extends 'dashboard.twig' %} + +{% block topcontrols %} +{% endblock %} + +{% block content %} +<div class="activateTagManager"> + <div class="row"> + <div class="col s12" style="text-align: center;"> + <h2>{{ 'CorePluginsAdmin_TagManagerNowAvailableTitle'|translate }}</h2> + <p>{{ 'CorePluginsAdmin_TagManagerNowAvailableSubtitle'|translate }}</p> + </div> + </div> + {% set actionBlock %} + <div class="row"> + <div class="col s12"> + <div style="text-align: center;"> + {% if isSuperUser %} + <a href="{{ linkTo({'module': 'CorePluginsAdmin', 'action': 'activate', 'nonce': nonce, 'pluginName': 'TagManager', 'redirectTo': 'tagmanager'}) }}" + class="btn activateTagManagerPlugin"><span class="icon-rocket"></span> {{ 'CorePluginsAdmin_ActivateTagManagerNow'|translate }} <span class="icon-rocket"></span></a> + {% else %} + <a href="mailto:{{ superUserEmails|e('url') }}?subject={{ 'CorePluginsAdmin_TagManagerNowAvailableTitle'|translate|e('url') }}&body={{ 'CorePluginsAdmin_TagManagerTeaserEmailSuperUserBody'|translate("\n\n", "\n\n", piwikUrl, "\n\n")|e('url') }}" + class="btn activateTagManagerPlugin"><span class="icon-rocket"></span> {{ 'CorePluginsAdmin_TagManagerEmailSuperUserToActivate'|translate }} <span class="icon-rocket"></span></a> + {% endif %} + + <a href="{{ linkTo({'module': 'CorePluginsAdmin', 'action': 'disableActivateTagManagerPage'}) }}" + class="btn dontShowAgainBtn"><span class="icon-hide"></span> + {% if isSuperUser %}{{ 'CorePluginsAdmin_TagManagerTeaserHideSuperUser'|translate }}{% else %}{{ 'CorePluginsAdmin_TagManagerTeaserHideNonSuperUser'|translate }}{% endif %} + </a> + </div> + </div> + </div> + {% endset %} + {{ actionBlock|raw }} + <div class="row"> + <div class="col {% if isSuperUser %}l4{% else %}l6{% endif %} m12 s12"> + <div piwik-content-block content-title="{{ 'CorePluginsAdmin_WhatIsTagManager'|translate }}"> + <p> + {{ 'CorePluginsAdmin_WhatIsTagManagerDetails1'|translate }}<br /><br /> + {{ 'CorePluginsAdmin_WhatIsTagManagerDetails2'|translate }}<br /><br /> + <a href="https://matomo.org/docs/tag-manager" rel="noreferrer noopener">{{ 'CorePluginsAdmin_TagManagerLearnMoreInUserGuide'|translate }}</a> + </p> + </div> + </div> + <div class="col {% if isSuperUser %}l4{% else %}l6{% endif %} m12 s12"> + <div piwik-content-block content-title="{{ 'CorePluginsAdmin_WhyUsingATagManager'|translate }}"> + <p> + {{ 'CorePluginsAdmin_WhyUsingATagManagerDetails1'|translate }} + <br /><br /> + {{ 'CorePluginsAdmin_WhyUsingATagManagerDetails2'|translate }} + <br /><br /> + {{ 'CorePluginsAdmin_WhyUsingATagManagerDetails3'|translate }} + <br /><br /><br /> + <a href="https://matomo.org/docs/tag-manager" rel="noreferrer noopener">{{ 'CorePluginsAdmin_TagManagerLearnMoreInUserGuide'|translate }}</a> + </p> + </div> + </div> + {% if isSuperUser %} + <div class="col l4 m12 s12"> + <div piwik-content-block content-title="{{ 'CorePluginsAdmin_AreThereAnyRisks'|translate }}"> + + {{ 'CorePluginsAdmin_AreThereAnyRisksDetails1'|translate('<a rel="noreferrer noopener" href="https://en.wikipedia.org/wiki/Cross-site_scripting">', '</a>')|raw }} + <br /><br /> + {{ 'CorePluginsAdmin_AreThereAnyRisksDetails2'|translate }} + <br /><br /><br /> + <a href="https://matomo.org/docs/tag-manager/#website-security" rel="noreferrer noopener">{{ 'CorePluginsAdmin_TagManagerLearnMoreInUserGuide'|translate }}</a> + </div> + </div> + {% endif %} + </div> + {{ actionBlock|raw }} +</div> +{% endblock %} diff --git a/plugins/CorePluginsAdmin/tests/Integration/TagManagerTeaserTest.php b/plugins/CorePluginsAdmin/tests/Integration/TagManagerTeaserTest.php new file mode 100644 index 0000000000..7b28bf339e --- /dev/null +++ b/plugins/CorePluginsAdmin/tests/Integration/TagManagerTeaserTest.php @@ -0,0 +1,106 @@ +<?php +/** + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +namespace Piwik\Plugins\CorePluginsAdmin\tests\Integration; + +use Piwik\Plugin; +use Piwik\Plugins\CorePluginsAdmin\Model\TagManagerTeaser; +use Piwik\Tests\Framework\TestCase\IntegrationTestCase; + +/** + * @group CorePluginsAdmin + * @group ApiTest + * @group Api + * @group Plugins + */ +class TagManagerTeaserTest extends IntegrationTestCase +{ + /** + * @var TagManagerTeaser + */ + private $teaser; + + public function setUp() + { + parent::setUp(); + + Plugin\Manager::getInstance()->deactivatePlugin('TagManager'); + + $this->teaser = $this->makeTeaser('mylogin'); + } + + private function makeTeaser($login) + { + return new TagManagerTeaser($login); + } + + public function test_isEnabledGloballyByDefault() + { + $this->assertTrue($this->teaser->isEnabledGlobally()); + } + + public function test_disableGlobally() + { + $this->teaser->disableGlobally(); + $this->assertFalse($this->teaser->isEnabledGlobally()); + } + + public function test_reset() + { + $this->teaser->disableGlobally(); + $this->assertFalse($this->teaser->isEnabledGlobally()); + $this->teaser->reset(); + $this->assertTrue($this->teaser->isEnabledGlobally()); + } + + public function test_disableGlobally_removesUserSettings() + { + $this->teaser->disableForUser(); + $this->assertFalse($this->teaser->isEnabledForUser()); + + $this->teaser->disableGlobally(); + + $this->assertFalse($this->teaser->isEnabledGlobally()); + // should reset user enable flags cause disabled globally anyway + $this->assertTrue($this->teaser->isEnabledForUser()); + } + + public function test_isEnabledForCurrentUserByDefault() + { + $this->assertTrue($this->teaser->isEnabledForUser()); + } + + public function test_disableForUser() + { + $this->teaser->disableForUser(); + $this->assertFalse($this->teaser->isEnabledForUser()); + + // still enabled globally + $this->assertTrue($this->teaser->isEnabledGlobally()); + + // still enabled for other user + $otherUser = $this->makeTeaser('foobar123'); + $this->assertTrue($otherUser->isEnabledForUser()); + } + + public function test_shouldShowTeaser() + { + $this->assertTrue($this->teaser->shouldShowTeaser()); + $this->assertTrue($this->teaser->isEnabledGlobally()); + } + + public function test_shouldShowTeaser_shouldNotBeShownWhenTagManagerEnabled() + { + Plugin\Manager::getInstance()->activatePlugin('TagManager'); + $this->assertFalse($this->teaser->shouldShowTeaser()); + // should have been disabled automatically + $this->assertFalse($this->teaser->isEnabledGlobally()); + } + + +} diff --git a/plugins/CorePluginsAdmin/tests/UI/.gitignore b/plugins/CorePluginsAdmin/tests/UI/.gitignore new file mode 100644 index 0000000000..f39be478e7 --- /dev/null +++ b/plugins/CorePluginsAdmin/tests/UI/.gitignore @@ -0,0 +1,2 @@ +/processed-ui-screenshots +/screenshot-diffs
\ No newline at end of file diff --git a/plugins/CorePluginsAdmin/tests/UI/TagManagerTeaser_spec.js b/plugins/CorePluginsAdmin/tests/UI/TagManagerTeaser_spec.js new file mode 100644 index 0000000000..f892f42bed --- /dev/null +++ b/plugins/CorePluginsAdmin/tests/UI/TagManagerTeaser_spec.js @@ -0,0 +1,92 @@ +/*! + * Matomo - free/libre analytics platform + * + * Screenshot integration tests. + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +describe("TagManagerTeaser", function () { + this.timeout(0); + + var urlBase = '?module=CorePluginsAdmin&action=tagManagerTeaser&idSite=1&period=day&date=2010-01-03', + pageSelector = '.activateTagManager'; + + function setPluginsToLoad(plugins) + { + testEnvironment.pluginsToLoad = plugins + testEnvironment.save(); + } + + function unloadTagManager() + { + testEnvironment.unloadTagManager = 1; + testEnvironment.save(); + } + + function setAdminUser() + { + delete testEnvironment.idSitesViewAccess; + delete testEnvironment.idSitesWriteAccess; + testEnvironment.idSitesAdminAccess = [1]; + testEnvironment.save(); + } + + function reset() + { + delete testEnvironment.idSitesViewAccess; + delete testEnvironment.idSitesWriteAccess; + delete testEnvironment.idSitesAdminAccess; + delete testEnvironment.idSitesCapabilities; + delete testEnvironment.unloadTagManager; + testEnvironment.save(); + } + + beforeEach(function () { + setPluginsToLoad(['CorePluginsAdmin']); + }); + + afterEach(reset); + + function capturePage(done, screenshotName, test, selector) + { + if (!selector) { + selector = pageSelector; + } + expect.screenshot(screenshotName).to.be.captureSelector(selector, test, done); + } + + it('should show teaser to super user', function (done) { + unloadTagManager(); + capturePage(done, 'superuser_page', function (page) { + unloadTagManager(); + page.load(urlBase); + }); + }); + + it('should be possible to activate plugin and redirect to tag manager', function (done) { + capturePage(done, 'super_user_activate_plugin', function (page) { + page.click('.activateTagManager .activateTagManagerPlugin'); + }, '.pageWrap'); + }); + + it('should show teaser to admin', function (done) { + unloadTagManager(); + setAdminUser(); + capturePage(done, 'admin_page', function (page) { + unloadTagManager(); + setAdminUser(); + page.load(urlBase); + }); + }); + + it('should be possible to disable page and redirect to home', function (done) { + capturePage(done, 'admin_page_disable', function (page) { + unloadTagManager(); + setAdminUser(); + page.click('.activateTagManager .dontShowAgainBtn'); + }, '.pageWrap'); + }); + +});
\ No newline at end of file diff --git a/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/.gitkeep b/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/.gitkeep diff --git a/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_admin_page.png b/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_admin_page.png new file mode 100644 index 0000000000..73344efb78 --- /dev/null +++ b/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_admin_page.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd7ff984c4a1b5d341bdbf221f33f5ba0b82c4d65280f48a93ebd329c8412ae2 +size 156916 diff --git a/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_admin_page_disable.png b/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_admin_page_disable.png new file mode 100644 index 0000000000..caaeb7edee --- /dev/null +++ b/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_admin_page_disable.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72823683d6dcf3c3f423ca4519cfc33c9bc9166a31acde992a737b00bd9ddd2b +size 142530 diff --git a/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_super_user_activate_plugin.png b/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_super_user_activate_plugin.png new file mode 100644 index 0000000000..7e962c324f --- /dev/null +++ b/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_super_user_activate_plugin.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4fcce39e90d28b3c78d311d50a546c7c6a30c52b028e4a3dce38daa4da395a0 +size 208986 diff --git a/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_superuser_page.png b/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_superuser_page.png new file mode 100644 index 0000000000..8a483e976d --- /dev/null +++ b/plugins/CorePluginsAdmin/tests/UI/expected-screenshots/TagManagerTeaser_superuser_page.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0351e3a807ae93574d8d303a734a16b226bde1254929f8b3d9d11857f850a93e +size 202635 diff --git a/plugins/CoreUpdater/tests/UI/expected-screenshots/CoreUpdaterCode_newVersion.png b/plugins/CoreUpdater/tests/UI/expected-screenshots/CoreUpdaterCode_newVersion.png index e82dad6f88..19963b8b2d 100644 --- a/plugins/CoreUpdater/tests/UI/expected-screenshots/CoreUpdaterCode_newVersion.png +++ b/plugins/CoreUpdater/tests/UI/expected-screenshots/CoreUpdaterCode_newVersion.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:15f8c9d337cc24d3a8359c2e9c15ca47ca7e4494534920151b4f709ad0c4be20 -size 107457 +oid sha256:d4f7acec863931b6f31e5f2ce6f1e438494913e7b1d0e9b9d0c0a80918eabeb8 +size 111551 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png index 6d8cb7adeb..86f29c57d4 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4eed2ccd11a0fd8867a9f83721d674cdcc80d3b3fafaa3e28e237201480e0e65 -size 47578 +oid sha256:c0e9e0f54f4aaa087c089bacc5b0084f37efb0e13c5daf558f0fcaf0f043bca7 +size 48890 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png index 2c120280ea..08b4bc5327 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:65caea6e601e5e47179910f7734a43fb69012039d389f0d230ad11cc063ecc37 -size 417251 +oid sha256:31fe6383aec3a6d76a28cc468a27cb3eed32de039acc5dba8722eedd70ded8ea +size 420877 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_loaded_token_auth.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_loaded_token_auth.png index ae84d07882..9c82e8c27b 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_loaded_token_auth.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_loaded_token_auth.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c23d08478368cd1cf5e6c04514c52a591943731baf4d818f15fa10c7443b1e5e -size 618492 +oid sha256:a151aaa5548a2c7e6fa4f495a33452fe679677c1230ad0572256455bfd3bd5cc +size 622120 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_removed.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_removed.png index 3eb663181a..0041ce0a72 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_removed.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_removed.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d8403f3404111b1b96e98de323e36c26df1c53859473923da471d3b5267f6f2e -size 617854 +oid sha256:f883ff90fefeedb6ffc5bd8246389a3633a445c549bb23b903959210073ce9f7 +size 621753 diff --git a/plugins/ExamplePlugin/tests/UI/expected-screenshots/SimpleUITest_simplePage.png b/plugins/ExamplePlugin/tests/UI/expected-screenshots/SimpleUITest_simplePage.png index 94def54b94..cad763022b 100644 --- a/plugins/ExamplePlugin/tests/UI/expected-screenshots/SimpleUITest_simplePage.png +++ b/plugins/ExamplePlugin/tests/UI/expected-screenshots/SimpleUITest_simplePage.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3c4fcf3b6825199ad97c90464bf63cb68b125e0fd24fe85eb342ab380023e895 -size 20984 +oid sha256:2ec66dec184cd8efb4b8d05a2b21a8d0a929c7d5393d15e0ee0f763f6ac3ac64 +size 22794 diff --git a/plugins/ExamplePlugin/tests/UI/expected-screenshots/SimpleUITest_simplePagePartial.png b/plugins/ExamplePlugin/tests/UI/expected-screenshots/SimpleUITest_simplePagePartial.png index 33dd8fe841..1b2f5ee275 100644 --- a/plugins/ExamplePlugin/tests/UI/expected-screenshots/SimpleUITest_simplePagePartial.png +++ b/plugins/ExamplePlugin/tests/UI/expected-screenshots/SimpleUITest_simplePagePartial.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:08365ce9bc2b3fb1bc2764484c8d14d22322e97d09e1306f0ffa72c7e33b09be -size 16512 +oid sha256:b9f7e01b55f5104db11be65355a8ad3bf247f767faa1e9f6689d2e7127ae95a9 +size 18102 diff --git a/plugins/Installation/tests/UI/expected-screenshots/Installation_system_check.png b/plugins/Installation/tests/UI/expected-screenshots/Installation_system_check.png index a6b4de304a..bd862f970b 100644 --- a/plugins/Installation/tests/UI/expected-screenshots/Installation_system_check.png +++ b/plugins/Installation/tests/UI/expected-screenshots/Installation_system_check.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:88dfee4009c5ad71932e85027a16c0efc632b3a44d4316f43817f568395eef3d -size 186236 +oid sha256:60327191437c5b017ce0c54a578c9f9934f8d0dac4e5052d52342d2955c14dd3 +size 191772 diff --git a/plugins/TagManager b/plugins/TagManager new file mode 160000 +Subproject a5dc8814117b410899f399a0005de133d91b6a6 diff --git a/plugins/UsersManager/tests/Integration/UsersManagerTest.php b/plugins/UsersManager/tests/Integration/UsersManagerTest.php index d51f267875..961343f2a7 100644 --- a/plugins/UsersManager/tests/Integration/UsersManagerTest.php +++ b/plugins/UsersManager/tests/Integration/UsersManagerTest.php @@ -1075,7 +1075,29 @@ class UsersManagerTest extends IntegrationTestCase public function testGetAvailableCapabilities() { $this->addSites(1); - $this->assertSame(array(), $this->api->getAvailableCapabilities()); + $this->assertSame(array( + 0 => array( + 'id' => 'tagmanager_write', + 'name' => 'UsersManager_PrivWrite', + 'description' => 'TagManager_CapabilityWriteDescription', + 'helpUrl' => '', + 'includedInRoles' => array ('write', 'admin') + ), + 1 => array ( + 'id' => 'tagmanager_publish_live_container', + 'name' => 'TagManager_CapabilityPublishLiveContainer', + 'description' => 'TagManager_CapabilityPublishLiveContainerDescription', + 'helpUrl' => '', + 'includedInRoles' => array ('admin') + ), + 2 => array ( + 'id' => 'tagmanager_use_custom_templates', + 'name' => 'TagManager_CapabilityUseCustomTemplates', + 'description' => 'TagManager_CapabilityUseCustomTemplateDescription', + 'helpUrl' => '', + 'includedInRoles' => array ('admin') + ) + ), $this->api->getAvailableCapabilities()); } private function addSites($numberOfSites) diff --git a/tests/PHPUnit/Framework/TestRequest/Collection.php b/tests/PHPUnit/Framework/TestRequest/Collection.php index 485ee15944..8ab66a82ee 100644 --- a/tests/PHPUnit/Framework/TestRequest/Collection.php +++ b/tests/PHPUnit/Framework/TestRequest/Collection.php @@ -29,6 +29,7 @@ class Collection 'Dashboard', 'UsersManager', 'SitesManager', + 'TagManager', 'ExampleUI', 'Overlay', 'Live', diff --git a/tests/PHPUnit/Integration/ReleaseCheckListTest.php b/tests/PHPUnit/Integration/ReleaseCheckListTest.php index 4ad037972b..bce8b56c24 100644 --- a/tests/PHPUnit/Integration/ReleaseCheckListTest.php +++ b/tests/PHPUnit/Integration/ReleaseCheckListTest.php @@ -108,13 +108,29 @@ class ReleaseCheckListTest extends \PHPUnit_Framework_TestCase }; $screenshots = array_map($cleanPath, $screenshots); - $storedLfsFiles = explode("\n", `git lfs ls-files`); + $lfsFiles = `git lfs ls-files`; + $submodules = `git submodule | awk '{ print $2 }'`; + $submodules = explode("\n", $submodules); + $storedLfsFiles = explode("\n", $lfsFiles); $cleanRevision = function ($value) { $parts = explode(' ', $value); return array_pop($parts); }; $storedLfsFiles = array_map($cleanRevision, $storedLfsFiles); + foreach ($submodules as $submodule) { + $submodule = trim(trim($submodule), './'); + $pluginLfsFiles = shell_exec('cd ' . PIWIK_DOCUMENT_ROOT.'/'.$submodule . ' && git lfs ls-files'); + if (!empty($pluginLfsFiles)) { + $pluginLfsFiles = explode("\n", $pluginLfsFiles); + $pluginLfsFiles = array_map($cleanRevision, $pluginLfsFiles); + $pluginLfsFiles = array_map(function ($val) use ($submodule) { + return $submodule . '/' . $val; + }, $pluginLfsFiles); + $storedLfsFiles = array_merge($storedLfsFiles, $pluginLfsFiles); + } + } + $diff = array_diff($screenshots, $storedLfsFiles); $this->assertEmpty($diff, 'Some Screenshots are not stored in LFS: ' . implode("\n", $diff)); } diff --git a/tests/PHPUnit/Integration/Tracker/VisitTest.php b/tests/PHPUnit/Integration/Tracker/VisitTest.php index d78e65ceda..ac50350347 100644 --- a/tests/PHPUnit/Integration/Tracker/VisitTest.php +++ b/tests/PHPUnit/Integration/Tracker/VisitTest.php @@ -38,6 +38,8 @@ class VisitTest extends IntegrationTestCase $pluginNames = array_keys(Manager::getInstance()->getLoadedPlugins()); $pluginNames[] = 'SitesManager'; $pluginNames[] = 'WebsiteMeasurable'; + $pluginNames[] = 'TagManager';// needed because we create a site in Tracker mode... + $pluginNames[] = 'API'; // needed because we create a site in Tracker mode... Manager::getInstance()->loadPlugins($pluginNames); Visit::$dimensions = null; } diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__CorePluginsAdmin.getSystemSettings.xml b/tests/PHPUnit/System/expected/test_ImportLogs__CorePluginsAdmin.getSystemSettings.xml index 665e721923..a75f8313c8 100644 --- a/tests/PHPUnit/System/expected/test_ImportLogs__CorePluginsAdmin.getSystemSettings.xml +++ b/tests/PHPUnit/System/expected/test_ImportLogs__CorePluginsAdmin.getSystemSettings.xml @@ -769,4 +769,67 @@ Another line</defaultValue> </row> </settings> </row> + <row> + <pluginName>TagManager</pluginName> + <title>TagManager</title> + <settings> + <row> + <name>restrictCustomTemplates</name> + <title>Restrict usage of custom templates</title> + <value>admin</value> + <defaultValue>admin</defaultValue> + <type>string</type> + <uiControl>select</uiControl> + <uiControlAttributes> + </uiControlAttributes> + <availableValues> + <disabled>Disabled, nobody can use them</disabled> + <admin>Users with at last admin permission can use them</admin> + <superuser>Only Super Users can use them</superuser> + </availableValues> + <description>This setting defines who can use custom templates or whether they should be completely disabled. Changing this setting can improve the security on your website. When you configure a trigger, tag, or a variable, some of them may allow a Matomo user to enter HTML or JavaScript which will be executed on your website. Entering custom code cannot only break the container in case there is an error, but also allows them to execute any JavaScript code on your website. This can be misused to steal for example sensitive information on your website. If you do not want to allow your team members to enter any JavaScript code, you may want to disable this setting.</description> + <inlineHelp /> + <templateFile /> + <introduction /> + <condition /> + </row> + <row> + <name>environments</name> + <title>Environments</title> + <value> + <row> + <environment>dev</environment> + </row> + <row> + <environment>staging</environment> + </row> + </value> + <defaultValue> + <row> + <environment>dev</environment> + </row> + <row> + <environment>staging</environment> + </row> + </defaultValue> + <type>array</type> + <uiControl>multituple</uiControl> + <uiControlAttributes> + <field1> + <key>environment</key> + <title>Environment</title> + <uiControl>text</uiControl> + <templateFile /> + <availableValues /> + </field1> + </uiControlAttributes> + <availableValues /> + <description>Define one or multiple additional environments. Please note that if you remove any environment, generated container files that exist for a specific environment will be removed and will be no longer available.</description> + <inlineHelp /> + <templateFile /> + <introduction /> + <condition /> + </row> + </settings> + </row> </result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableComparisons.xml b/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableComparisons.xml new file mode 100644 index 0000000000..0f53cab9b5 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableComparisons.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>equals</id> + <name>equals</name> + </row> + <row> + <id>not_equals</id> + <name>not equals</name> + </row> + <row> + <id>equals_exactly</id> + <name>equals exactly</name> + </row> + <row> + <id>not_equals_exactly</id> + <name>not equals exactly</name> + </row> + <row> + <id>contains</id> + <name>contains</name> + </row> + <row> + <id>not_contains</id> + <name>not contains</name> + </row> + <row> + <id>starts_with</id> + <name>starts with</name> + </row> + <row> + <id>not_starts_with</id> + <name>not starts with</name> + </row> + <row> + <id>ends_with</id> + <name>ends with</name> + </row> + <row> + <id>not_ends_with</id> + <name>not ends with</name> + </row> + <row> + <id>lower_than</id> + <name>is lower than</name> + </row> + <row> + <id>not_lower_than</id> + <name>not is lower than</name> + </row> + <row> + <id>lower_than_or_equals</id> + <name>is lower than or equals</name> + </row> + <row> + <id>not_lower_than_or_equals</id> + <name>not is lower than or equals</name> + </row> + <row> + <id>greater_than</id> + <name>is greater than</name> + </row> + <row> + <id>not_greater_than</id> + <name>not is greater than</name> + </row> + <row> + <id>greater_than_or_equals</id> + <name>is greater than or equals</name> + </row> + <row> + <id>not_greater_than_or_equals</id> + <name>not is greater than or equals</name> + </row> + <row> + <id>regexp</id> + <name>matches the regular expression</name> + </row> + <row> + <id>not_regexp</id> + <name>not matches the regular expression</name> + </row> + <row> + <id>regexp_ignore_case</id> + <name>matches the regular expression (ignore case)</name> + </row> + <row> + <id>not_regexp_ignore_case</id> + <name>not matches the regular expression (ignore case)</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableContexts.xml b/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableContexts.xml new file mode 100644 index 0000000000..b510944645 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableContexts.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>web</id> + <name>Web</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableEnvironments.xml b/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableEnvironments.xml new file mode 100644 index 0000000000..36fa243ebd --- /dev/null +++ b/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableEnvironments.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>live</id> + <name>Live</name> + </row> + <row> + <id>dev</id> + <name>Dev</name> + </row> + <row> + <id>staging</id> + <name>Staging</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableEnvironmentsWithPublishCapability.xml b/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableEnvironmentsWithPublishCapability.xml new file mode 100644 index 0000000000..36fa243ebd --- /dev/null +++ b/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableEnvironmentsWithPublishCapability.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>live</id> + <name>Live</name> + </row> + <row> + <id>dev</id> + <name>Dev</name> + </row> + <row> + <id>staging</id> + <name>Staging</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableTagFireLimits.xml b/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableTagFireLimits.xml new file mode 100644 index 0000000000..860e045122 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getAvailableTagFireLimits.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>unlimited</id> + <name>Unlimited</name> + </row> + <row> + <id>once_page</id> + <name>Once per pageview</name> + </row> + <row> + <id>once_24hours</id> + <name>Once per 24 hours</name> + </row> + <row> + <id>once_lifetime</id> + <name>Once in lifetime</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getContainers.xml b/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getContainers.xml new file mode 100644 index 0000000000..8099bab41b --- /dev/null +++ b/tests/PHPUnit/System/expected/test_ImportLogs__TagManager.getContainers.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <idcontainer>KTd0bIgo</idcontainer> + <idsite>1</idsite> + <context>web</context> + <name>Default Container</name> + <description>This container was auto generated when the website was created.</description> + <status>active</status> + <created_date>today-date-removed-in-tests</created_date> + <updated_date>today-date-removed-in-tests</updated_date> + <created_date_pretty>Sep 10, 2018 04:45:22</created_date_pretty> + <updated_date_pretty>Sep 10, 2018 04:45:22</updated_date_pretty> + <versions> + <row> + <idcontainerversion>2</idcontainerversion> + <idcontainer>KTd0bIgo</idcontainer> + <idsite>1</idsite> + <status>active</status> + <revision>1</revision> + <name>0.1.0 - Auto generated</name> + <description /> + <created_date>today-date-removed-in-tests</created_date> + <updated_date>today-date-removed-in-tests</updated_date> + <created_date_pretty>Sep 10, 2018 04:45:22</created_date_pretty> + <updated_date_pretty>Sep 10, 2018 04:45:22</updated_date_pretty> + <environments> + </environments> + </row> + </versions> + <releases> + <row> + <idcontainerrelease>1</idcontainerrelease> + <idcontainer>KTd0bIgo</idcontainer> + <idcontainerversion>1</idcontainerversion> + <idsite>1</idsite> + <status>active</status> + <environment>live</environment> + <release_login>superUserLogin</release_login> + <release_date>today-date-removed-in-tests</release_date> + <release_date_pretty>Sep 10, 2018 04:45:22</release_date_pretty> + <version_name /> + </row> + </releases> + <draft> + <idcontainerversion>1</idcontainerversion> + <idcontainer>KTd0bIgo</idcontainer> + <idsite>1</idsite> + <status>active</status> + <revision>0</revision> + <name /> + <description /> + <created_date>today-date-removed-in-tests</created_date> + <updated_date>today-date-removed-in-tests</updated_date> + <created_date_pretty>Sep 10, 2018 04:45:22</created_date_pretty> + <updated_date_pretty>Sep 10, 2018 04:45:22</updated_date_pretty> + </draft> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CorePluginsAdmin.getSystemSettings.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CorePluginsAdmin.getSystemSettings.xml index 665e721923..a75f8313c8 100644 --- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CorePluginsAdmin.getSystemSettings.xml +++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CorePluginsAdmin.getSystemSettings.xml @@ -769,4 +769,67 @@ Another line</defaultValue> </row> </settings> </row> + <row> + <pluginName>TagManager</pluginName> + <title>TagManager</title> + <settings> + <row> + <name>restrictCustomTemplates</name> + <title>Restrict usage of custom templates</title> + <value>admin</value> + <defaultValue>admin</defaultValue> + <type>string</type> + <uiControl>select</uiControl> + <uiControlAttributes> + </uiControlAttributes> + <availableValues> + <disabled>Disabled, nobody can use them</disabled> + <admin>Users with at last admin permission can use them</admin> + <superuser>Only Super Users can use them</superuser> + </availableValues> + <description>This setting defines who can use custom templates or whether they should be completely disabled. Changing this setting can improve the security on your website. When you configure a trigger, tag, or a variable, some of them may allow a Matomo user to enter HTML or JavaScript which will be executed on your website. Entering custom code cannot only break the container in case there is an error, but also allows them to execute any JavaScript code on your website. This can be misused to steal for example sensitive information on your website. If you do not want to allow your team members to enter any JavaScript code, you may want to disable this setting.</description> + <inlineHelp /> + <templateFile /> + <introduction /> + <condition /> + </row> + <row> + <name>environments</name> + <title>Environments</title> + <value> + <row> + <environment>dev</environment> + </row> + <row> + <environment>staging</environment> + </row> + </value> + <defaultValue> + <row> + <environment>dev</environment> + </row> + <row> + <environment>staging</environment> + </row> + </defaultValue> + <type>array</type> + <uiControl>multituple</uiControl> + <uiControlAttributes> + <field1> + <key>environment</key> + <title>Environment</title> + <uiControl>text</uiControl> + <templateFile /> + <availableValues /> + </field1> + </uiControlAttributes> + <availableValues /> + <description>Define one or multiple additional environments. Please note that if you remove any environment, generated container files that exist for a specific environment will be removed and will be no longer available.</description> + <inlineHelp /> + <templateFile /> + <introduction /> + <condition /> + </row> + </settings> + </row> </result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableComparisons.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableComparisons.xml new file mode 100644 index 0000000000..0f53cab9b5 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableComparisons.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>equals</id> + <name>equals</name> + </row> + <row> + <id>not_equals</id> + <name>not equals</name> + </row> + <row> + <id>equals_exactly</id> + <name>equals exactly</name> + </row> + <row> + <id>not_equals_exactly</id> + <name>not equals exactly</name> + </row> + <row> + <id>contains</id> + <name>contains</name> + </row> + <row> + <id>not_contains</id> + <name>not contains</name> + </row> + <row> + <id>starts_with</id> + <name>starts with</name> + </row> + <row> + <id>not_starts_with</id> + <name>not starts with</name> + </row> + <row> + <id>ends_with</id> + <name>ends with</name> + </row> + <row> + <id>not_ends_with</id> + <name>not ends with</name> + </row> + <row> + <id>lower_than</id> + <name>is lower than</name> + </row> + <row> + <id>not_lower_than</id> + <name>not is lower than</name> + </row> + <row> + <id>lower_than_or_equals</id> + <name>is lower than or equals</name> + </row> + <row> + <id>not_lower_than_or_equals</id> + <name>not is lower than or equals</name> + </row> + <row> + <id>greater_than</id> + <name>is greater than</name> + </row> + <row> + <id>not_greater_than</id> + <name>not is greater than</name> + </row> + <row> + <id>greater_than_or_equals</id> + <name>is greater than or equals</name> + </row> + <row> + <id>not_greater_than_or_equals</id> + <name>not is greater than or equals</name> + </row> + <row> + <id>regexp</id> + <name>matches the regular expression</name> + </row> + <row> + <id>not_regexp</id> + <name>not matches the regular expression</name> + </row> + <row> + <id>regexp_ignore_case</id> + <name>matches the regular expression (ignore case)</name> + </row> + <row> + <id>not_regexp_ignore_case</id> + <name>not matches the regular expression (ignore case)</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableContexts.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableContexts.xml new file mode 100644 index 0000000000..b510944645 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableContexts.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>web</id> + <name>Web</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableEnvironments.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableEnvironments.xml new file mode 100644 index 0000000000..36fa243ebd --- /dev/null +++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableEnvironments.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>live</id> + <name>Live</name> + </row> + <row> + <id>dev</id> + <name>Dev</name> + </row> + <row> + <id>staging</id> + <name>Staging</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableEnvironmentsWithPublishCapability.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableEnvironmentsWithPublishCapability.xml new file mode 100644 index 0000000000..36fa243ebd --- /dev/null +++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableEnvironmentsWithPublishCapability.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>live</id> + <name>Live</name> + </row> + <row> + <id>dev</id> + <name>Dev</name> + </row> + <row> + <id>staging</id> + <name>Staging</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableTagFireLimits.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableTagFireLimits.xml new file mode 100644 index 0000000000..860e045122 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getAvailableTagFireLimits.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>unlimited</id> + <name>Unlimited</name> + </row> + <row> + <id>once_page</id> + <name>Once per pageview</name> + </row> + <row> + <id>once_24hours</id> + <name>Once per 24 hours</name> + </row> + <row> + <id>once_lifetime</id> + <name>Once in lifetime</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getContainers.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getContainers.xml new file mode 100644 index 0000000000..e61436f310 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__TagManager.getContainers.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <idcontainer>mIuLeiKP</idcontainer> + <idsite>1</idsite> + <context>web</context> + <name>Default Container</name> + <description>This container was auto generated when the website was created.</description> + <status>active</status> + <created_date>today-date-removed-in-tests</created_date> + <updated_date>today-date-removed-in-tests</updated_date> + <created_date_pretty>Sep 10, 2018 04:47:52</created_date_pretty> + <updated_date_pretty>Sep 10, 2018 04:47:52</updated_date_pretty> + <versions> + <row> + <idcontainerversion>2</idcontainerversion> + <idcontainer>mIuLeiKP</idcontainer> + <idsite>1</idsite> + <status>active</status> + <revision>1</revision> + <name>0.1.0 - Auto generated</name> + <description /> + <created_date>today-date-removed-in-tests</created_date> + <updated_date>today-date-removed-in-tests</updated_date> + <created_date_pretty>Sep 10, 2018 04:47:52</created_date_pretty> + <updated_date_pretty>Sep 10, 2018 04:47:52</updated_date_pretty> + <environments> + </environments> + </row> + </versions> + <releases> + <row> + <idcontainerrelease>1</idcontainerrelease> + <idcontainer>mIuLeiKP</idcontainer> + <idcontainerversion>1</idcontainerversion> + <idsite>1</idsite> + <status>active</status> + <environment>live</environment> + <release_login>superUserLogin</release_login> + <release_date>today-date-removed-in-tests</release_date> + <release_date_pretty>Sep 10, 2018 04:47:52</release_date_pretty> + <version_name /> + </row> + </releases> + <draft> + <idcontainerversion>1</idcontainerversion> + <idcontainer>mIuLeiKP</idcontainer> + <idsite>1</idsite> + <status>active</status> + <revision>0</revision> + <name /> + <description /> + <created_date>today-date-removed-in-tests</created_date> + <updated_date>today-date-removed-in-tests</updated_date> + <created_date_pretty>Sep 10, 2018 04:47:52</created_date_pretty> + <updated_date_pretty>Sep 10, 2018 04:47:52</updated_date_pretty> + </draft> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CorePluginsAdmin.getSystemSettings.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CorePluginsAdmin.getSystemSettings.xml index 665e721923..a75f8313c8 100644 --- a/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CorePluginsAdmin.getSystemSettings.xml +++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CorePluginsAdmin.getSystemSettings.xml @@ -769,4 +769,67 @@ Another line</defaultValue> </row> </settings> </row> + <row> + <pluginName>TagManager</pluginName> + <title>TagManager</title> + <settings> + <row> + <name>restrictCustomTemplates</name> + <title>Restrict usage of custom templates</title> + <value>admin</value> + <defaultValue>admin</defaultValue> + <type>string</type> + <uiControl>select</uiControl> + <uiControlAttributes> + </uiControlAttributes> + <availableValues> + <disabled>Disabled, nobody can use them</disabled> + <admin>Users with at last admin permission can use them</admin> + <superuser>Only Super Users can use them</superuser> + </availableValues> + <description>This setting defines who can use custom templates or whether they should be completely disabled. Changing this setting can improve the security on your website. When you configure a trigger, tag, or a variable, some of them may allow a Matomo user to enter HTML or JavaScript which will be executed on your website. Entering custom code cannot only break the container in case there is an error, but also allows them to execute any JavaScript code on your website. This can be misused to steal for example sensitive information on your website. If you do not want to allow your team members to enter any JavaScript code, you may want to disable this setting.</description> + <inlineHelp /> + <templateFile /> + <introduction /> + <condition /> + </row> + <row> + <name>environments</name> + <title>Environments</title> + <value> + <row> + <environment>dev</environment> + </row> + <row> + <environment>staging</environment> + </row> + </value> + <defaultValue> + <row> + <environment>dev</environment> + </row> + <row> + <environment>staging</environment> + </row> + </defaultValue> + <type>array</type> + <uiControl>multituple</uiControl> + <uiControlAttributes> + <field1> + <key>environment</key> + <title>Environment</title> + <uiControl>text</uiControl> + <templateFile /> + <availableValues /> + </field1> + </uiControlAttributes> + <availableValues /> + <description>Define one or multiple additional environments. Please note that if you remove any environment, generated container files that exist for a specific environment will be removed and will be no longer available.</description> + <inlineHelp /> + <templateFile /> + <introduction /> + <condition /> + </row> + </settings> + </row> </result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableComparisons.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableComparisons.xml new file mode 100644 index 0000000000..0f53cab9b5 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableComparisons.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>equals</id> + <name>equals</name> + </row> + <row> + <id>not_equals</id> + <name>not equals</name> + </row> + <row> + <id>equals_exactly</id> + <name>equals exactly</name> + </row> + <row> + <id>not_equals_exactly</id> + <name>not equals exactly</name> + </row> + <row> + <id>contains</id> + <name>contains</name> + </row> + <row> + <id>not_contains</id> + <name>not contains</name> + </row> + <row> + <id>starts_with</id> + <name>starts with</name> + </row> + <row> + <id>not_starts_with</id> + <name>not starts with</name> + </row> + <row> + <id>ends_with</id> + <name>ends with</name> + </row> + <row> + <id>not_ends_with</id> + <name>not ends with</name> + </row> + <row> + <id>lower_than</id> + <name>is lower than</name> + </row> + <row> + <id>not_lower_than</id> + <name>not is lower than</name> + </row> + <row> + <id>lower_than_or_equals</id> + <name>is lower than or equals</name> + </row> + <row> + <id>not_lower_than_or_equals</id> + <name>not is lower than or equals</name> + </row> + <row> + <id>greater_than</id> + <name>is greater than</name> + </row> + <row> + <id>not_greater_than</id> + <name>not is greater than</name> + </row> + <row> + <id>greater_than_or_equals</id> + <name>is greater than or equals</name> + </row> + <row> + <id>not_greater_than_or_equals</id> + <name>not is greater than or equals</name> + </row> + <row> + <id>regexp</id> + <name>matches the regular expression</name> + </row> + <row> + <id>not_regexp</id> + <name>not matches the regular expression</name> + </row> + <row> + <id>regexp_ignore_case</id> + <name>matches the regular expression (ignore case)</name> + </row> + <row> + <id>not_regexp_ignore_case</id> + <name>not matches the regular expression (ignore case)</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableContexts.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableContexts.xml new file mode 100644 index 0000000000..b510944645 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableContexts.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>web</id> + <name>Web</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableEnvironments.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableEnvironments.xml new file mode 100644 index 0000000000..36fa243ebd --- /dev/null +++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableEnvironments.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>live</id> + <name>Live</name> + </row> + <row> + <id>dev</id> + <name>Dev</name> + </row> + <row> + <id>staging</id> + <name>Staging</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableEnvironmentsWithPublishCapability.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableEnvironmentsWithPublishCapability.xml new file mode 100644 index 0000000000..36fa243ebd --- /dev/null +++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableEnvironmentsWithPublishCapability.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>live</id> + <name>Live</name> + </row> + <row> + <id>dev</id> + <name>Dev</name> + </row> + <row> + <id>staging</id> + <name>Staging</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableTagFireLimits.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableTagFireLimits.xml new file mode 100644 index 0000000000..860e045122 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getAvailableTagFireLimits.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>unlimited</id> + <name>Unlimited</name> + </row> + <row> + <id>once_page</id> + <name>Once per pageview</name> + </row> + <row> + <id>once_24hours</id> + <name>Once per 24 hours</name> + </row> + <row> + <id>once_lifetime</id> + <name>Once in lifetime</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getContainers.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getContainers.xml new file mode 100644 index 0000000000..501c2ecf86 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__TagManager.getContainers.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <idcontainer>kSRALajy</idcontainer> + <idsite>1</idsite> + <context>web</context> + <name>Default Container</name> + <description>This container was auto generated when the website was created.</description> + <status>active</status> + <created_date>today-date-removed-in-tests</created_date> + <updated_date>today-date-removed-in-tests</updated_date> + <created_date_pretty>Sep 10, 2018 04:46:49</created_date_pretty> + <updated_date_pretty>Sep 10, 2018 04:46:49</updated_date_pretty> + <versions> + <row> + <idcontainerversion>2</idcontainerversion> + <idcontainer>kSRALajy</idcontainer> + <idsite>1</idsite> + <status>active</status> + <revision>1</revision> + <name>0.1.0 - Auto generated</name> + <description /> + <created_date>today-date-removed-in-tests</created_date> + <updated_date>today-date-removed-in-tests</updated_date> + <created_date_pretty>Sep 10, 2018 04:46:49</created_date_pretty> + <updated_date_pretty>Sep 10, 2018 04:46:49</updated_date_pretty> + <environments> + </environments> + </row> + </versions> + <releases> + <row> + <idcontainerrelease>1</idcontainerrelease> + <idcontainer>kSRALajy</idcontainer> + <idcontainerversion>1</idcontainerversion> + <idsite>1</idsite> + <status>active</status> + <environment>live</environment> + <release_login>superUserLogin</release_login> + <release_date>today-date-removed-in-tests</release_date> + <release_date_pretty>Sep 10, 2018 04:46:49</release_date_pretty> + <version_name /> + </row> + </releases> + <draft> + <idcontainerversion>1</idcontainerversion> + <idcontainer>kSRALajy</idcontainer> + <idsite>1</idsite> + <status>active</status> + <revision>0</revision> + <name /> + <description /> + <created_date>today-date-removed-in-tests</created_date> + <updated_date>today-date-removed-in-tests</updated_date> + <created_date_pretty>Sep 10, 2018 04:46:49</created_date_pretty> + <updated_date_pretty>Sep 10, 2018 04:46:49</updated_date_pretty> + </draft> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit__CorePluginsAdmin.getSystemSettings.xml b/tests/PHPUnit/System/expected/test_noVisit__CorePluginsAdmin.getSystemSettings.xml index 665e721923..a75f8313c8 100644 --- a/tests/PHPUnit/System/expected/test_noVisit__CorePluginsAdmin.getSystemSettings.xml +++ b/tests/PHPUnit/System/expected/test_noVisit__CorePluginsAdmin.getSystemSettings.xml @@ -769,4 +769,67 @@ Another line</defaultValue> </row> </settings> </row> + <row> + <pluginName>TagManager</pluginName> + <title>TagManager</title> + <settings> + <row> + <name>restrictCustomTemplates</name> + <title>Restrict usage of custom templates</title> + <value>admin</value> + <defaultValue>admin</defaultValue> + <type>string</type> + <uiControl>select</uiControl> + <uiControlAttributes> + </uiControlAttributes> + <availableValues> + <disabled>Disabled, nobody can use them</disabled> + <admin>Users with at last admin permission can use them</admin> + <superuser>Only Super Users can use them</superuser> + </availableValues> + <description>This setting defines who can use custom templates or whether they should be completely disabled. Changing this setting can improve the security on your website. When you configure a trigger, tag, or a variable, some of them may allow a Matomo user to enter HTML or JavaScript which will be executed on your website. Entering custom code cannot only break the container in case there is an error, but also allows them to execute any JavaScript code on your website. This can be misused to steal for example sensitive information on your website. If you do not want to allow your team members to enter any JavaScript code, you may want to disable this setting.</description> + <inlineHelp /> + <templateFile /> + <introduction /> + <condition /> + </row> + <row> + <name>environments</name> + <title>Environments</title> + <value> + <row> + <environment>dev</environment> + </row> + <row> + <environment>staging</environment> + </row> + </value> + <defaultValue> + <row> + <environment>dev</environment> + </row> + <row> + <environment>staging</environment> + </row> + </defaultValue> + <type>array</type> + <uiControl>multituple</uiControl> + <uiControlAttributes> + <field1> + <key>environment</key> + <title>Environment</title> + <uiControl>text</uiControl> + <templateFile /> + <availableValues /> + </field1> + </uiControlAttributes> + <availableValues /> + <description>Define one or multiple additional environments. Please note that if you remove any environment, generated container files that exist for a specific environment will be removed and will be no longer available.</description> + <inlineHelp /> + <templateFile /> + <introduction /> + <condition /> + </row> + </settings> + </row> </result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableComparisons.xml b/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableComparisons.xml new file mode 100644 index 0000000000..0f53cab9b5 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableComparisons.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>equals</id> + <name>equals</name> + </row> + <row> + <id>not_equals</id> + <name>not equals</name> + </row> + <row> + <id>equals_exactly</id> + <name>equals exactly</name> + </row> + <row> + <id>not_equals_exactly</id> + <name>not equals exactly</name> + </row> + <row> + <id>contains</id> + <name>contains</name> + </row> + <row> + <id>not_contains</id> + <name>not contains</name> + </row> + <row> + <id>starts_with</id> + <name>starts with</name> + </row> + <row> + <id>not_starts_with</id> + <name>not starts with</name> + </row> + <row> + <id>ends_with</id> + <name>ends with</name> + </row> + <row> + <id>not_ends_with</id> + <name>not ends with</name> + </row> + <row> + <id>lower_than</id> + <name>is lower than</name> + </row> + <row> + <id>not_lower_than</id> + <name>not is lower than</name> + </row> + <row> + <id>lower_than_or_equals</id> + <name>is lower than or equals</name> + </row> + <row> + <id>not_lower_than_or_equals</id> + <name>not is lower than or equals</name> + </row> + <row> + <id>greater_than</id> + <name>is greater than</name> + </row> + <row> + <id>not_greater_than</id> + <name>not is greater than</name> + </row> + <row> + <id>greater_than_or_equals</id> + <name>is greater than or equals</name> + </row> + <row> + <id>not_greater_than_or_equals</id> + <name>not is greater than or equals</name> + </row> + <row> + <id>regexp</id> + <name>matches the regular expression</name> + </row> + <row> + <id>not_regexp</id> + <name>not matches the regular expression</name> + </row> + <row> + <id>regexp_ignore_case</id> + <name>matches the regular expression (ignore case)</name> + </row> + <row> + <id>not_regexp_ignore_case</id> + <name>not matches the regular expression (ignore case)</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableContexts.xml b/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableContexts.xml new file mode 100644 index 0000000000..b510944645 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableContexts.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>web</id> + <name>Web</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableEnvironments.xml b/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableEnvironments.xml new file mode 100644 index 0000000000..36fa243ebd --- /dev/null +++ b/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableEnvironments.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>live</id> + <name>Live</name> + </row> + <row> + <id>dev</id> + <name>Dev</name> + </row> + <row> + <id>staging</id> + <name>Staging</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableEnvironmentsWithPublishCapability.xml b/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableEnvironmentsWithPublishCapability.xml new file mode 100644 index 0000000000..36fa243ebd --- /dev/null +++ b/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableEnvironmentsWithPublishCapability.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>live</id> + <name>Live</name> + </row> + <row> + <id>dev</id> + <name>Dev</name> + </row> + <row> + <id>staging</id> + <name>Staging</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableTagFireLimits.xml b/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableTagFireLimits.xml new file mode 100644 index 0000000000..860e045122 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_noVisit__TagManager.getAvailableTagFireLimits.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <id>unlimited</id> + <name>Unlimited</name> + </row> + <row> + <id>once_page</id> + <name>Once per pageview</name> + </row> + <row> + <id>once_24hours</id> + <name>Once per 24 hours</name> + </row> + <row> + <id>once_lifetime</id> + <name>Once in lifetime</name> + </row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_noVisit__TagManager.getContainers.xml b/tests/PHPUnit/System/expected/test_noVisit__TagManager.getContainers.xml new file mode 100644 index 0000000000..501c2ecf86 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_noVisit__TagManager.getContainers.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <idcontainer>kSRALajy</idcontainer> + <idsite>1</idsite> + <context>web</context> + <name>Default Container</name> + <description>This container was auto generated when the website was created.</description> + <status>active</status> + <created_date>today-date-removed-in-tests</created_date> + <updated_date>today-date-removed-in-tests</updated_date> + <created_date_pretty>Sep 10, 2018 04:46:49</created_date_pretty> + <updated_date_pretty>Sep 10, 2018 04:46:49</updated_date_pretty> + <versions> + <row> + <idcontainerversion>2</idcontainerversion> + <idcontainer>kSRALajy</idcontainer> + <idsite>1</idsite> + <status>active</status> + <revision>1</revision> + <name>0.1.0 - Auto generated</name> + <description /> + <created_date>today-date-removed-in-tests</created_date> + <updated_date>today-date-removed-in-tests</updated_date> + <created_date_pretty>Sep 10, 2018 04:46:49</created_date_pretty> + <updated_date_pretty>Sep 10, 2018 04:46:49</updated_date_pretty> + <environments> + </environments> + </row> + </versions> + <releases> + <row> + <idcontainerrelease>1</idcontainerrelease> + <idcontainer>kSRALajy</idcontainer> + <idcontainerversion>1</idcontainerversion> + <idsite>1</idsite> + <status>active</status> + <environment>live</environment> + <release_login>superUserLogin</release_login> + <release_date>today-date-removed-in-tests</release_date> + <release_date_pretty>Sep 10, 2018 04:46:49</release_date_pretty> + <version_name /> + </row> + </releases> + <draft> + <idcontainerversion>1</idcontainerversion> + <idcontainer>kSRALajy</idcontainer> + <idsite>1</idsite> + <status>active</status> + <revision>0</revision> + <name /> + <description /> + <created_date>today-date-removed-in-tests</created_date> + <updated_date>today-date-removed-in-tests</updated_date> + <created_date_pretty>Sep 10, 2018 04:46:49</created_date_pretty> + <updated_date_pretty>Sep 10, 2018 04:46:49</updated_date_pretty> + </draft> + </row> +</result>
\ No newline at end of file diff --git a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard.png b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard.png index 3163ee86b7..a5e5a17074 100644 --- a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard.png +++ b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e30463d72ebaf95e97ca5c4774c05863bdaa97b3b9cae2dcfa56c018be88add8 -size 223919 +oid sha256:b12dd6373fccfa0f7848069f413c23b0d7bf85da45cbd2fc2a1bdde7ff83910a +size 253439 diff --git a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png index 11261dad38..fe4bb8f5db 100644 --- a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png +++ b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:70da4ac81c11a90e327bbf0b0d38ccb49ed269d41bed7d1ee606dcd20a839bd8 -size 325057 +oid sha256:6b39d9edc4bc87210d29cae15472fbed10591ceeddac22261d3795080c164179 +size 327241 diff --git a/tests/UI/expected-screenshots/Menus_mobile_top.png b/tests/UI/expected-screenshots/Menus_mobile_top.png index 3b70f79414..1ab5a10f4b 100644 --- a/tests/UI/expected-screenshots/Menus_mobile_top.png +++ b/tests/UI/expected-screenshots/Menus_mobile_top.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c1f994eb80f0341aa3acc495a84a7a65bf58cedafe279e661b81b0b2e8bde5b5 -size 195132 +oid sha256:27f570f999ac6b94b5100cbcbe01a243764e239cc9caa16cb3e576271f6982b5 +size 196549 diff --git a/tests/UI/expected-screenshots/QuickAccess_search_category.png b/tests/UI/expected-screenshots/QuickAccess_search_category.png index 4450980c04..4bf33aba90 100644 --- a/tests/UI/expected-screenshots/QuickAccess_search_category.png +++ b/tests/UI/expected-screenshots/QuickAccess_search_category.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d10121287ed5f79c2c1c8302c4ab88fae89368de03778f1e0aa9700e1a0ef28c -size 6095 +oid sha256:14ba9b561320d3a8eb01aab1d522f1eef2ac2a576e2a05bfe546aaa2dcfbd9ac +size 7428 diff --git a/tests/UI/expected-screenshots/Theme_home.png b/tests/UI/expected-screenshots/Theme_home.png index 9ab7d06b80..4e329db4d9 100644 --- a/tests/UI/expected-screenshots/Theme_home.png +++ b/tests/UI/expected-screenshots/Theme_home.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b31aa38b49ac5040101692650b3a59accca120bbeffe0f62e7ee3a535f641d4e -size 623030 +oid sha256:961403810dac0bd16fae0df5749cc6b6c8da1d7925739ffb1fcdc9c461d91137 +size 626570 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png index 4e0fe73399..836ebae915 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:67f248179a17818ff4f7c9dab3015718002e351fa2ebbffb0b81ff2235cd20c6 -size 4022845 +oid sha256:01e6a41716ebe6c75c8b78ecfe3175280cc3e23878cabeaad7fff682a6a20f9a +size 4110473 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png index d8cf7c8af5..299ccc82ac 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:82c9c088dc5578e0e6b1417f32b81a5363b5de800d64559708de28fc0967a558 -size 135714 +oid sha256:c0ae049ede3efe56cef5e69f3946affd011a226de81ed3b9be3ada671ac0238d +size 138437 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_manage_tracking_code.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_manage_tracking_code.png index 6a36853a3a..390306544b 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_manage_tracking_code.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_manage_tracking_code.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cbc616568e1e1a792741497c9053cebe79c7e4c68a5cdb3a8c4e8caece9d8584 -size 365360 +oid sha256:31d4b34dec95f55fa1d924dc07bd9f7896085b2828b964bef221231cb8306ec2 +size 400745 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png index 1f39286ad7..6099ce7bd7 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:77a4889ff5351564c0c75c72527c7c6329af0406b8ec2df33366c7255a44b01e -size 1038888 +oid sha256:7f8f25d7012f47948f8742a36ab9992aa4daa569bbdfba6802d266adb7ce3795 +size 1051366 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins_no_internet.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins_no_internet.png index 83497d4ee7..75087104dc 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins_no_internet.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins_no_internet.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:630f78ed4c4595afe97d851695480de199a438fcfe21bafe9881dd3dc4cce426 -size 1039115 +oid sha256:0babe76875917c3e684ad3851fe05b2e2a816c485956198937937f469680dcad +size 1051120 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_general.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_general.png index 422f4334f6..06ff8bf11c 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_general.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_general.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7b8a3607abdd6c5086e0593c28fe4a861c4b3dba17572244d969e4eb8ec60662 -size 796811 +oid sha256:42f786d444864e82d56a2d7bc92ff34f620247166dac650d521ed138e0ce7dd1 +size 902037 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png b/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png index f4dcf87fcc..310d4b080c 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d2edd2e71b8ba4a176034f74649ccd791ecdfdec4b169be0ca1ef7c4d325772f -size 4560424 +oid sha256:0a00afe1a885b456bd422413e6c6f67ffaa08e3ad17d4227b93c03e740efb335 +size 5007322 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png index c155274ba2..ccf8aab003 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5709a9f9d23f20e2f2590956c9950db38e43a70f3c311e09c99442cfe86251d3 -size 572510 +oid sha256:686343f8e45bea27eb17d51f75598451d7fee2906d5e8147e26698f02170e85a +size 575239 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_fatal_error_safemode.png b/tests/UI/expected-screenshots/UIIntegrationTest_fatal_error_safemode.png index aacf0c3d47..a7ccd9e333 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_fatal_error_safemode.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_fatal_error_safemode.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:68503ef9dafa19792aba12552ab81872b25247b619851d0ba1b743b31a51c919 -size 203273 +oid sha256:299ced7de21b6dcf297c93b0e3f152f5c436fb1c1aeed14a46ffe65f046a0bd1 +size 207929 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_glossary.png b/tests/UI/expected-screenshots/UIIntegrationTest_glossary.png index 7f0b0a69ff..0a114df391 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_glossary.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_glossary.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7d04075df22c42a004853bc239059c241c6aeb2b387c5fdf454534220460a54f -size 492857 +oid sha256:36eeef56902a2094da3737b9e32d6132df2469e26b03a6b1c91ce620cc4df733 +size 494459 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_glossary_widgetized.png b/tests/UI/expected-screenshots/UIIntegrationTest_glossary_widgetized.png index ab5afb98fc..7944a65b1f 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_glossary_widgetized.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_glossary_widgetized.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f76a0bd0e86a1a99e1a1cf30fec8d4092f5d827c30db992164b40045833be067 -size 601225 +oid sha256:fcd907ad0a9675259edff7f7dea6b385e699992a8903443bf4b28deb201b9153 +size 603147 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_period_select_date_range_click.png b/tests/UI/expected-screenshots/UIIntegrationTest_period_select_date_range_click.png index 381293c3ed..2a279eefa9 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_period_select_date_range_click.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_period_select_date_range_click.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b750b5bb9722c2e0988f67c0ec570f40ca5d7f85e6ee1c568049950a218ec48 -size 66884 +oid sha256:fb5125b3ac50c6f172636186f5ff986f524027771be4db55d606021b2acf8651 +size 68372 |