From ff595df7caa656664246d92fc13fab55491b3142 Mon Sep 17 00:00:00 2001 From: Peter Keating Date: Thu, 28 Feb 2019 16:43:22 +0000 Subject: [PATCH 1/4] Fix notifications not sending when user has multiple of same type When a user has multiple notifications of the same type, the user may not receive the notification depending on the order which the notification was setup. To fix this the notification logic has changed from looping over users to looping over notifications. Fixes #4713. (cherry picked from commit 01a895bbf75006d442a590e5386a9f0de18a42f2) --- .../Services/NotificationService.cs | 78 +++++++++++-------- 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/src/Umbraco.Core/Services/NotificationService.cs b/src/Umbraco.Core/Services/NotificationService.cs index 07d6e4e9e5..ccf9b9da00 100644 --- a/src/Umbraco.Core/Services/NotificationService.cs +++ b/src/Umbraco.Core/Services/NotificationService.cs @@ -124,40 +124,52 @@ namespace Umbraco.Core.Services var notifications = GetUsersNotifications(users.Select(x => x.Id), action, Enumerable.Empty(), Constants.ObjectTypes.DocumentGuid).ToList(); if (notifications.Count == 0) break; - var i = 0; - foreach (var user in users) - { - // continue if there's no notification for this user - if (notifications[i].UserId != user.Id) continue; // next user - - for (var j = 0; j < entitiesL.Count; j++) - { - var content = entitiesL[j]; - var path = paths[j]; - - // test if the notification applies to the path ie to this entity - if (path.Contains(notifications[i].EntityId) == false) continue; // next entity - - if (prevVersionDictionary.ContainsKey(content.Id) == false) - { - prevVersionDictionary[content.Id] = GetPreviousVersion(content.Id); - } - - // queue notification - var req = CreateNotificationRequest(operatingUser, user, content, prevVersionDictionary[content.Id], actionName, http, createSubject, createBody); - Enqueue(req); - } - - // skip other notifications for this user, essentially this means moving i to the next index of notifications - // for the next user. - do - { - i++; - } while (i < notifications.Count && notifications[i].UserId == user.Id); - - if (i >= notifications.Count) break; // break if no more notifications - } + while (notifications.Count > 0) + { + var notification = notifications[0]; + var isMatched = false; + // grab user whose associated to the notification + var user = users.Where(x => x.Id == notification.UserId).FirstOrDefault(); + + if (user == null) + { + notifications.RemoveAll(x => x.UserId == notification.UserId); + } + + for (var j = 0; j < entitiesL.Count; j++) + { + var content = entitiesL[j]; + var path = paths[j]; + + // test if the notification applies to the path ie to this entity + if (path.Contains(notification.EntityId) == false) continue; // next entity + + isMatched = true; + + if (prevVersionDictionary.ContainsKey(content.Id) == false) + { + prevVersionDictionary[content.Id] = GetPreviousVersion(content.Id); + } + + // queue notification + var req = CreateNotificationRequest(operatingUser, user, content, prevVersionDictionary[content.Id], actionName, http, createSubject, createBody); + Enqueue(req); + + // don't process any further entities as a notification has been sent + break; + } + + // when a match has been found, skip other notifications for user. + if (isMatched) + { + notifications.RemoveAll(x => x.UserId == notification.UserId); + continue; + } + + notifications.Remove(notification); + } + // load more users if any id = users.Count == pagesz ? users.Last().Id + 1 : -1; From dc44a7a3a7a3790a7c6cae3da76432dd4de3f188 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 8 Aug 2019 22:06:59 +0200 Subject: [PATCH 2/4] Fix the disabled upload button in media picker (cherry picked from commit 79c4d7797cc67ddc70f195e62961addd7613ef2b) --- .../views/common/overlays/mediaPicker/mediapicker.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/mediaPicker/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/overlays/mediaPicker/mediapicker.controller.js index 5f76528f5d..fc62c0ce67 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/mediaPicker/mediapicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/mediaPicker/mediapicker.controller.js @@ -267,7 +267,7 @@ angular.module("umbraco") // also make sure the node is not trashed if (nodePath.indexOf($scope.startNodeId.toString()) !== -1 && node.trashed === false) { - $scope.gotoFolder({ id: $scope.lastOpenedNode, name: "Media", icon: "icon-folder" }); + $scope.gotoFolder({ id: $scope.lastOpenedNode, name: "Media", icon: "icon-folder", path: node.path }); return true; } else { $scope.gotoFolder({ id: $scope.startNodeId, name: "Media", icon: "icon-folder" }); From 9865596dcce3735ad2573d9fc596ff16ed4f9a90 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Fri, 9 Aug 2019 16:44:43 +0200 Subject: [PATCH 3/4] =?UTF-8?q?V7:=20Change=20the=20priority=20of=20the=20?= =?UTF-8?q?tree=20node=20annotations=20for=20contai=E2=80=A6=20(#6083)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 7393d9c3725d91016e7dedfb1159f74f0c6b54d5) --- src/Umbraco.Web.UI.Client/src/less/tree.less | 44 ++++++++++---------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/tree.less b/src/Umbraco.Web.UI.Client/src/less/tree.less index fae99ced3e..a75054453b 100644 --- a/src/Umbraco.Web.UI.Client/src/less/tree.less +++ b/src/Umbraco.Web.UI.Client/src/less/tree.less @@ -327,27 +327,6 @@ li.root > div > a.umb-options { div.not-published > i.icon,div.not-published > a{ opacity: 0.6; } -div.protected:before{ - content:"\e256"; - font-family: 'icomoon'; - color: @red; - position: absolute; - font-size: 20px; - padding-left: 7px; - padding-top: 7px; - bottom: 0; -} - -div.has-unpublished-version:before{ - content:"\e25a"; - font-family: 'icomoon'; - color: @green; - position: absolute; - font-size: 20px; - padding-left: 7px; - padding-top: 7px; - bottom: 0; -} div.not-allowed > i.icon,div.not-allowed > a{ cursor: not-allowed; @@ -380,6 +359,29 @@ div.locked:before{ bottom: 0; } + +div.has-unpublished-version:before { + content: "\e25a"; + font-family: 'icomoon'; + color: @green; + position: absolute; + font-size: 20px; + padding-left: 7px; + padding-top: 7px; + bottom: 0; +} + +div.protected:before { + content: "\e256"; + font-family: 'icomoon'; + color: @red; + position: absolute; + font-size: 20px; + padding-left: 7px; + padding-top: 7px; + bottom: 0; +} + .umb-tree li div.no-access .umb-tree-icon, .umb-tree li div.no-access .root-link, .umb-tree li div.no-access .umb-tree-item__label { From 12ad9dd36b802e5785672a9a8eb35576f549a723 Mon Sep 17 00:00:00 2001 From: arkadiuszbiel Date: Tue, 13 Aug 2019 13:37:35 +0100 Subject: [PATCH 4/4] Change z-index (cherry picked from commit 3fa77dbf3d134567b022a32ee656f7a53bcb08af) --- .../src/less/components/notifications/umb-notifications.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less b/src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less index 77dc6c6995..b79f5e5bb2 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less @@ -1,5 +1,5 @@ .umb-notifications { - z-index: 1000; + z-index: 1100; position: absolute; bottom: 52px; left: 0;