Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2018-12-11 09:30:42 +0300
committerdiosmosis <diosmosis@users.noreply.github.com>2018-12-11 09:30:42 +0300
commita06e2d5c27e0172b6de647c6754b9eead5ed0b36 (patch)
tree907efbc6f18aa1a7a514a716b9fccb63aa512900
parentef5b071576e06dda758d2a0855058aef11b160fd (diff)
Add new transitions report (#13475)3.8.0-b4
* trying to add a report through visualization * refs #12865 added transitions report * small tweak * remove auto generated api * apply review feedback * add ui test, fix widget view * fix ui test * fix tests * update screenshots * fix various issues * trying to fix tests * fix tests * Update expected screenshot tests. * Try to fix random failure & update screenshots. * add help text, add icon, do not fetch anything when no action name * trying to fix tests * tweak code * run tests again * Update expected screenshots.
-rw-r--r--plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png4
-rw-r--r--plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_loaded_token_auth.png4
-rw-r--r--plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_removed.png4
-rw-r--r--plugins/Transitions/Categories/TransitionsSubcategory.php19
-rw-r--r--plugins/Transitions/Transitions.php8
-rw-r--r--plugins/Transitions/Widgets/GetTransitions.php47
-rw-r--r--plugins/Transitions/angularjs/transitionswitcher/transitionswitcher.controller.js155
-rw-r--r--plugins/Transitions/javascripts/transitions.js69
-rw-r--r--plugins/Transitions/lang/en.json8
-rw-r--r--plugins/Transitions/stylesheets/transitions.less50
-rw-r--r--plugins/Transitions/templates/transitions.twig53
-rw-r--r--plugins/Transitions/tests/UI/Transitions_spec.js52
-rw-r--r--plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data.png3
-rw-r--r--plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data_widget.png3
-rw-r--r--plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_type_title.png3
-rw-r--r--plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_url.png3
-rw-r--r--plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_report.png3
-rw-r--r--plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_widget.png3
-rw-r--r--tests/PHPUnit/Integration/WidgetsListTest.php2
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportPagesMetadata.xml28
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getWidgetMetadata.xml23
-rw-r--r--tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png4
-rw-r--r--tests/UI/expected-screenshots/Menus_mainmenu_loaded.png4
-rw-r--r--tests/UI/expected-screenshots/QuickAccess_search_1.png4
-rw-r--r--tests/UI/expected-screenshots/QuickAccess_search_sites.png4
-rw-r--r--tests/UI/expected-screenshots/Theme_home.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_actions_content_name_piece.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece_name.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_actions_contents.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_actions_outlinks.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_dashboard4.png4
36 files changed, 551 insertions, 53 deletions
diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png
index 914bd4c78a..ac6ba667c8 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:5cc558d5fa6634dfcc05a52c9ff10f640e4d631396df9749dbe7fb782f71f07e
-size 439728
+oid sha256:39ca6c02d7702a4268460e021f7ff58792d9b95aa6f35fd81ee0a9eea56237eb
+size 450733
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 a303a6bbc9..cab70fe70a 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:ca08e4db2dc2def8e61bcc50ad70e668ea9811b78549e2272364261c7b57057a
-size 634426
+oid sha256:25379775c8d8ab9f6f04cf9543a2aef9bb12374d5de18898e3412d15c8b52365
+size 653240
diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_removed.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_removed.png
index 764cdbd44e..b13628c138 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:d7898080e63af2fd804577812e62d1f0ceeb2af128ede5bb0b00b4012c58ae30
-size 633792
+oid sha256:e463ba8c71f1014bbf5c871a360f977fc6e001f0fcaa1888a88306c9c430913e
+size 652620
diff --git a/plugins/Transitions/Categories/TransitionsSubcategory.php b/plugins/Transitions/Categories/TransitionsSubcategory.php
new file mode 100644
index 0000000000..d801ab1ba3
--- /dev/null
+++ b/plugins/Transitions/Categories/TransitionsSubcategory.php
@@ -0,0 +1,19 @@
+<?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\Transitions\Categories;
+
+use Piwik\Category\Subcategory;
+
+class TransitionsSubcategory extends Subcategory
+{
+ protected $categoryId = 'General_Actions';
+ protected $id = 'Transitions_Transitions';
+ protected $order = 46;
+
+}
diff --git a/plugins/Transitions/Transitions.php b/plugins/Transitions/Transitions.php
index c1c10d8b81..fd28fb9be6 100644
--- a/plugins/Transitions/Transitions.php
+++ b/plugins/Transitions/Transitions.php
@@ -14,7 +14,7 @@ namespace Piwik\Plugins\Transitions;
class Transitions extends \Piwik\Plugin
{
/**
- * @see Piwik\Plugin::registerEvents
+ * @see \Piwik\Plugin::registerEvents
*/
public function registerEvents()
{
@@ -33,11 +33,17 @@ class Transitions extends \Piwik\Plugin
public function getJsFiles(&$jsFiles)
{
$jsFiles[] = 'plugins/Transitions/javascripts/transitions.js';
+ $jsFiles[] = 'plugins/Transitions/angularjs/transitionswitcher/transitionswitcher.controller.js';
}
public function getClientSideTranslationKeys(&$translationKeys)
{
$translationKeys[] = 'General_TransitionsRowActionTooltipTitle';
$translationKeys[] = 'General_TransitionsRowActionTooltip';
+ $translationKeys[] = 'Actions_PageUrls';
+ $translationKeys[] = 'Actions_WidgetPageTitles';
+ $translationKeys[] = 'Transitions_NumPageviews';
+ $translationKeys[] = 'CoreHome_ThereIsNoDataForThisReport';
+ $translationKeys[] = 'General_Others';
}
}
diff --git a/plugins/Transitions/Widgets/GetTransitions.php b/plugins/Transitions/Widgets/GetTransitions.php
new file mode 100644
index 0000000000..0c1cdf3e46
--- /dev/null
+++ b/plugins/Transitions/Widgets/GetTransitions.php
@@ -0,0 +1,47 @@
+<?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\Transitions\Widgets;
+
+use Piwik\Common;
+use Piwik\Piwik;
+use Piwik\Plugins\Transitions\Controller;
+use Piwik\Widget\Widget;
+use Piwik\Widget\WidgetConfig;
+
+class GetTransitions extends Widget
+{
+ public static function configure(WidgetConfig $config)
+ {
+ $config->setCategoryId('General_Actions');
+ $config->setSubcategoryId('Transitions_Transitions');
+ $config->setName('Transitions_Transitions');
+ $config->setOrder(99);
+ $idSite = self::getIdSite();
+ if (!$idSite || !Piwik::isUserHasViewAccess($idSite)) {
+ $config->disable();
+ }
+ }
+
+ private static function getIdSite()
+ {
+ return Common::getRequestVar('idSite', 0, 'int');
+ }
+
+ public function render()
+ {
+ Piwik::checkUserHasViewAccess(self::getIdSite());
+
+ $isWidgetized = Common::getRequestVar('widget', 0, 'int') === 1;
+
+ return $this->renderTemplate('transitions', array(
+ 'isWidget' => $isWidgetized
+ ));
+ }
+
+} \ No newline at end of file
diff --git a/plugins/Transitions/angularjs/transitionswitcher/transitionswitcher.controller.js b/plugins/Transitions/angularjs/transitionswitcher/transitionswitcher.controller.js
new file mode 100644
index 0000000000..4195ba495a
--- /dev/null
+++ b/plugins/Transitions/angularjs/transitionswitcher/transitionswitcher.controller.js
@@ -0,0 +1,155 @@
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+(function () {
+ angular.module('piwikApp').controller('TransitionSwitcherController', TransitionSwitcherController);
+
+ TransitionSwitcherController.$inject = ['piwikApi', '$filter', '$rootScope'];
+
+ function TransitionSwitcherController(piwikApi, $filter, $rootScope) {
+ var translate = $filter('translate');
+
+ var self = this;
+ this.actionType = 'Actions.getPageUrls';
+ this.actionNameOptions = [];
+ this.actionTypeOptions = [
+ {key: 'Actions.getPageUrls', value: translate('Actions_PageUrls')},
+ {key: 'Actions.getPageTitles', value: translate('Actions_WidgetPageTitles')}
+ ];
+ this.isLoading = false;
+ this.transitions = null;
+ this.actionName = null;
+ this.isEnabled = true;
+ var noDataKey = '_____ignore_____';
+
+ this.detectActionName = function (reports)
+ {
+ var othersLabel = translate('General_Others');
+
+ var label, report;
+ for (var i = 0; i < reports.length; i++) {
+ if (!reports[i]) {
+ continue;
+ }
+
+ report = reports[i];
+
+ if (report.label === othersLabel) {
+ continue;
+ }
+
+ var key = null;
+ if (self.isUrlReport()) {
+ key = report.url
+ } else {
+ key = report.label;
+ }
+
+ if (key) {
+ label = report.label + ' (' + translate('Transitions_NumPageviews', report.nb_hits) + ')';
+ self.actionNameOptions.push({key: key, value: label, url: report.url});
+ if (!self.actionName) {
+ self.actionName = key
+ }
+ }
+ }
+ }
+
+ this.isUrlReport = function()
+ {
+ return this.actionType === 'Actions.getPageUrls';
+ }
+
+ this.fetch = function (type) {
+ this.isLoading = true;
+ this.actionNameOptions = [];
+ this.actionName = null;
+
+ piwikApi.fetch({
+ method: type,
+ flat: 1, filter_limit: 100,
+ filter_sort_order: 'desc',
+ filter_sort_column: 'nb_hits',
+ showColumns: 'label,nb_hits,url'
+ }).then(function (report) {
+ self.isLoading = false;
+ self.actionNameOptions = [];
+ self.actionName = null;
+
+ if (report && report.length) {
+ self.isEnabled = true;
+ self.detectActionName(report);
+ self.onActionNameChange(self.actionName);
+ }
+
+ if (null === self.actionName || self.actionNameOptions.length === 0) {
+ self.isEnabled = false;
+ self.actionName = noDataKey;
+ self.actionNameOptions.push({key: noDataKey, value: translate('CoreHome_ThereIsNoDataForThisReport')});
+ }
+ }, function () {
+ self.isLoading = false;
+ self.isEnabled = false;
+ });
+ }
+
+ this.onActionTypeChange = function (actionName) {
+ this.fetch(actionName);
+ };
+
+ this.onActionNameChange = function (actionName) {
+ if (actionName === null || actionName === noDataKey) {
+ return;
+ }
+
+ var type = 'url';
+ if (!this.isUrlReport()) {
+ type = 'title';
+ }
+ if (!this.transitions) {
+ this.transitions = new Piwik_Transitions(type, actionName, null, '');
+ } else {
+ this.transitions.reset(type, actionName, '');
+ }
+ this.transitions.showPopover(true);
+ };
+
+ $rootScope.$on('Transitions.switchTransitionsUrl', function (event, params) {
+ if (params && params.url) {
+ if (self.isUrlReport()) {
+ params.url = params.url.replace('https://', '').replace('http://', '');
+ }
+
+ var found = false, option, optionUrl;
+ for (var i = 0; i < self.actionNameOptions.length; i++) {
+ option = self.actionNameOptions[i];
+ optionUrl = option.url;
+ if (optionUrl && self.isUrlReport()) {
+ optionUrl = String(optionUrl).replace('https://', '').replace('http://', '');
+ } else {
+ optionUrl = null;
+ }
+
+ if (!found && (option.key === params.url || (params.url === optionUrl && optionUrl))) {
+ found = true;
+ self.actionName = option.key;
+ }
+ }
+ if (!found) {
+ // we only fetch top 100 in the report... so the entry the user clicked on, might not be in the top 100
+ var options = angular.copy(self.actionNameOptions); // somehow needed to force angular to render it
+ options.push({key: params.url, value: params.url});
+ self.actionNameOptions = options;
+ self.actionName = params.url;
+ }
+ self.onActionNameChange(self.actionName);
+ }
+ });
+
+ this.fetch(this.actionType);
+ }
+})(); \ No newline at end of file
diff --git a/plugins/Transitions/javascripts/transitions.js b/plugins/Transitions/javascripts/transitions.js
index 944fb0c765..4a0b74df63 100644
--- a/plugins/Transitions/javascripts/transitions.js
+++ b/plugins/Transitions/javascripts/transitions.js
@@ -183,15 +183,29 @@ Piwik_Transitions.prototype.reset = function (actionType, actionName, segment) {
};
/** Open the popover */
-Piwik_Transitions.prototype.showPopover = function () {
+Piwik_Transitions.prototype.showPopover = function (showEmbeddedInReport) {
var self = this;
+ this.showEmbeddedInReport = showEmbeddedInReport;
- this.popover = Piwik_Popover.showLoading('Transitions', self.actionName, 550);
- Piwik_Popover.addHelpButton('https://matomo.org/docs/transitions');
+ $('#transitions_report .popoverContainer').hide();
- var bothLoaded = function () {
- Piwik_Popover.setContent(Piwik_Transitions.popoverHtml);
+ if (showEmbeddedInReport) {
+ this.popover = $('#transitions_report');
+ $('#Transitions_Error_Container').hide();
+ $('#transitions_inline_loading').show();
+ } else {
+ this.popover = Piwik_Popover.showLoading('Transitions', self.actionName, 550);
+ Piwik_Popover.addHelpButton('https://matomo.org/docs/transitions');
+ }
+ var bothLoaded = function () {
+ if (!showEmbeddedInReport) {
+ Piwik_Popover.setContent(Piwik_Transitions.popoverHtml);
+ } else {
+ $('#transitions_inline_loading').hide();
+ $('#transitions_report .popoverContainer').html(Piwik_Transitions.popoverHtml);
+ $('#transitions_report .popoverContainer').show();
+ }
self.preparePopover();
self.model.htmlLoaded();
@@ -566,11 +580,26 @@ Piwik_Transitions.prototype.renderOpenGroup = function (groupName, side, onlyBg)
var isOthers = (label == 'Others');
var onClick = false;
if (!isOthers && (groupName == 'previousPages' || groupName == 'followingPages')) {
- onClick = (function (url) {
- return function () {
- self.reloadPopover(url.replace(/^(?!http)/, 'http://'));
- };
- })(label);
+
+ if (this.showEmbeddedInReport) {
+ onClick = (function (url) {
+ return function () {
+ var $rootScope = piwikHelper.getAngularDependency('$rootScope');
+ if ($rootScope) {
+ $rootScope.$emit('Transitions.switchTransitionsUrl', {
+ url:url
+ });
+ }
+ };
+ })(label);
+ } else {
+ onClick = (function (url) {
+ return function () {
+ self.reloadPopover(url.replace(/^(?!http)/, 'http://'));
+ };
+ })(label);
+ }
+
} else if (!isOthers && (groupName == 'outlinks' || groupName == 'websites' || groupName == 'downloads')) {
onClick = label
}
@@ -1516,7 +1545,25 @@ Piwik_Transitions_Ajax.prototype.callApi = function (method, params, callback) {
}
errorMessage = sprintf(errorMessage, '<br />');
- Piwik_Popover.showError(errorTitle, errorMessage, errorBack);
+ var inlineErrorNode = $('#Transitions_Error_Container');
+ if (inlineErrorNode.length) {
+ // viewing it as report, not popover
+ inlineErrorNode.html('');
+ var theContentNode = $(document.createElement('div')).addClass('Piwik_Popover_Error');
+
+ var p = $(document.createElement('p')).addClass('Piwik_Popover_Error_Title');
+ theContentNode.append(p.html(errorTitle));
+
+ if (errorMessage) {
+ p = $(document.createElement('p')).addClass('Piwik_Popover_Error_Message');
+ theContentNode.append(p.html(errorMessage));
+ }
+ inlineErrorNode.append(theContentNode);
+ inlineErrorNode.show();
+ $('#transitions_report .popoverContainer').hide();
+ } else {
+ Piwik_Popover.showError(errorTitle, errorMessage, errorBack);
+ }
};
if (typeof Piwik_Transitions_Translations == 'undefined') {
diff --git a/plugins/Transitions/lang/en.json b/plugins/Transitions/lang/en.json
index 7096f46606..3fece8c57e 100644
--- a/plugins/Transitions/lang/en.json
+++ b/plugins/Transitions/lang/en.json
@@ -2,11 +2,16 @@
"Transitions": {
"BouncesInline": "%s bounces",
"DirectEntries": "Direct Entries",
+ "Transitions": "Transitions",
"ErrorBack": "Go back to the previous action",
"ExitsInline": "%s exits",
"NumPageviews": "%s pageviews",
"NumDownloads": "%s downloads",
"NumOutlinks": "%s outlinks",
+ "TopX": "Top %s labels",
+ "FeatureDescription": "Transitions gives you a report that shows the things your visitors did directly before and after viewing a certain page. This page will explain how to access, understand, and use the powerful Transitions report.",
+ "AvailableInOtherReports": "Did you know? Transitions are also available as a row action in the following reports:",
+ "AvailableInOtherReports2": "Simply hover a row in any of these reports and click on the transition icon %s to launch it.",
"FromCampaigns": "From Campaigns",
"FromPreviousPages": "From Internal Pages",
"FromPreviousPagesInline": "%s from internal pages",
@@ -27,6 +32,7 @@
"ToFollowingSiteSearches": "Internal Searches",
"ToFollowingSiteSearchesInline": "%s internal searches",
"XOfAllPageviews": "%s of all views of this page",
- "XOutOfYVisits": "%1$s (out of %2$s)"
+ "XOutOfYVisits": "%1$s (out of %2$s)",
+ "PageURLTransitions": "Page URL Transitions"
}
} \ No newline at end of file
diff --git a/plugins/Transitions/stylesheets/transitions.less b/plugins/Transitions/stylesheets/transitions.less
index 3ddbe1d12d..70b8d0e643 100644
--- a/plugins/Transitions/stylesheets/transitions.less
+++ b/plugins/Transitions/stylesheets/transitions.less
@@ -7,7 +7,6 @@
text-align: left;
margin-left: 50px;
}
-
.Transitions_Canvas_Container {
position: absolute;
}
@@ -200,3 +199,52 @@ body .ui-tooltip.Transitions_Tooltip_Small {
font-size: 12px;
height: 21px;
}
+
+#transitions_report {
+ #Transitions_Container {
+ z-index: 980;
+ }
+ #Transitions_CenterBox {
+ z-index: 987;
+ }
+ .Transitions_Text,
+ #Transitions_Loops {
+ z-index: 986;
+ }
+ #Transitions_Canvas_Background_Left {
+ z-index: 981;
+ }
+ #Transitions_Canvas_Background_Right {
+ z-index: 982;
+ }
+ #Transitions_Canvas_Left {
+ z-index: 983;
+ }
+ #Transitions_Canvas_Right {
+ z-index: 984;
+ }
+ #Transitions_Canvas_Loops {
+ z-index: 985;
+ }
+}
+
+.widget #Transitions_Container h3 {
+ padding: 0 !important;
+}
+
+#transitions_report {
+ div[name=actionType] {
+ margin-left: -0.75rem;
+ }
+ div[name=actionName] {
+ margin-right: -0.75rem;
+ }
+}
+
+#dashboardWidgetsArea {
+ #transitions_report {
+ #Transitions_Container {
+ overflow: scroll;
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/Transitions/templates/transitions.twig b/plugins/Transitions/templates/transitions.twig
new file mode 100644
index 0000000000..8bb6657361
--- /dev/null
+++ b/plugins/Transitions/templates/transitions.twig
@@ -0,0 +1,53 @@
+{% if not isWidget %}<div piwik-content-block
+ help-text="{{ 'Transitions_FeatureDescription'|translate|e('html_attr') }}"
+ help-url="https://matomo.org/docs/transitions/"
+ content-title="{{ 'Transitions_Transitions'|translate|e('html_attr') }}">{% endif %}
+
+<div id="transitions_report" {% if isWidget %}class="widgetBody"{% endif %} ng-controller="TransitionSwitcherController as transitionSwitcher">
+ <div class="row">
+ <div class="col s12 m3">
+ <div piwik-field uicontrol="select" name="actionType"
+ ng-model="transitionSwitcher.actionType"
+ ng-change="transitionSwitcher.onActionTypeChange(transitionSwitcher.actionType)"
+ title="{{ 'Actions_ActionType'|translate|e('html_attr') }}"
+ full-width="true"
+ options='transitionSwitcher.actionTypeOptions'>
+ </div>
+ </div>
+ <div class="col s12 m9">
+ <div piwik-field uicontrol="select" name="actionName"
+ ng-model="transitionSwitcher.actionName"
+ ng-change="transitionSwitcher.onActionNameChange(transitionSwitcher.actionName)"
+ title="{{ 'Transitions_TopX'|translate(100)|e('html_attr') }}"
+ full-width="true"
+ disabled="!transitionSwitcher.isEnabled"
+ options='transitionSwitcher.actionNameOptions'>
+ </div>
+ </div>
+ </div>
+
+ <div piwik-activity-indicator loading="transitionSwitcher.isLoading"></div>
+
+ <div class="loadingPiwik" ng-show="!transitionSwitcher.isLoading" style="display:none" id="transitions_inline_loading">
+ <img src="plugins/Morpheus/images/loading-blue.gif" alt=""/> <span>{{ 'General_LoadingData'|translate }}</span>
+ </div>
+
+ <div class="popoverContainer" ng-show="!transitionSwitcher.isLoading && transitionSwitcher.isEnabled">
+
+ </div>
+
+ <div id="Transitions_Error_Container" ng-show="!transitionSwitcher.isLoading">
+
+ </div>
+
+ <div class="alert alert-info">
+ {{ 'Transitions_AvailableInOtherReports'|translate }}
+ {{ 'Actions_PageUrls'|translate }}, {{ 'Actions_SubmenuPageTitles'|translate }},
+ {{ 'Actions_SubmenuPagesEntry'|translate }},
+ {{ 'Actions_SubmenuPagesExit'|translate }},
+ {{ 'General_Outlinks'|translate }}, {{ 'General_And'|translate }} {{ 'General_Downloads'|translate }}.
+ {{ 'Transitions_AvailableInOtherReports2'|translate('<span class="icon-transition"></span>')|raw }}
+ </div>
+</div>
+
+{% if not isWidget %}</div>{% endif %} \ No newline at end of file
diff --git a/plugins/Transitions/tests/UI/Transitions_spec.js b/plugins/Transitions/tests/UI/Transitions_spec.js
index b79a5e5868..47ad47d429 100644
--- a/plugins/Transitions/tests/UI/Transitions_spec.js
+++ b/plugins/Transitions/tests/UI/Transitions_spec.js
@@ -11,8 +11,23 @@ describe("Transitions", function () {
this.timeout(0);
var generalParams = 'idSite=1&period=year&date=2012-08-09',
- urlBase = 'module=CoreHome&action=index&' + generalParams
- ;
+ urlBase = 'module=CoreHome&action=index&' + generalParams;
+
+
+ function selectValue(page, field, title)
+ {
+ page.execCallback(function () {
+ page.webpage.evaluate(function(field) {
+ $(field + ' input.select-dropdown').click()
+ }, field);
+ });
+ page.wait(800);
+ page.execCallback(function () {
+ page.webpage.evaluate(function(field, title) {
+ $(field + ' .dropdown-content.active li:contains("' + title + '"):first').click()
+ }, field, title);
+ });
+ };
it('should load the transitions popup correctly for the page titles report', function (done) {
expect.screenshot('transitions_popup_titles').to.be.captureSelector('.ui-dialog', function (page) {
@@ -31,4 +46,37 @@ describe("Transitions", function () {
page.mouseMove('.Transitions_CurveTextRight');
}, done);
});
+
+ it('should show no data message in selector', function (done) {
+ expect.screenshot('transitions_report_no_data_widget').to.be.captureSelector('body', function (page) {
+ page.load("?module=Widgetize&action=iframe&widget=1&moduleToWidgetize=Transitions&actionToWidgetize=getTransitions&idSite=1&period=day&date=today&disableLink=1&widget=1");
+ }, done);
+ });
+
+ it('should show report in reporting ui with data', function (done) {
+ expect.screenshot('transitions_report_with_data_report').to.be.captureSelector('.pageWrap', function (page) {
+ page.load("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=Transitions_Transitions");
+ page.wait(1000);
+ }, done);
+ });
+
+ it('should show report in widget ui in selector', function (done) {
+ expect.screenshot('transitions_report_with_data_widget').to.be.captureSelector('body', function (page) {
+ page.load("?module=Widgetize&action=iframe&widget=1&moduleToWidgetize=Transitions&actionToWidgetize=getTransitions&"+generalParams+"&disableLink=1&widget=1");
+ page.wait(1000);
+ }, done);
+ });
+
+ it('should be possible to switch report', function (done) {
+ expect.screenshot('transitions_report_switch_url').to.be.captureSelector('body', function (page) {
+ selectValue(page, '[name="actionName"]', 'category/meta');
+ }, done);
+ });
+
+ it('should be possible to show page titles', function (done) {
+ expect.screenshot('transitions_report_switch_type_title').to.be.captureSelector('body', function (page) {
+ selectValue(page, '[name="actionType"]', 'Title');
+ }, done);
+ });
+
}); \ No newline at end of file
diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data.png
new file mode 100644
index 0000000000..aac01f83ef
--- /dev/null
+++ b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ab022db73d4eaf512752eadb27d365776b344fa96c45dbcf20ef505efc7b9d6a
+size 33377
diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data_widget.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data_widget.png
new file mode 100644
index 0000000000..15b4e54a70
--- /dev/null
+++ b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data_widget.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:976d6bf0bb11d7d4b60faf797e23fe78abd188b2d8956431b5f31c7363a0bb84
+size 26265
diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_type_title.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_type_title.png
new file mode 100644
index 0000000000..eb1fd2914f
--- /dev/null
+++ b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_type_title.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bf28366b7ba8fa3e97fc3fffe0980b3bb6e797465bacf88937f1334de623301c
+size 135466
diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_url.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_url.png
new file mode 100644
index 0000000000..6988ecfbc9
--- /dev/null
+++ b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_url.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:48e58ecff0cbcb06568c2f7e61c2fff3afb1001455c2c859f6dd2471fc6cc960
+size 97853
diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_report.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_report.png
new file mode 100644
index 0000000000..5938af1cac
--- /dev/null
+++ b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_report.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f6b573e75aa94dca586b082d29f9237df0b78d0a6da9543210c800c498179490
+size 155679
diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_widget.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_widget.png
new file mode 100644
index 0000000000..d9c4fe2d03
--- /dev/null
+++ b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_widget.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e86fe7b1000f086744347d8023e76f967d5b1e3835721f7ee398dab18adc7568
+size 151398
diff --git a/tests/PHPUnit/Integration/WidgetsListTest.php b/tests/PHPUnit/Integration/WidgetsListTest.php
index e69fc2d6d6..bcf7746bd7 100644
--- a/tests/PHPUnit/Integration/WidgetsListTest.php
+++ b/tests/PHPUnit/Integration/WidgetsListTest.php
@@ -41,7 +41,7 @@ class WidgetsListTest extends IntegrationTestCase
// check if each category has the right number of widgets
$numberOfWidgets = array(
'Dashboard_Dashboard' => 1,
- 'General_Actions' => 21,
+ 'General_Actions' => 22,
'General_Generic' => 1,
'General_Visitors' => 31,
'SEO' => 2,
diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportPagesMetadata.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportPagesMetadata.xml
index 3f5bd03246..89ae837520 100644
--- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportPagesMetadata.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportPagesMetadata.xml
@@ -105,6 +105,34 @@
</widgets>
</row>
<row>
+ <uniqueId>General_Actions.Transitions_Transitions</uniqueId>
+ <category>
+ <id>General_Actions</id>
+ <name>Behaviour</name>
+ <order>10</order>
+ <icon>icon-reporting-actions</icon>
+ </category>
+ <subcategory>
+ <id>Transitions_Transitions</id>
+ <name>Transitions</name>
+ <order>46</order>
+ </subcategory>
+ <widgets>
+ <row>
+ <name>Transitions</name>
+ <module>Transitions</module>
+ <action>getTransitions</action>
+ <order>99</order>
+ <parameters>
+ <module>Transitions</module>
+ <action>getTransitions</action>
+ </parameters>
+ <uniqueId>widgetTransitionsgetTransitions</uniqueId>
+ <isWide>0</isWide>
+ </row>
+ </widgets>
+ </row>
+ <row>
<uniqueId>General_Actions.General_Downloads</uniqueId>
<category>
<id>General_Actions</id>
diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getWidgetMetadata.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getWidgetMetadata.xml
index 04c461dfa4..04af2ab5e0 100644
--- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getWidgetMetadata.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getWidgetMetadata.xml
@@ -1401,6 +1401,29 @@
<isReport>1</isReport>
</row>
<row>
+ <name>Transitions</name>
+ <category>
+ <id>General_Actions</id>
+ <name>Behaviour</name>
+ <order>10</order>
+ <icon>icon-reporting-actions</icon>
+ </category>
+ <subcategory>
+ <id>Transitions_Transitions</id>
+ <name>Transitions</name>
+ <order>46</order>
+ </subcategory>
+ <module>Transitions</module>
+ <action>getTransitions</action>
+ <order>99</order>
+ <parameters>
+ <module>Transitions</module>
+ <action>getTransitions</action>
+ </parameters>
+ <uniqueId>widgetTransitionsgetTransitions</uniqueId>
+ <isWide>0</isWide>
+ </row>
+ <row>
<name>Returning Visits Over Time</name>
<category>
<id>General_Actions</id>
diff --git a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png
index f702b3c476..f136586e66 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:76eacf84272b3f21f032d71f6d9c362f16d4555521bfa776fce4a02f7fac0c70
-size 325057
+oid sha256:bd2e6ce3d723899f95a42ea1693be4a709d1dd9d183c9eddf05e628f2104eb84
+size 335499
diff --git a/tests/UI/expected-screenshots/Menus_mainmenu_loaded.png b/tests/UI/expected-screenshots/Menus_mainmenu_loaded.png
index a03ef73436..b3d88035e0 100644
--- a/tests/UI/expected-screenshots/Menus_mainmenu_loaded.png
+++ b/tests/UI/expected-screenshots/Menus_mainmenu_loaded.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:9e0d8903c0a0a67c12fb4c02ffc5916b47c41762a5ca58fa6388893722eaf7b2
-size 25012
+oid sha256:72bddaa05d7a07069ca0563ab9c83fc7382857adcabf640fbe407e2f05a180ad
+size 26212
diff --git a/tests/UI/expected-screenshots/QuickAccess_search_1.png b/tests/UI/expected-screenshots/QuickAccess_search_1.png
index 36760f6d5d..60abaaf39b 100644
--- a/tests/UI/expected-screenshots/QuickAccess_search_1.png
+++ b/tests/UI/expected-screenshots/QuickAccess_search_1.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a5539920807f043a938db835c2e7204cab9924f619b8cf8cbe82c91d53f48ec2
-size 92599
+oid sha256:e2414791d5e432d1f93c0cfe161c8374246f66f9258b14ccca4267b3da82221b
+size 93556
diff --git a/tests/UI/expected-screenshots/QuickAccess_search_sites.png b/tests/UI/expected-screenshots/QuickAccess_search_sites.png
index e8771a3281..64d1a81a1e 100644
--- a/tests/UI/expected-screenshots/QuickAccess_search_sites.png
+++ b/tests/UI/expected-screenshots/QuickAccess_search_sites.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:c5979420443831f888ac7301501d9cf5fdb8bf63f38d00a815d97aa1fbffe9f2
-size 39872
+oid sha256:b4ea1908600d44b3d6040eda329084c23b24975036aecc6c6750b9678bf73627
+size 40794
diff --git a/tests/UI/expected-screenshots/Theme_home.png b/tests/UI/expected-screenshots/Theme_home.png
index ce59b2f2c1..2065584cd6 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:b0e7927f8542b760d23166fa7f31e083634cbf718e04b9aedcffe2e2fba76975
-size 637432
+oid sha256:e81e3ba391f7b487c474178b1d3987b7f3fcd82e53565dd95cbbbef43af36639
+size 657698
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_name_piece.png b/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_name_piece.png
index 160a06945e..544bfa9355 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_name_piece.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_name_piece.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:5c82fa31cfd03b7c80e1c36c02a23a345bae720179b376ed7c865870462f25d3
-size 46541
+oid sha256:0bdc5988d4776d4e8063b0f439a9dadbc15534e418482a65f793d82ac9de4eee
+size 46788
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece.png b/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece.png
index 6097deddb4..6293b9985f 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:21e4a0794891064f558fa299455541e384419b025a0b148a9f0960a73c9968c5
-size 37854
+oid sha256:98dce660fea8c3c061aabceac89477bf736f13367931c6cce62f010404b755db
+size 38110
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece_name.png b/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece_name.png
index ebdc99f300..62f059ea4b 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece_name.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece_name.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e8742001449ac71704001665c334f079746bece4d7db6f220ec2e51603c9c7f4
-size 51604
+oid sha256:dbdaa5cb578a9d04ad919c3719546eeaa14271798d1ee0dd536a5cfb2fedd6cb
+size 51870
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_actions_contents.png b/tests/UI/expected-screenshots/UIIntegrationTest_actions_contents.png
index d584be8fe9..51ee1387b5 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_actions_contents.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_actions_contents.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:86da3dd25a8f4886d6f8e3253557e2f7e155aab4858c87b9247a2686cc7a22af
-size 26806
+oid sha256:7bbef11c45dc433ce5ec5731a4fe02cb0999cf80c5a68bce343d4894387c70c4
+size 27053
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_actions_outlinks.png b/tests/UI/expected-screenshots/UIIntegrationTest_actions_outlinks.png
index 9771608495..22d6e4731d 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_actions_outlinks.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_actions_outlinks.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:64269208e036dbfe6932813a5d42286a8edaacbec2d3eff79f8ebc9ee9bcb454
-size 40525
+oid sha256:a068b9226ce723806f9b1fc06d32544c58b3e828176d6fde0337e8a62a0a0a71
+size 40791
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png
index 8fba165b54..430d92117b 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:292c9caeb7f96d317c19af8d534d1782dab8a1fd5fad942f86f0cb720a13ceed
-size 4210999
+oid sha256:e3c34088bdb7c5dd5ed7dc249e0a0e9d62b62e9ef55b6068ece1ad7d6d1bee19
+size 4215012
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png
index 7e7ceebf76..b2b3209037 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:04978b1b1fc3ded37d9f1c67ae9dc0f84f5859533cd3736567cd00189fddd2f7
-size 582155
+oid sha256:2fb05add4d153ed878d6b8b27826dffaf1ffe957655f95f3723bc185dd1eae0b
+size 603284
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png
index a1a182763f..7b13c7f76c 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f84cd9c91525abcc494e6739926d3245d381f3d9e7d8b9c252fb70a89c51331e
-size 1592120
+oid sha256:7666dc5e632377764535da9fd8d2cf8b4f8f8f3709c07b3fe7c66f7e9d5954f3
+size 1598764
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png
index 4a5db34553..38370236af 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:32799020646194a048391f05ebedd884ba4d84a896ca64539e01ef7f434a49dd
-size 636768
+oid sha256:8096c4a0e66105c61a557b9ffe4dbefed1b1675e56cf8c0c39bc15c8c13e7d05
+size 713932
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard4.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard4.png
index 456b10a1cb..a709f7a602 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard4.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard4.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f5edb345809c51ba5be421598eae2722a17d6ea695bb3e415c69d99b19aea4fb
-size 298744
+oid sha256:4aee36d8e71092bb0a0cf9f69a133ad1a6a9bd3c4b020046082852350549152b
+size 274909