Skip to content

Commit f2d7b6c

Browse files
tzinathangavin
authored andcommitted
Add a Segment Management Page (#23885)
* Initiate the Segment Management Page Add 'All Visits at the top' Reorder segments: fixed > selected > starred > others Add highlighted styles to fixed and selected segments Allow star/unstar segments Reorder data Add view, edit, and delete actions Synchronize UI between the editor panel and the management page Align number to the right Add right management Use translation for the page description Implement the search segment Add tooltip on view action Add a create segment button Add sparkline UX Meeting feedback Add a menu entry into the Administration menu + colored evolution Fix range selection Update evolution tooltip Add manage segment button Remove tooltip on sparkline when using a custom range Reorder administration menu and add an outlink icon Use generic table tooltip instead of custom ones Fix PHPCS Fix PHP errors Update the Scheduled Reports help box about segment Move JavaScript in a separate file and fix a bug when we unstar selected segment Bugfix: not all users are allowed to create segments Change translation key since the parameters changed No need to have write access to be able to see the segment management page Fix UI feedback on failing star/unstar api calls First round of Stefan’s feedback * Update UI screenshots and fix tests Update UI screenshots Update UI Screenshots * Only display data for pre-processed segments * Fix the tooltip synchronisation after segment star state change * Revert UI Screenshot change * Create Dashboard link with an accessible idSite * Build dashboard link on the client side * Handle string enable_only_idsite * Add tests on title, order, and synchronisation * Add test on edit button * Update UI screenshot * Redesign real-time segment notice after team feedback * Consolidate and add more tests * Create back-end Fixture for #23885 (#24161) * Create back-end Fixture * Feedback from @sgiehl * Update expected screenshots * More Stable SegmentSelectorEditor test * Feedback from @chippison * Make listeners return unsubscribe handlers to prevent duplicate handlers * Vue build * Fix - Allow to remove 'All Visits' from comparisons * restore browser-trigger archiving state in SegmentEditor ControllerTest teardown * Do not update TagManager * Load data for the ManageSegmentPage line by line from front-end asynchronous calls * Securize segment data/delete flows and stabilize async ManageSegmentPage tests * Sanitize segment-data errors and test sequential loading after row failure * Fix tests * stabilize UI tests * add new segment management page to whats new list (#24189) * stabilize UI tests * Small back-end optimisation * Fix front-end user right to star/edit/delete segment * Fix segment search in segment panel * Move SegmentEditor.getSegmentData to API file and rename parameter (#24199) * SegmentEditor.getSegmentData API moved to the API file and renamed parameter * Fix evolution icons --------- Co-authored-by: Nathan Gavin <nathangavin987@gmail.com> # Conflicts: # tests/UI/expected-screenshots/UIIntegrationTest_period_select_date_range_click.png
1 parent d2fcd6c commit f2d7b6c

61 files changed

Lines changed: 2621 additions & 292 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ā€Žcore/Menu/MenuAdmin.phpā€Ž

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,14 @@ public function addPluginItem(string $menuName, array $url, int $order = 50, $to
107107
* @param string $menuName
108108
* @param array $url
109109
* @param int $order
110-
* @param bool|string $tooltip
110+
* @param false|string $tooltip
111+
* @param false|string $icon
111112
* @api
112113
* @since 3.0.0
113114
*/
114-
public function addMeasurableItem($menuName, $url, $order = 50, $tooltip = false)
115+
public function addMeasurableItem($menuName, $url, $order = 50, $tooltip = false, $icon = false)
115116
{
116-
$this->addItem('CoreAdminHome_MenuMeasurables', $menuName, $url, $order, $tooltip);
117+
$this->addItem('CoreAdminHome_MenuMeasurables', $menuName, $url, $order, $tooltip, $icon);
117118
}
118119

119120
/**

ā€Žlang/en.jsonā€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@
3030
"Cancel": "Cancel",
3131
"CannotUnzipFile": "Cannot unzip file %1$s: %2$s",
3232
"CanNotEditGlobalSegment": "This is a global segment. Only super users can edit global segments.",
33+
"CanNotDeleteGlobalSegment": "This is a global segment. Only super users can delete global segments.",
3334
"CanNotStarGlobalSegment": "This is a global segment. Only super users can star global segments.",
3435
"CanNotUnstarGlobalSegment": "This is a global segment. Only super users can unstar global segments.",
3536
"CanEditGlobalSegment": "This is a global segment. Any changes will apply across all websites.",
37+
"CanDeleteGlobalSegment": "This is a global segment. Deleting will apply across all websites.",
3638
"CanStarGlobalSegment": "This is a global segment. Adding to Starred will apply across all websites.",
3739
"CanUnstarGlobalSegment": "This is a global segment. Removing from Starred will apply across all websites.",
3840
"CanNotEditSiteSegment": "You can only edit the segments you created yourself.",
41+
"CanNotDeleteSiteSegment": "You can only delete the segments you created yourself.",
3942
"CanNotStarSiteSegment": "You can only add to Starred the segments you created yourself.",
4043
"CanNotUnstarSiteSegment": "You can only remove from Starred the segments you created yourself.",
4144
"CanEditSiteSegment": "Edit the segment for this website.",
45+
"CanDeleteSiteSegment": "Delete the segment for this website.",
4246
"CanStarSiteSegment": "Add to Starred segments for this website.",
4347
"CanUnstarSiteSegment": "Remove from Starred segments for this website.",
4448
"ChangeInX": "Change in %1$s",
@@ -70,6 +74,8 @@
7074
"ColumnDestinationPage": "Destination Page",
7175
"ColumnEntrances": "Entrances",
7276
"ColumnEntrancesDocumentation": "Number of visits that started on this page.",
77+
"ColumnEvolutionVisits": "Evolution Visits",
78+
"ColumnEvolutionVisitsDocumentation": "The percentage change of visits compared to the previous period. A positive value indicates growth, while a negative value signals a decrease.",
7379
"ColumnExitRate": "Exit rate",
7480
"ColumnExitRateDocumentation": "The percentage of visits that left the website after viewing this page.",
7581
"ColumnExits": "Exits",
@@ -95,6 +101,8 @@
95101
"ColumnPercentageVisits": "%% Visits",
96102
"ColumnPercentageVisitsDocumentation": "The percentage of total visits.",
97103
"ColumnRevenue": "Revenue",
104+
"ColumnSegment": "Segment",
105+
"ColumnSegmentDocumentation": "A segment is a set of criteria used to select only a part of the entire set of visits.",
98106
"ColumnSumTimeOnSite": "Total Time on Website",
99107
"ColumnSumVisitLength": "Total time spent by visitors (in seconds)",
100108
"ColumnTotalPageviews": "Total Pageviews",

ā€Žplugins/CoreHome/stylesheets/dataTable/_dataTable.lessā€Ž

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ body>.widget table.dataTable {
101101
}
102102

103103
// for dataTables in report pages (not for widgets in the dashboard)
104-
.theWidgetContent .card .card-content table.dataTable, table.dataTable, table.subDataTable {
104+
.theWidgetContent .card .card-content table.dataTable,
105+
table.dataTable,
106+
table.subDataTable {
105107

106108
th {
107109
background: @theme-color-background-base !important;
@@ -156,10 +158,15 @@ table.dataTable td.column {
156158
white-space: nowrap;
157159
}
158160

159-
.dataTable tr.highlight td {
161+
.dataTable tr.highlight td,
162+
.dataTable_row-highlight td {
160163
font-weight: bold;
161164
}
162165

166+
tr:nth-last-child(1 of .dataTable_row-group) td {
167+
border-bottom: 3px solid @theme-color-background-tinyContrast !important;
168+
}
169+
163170
table.dataTable th.label,
164171
table.dataTable td.label,
165172
table.subActionsDataTable td.label,

ā€Žplugins/CoreHome/stylesheets/dataTable/_entityTable.lessā€Ž

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,45 @@ table.entityTable {
5050
}
5151
}
5252
}
53+
54+
th.entityTable_Numeric {
55+
text-align: right !important;
56+
}
57+
td.entityTable_Numeric {
58+
text-align: right;
59+
font-variant-numeric: tabular-nums;
60+
}
61+
62+
.entityTable_Sparkline {
63+
padding: 0;
64+
width: 100px;
65+
}
66+
}
67+
68+
.entityTable_StarCell,
69+
table.entityTable tbody tr .entityTable_StarCell {
70+
width: 40px;
71+
padding-right: 0;
72+
}
73+
74+
.entityTable_Filler,
75+
table.entityTable tbody tr .entityTable_Filler {
76+
padding: 0;
77+
}
78+
79+
.entityTable_ActionCell,
80+
table.entityTable tbody tr .entityTable_ActionCell {
81+
padding: 0 16px;
82+
}
83+
84+
.entityTable_ActionCell-1,
85+
table.entityTable tbody tr .entityTable_ActionCell-1 {
86+
width: 80px;
87+
}
88+
89+
.entityTable_ActionCell-3,
90+
table.entityTable tbody tr .entityTable_ActionCell-3 {
91+
width: 170px;
5392
}
5493

5594
.table-action {
@@ -71,6 +110,15 @@ table.entityTable {
71110
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.16), 0 1px 5px 0 rgba(0,0,0,0.12);
72111
cursor: pointer;
73112
}
113+
114+
&[data-state="disabled"] {
115+
opacity: 0.2;
116+
cursor: not-allowed;
117+
}
118+
119+
.entityTable_ActionCell & {
120+
display: inline-block;
121+
}
74122
}
75123

76124
.card .tableActionBar {
@@ -82,6 +130,11 @@ table.entityTable {
82130
}
83131
}
84132

133+
.tableFooterLabel {
134+
margin-bottom: 16px;
135+
font-style: italic;
136+
}
137+
85138
.tableActionBar {
86139
a,
87140
button {
@@ -105,12 +158,14 @@ table.entityTable {
105158
text-transform: uppercase;
106159
vertical-align: middle;
107160
-webkit-tap-highlight-color: transparent;
161+
108162
&:hover {
109163
text-decoration: none;
110164
}
111165
}
112166

113-
button:first-child, a:first-child {
167+
button:first-child,
168+
a:first-child {
114169
background-color: @theme-color-brand !important;
115170
color: @color-white;
116171
}

ā€Žplugins/CoreHome/vue/src/Sparkline/Sparkline.lessā€Ž

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,22 @@ img.sparklineImg {
22
width: 100px;
33
height: 25px;
44
}
5+
6+
.sparklineEvolution {
7+
color: black;
8+
font-size: 12px;
9+
white-space: nowrap;
10+
}
11+
12+
.sparklineEvolution-positive {
13+
color: green;
14+
}
15+
16+
.sparklineEvolution-negative {
17+
color: red;
18+
}
19+
20+
.sparklineEvolution_icon {
21+
margin-right: 1em;
22+
vertical-align: middle;
23+
}

ā€Žplugins/CoreVue/types/index.d.tsā€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ declare global {
8383
interface PiwikHelperGlobal {
8484
escape(text: string): string;
8585
redirect(params?: any);
86+
getCurrentQueryStringWithParametersModified(newparams: string);
8687
htmlDecode(encoded: string): string;
8788
htmlEntities(value: string): string;
8889
modalConfirm(element: JQuery|HTMLElement|string, callbacks?: ModalConfirmCallbacks, options?: ModalConfirmOptions);

ā€Žplugins/CustomDimensions/tests/System/expected/test___API.getReportPagesMetadata.xmlā€Ž

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1565,4 +1565,35 @@
15651565
</row>
15661566
</widgets>
15671567
</row>
1568-
</result>
1568+
<row>
1569+
<uniqueId>General_Visitors.CoreHome_Segments</uniqueId>
1570+
<category>
1571+
<id>General_Visitors</id>
1572+
<name>Visitors</name>
1573+
<order>5</order>
1574+
<icon>icon-reporting-visitors</icon>
1575+
<help>&lt;p&gt;The Visitors pages tell you things about who your visitors are. Things like where your visitors came from, what devices and browsers they're using and when they generally visit your website. Understand, in the aggregate, who your audience is, and look for outliers to see how your audience could grow.&lt;/p&gt;&lt;p&gt;In addition to general information about your visitors, you can also use the &lt;a href="#" onclick="this.href=broadcast.buildReportingUrl('category=General_Visitors&amp;subcategory=Live_VisitorLog')"&gt;Visits Log&lt;/a&gt; to see what occurred in every individual visit.&lt;/p&gt;</help>
1576+
<widget/>
1577+
</category>
1578+
<subcategory>
1579+
<id>CoreHome_Segments</id>
1580+
<name>Segments</name>
1581+
<order>99</order>
1582+
<help/>
1583+
</subcategory>
1584+
<widgets>
1585+
<row>
1586+
<name>Segments</name>
1587+
<module>SegmentEditor</module>
1588+
<action>manageSegments</action>
1589+
<order>99</order>
1590+
<parameters>
1591+
<module>SegmentEditor</module>
1592+
<action>manageSegments</action>
1593+
</parameters>
1594+
<uniqueId>widgetSegmentEditormanageSegments</uniqueId>
1595+
<isWide>0</isWide>
1596+
</row>
1597+
</widgets>
1598+
</row>
1599+
</result>
Lines changed: 2 additions & 2 deletions
Loading

ā€Žplugins/Goals/Menu.phpā€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function configureAdminMenu(MenuAdmin $menu)
2222
$idSite = $this->getIdSite($userPreferences->getDefaultWebsiteId());
2323

2424
if (Piwik::isUserHasWriteAccess($idSite)) {
25-
$menu->addMeasurableItem('Goals_Goals', $this->urlForAction('manage', array('idSite' => $idSite)), 40);
25+
$menu->addMeasurableItem('Goals_Goals', $this->urlForAction('manage', array('idSite' => $idSite)), 15);
2626
}
2727
}
2828

ā€Žplugins/Morpheus/stylesheets/ui/_cards.lessā€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ h1,
5959
}
6060
}
6161

62-
.card-table + .tableActionBar {
62+
.card-introduction {
63+
max-width: 900px;
64+
}
65+
66+
.card-table + .tableActionBar,
67+
.tableFooterLabel + .tableActionBar {
6368
margin: 0 0 0 -20px;
6469
}
6570

0 commit comments

Comments
Ā (0)
⚔