diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-02-03 17:52:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-03 17:52:51 +0300 |
commit | cbe27096a5b9b39772bed74e60761651b1c3f546 (patch) | |
tree | fc62b0f09ac785d1816b2956beeb5e0d3af73c67 /plugins/UserCountryMap | |
parent | 67c8f6e7461772bf9a02b4986b5b5aefc7dc67bb (diff) |
Hide visitor map controls if no data is available (#15223)
* Hide visitor map controls if no data is available
* Show widget title if there is no data for the map
* update ui tests
* hide no data titel in widgets
* update ui test files
Diffstat (limited to 'plugins/UserCountryMap')
5 files changed, 17 insertions, 7 deletions
diff --git a/plugins/UserCountryMap/javascripts/visitor-map.js b/plugins/UserCountryMap/javascripts/visitor-map.js index 9f9f94153c..396fac73a3 100644 --- a/plugins/UserCountryMap/javascripts/visitor-map.js +++ b/plugins/UserCountryMap/javascripts/visitor-map.js @@ -69,7 +69,6 @@ citySelectedLabelColor = colors['city-selected-label-color'], regionLayerStrokeColor = colors['region-layer-stroke-color'], hasUserZoomed = false; - ; /* * our own custom selector to only select stuff of this widget @@ -375,8 +374,8 @@ infobtn.off('mouseenter').on('mouseenter',function (e) { $(infobtn.data('tooltip-target')).show(); }).off('mouseleave').on('mouseleave', function (e) { - $(infobtn.data('tooltip-target')).hide(); - }); + $(infobtn.data('tooltip-target')).hide(); + }); $('.UserCountryMap-tooltip').hide(); } @@ -700,6 +699,11 @@ } function displayUnlocatableCount(unlocated, total, regionOrCity) { + + if (0 == unlocated) { + return; + } + $('.unlocated-stats').html( $('.unlocated-stats').data('tpl') .replace('%s', unlocated) diff --git a/plugins/UserCountryMap/stylesheets/visitor-map.less b/plugins/UserCountryMap/stylesheets/visitor-map.less index 6becb0c902..4c96011302 100644 --- a/plugins/UserCountryMap/stylesheets/visitor-map.less +++ b/plugins/UserCountryMap/stylesheets/visitor-map.less @@ -81,6 +81,7 @@ position: absolute; z-index: 700; opacity: 0.9; + display: none; } /* this should me moved to TableView css sometimes */ diff --git a/plugins/UserCountryMap/templates/visitorMap.twig b/plugins/UserCountryMap/templates/visitorMap.twig index cbfc53f02a..f87a2df356 100644 --- a/plugins/UserCountryMap/templates/visitorMap.twig +++ b/plugins/UserCountryMap/templates/visitorMap.twig @@ -20,6 +20,9 @@ </div> <div class="mapWidgetStatus"> {% if noData %} + {% if not isWidget %} + <h2>{{ 'UserCountryMap_VisitorMap'|translate }}</h2> + {% endif %} <div class="pk-emptyDataTable">{{ 'CoreHome_ThereIsNoDataForThisReport'|translate }}</div> {% else %} <span class="loadingPiwik"> @@ -28,6 +31,7 @@ </span> {% endif %} </div> + {% if not noData %} <div class="dataTableFeatures" style="padding-top:0;"> <div class="dataTableFooterIcons"> <div class="dataTableFooterWrap" var="graphVerticalBar"> @@ -70,6 +74,7 @@ </select> </div> </div> + {% endif %} </div> </section> diff --git a/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_cities.png b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_cities.png index b35c9c0fe3..2b903e0d67 100644 --- a/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_cities.png +++ b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_cities.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9fb473bc96a5749312cc1928b506df81fbabf474c02dd465d22c8c9c52a7ef04 -size 114792 +oid sha256:31f3a972fd727b7be525d242a0c95ffafc619ce64969c981d783f5151dedafa3 +size 114527 diff --git a/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_regions.png b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_regions.png index 3f2df782b7..6e61d68d4d 100644 --- a/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_regions.png +++ b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_regions.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1679723fce50ccd125e64475330ae1dbf134ef70ec0fd157ff5caeb315e0a99a -size 114252 +oid sha256:826285bbd7d36882f590a4d6a489a2161fb42e2683b3b44809524e6b6ea35184 +size 113986 |