diff options
author | Benaka <diosmosis@users.noreply.github.com> | 2018-05-04 03:17:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-04 03:17:06 +0300 |
commit | 453e3fbdabbf8c72264a3e15e2650cfad99b06b2 (patch) | |
tree | 18a4816bf85c3e4a33a916ef01a53158de3cc519 /plugins | |
parent | 83ae9176c7877155b5d793835a7a5ebc0db2127e (diff) |
Do not show 'all' limit selector option for VisitorLog & default to 25 if filter_limit=-1 used (#12790)
* Add disable_all_rows_filter_limit viewdatatable config option & use in visitorlog visualization.
* If -1 filter_limit is used w/ visitor log visualization, change it to 25 (which is in the datatable_row_limits default config value).
* Use datatable_default_limit as limit to set when unsupported filter_limit used in VisitorLog visualization.
* Update screenshots.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Actions/tests/UI/expected-screenshots/ActionsDataTable_segmented_visitor_log.png | bin | 131 -> 423104 bytes | |||
-rw-r--r-- | plugins/CoreHome/javascripts/dataTable.js | 26 | ||||
-rw-r--r-- | plugins/Live/Visualizations/VisitorLog.php | 9 | ||||
-rw-r--r-- | plugins/Live/tests/UI/expected-screenshots/Live_visitor_log.png | bin | 131 -> 402671 bytes |
4 files changed, 25 insertions, 10 deletions
diff --git a/plugins/Actions/tests/UI/expected-screenshots/ActionsDataTable_segmented_visitor_log.png b/plugins/Actions/tests/UI/expected-screenshots/ActionsDataTable_segmented_visitor_log.png Binary files differindex 4622ba191e..7fcc3a0820 100644 --- a/plugins/Actions/tests/UI/expected-screenshots/ActionsDataTable_segmented_visitor_log.png +++ b/plugins/Actions/tests/UI/expected-screenshots/ActionsDataTable_segmented_visitor_log.png diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js index 37a7e9548b..62db8ef1c7 100644 --- a/plugins/CoreHome/javascripts/dataTable.js +++ b/plugins/CoreHome/javascripts/dataTable.js @@ -626,14 +626,14 @@ $.extend(DataTable.prototype, UIControl.prototype, { }, handleLimit: function (domElem) { - var tableRowLimits = piwik.config.datatable_row_limits, - evolutionLimits = - { - day: [8, 30, 60, 90, 180, 365, 500], - week: [4, 12, 26, 52, 104, 500], - month: [3, 6, 12, 24, 36, 120], - year: [3, 5, 10] - }; + var tableRowLimits = piwik.config.datatable_row_limits, + evolutionLimits = + { + day: [8, 30, 60, 90, 180, 365, 500], + week: [4, 12, 26, 52, 104, 500], + month: [3, 6, 12, 24, 36, 120], + year: [3, 5, 10] + }; var self = this; if (typeof self.parentId != "undefined" && self.parentId != '') { @@ -642,6 +642,16 @@ $.extend(DataTable.prototype, UIControl.prototype, { return; } + if (self.props.disable_all_rows_filter_limit) { // remove the -1 value from the limits array + var tempTableRowLimits = []; + tableRowLimits.forEach(function (limit) { + if (limit != -1) { + tempTableRowLimits.push(limit); + } + }); + tableRowLimits = tempTableRowLimits; + } + // configure limit control var setLimitValue, numbers, limitParamName; if (self.param.viewDataTable == 'graphEvolution') { diff --git a/plugins/Live/Visualizations/VisitorLog.php b/plugins/Live/Visualizations/VisitorLog.php index f6c7790f14..575b603d7d 100644 --- a/plugins/Live/Visualizations/VisitorLog.php +++ b/plugins/Live/Visualizations/VisitorLog.php @@ -9,6 +9,7 @@ namespace Piwik\Plugins\Live\Visualizations; use Piwik\Common; +use Piwik\Config; use Piwik\DataTable; use Piwik\Piwik; use Piwik\Plugin; @@ -43,8 +44,11 @@ class VisitorLog extends Visualization 'filter_sort_order', )); - if (!is_numeric($this->requestConfig->filter_limit)) { - $this->requestConfig->filter_limit = 20; + if (!is_numeric($this->requestConfig->filter_limit) + || $this->requestConfig->filter_limit == -1 // 'all' is not supported for this visualization + ) { + $defaultLimit = Config::getInstance()->General['datatable_default_limit']; + $this->requestConfig->filter_limit = $defaultLimit; } $this->requestConfig->disable_generic_filters = true; @@ -83,6 +87,7 @@ class VisitorLog extends Visualization $this->config->show_all_views_icons = false; $this->config->show_table_all_columns = false; $this->config->show_export_as_rss_feed = false; + $this->config->disable_all_rows_filter_limit = true; $this->config->documentation = Piwik::translate('Live_VisitorLogDocumentation', array('<br />', '<br />')); diff --git a/plugins/Live/tests/UI/expected-screenshots/Live_visitor_log.png b/plugins/Live/tests/UI/expected-screenshots/Live_visitor_log.png Binary files differindex 6dcf9b7c49..1072bd2b5c 100644 --- a/plugins/Live/tests/UI/expected-screenshots/Live_visitor_log.png +++ b/plugins/Live/tests/UI/expected-screenshots/Live_visitor_log.png |