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 <thomas.steur@gmail.com>2015-11-18 05:25:52 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-11-19 07:14:31 +0300
commit0bbf8eb60be3e205d7c230e430ebd7765ef38526 (patch)
tree8d40b56b04d52dc8f31e4803f51f80aff009753b
parent3154cba01693ef0d583567bc89659ea9868656fa (diff)
show union segments in a title if given
-rw-r--r--plugins/SegmentEditor/lang/en.json3
-rw-r--r--plugins/SegmentEditor/templates/_segmentSelector.twig12
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml28
3 files changed, 41 insertions, 2 deletions
diff --git a/plugins/SegmentEditor/lang/en.json b/plugins/SegmentEditor/lang/en.json
index 46bdf5fef2..933ac73884 100644
--- a/plugins/SegmentEditor/lang/en.json
+++ b/plugins/SegmentEditor/lang/en.json
@@ -26,6 +26,7 @@
"YouMayChangeSetting": "Alternatively you may change the setting in the config file (%s), or edit this Segment and choose '%s'.",
"YouMustBeLoggedInToCreateSegments": "You must be logged in to create and edit custom visitor segments.",
"YouDontHaveAccessToCreateSegments": "You don't have the required access level to create and edit segments.",
- "AddingSegmentForAllWebsitesDisabled": "Adding segments for all websites has been disabled."
+ "AddingSegmentForAllWebsitesDisabled": "Adding segments for all websites has been disabled.",
+ "SegmentXIsAUnionOf": "%s is a union of these segments:"
}
} \ No newline at end of file
diff --git a/plugins/SegmentEditor/templates/_segmentSelector.twig b/plugins/SegmentEditor/templates/_segmentSelector.twig
index 7a8019d37e..1ffb4b3d47 100644
--- a/plugins/SegmentEditor/templates/_segmentSelector.twig
+++ b/plugins/SegmentEditor/templates/_segmentSelector.twig
@@ -99,7 +99,17 @@
<a class="metric_category" href="#">{{ category }}</a>
<ul style="display:none;">
{% for segmentInCategory in segmentsInCategory %}
- <li data-metric="{{ segmentInCategory.segment }}"><a class="ddmetric" href="#">{{ segmentInCategory.name }}</a></li>
+ {% set title = segmentInCategory.name %}
+ {% if segmentInCategory.unionOfSegments is defined and segmentInCategory.unionOfSegments %}
+ {% set title = 'SegmentEditor_SegmentXIsAUnionOf'|translate(title) %}
+ {% for unionSegment in segmentInCategory.unionOfSegments %}
+ {% set title = title ~ ' ' ~ unionSegment %}
+ {% if not loop.last %}
+ {% set title = title ~ ',' %}
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+ <li data-metric="{{ segmentInCategory.segment }}" title="{{ title|e('html_attr') }}"><a class="ddmetric" href="#">{{ segmentInCategory.name }}</a></li>
{% endfor %}
</ul>
</li>
diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
index 017837d9a8..e2c3f30c00 100644
--- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
@@ -274,6 +274,13 @@
<category>Custom Variables</category>
<name>Custom Variable name (scope visit)</name>
<segment>customVariableName</segment>
+ <unionOfSegments>
+ <row>customVariableName1</row>
+ <row>customVariableName2</row>
+ <row>customVariableName3</row>
+ <row>customVariableName4</row>
+ <row>customVariableName5</row>
+ </unionOfSegments>
</row>
<row>
<type>dimension</type>
@@ -310,6 +317,13 @@
<category>Custom Variables</category>
<name>Custom Variable name (scope page)</name>
<segment>customVariablePageName</segment>
+ <unionOfSegments>
+ <row>customVariablePageName1</row>
+ <row>customVariablePageName2</row>
+ <row>customVariablePageName3</row>
+ <row>customVariablePageName4</row>
+ <row>customVariablePageName5</row>
+ </unionOfSegments>
</row>
<row>
<type>dimension</type>
@@ -346,6 +360,13 @@
<category>Custom Variables</category>
<name>Custom Variable value (scope page)</name>
<segment>customVariablePageValue</segment>
+ <unionOfSegments>
+ <row>customVariablePageValue1</row>
+ <row>customVariablePageValue2</row>
+ <row>customVariablePageValue3</row>
+ <row>customVariablePageValue4</row>
+ <row>customVariablePageValue5</row>
+ </unionOfSegments>
</row>
<row>
<type>dimension</type>
@@ -382,6 +403,13 @@
<category>Custom Variables</category>
<name>Custom Variable value (scope visit)</name>
<segment>customVariableValue</segment>
+ <unionOfSegments>
+ <row>customVariableValue1</row>
+ <row>customVariableValue2</row>
+ <row>customVariableValue3</row>
+ <row>customVariableValue4</row>
+ <row>customVariableValue5</row>
+ </unionOfSegments>
</row>
<row>
<type>dimension</type>