Skip to content

Commit 14ffece

Browse files
author
Zoltan Flamis
authored
Show report generated time when date range includes today (matomo-org#17506)
* wip * wip * report generated tooltip * show only if date includes today * show generated date for evo graphs * add and use new clock icon * force html formatter * delete metadata from api response for multisite API * redo show report generated for evo graph * fix ui tests * Update Archive.php
1 parent c973567 commit 14ffece

File tree

16 files changed

+54
-17
lines changed

16 files changed

+54
-17
lines changed

LEGALNOTICE

+3-3
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ THIRD-PARTY COMPONENTS AND LIBRARIES
217217
Link: http://raphaeljs.com/
218218
License: MIT (Expat)
219219

220-
Name: iFrame Resizer
220+
Name: iFrame Resizer
221221
Link: https://github.com/davidjbradshaw/iframe-resizer
222222
License: MIT
223223

@@ -279,7 +279,7 @@ THIRD-PARTY CONTENT
279279
License: GPL
280280
By: Alessandro Rei - http://www.kde-look.org/usermanager/search.php?username=mentalrey
281281

282-
Name: Material icons ("icon-info2", "icon-outline", "icon-settings", "icon-form", "icon-play", "icon-pause", "icon-replay", "icon-skip-next", "icon-skip-forward", "icon-stop", "icon-fast-forward", "icon-fast-rewind", "icon-bug", "icon-upload", "icon-segmented-visits-log") in plugins/Morpheus/fonts, and plugins/Morpheus/images/compare.svg
282+
Name: Material icons ("icon-info2", "icon-outline", "icon-settings", "icon-form", "icon-play", "icon-pause", "icon-replay", "icon-skip-next", "icon-skip-forward", "icon-stop", "icon-fast-forward", "icon-fast-rewind", "icon-bug", "icon-upload", "icon-segmented-visits-log", "icon-clock") in plugins/Morpheus/fonts, and plugins/Morpheus/images/compare.svg
283283
Link: https://design.google.com/icons/
284284
License: Apache License Version 2.0
285285

@@ -294,6 +294,6 @@ THIRD-PARTY CONTENT
294294
Notes:
295295
- the "New BSD" license refers to either the "Modified BSD" and "Simplified BSD"
296296
licenses (2- or 3-clause), which are GPL compatible.
297-
- icons for browsers, operating systems, browser plugins, brands, search engines, social media websites
297+
- icons for browsers, operating systems, browser plugins, brands, search engines, social media websites
298298
and flags of countries are nominative use of third-party trademarks when
299299
referring to the corresponding product or entity

core/ArchiveProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ public function renameColumnsAfterAggregation(DataTable $table, $columnsToRename
582582
if (empty($columnsToRenameAfterAggregation)) {
583583
return;
584584
}
585-
585+
586586
foreach ($table->getRows() as $row) {
587587
foreach ($columnsToRenameAfterAggregation as $oldName => $newName) {
588588
$row->renameColumn($oldName, $newName);

plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.html

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
title="{{ featureName }}"></div>
2424
</span>
2525

26+
<div ng-show="showReportGenerated" class="icon-clock report-generated"></div>
27+
2628
<div class="inlineHelp" ng-show="view.showInlineHelp">
2729
<div ng-bind-html="inlineHelp"></div>
2830
<a ng-if="helpUrl"

plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.js

+25-5
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,22 @@
2828
* </h2>
2929
* -> alternative definition for inline help
3030
* -> shows help icon to display inline help on click. Note: You can combine inlinehelp and help-url
31+
*
32+
* * <h2 piwik-enriched-headline report-generated="generated time">Pages report</h2>
33+
* -> reportGenerated specified via this attribute shows a clock icon with a tooltip which activated by hover
34+
* -> the tooltip shows the value of the attribute
3135
*/
3236
(function () {
3337
angular.module('piwikApp').directive('piwikEnrichedHeadline', piwikEnrichedHeadline);
3438

35-
piwikEnrichedHeadline.$inject = ['$document', 'piwik', '$filter', '$parse'];
39+
piwikEnrichedHeadline.$inject = ['$document', 'piwik', '$filter', '$parse', 'piwikPeriods'];
3640

37-
function piwikEnrichedHeadline($document, piwik, $filter, $parse){
41+
function piwikEnrichedHeadline($document, piwik, $filter, $parse, piwikPeriods){
3842
var defaults = {
3943
helpUrl: '',
40-
editUrl: ''
44+
editUrl: '',
45+
reportGenerated: '',
46+
showReportGenerated: '',
4147
};
4248

4349
return {
@@ -46,8 +52,10 @@
4652
scope: {
4753
helpUrl: '@',
4854
editUrl: '@',
55+
reportGenerated: '@?',
4956
featureName: '@',
50-
inlineHelp: '@?'
57+
inlineHelp: '@?',
58+
showReportGenerated: '=?'
5159
},
5260
templateUrl: 'plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.html?cb=' + piwik.cacheBuster,
5361
compile: function (element, attrs) {
@@ -87,8 +95,20 @@
8795
if (!attrs.featureName) {
8896
attrs.featureName = $.trim(element.find('.title').first().text());
8997
}
98+
99+
if (scope.reportGenerated && piwikPeriods.parse(piwik.period, piwik.currentDateString).containsToday()) {
100+
element.find('.report-generated').first().tooltip({
101+
track: true,
102+
content: scope.reportGenerated,
103+
items: 'div',
104+
show: false,
105+
hide: false
106+
});
107+
108+
scope.showReportGenerated = '1';
109+
}
90110
};
91111
}
92112
};
93113
}
94-
})();
114+
})();

plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.less

+9
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,13 @@
6262
text-decoration: none;
6363
}
6464
}
65+
66+
.report-generated {
67+
float: right;
68+
cursor: pointer;
69+
font-size: 14px;
70+
color:#888;
71+
opacity: 0.3;
72+
line-height: 32px;
73+
}
6574
}

plugins/CoreHome/templates/_dataTable.twig

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
{% if properties.title %}
1414
<h2 class="card-title"
1515
{% if properties.title_edit_entity_url %}edit-url="{{ properties.title_edit_entity_url }}"{% endif %}
16+
{% if reportLastUpdatedMessage is defined and reportLastUpdatedMessage %}report-generated="{{ reportLastUpdatedMessage|raw }}"{% endif %}
1617
piwik-enriched-headline
1718
>{{ properties.title }}</h2>
1819
{% endif %}

plugins/Morpheus/fonts/matomo.svg

+1
Loading

plugins/Morpheus/fonts/matomo.ttf

84 Bytes
Binary file not shown.

plugins/Morpheus/fonts/matomo.woff

84 Bytes
Binary file not shown.

plugins/Morpheus/fonts/matomo.woff2

40 Bytes
Binary file not shown.

plugins/Morpheus/fonts/selection.json

+1-1
Large diffs are not rendered by default.

plugins/Morpheus/stylesheets/base/icons.css

+4-1
Original file line numberDiff line numberDiff line change
@@ -387,4 +387,7 @@
387387
}
388388
.icon-page-performance:before {
389389
content: "\e9a6";
390-
}
390+
}
391+
.icon-clock:before {
392+
content: "\e901";
393+
}

plugins/Morpheus/templates/demo.twig

+2-1
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,8 @@
667667
'form',
668668
'transition',
669669
'overlay',
670-
'lab'
670+
'lab',
671+
'clock'
671672
],
672673
'Users': [
673674
'user',
Loading

tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,4 @@ public static function getOutputPrefix()
148148
}
149149

150150
TwoVisitorsTwoWebsitesDifferentDaysConversionsTest::$fixture = new TwoSitesTwoVisitorsDifferentDays();
151-
TwoVisitorsTwoWebsitesDifferentDaysConversionsTest::$fixture->allowConversions = true;
151+
TwoVisitorsTwoWebsitesDifferentDaysConversionsTest::$fixture->allowConversions = true;
Loading

0 commit comments

Comments
 (0)