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:
authordizzy <diosmosis@users.noreply.github.com>2021-12-10 11:37:42 +0300
committerGitHub <noreply@github.com>2021-12-10 11:37:42 +0300
commite669bec77c63b831e404cf00101e62e06a4d210a (patch)
treeef48e523323951b56b3a0251b03de3e4c888596b /plugins/Dashboard
parent9384a4269eba3eb796ac3c1d11455431446db77b (diff)
[Vue] fix build + race condition fixes (#18474)
* update screenshot + better race condition fix for create dashboard + race condition fix for remove dashboard * built vue files * make sure correct active subsub category title is displayed in dropdown input when changing the subcategory in a dropdown * do not include empty query params in URLs and fix last fix * default activesubsubcategory correctly and make sure active category/subcategory is based on displayed category, not on manually set active category * update some expected screenshots * fix widgetized dashboard changes * update some expected screenshots Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'plugins/Dashboard')
-rw-r--r--plugins/Dashboard/javascripts/dashboard.js14
-rw-r--r--plugins/Dashboard/javascripts/dashboardObject.js12
-rw-r--r--plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png4
-rw-r--r--plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png4
4 files changed, 17 insertions, 17 deletions
diff --git a/plugins/Dashboard/javascripts/dashboard.js b/plugins/Dashboard/javascripts/dashboard.js
index 7edc348951..7af6e407b5 100644
--- a/plugins/Dashboard/javascripts/dashboard.js
+++ b/plugins/Dashboard/javascripts/dashboard.js
@@ -29,11 +29,13 @@ function createDashboard() {
function (response) {
var id = response.value;
angular.element(document).injector().invoke(function ($location, reportingMenuModel, dashboardsModel) {
- dashboardsModel.reloadAllDashboards().then(function () {
-
- $('#dashboardWidgetsArea').dashboard('loadDashboard', id);
- $('#dashboardWidgetsArea').dashboard('rebuildMenu');
- });
+ Promise.all([
+ dashboardsModel.reloadAllDashboards(),
+ reportingMenuModel.reloadMenuItems(),
+ ]).then(function () {
+ $('#dashboardWidgetsArea').dashboard('loadDashboard', id);
+ $('#dashboardWidgetsArea').dashboard('rebuildMenu');
+ });
});
}
);
@@ -314,4 +316,4 @@ function copyDashboardToUser() {
};
exports.DashboardManagerControl = DashboardManagerControl;
-}()); \ No newline at end of file
+}());
diff --git a/plugins/Dashboard/javascripts/dashboardObject.js b/plugins/Dashboard/javascripts/dashboardObject.js
index f417a16881..d7c20ca25b 100644
--- a/plugins/Dashboard/javascripts/dashboardObject.js
+++ b/plugins/Dashboard/javascripts/dashboardObject.js
@@ -204,8 +204,9 @@
}, 'get');
ajaxRequest.setCallback(
function () {
- methods.loadDashboard.apply(this, [1]);
- rebuildMenu();
+ Promise.resolve(rebuildMenu()).then(function () {
+ methods.loadDashboard.apply(this, [1]);
+ });
}
);
ajaxRequest.withTokenInUrl();
@@ -535,10 +536,7 @@
if (piwikHelper.isAngularRenderingThePage()) {
// dashboard in reporting page (regular Piwik UI)
- angular.element(document).injector().invoke(function (reportingMenuModel) {
- reportingMenuModel.reloadMenuItems();
- });
- return;
+ return piwikHelper.getAngularDependency('reportingMenuModel').reloadMenuItems();
}
var _self = this;
@@ -595,7 +593,7 @@
}, 'get');
ajaxRequest.withTokenInUrl();
ajaxRequest.setCallback(success);
- ajaxRequest.send();
+ return ajaxRequest.send();
}
/**
diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png
index e5726aac5d..5c691ad82c 100644
--- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png
+++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:88acd2937275d3788a13c87619ec67643e9b89d33756f975c811e9d07ec0d67d
-size 293490
+oid sha256:a07b081dc2be59969c55d42c713a61692e05aa9d17de04ea0ecff18762d20c0b
+size 293532
diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png
index 8375170b64..50abd73c78 100644
--- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png
+++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:1597684be6b7ae1dbad4a5cc381f2a742a4e19ad45626a439344fc7b60f1871e
-size 475301
+oid sha256:b0b4fddfece501d072fd0fccea9dfafa0994f77f4025c85a57932352217fa5be
+size 481675