diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php index e7d8c5218582fecaa356fece73765d9a5c4c0bba..4c5abc8071a515101cda152e90b01312afcbd834 100644 --- a/plugins/CoreHome/CoreHome.php +++ b/plugins/CoreHome/CoreHome.php @@ -257,6 +257,7 @@ class CoreHome extends \Piwik\Plugin $translationKeys[] = 'Intl_Year_Short'; $translationKeys[] = 'General_MultiSitesSummary'; $translationKeys[] = 'General_SearchNoResults'; + $translationKeys[] = 'CoreHome_ChooseX'; $translationKeys[] = 'CoreHome_YouAreUsingTheLatestVersion'; $translationKeys[] = 'CoreHome_IncludeRowsWithLowPopulation'; $translationKeys[] = 'CoreHome_ExcludeRowsWithLowPopulation'; diff --git a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu-model.js b/plugins/CoreHome/angularjs/reporting-menu/reportingmenu-model.js index 83a714ceb71d0565a2c92367cc458a277b226757..ca26581da02029b3c7e25388997dfb23b7fceec1 100644 --- a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu-model.js +++ b/plugins/CoreHome/angularjs/reporting-menu/reportingmenu-model.js @@ -82,7 +82,7 @@ category.subcategories = []; - var goalsGroup = false; + var categoryGroups = false; angular.forEach(pages, function (page, key) { if (page.category.id === categoryId) { @@ -92,25 +92,25 @@ subcategory.active = true; } - if (page.widgets && page.widgets[0] && page.category.id === 'Goals_Goals' && isNumeric(page.subcategory.id)) { + if (page.widgets && page.widgets[0] && isNumeric(page.subcategory.id)) { // we handle a goal - if (!goalsGroup) { - goalsGroup = angular.copy(subcategory); - goalsGroup.name = $filter('translate')('Goals_ChooseGoal'); - goalsGroup.isGroup = true; - goalsGroup.subcategories = []; - goalsGroup.order = 10; + if (!categoryGroups) { + categoryGroups = angular.copy(subcategory); + categoryGroups.name = $filter('translate')('CoreHome_ChooseX', [category.name]); + categoryGroups.isGroup = true; + categoryGroups.subcategories = []; + categoryGroups.order = 10; } if (subcategory.active) { - goalsGroup.name = subcategory.name; - goalsGroup.active = true; + categoryGroups.name = subcategory.name; + categoryGroups.active = true; } var goalId = page.subcategory.id; subcategory.tooltip = subcategory.name + ' (id = ' + goalId + ' )'; - goalsGroup.subcategories.push(subcategory); + categoryGroups.subcategories.push(subcategory); return; } @@ -118,12 +118,12 @@ } }); - if (goalsGroup && goalsGroup.subcategories && goalsGroup.subcategories.length <= 3) { - angular.forEach(goalsGroup.subcategories, function (subcategory) { + if (categoryGroups && categoryGroups.subcategories && categoryGroups.subcategories.length <= 5) { + angular.forEach(categoryGroups.subcategories, function (subcategory) { category.subcategories.push(subcategory); }); - } else if(goalsGroup) { - category.subcategories.push(goalsGroup); + } else if(categoryGroups) { + category.subcategories.push(categoryGroups); } category.subcategories = sortMenuItems(category.subcategories); diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js index 9034c9eef5dc56108b996204997e6458c5cb6a56..3ec2a0821dcbbe0ef949aad67fbf0cf6b6c5745c 100644 --- a/plugins/CoreHome/javascripts/broadcast.js +++ b/plugins/CoreHome/javascripts/broadcast.js @@ -315,6 +315,15 @@ var broadcast = { } } + var updatedUrl = new RegExp('&updated=([0-9]+)'); + var updatedCounter = updatedUrl.exec(currentSearchStr); + if (!updatedCounter) { + currentSearchStr += '&updated=1'; + } else { + updatedCounter = 1 + parseInt(updatedCounter[1]); + currentSearchStr = currentSearchStr.replace(new RegExp('(&updated=[0-9]+)'), '&updated=' + updatedCounter); + } + if (strHash && currentHashStr.length != 0) { var params_hash_vals = strHash.split("&"); for (var i = 0; i < params_hash_vals.length; i++) { diff --git a/plugins/CoreHome/lang/en.json b/plugins/CoreHome/lang/en.json index 814c647cb26d6a35db1267d6e23bed5ece4f0a36..500d67868ca5e997d7a81209801f7dbe3ccce3fc 100644 --- a/plugins/CoreHome/lang/en.json +++ b/plugins/CoreHome/lang/en.json @@ -7,6 +7,7 @@ "ClickToEditX": "Click to edit %s", "CloseSearch": "Close search", "CloseWidgetDirections": "You can close this widget by clicking on the 'X' icon at the top of the widget.", + "ChooseX": "Choose %1$s", "DataForThisReportHasBeenPurged": "The data for this report is more than %s months old and has been purged.", "DataTableExcludeAggregateRows": "Aggregate rows are shown %s Hide them", "DataTableIncludeAggregateRows": "Aggregate rows are hidden %s Show them", diff --git a/plugins/CorePluginsAdmin/angularjs/field/field.directive.js b/plugins/CorePluginsAdmin/angularjs/field/field.directive.js index ee35c35075d7c2e977a14c0d5b41a79b2628cba5..1268fb881f14f92b52442f8c3e8e606f0444e3ce 100644 --- a/plugins/CorePluginsAdmin/angularjs/field/field.directive.js +++ b/plugins/CorePluginsAdmin/angularjs/field/field.directive.js @@ -134,6 +134,14 @@ } }); + if ('undefined' !== typeof $scope.placeholder && $scope.placeholder !== null) { + $scope.$watch('placeholder', function (val, oldVal) { + if (val !== oldVal) { + $scope.field.uiControlAttributes.placeholder = val; + } + }); + } + $scope.$watch('disabled', function (val, oldVal) { if (val !== oldVal) { $scope.field.uiControlAttributes.disabled = val; diff --git a/plugins/CorePluginsAdmin/angularjs/form-field/field-textarea.html b/plugins/CorePluginsAdmin/angularjs/form-field/field-textarea.html index d6336bb888e0fb6a41d2d7601285043eb36123d3..a52d05cb722792c2cf6dc409518c9cafed11e5cc 100644 --- a/plugins/CorePluginsAdmin/angularjs/form-field/field-textarea.html +++ b/plugins/CorePluginsAdmin/angularjs/form-field/field-textarea.html @@ -1,6 +1,7 @@ <div> <textarea name="{{ formField.name }}" piwik-attributes="{{formField.uiControlAttributes}}" + id="{{ formField.name }}" ng-model="formField.value" class="materialize-textarea" ></textarea> diff --git a/plugins/Goals/Goals.php b/plugins/Goals/Goals.php index 0ea6543ccfd09eaebd77070e5ba9dd2f2d5440b0..0700d8aa7584afc53d020d9bc1019edd323722aa 100644 --- a/plugins/Goals/Goals.php +++ b/plugins/Goals/Goals.php @@ -272,6 +272,5 @@ class Goals extends \Piwik\Plugin $translationKeys[] = 'Goals_DeleteGoalConfirm'; $translationKeys[] = 'Goals_Ecommerce'; $translationKeys[] = 'Goals_Optional'; - $translationKeys[] = 'Goals_ChooseGoal'; } } diff --git a/plugins/Goals/lang/en.json b/plugins/Goals/lang/en.json index 4c886392b28d6f4502aad1c334e315c517608baf..d78a22a276e98454fca0d42ff5434532e4e1ddaa 100644 --- a/plugins/Goals/lang/en.json +++ b/plugins/Goals/lang/en.json @@ -16,7 +16,6 @@ "CategoryTextVisitsSummary_VisitsSummary": "User attribute", "CategoryTextDevicesDetection_DevicesDetection": "Devices", "CategoryTextGeneral_Visit": "engagement", - "ChooseGoal": "Choose Goal", "ClickOutlink": "Click on a Link to an external website", "SendEvent": "Send an event", "ColumnAverageOrderRevenueDocumentation": "Average Order Value (AOV) is the total revenue from all Ecommerce Orders divided by the number of orders.", diff --git a/tests/lib/screenshot-testing/support/page-renderer.js b/tests/lib/screenshot-testing/support/page-renderer.js index 34fca8c69c4df626cb7fdb622042fd3c8eab2ac0..1551a68511416afb713cb5df1a0aa7c2a804ee12 100644 --- a/tests/lib/screenshot-testing/support/page-renderer.js +++ b/tests/lib/screenshot-testing/support/page-renderer.js @@ -110,6 +110,10 @@ PageRenderer.prototype.evaluate = function (impl, waitTime) { this.queuedEvents.push([this._evaluate, waitTime, impl]); }; +PageRenderer.prototype.execCallback = function (callback, waitTime) { + this.queuedEvents.push([this._execCallback, waitTime, callback]); +}; + PageRenderer.prototype.downloadLink = function (selector, waitTime) { this.queuedEvents.push([this._downloadLink, waitTime, selector]); }; @@ -277,6 +281,11 @@ PageRenderer.prototype._evaluate = function (impl, callback) { callback(); }; +PageRenderer.prototype._execCallback = function (actualCallback, callback) { + actualCallback(); + callback(); +}; + PageRenderer.prototype._downloadLink = function (str, callback) { var url = this.webpage.evaluate(function (selector) { return $(selector).attr('href');