From fd3463170886a6e01cbae0798b4e7ec0e11cb0a5 Mon Sep 17 00:00:00 2001
From: Stefan Giehl <stefan@piwik.org>
Date: Mon, 3 Oct 2016 21:09:17 +0200
Subject: [PATCH] Show description as part of the datatable (#10649)

* fixes #10613 - show description as part of the datatable
---
 plugins/CoreHome/templates/_dataTable.twig      |   8 ++++----
 .../UIIntegrationTest_dashboard2.png            | Bin 132 -> 132 bytes
 .../UIIntegrationTest_goals_individual_goal.png | Bin 131 -> 131 bytes
 ...rationTest_goals_individual_goal_updated.png | Bin 0 -> 131 bytes
 tests/UI/specs/UIIntegration_spec.js            |   6 ++++++
 5 files changed, 10 insertions(+), 4 deletions(-)
 create mode 100644 tests/UI/expected-screenshots/UIIntegrationTest_goals_individual_goal_updated.png

diff --git a/plugins/CoreHome/templates/_dataTable.twig b/plugins/CoreHome/templates/_dataTable.twig
index 2ec3f00fa6..b43337a906 100644
--- a/plugins/CoreHome/templates/_dataTable.twig
+++ b/plugins/CoreHome/templates/_dataTable.twig
@@ -27,10 +27,6 @@
     <div class="card-content">
 {% endif %}
 
-{% if properties.description %}
-    <div class="card-description">{{ properties.description }}</div>
-{% endif %}
-
 {% set summaryRowId = constant('Piwik\\DataTable::ID_SUMMARY_ROW') %}{# ID_SUMMARY_ROW #}
 {% set isSubtable = javascriptVariablesToSet.idSubtable is defined and javascriptVariablesToSet.idSubtable != 0 %}
 <div class="dataTable {{ visualizationCssClass }} {{ properties.datatable_css_class|default('') }} {% if isSubtable %}subDataTable{% endif %}"
@@ -40,6 +36,10 @@
      data-props="{% if clientSideProperties is empty %}{}{% else %}{{ clientSideProperties|json_encode }}{% endif %}"
      data-params="{% if clientSideParameters is empty %}{}{% else %}{{ clientSideParameters|json_encode }}{% endif %}">
 
+    {% if properties.description %}
+        <div class="card-description">{{ properties.description }}</div>
+    {% endif %}
+
     <div class="reportDocumentation">
         {% if properties.documentation|default is not empty %}<p>{{ properties.documentation|raw }}</p>{% endif %}
         {% if reportLastUpdatedMessage is defined and reportLastUpdatedMessage %}<span class='helpDate'>{{ reportLastUpdatedMessage|raw }}</span>{% endif %}
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png
index 3404bb899e17d8f0db26a5e5390476db9c83f428..f0495e85bcace7339623419dc882c59ddb75b661 100644
GIT binary patch
delta 84
zcmV~$u@QhE3<c1$WeP_ikmSP<4v|2(v$nHl07v${eeC1IMVzf83ONrz2@zAUycgCi
eHqDm~gJjVf!Dv3_Sdy)wgd;uo8z-@#ww8YArx!N>

delta 84
zcmWN`yAgmO5Cy;?wF*ms`#mVaA~;TFjLnQGz>;;-U1_Bk#~DQ2Lo`>ZrV%jDHUN@5
fxkdNVo4FB}*(ThK|95044ajz1&$$;-aMkSt%2*Z>

diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_goals_individual_goal.png b/tests/UI/expected-screenshots/UIIntegrationTest_goals_individual_goal.png
index 52cc88e9a7a81c0fd1f6f4edb3567a3c66b74479..7fad47a8ea8365e80acc864a3f82502adfbf907e 100644
GIT binary patch
delta 84
zcmV~$u@QhE3<c1mWeP{&ClSIB4gpEHv$nHk0Y~<|op$=_72)iQ>0G8fNQJtiv|$jM
eYK^B&QDL*fU6wncRU<e8h$8v9-#DOBl=Bbsxfb03

delta 84
zcmV~$yAgmO3;@uhWeP_C@*x?*A(BY$tnF-Bz>$4#mt8(SL8k<H55hzfWW!7|hg6br
er80P81cy4<LTW8(+Jvy+C9OX9yN)iPL+cL#To;=F

diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_goals_individual_goal_updated.png b/tests/UI/expected-screenshots/UIIntegrationTest_goals_individual_goal_updated.png
new file mode 100644
index 0000000000000000000000000000000000000000..2e99b4699373583c4774fd029e12edc1a617d822
GIT binary patch
literal 131
zcmWN?!41P83;@7?reJ{v84Q?g1I8&xZHWrWqtiE^yGy>K^^dA^9%Iw`+2-T5kM+Ku
zdFB4r;}F&tEWH&qYBJ7mVg#bk4ooRdgfcNF!4jQ^NXg~k*(bJS_hKwW#2c|*0uo{}
M%V<AQKo~46e<0Z>egFUf

literal 0
HcmV?d00001

diff --git a/tests/UI/specs/UIIntegration_spec.js b/tests/UI/specs/UIIntegration_spec.js
index 196e8d7f95..9b4706465f 100644
--- a/tests/UI/specs/UIIntegration_spec.js
+++ b/tests/UI/specs/UIIntegration_spec.js
@@ -296,6 +296,12 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik?
         }, done);
     });
 
+    it('should update the evolution chart if a sparkline is clicked', function (done) {
+        expect.screenshot('goals_individual_goal_updated').to.be.captureSelector('.pageWrap,.dataTable', function (page) {
+            page.click('.sparkline.linked:contains(%)');
+        }, done);
+    });
+
     // Events pages
     it('should load the Events > index page correctly', function (done) {
         expect.screenshot('events_overview').to.be.captureSelector('.pageWrap,.dataTable', function (page) {
-- 
GitLab