Skip to content

Commit 66214ca

Browse files
committed
using value from global.ini 'data_comparison_segment_limit' as the limit
1 parent 19a751d commit 66214ca

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/Config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ public function getClientSideOptions()
188188
'action_title_category_delimiter' => $general['action_title_category_delimiter'],
189189
'are_ads_enabled' => Advertising::isAdsEnabledInConfig($general),
190190
'autocomplete_min_sites' => $general['autocomplete_min_sites'],
191+
'data_comparison_segment_limit' => $general['data_comparison_segment_limit'],
191192
'datatable_export_range_as_day' => $general['datatable_export_range_as_day'],
192193
'datatable_row_limits' => $this->getDatatableRowLimits(),
193194
'enable_general_settings_admin' => Controller::isGeneralSettingsAdminEnabled(),

plugins/SegmentEditor/javascripts/Segmentation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Segmentation = (function($) {
110110
self.checkIfComparedSegmentsHasReachedLimit();
111111
};
112112
segmentation.prototype.checkIfComparedSegmentsHasReachedLimit = function() {
113-
const limit = 6;
113+
const limit = piwik.config.data_comparison_segment_limit;
114114
const comparisonService = window.CoreHome.ComparisonsStoreInstance;
115115
const comparedSegmentsLength = comparisonService.getSegmentComparisons().length;
116116
console.log('these are the available segments: ',this.availableSegments);
@@ -120,7 +120,7 @@ Segmentation = (function($) {
120120
if (comparedSegmentsLength >= limit) {
121121
console.log('limit reached');
122122
$(this).addClass('no-click');
123-
$(this).parent().attr('title', _pk_translate('General_MaximumNumberOfSegmentsComparedIs', [6]));
123+
$(this).parent().attr('title', _pk_translate('General_MaximumNumberOfSegmentsComparedIs', [limit]));
124124
} else {
125125
console.log('removing class');
126126
$(this).removeClass('no-click');

0 commit comments

Comments
 (0)