From 355f02971d495aa24a9c15755fcc8f28605425e9 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Mon, 12 Nov 2018 09:42:42 +0100 Subject: [PATCH 01/15] Fix the mardown editor button bar in split view --- .../markdowneditor/markdowneditor.controller.js | 6 +++++- .../propertyeditors/markdowneditor/markdowneditor.html | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.controller.js index 639c24f54c..b3c014f54a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.controller.js @@ -8,6 +8,10 @@ function MarkdownEditorController($scope, $element, assetsService, editorService $scope.model.value = $scope.model.config.defaultValue; } + // create a unique ID for the markdown editor, so the button bar bindings can handle split view + // - must be bound on scope, not scope.model - otherwise it won't work, because $scope.model is used in both sides of the split view + $scope.editorId = $scope.model.alias + _.uniqueId("-"); + function openMediaPicker(callback) { var mediaPicker = { disableFolderSelect: true, @@ -40,7 +44,7 @@ function MarkdownEditorController($scope, $element, assetsService, editorService $timeout(function () { $scope.markdownEditorInitComplete = false; var converter2 = new Markdown.Converter(); - var editor2 = new Markdown.Editor(converter2, "-" + $scope.model.alias); + var editor2 = new Markdown.Editor(converter2, "-" + $scope.editorId); editor2.run(); //subscribe to the image dialog clicks diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.html index 9b8f44317a..68fc86f002 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.html @@ -1,8 +1,8 @@
-
+
- + -
+
From a07227849073d6f9a697fdf89bd708bb16fe5f04 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Sun, 25 Nov 2018 13:50:54 +0100 Subject: [PATCH 02/15] Fix the changing source name when copying a node --- .../src/views/content/content.copy.controller.js | 8 ++++---- src/Umbraco.Web.UI.Client/src/views/content/copy.html | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js index 2642a79ac7..a1e74cc207 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js @@ -25,11 +25,11 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.CopyController", $scope.treeModel.hideHeader = userData.startContentIds.length > 0 && userData.startContentIds.indexOf(-1) == -1; }); - var node = $scope.currentNode; + $scope.source = _.clone($scope.currentNode); function treeLoadedHandler(args) { - if (node && node.path) { - $scope.dialogTreeApi.syncTree({ path: node.path, activate: false }); + if ($scope.source && $scope.source.path) { + $scope.dialogTreeApi.syncTree({ path: $scope.source.path, activate: false }); } } @@ -107,7 +107,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.CopyController", $scope.busy = true; $scope.error = false; - contentResource.copy({ parentId: $scope.target.id, id: node.id, relateToOriginal: $scope.relateToOriginal, recursive: $scope.recursive }) + contentResource.copy({ parentId: $scope.target.id, id: $scope.source.id, relateToOriginal: $scope.relateToOriginal, recursive: $scope.recursive }) .then(function (path) { $scope.error = false; $scope.success = true; diff --git a/src/Umbraco.Web.UI.Client/src/views/content/copy.html b/src/Umbraco.Web.UI.Client/src/views/content/copy.html index 03a024c439..9fff73f1cc 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/copy.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/copy.html @@ -11,14 +11,14 @@
- {{currentNode.name}} was copied to + {{source.name}} was copied to {{target.name}}

- Choose where to copy {{currentNode.name}} to in the tree structure below + Choose where to copy {{source.name}} to in the tree structure below

From 9b4a580734161f1ce3040fa5b3711eadb5691d5a Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Sun, 25 Nov 2018 13:35:14 +0100 Subject: [PATCH 03/15] Fix the changing source name when moving a node --- .../src/views/content/content.move.controller.js | 8 ++++---- src/Umbraco.Web.UI.Client/src/views/content/move.html | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.move.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.move.controller.js index a593bbad24..5dceff2571 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.move.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.move.controller.js @@ -22,11 +22,11 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.MoveController", $scope.treeModel.hideHeader = userData.startContentIds.length > 0 && userData.startContentIds.indexOf(-1) == -1; }); - var node = $scope.currentNode; + $scope.source = _.clone($scope.currentNode); function treeLoadedHandler(args) { - if (node && node.path) { - $scope.dialogTreeApi.syncTree({ path: node.path, activate: false }); + if ($scope.source && $scope.source.path) { + $scope.dialogTreeApi.syncTree({ path: $scope.source.path, activate: false }); } } @@ -84,7 +84,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.MoveController", $scope.busy = true; $scope.error = false; - contentResource.move({ parentId: $scope.target.id, id: node.id }) + contentResource.move({ parentId: $scope.target.id, id: $scope.source.id }) .then(function (path) { $scope.error = false; $scope.success = true; diff --git a/src/Umbraco.Web.UI.Client/src/views/content/move.html b/src/Umbraco.Web.UI.Client/src/views/content/move.html index 708c3d3f82..b655917f6f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/move.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/move.html @@ -11,14 +11,14 @@
- {{currentNode.name}} was moved underneath {{target.name}} + {{source.name}} was moved underneath {{target.name}}
- +

Choose where to move - {{currentNode.name}} + {{source.name}} to in the tree structure below

From 0c9ecacca02f10e43fa2610f3abb991db5d5a263 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Sun, 25 Nov 2018 13:44:02 +0100 Subject: [PATCH 04/15] Undo the leftovers from another issue --- src/Umbraco.Web.UI.Client/src/views/content/move.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/move.html b/src/Umbraco.Web.UI.Client/src/views/content/move.html index b655917f6f..2607343a0d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/move.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/move.html @@ -13,7 +13,7 @@
{{source.name}} was moved underneath {{target.name}}
- +

From 14fd9c835dd9baea80d61a95157bbab022bc4459 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Sun, 9 Dec 2018 14:17:57 +0100 Subject: [PATCH 05/15] V8: Fix the media picker folder creation and "sub folders" toggle button (#3630) --- .../mediapicker/mediapicker.controller.js | 15 +++++++++------ .../infiniteeditors/mediapicker/mediapicker.html | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js index c7a46c4c4a..a274c25287 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js @@ -4,9 +4,12 @@ angular.module("umbraco") function($scope, mediaResource, entityResource, mediaHelper, mediaTypeHelper, eventsService, treeService, localStorageService, localizationService, editorService) { if (!$scope.model.title) { - localizationService.localize("defaultdialogs_selectMedia") - .then(function(data){ - $scope.model.title = data; + localizationService.localizeMany(["defaultdialogs_selectMedia", "general_includeFromsubFolders"]) + .then(function (data) { + $scope.labels = { + title: data[0], + includeSubFolders: data[1] + } }); } @@ -113,10 +116,10 @@ angular.module("umbraco") }; $scope.submitFolder = function() { - if ($scope.newFolderName) { + if ($scope.model.newFolderName) { $scope.creatingFolder = true; mediaResource - .addFolder($scope.newFolderName, $scope.currentFolder.id) + .addFolder($scope.model.newFolderName, $scope.currentFolder.id) .then(function(data) { //we've added a new folder so lets clear the tree cache for that specific item treeService.clearCache({ @@ -126,7 +129,7 @@ angular.module("umbraco") $scope.creatingFolder = false; $scope.gotoFolder(data); $scope.showFolderInput = false; - $scope.newFolderName = ""; + $scope.model.newFolderName = ""; }); } else { $scope.showFolderInput = false; diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.html index 5046088d28..73a073b731 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.html @@ -68,7 +68,7 @@ - From 573db0d142acb01c832a668209106f8dddfd8d30 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Sun, 9 Dec 2018 14:25:43 +0100 Subject: [PATCH 06/15] V8 fix remove custom event directives (#3622) --- .../components/events/events.directive.js | 48 ------------------- .../common/infiniteeditors/embed/embed.html | 4 +- .../mediapicker/mediapicker.html | 2 +- .../views/components/umb-groups-builder.html | 6 +-- .../views/components/umb-locked-field.html | 2 +- .../src/views/propertyeditors/tags/tags.html | 2 +- 6 files changed, 8 insertions(+), 56 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/events/events.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/events/events.directive.js index 21980be925..a6a5336af0 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/events/events.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/events/events.directive.js @@ -3,54 +3,6 @@ **/ angular.module('umbraco.directives') -.directive('onKeyup', function () { - return { - link: function (scope, elm, attrs) { - var f = function () { - scope.$apply(attrs.onKeyup); - }; - elm.on("keyup", f); - scope.$on("$destroy", function(){ elm.off("keyup", f);} ); - } - }; -}) - -.directive('onKeydown', function () { - return { - link: function (scope, elm, attrs) { - var f = function () { - scope.$apply(attrs.onKeydown); - }; - elm.on("keydown", f); - scope.$on("$destroy", function(){ elm.off("keydown", f);} ); - } - }; -}) - -.directive('onBlur', function () { - return { - link: function (scope, elm, attrs) { - var f = function () { - scope.$apply(attrs.onBlur); - }; - elm.on("blur", f); - scope.$on("$destroy", function(){ elm.off("blur", f);} ); - } - }; -}) - -.directive('onFocus', function () { - return { - link: function (scope, elm, attrs) { - var f = function () { - scope.$apply(attrs.onFocus); - }; - elm.on("focus", f); - scope.$on("$destroy", function(){ elm.off("focus", f);} ); - } - }; -}) - .directive('onDragEnter', function () { return { link: function (scope, elm, attrs) { diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.html index f6a641f2af..f14fb364ab 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.html @@ -32,11 +32,11 @@

- + - + diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.html index 73a073b731..3bb694cac6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.html @@ -69,7 +69,7 @@ + ng-blur="submitFolder()" focus-when="{{showFolderInput}}" />
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html index 31ea24b581..c0490a1707 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html @@ -65,7 +65,7 @@ ng-disabled="tab.inherited" umb-auto-focus umb-auto-resize - on-focus="activateGroup(tab)" + ng-focus="activateGroup(tab)" required val-server-field="{{'Groups[' + $index + '].Name'}}" /> @@ -87,7 +87,7 @@
- +
@@ -121,7 +121,7 @@ hotkey="alt+shift+p" hotkey-when="{{tab.tabState === 'active' && property.propertyState=='init'}}" ng-click="addProperty(property, tab)" - on-focus="activateGroup(tab)" + ng-focus="activateGroup(tab)" focus-when="{{property.focus}}"> diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-locked-field.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-locked-field.html index 56c5be6fb2..d13474d221 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-locked-field.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-locked-field.html @@ -24,7 +24,7 @@ title="{{ngModel}}" focus-when="{{!locked}}" umb-select-when="{{!locked}}" - on-blur="lock()" /> + ng-blur="lock()" />
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html index f1d46e951e..6fcdfafdcd 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html @@ -26,7 +26,7 @@ class="typeahead tags-{{model.alias}}" ng-model="$parent.tagToAdd" ng-keydown="$parent.addTagOnEnter($event)" - on-blur="$parent.addTag()" + ng-blur="$parent.addTag()" localize="placeholder" placeholder="@placeholders_enterTags" /> From e3e3e0645845ca07264f7afafb00ce4db58dc151 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Mon, 12 Nov 2018 10:29:11 +0100 Subject: [PATCH 07/15] Markdown editor: Fix the redo button + remove the button hover flicker --- src/Umbraco.Web.UI.Client/lib/markdown/markdown.css | 5 +++++ src/Umbraco.Web.UI.Client/lib/markdown/markdown.editor.js | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/lib/markdown/markdown.css b/src/Umbraco.Web.UI.Client/lib/markdown/markdown.css index 45c9b39c48..5594f70634 100644 --- a/src/Umbraco.Web.UI.Client/lib/markdown/markdown.css +++ b/src/Umbraco.Web.UI.Client/lib/markdown/markdown.css @@ -26,6 +26,11 @@ width: 100%; } +/* unset the negative margin applied in button-groups.less to avoid flickering when hovering the button bar */ +.wmd-panel .btn-toolbar .btn-group>.btn+.btn { + margin-left: 0; +} + /* .icon-link, .icon-blockquote, diff --git a/src/Umbraco.Web.UI.Client/lib/markdown/markdown.editor.js b/src/Umbraco.Web.UI.Client/lib/markdown/markdown.editor.js index 21ad5d0a8b..e1617d8365 100644 --- a/src/Umbraco.Web.UI.Client/lib/markdown/markdown.editor.js +++ b/src/Umbraco.Web.UI.Client/lib/markdown/markdown.editor.js @@ -1390,7 +1390,7 @@ "Redo - Ctrl+Y" : "Redo - Ctrl+Shift+Z"; // mac and other non-Windows platforms - buttons.redo = makeButton("wmd-redo-button", redoTitle, "icon-share-alt", null, group4); + buttons.redo = makeButton("wmd-redo-button", redoTitle, "icon-redo", null, group4); buttons.redo.execute = function (manager) { if (manager) manager.redo(); }; if (helpOptions) { @@ -2107,4 +2107,4 @@ } -})(); \ No newline at end of file +})(); From e25e509d8467ddaa0ac4de410fe04fc1ce316f20 Mon Sep 17 00:00:00 2001 From: Andy Neil Date: Thu, 8 Nov 2018 15:45:59 +0000 Subject: [PATCH 08/15] Resolved check for removed properties --- .../Repositories/Implement/ContentTypeRepositoryBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs index 3184c69dfe..6be07a4c3d 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs @@ -328,7 +328,7 @@ AND umbracoNode.id <> @id", // We check if the entity's own PropertyTypes has been modified and then also check // any of the property groups PropertyTypes has been modified. // This specifically tells us if any property type collections have changed. - if (entity.IsPropertyDirty("PropertyTypes") || entity.PropertyGroups.Any(x => x.IsPropertyDirty("PropertyTypes"))) + if (entity.IsPropertyDirty("PropertyTypes") || entity.PropertyTypes.Any(pt => pt.IsDirty())) { var dbPropertyTypes = Database.Fetch("WHERE contentTypeId = @Id", new { entity.Id }); var dbPropertyTypeAlias = dbPropertyTypes.Select(x => x.Id); From a51d241dc223f2bf52ebc25279b22ceb32f5a309 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Tue, 6 Nov 2018 15:37:18 +0100 Subject: [PATCH 09/15] Fix missing "opens dialog dots" for menu items created using the MenuItemList helper methods --- src/Umbraco.Web/Models/Trees/MenuItemList.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web/Models/Trees/MenuItemList.cs b/src/Umbraco.Web/Models/Trees/MenuItemList.cs index b34f0b4444..70b35e25bd 100644 --- a/src/Umbraco.Web/Models/Trees/MenuItemList.cs +++ b/src/Umbraco.Web/Models/Trees/MenuItemList.cs @@ -44,10 +44,11 @@ namespace Umbraco.Web.Models.Trees /// /// /// The text to display for the menu item, will default to the IAction alias if not specified - public MenuItem Add(string name, bool hasSeparator = false) + /// Whether or not this action opens a dialog + public MenuItem Add(string name, bool hasSeparator = false, bool opensDialog = false) where T : IAction { - var item = CreateMenuItem(name, hasSeparator); + var item = CreateMenuItem(name, hasSeparator, opensDialog); if (item != null) { Add(item); @@ -62,11 +63,11 @@ namespace Umbraco.Web.Models.Trees /// /// /// The used to localize the action name based on it's alias - /// + /// Whether or not this action opens a dialog public MenuItem Add(ILocalizedTextService textService, bool hasSeparator = false, bool opensDialog = false) where T : IAction { - var item = CreateMenuItem(textService, hasSeparator); + var item = CreateMenuItem(textService, hasSeparator, opensDialog); if (item != null) { Add(item); @@ -75,14 +76,15 @@ namespace Umbraco.Web.Models.Trees return null; } - internal MenuItem CreateMenuItem(string name, bool hasSeparator = false) + internal MenuItem CreateMenuItem(string name, bool hasSeparator = false, bool opensDialog = false) where T : IAction { var item = Current.Actions.GetAction(); if (item == null) return null; var menuItem = new MenuItem(item, name) { - SeperatorBefore = hasSeparator + SeperatorBefore = hasSeparator, + OpensDialog = opensDialog }; return menuItem; From c00b3e283dd1a2adc48c07d6ac72b51be2c06623 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Wed, 28 Nov 2018 12:37:22 +0100 Subject: [PATCH 10/15] Add dirty tracking for slider and datetime --- .../propertyeditors/datepicker/datepicker.controller.js | 1 + .../src/views/propertyeditors/slider/slider.controller.js | 5 +++-- .../src/views/propertyeditors/slider/slider.html | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js index 704fccbde1..62099734fb 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js @@ -131,6 +131,7 @@ function dateTimePickerController($scope, notificationsService, assetsService, a else { $scope.model.value = null; } + angularHelper.getCurrentForm($scope).$setDirty(); } /** Sets the value of the date picker control adn associated viewModel objects based on the model value */ diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.controller.js index c8813ee4c0..515eddf0a3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.controller.js @@ -1,4 +1,4 @@ -function sliderController($scope) { +function sliderController($scope, angularHelper) { let sliderRef = null; @@ -14,13 +14,14 @@ function setModelValue(values) { $scope.model.value = values ? values.toString() : null; + angularHelper.getCurrentForm($scope).$setDirty(); } $scope.setup = function(slider) { sliderRef = slider; }; - $scope.end = function(values) { + $scope.change = function (values) { setModelValue(values); }; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.html index c147b30b23..ea0c2ef7bc 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.html @@ -5,7 +5,7 @@ ng-model="sliderValue" options="sliderOptions" on-setup="setup(slider)" - on-end="end(values)"> + on-change="change(values)">
From 8ff697ad98ae9bc53569061fe18603a127650a24 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Mon, 26 Nov 2018 22:47:42 +0100 Subject: [PATCH 11/15] Fix the flickering source name and the close button when moving items in the media tree. --- .../src/views/media/media.move.controller.js | 8 ++++---- src/Umbraco.Web.UI.Client/src/views/media/move.html | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js b/src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js index c5ff80b7fb..8bb1dc3ac8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js @@ -3,7 +3,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Media.MoveController", function ($scope, userService, eventsService, mediaResource, appState, treeService, navigationService) { $scope.dialogTreeApi = {}; - var node = $scope.currentNode; + $scope.source = _.clone($scope.currentNode); $scope.treeModel = { hideHeader: false @@ -13,8 +13,8 @@ angular.module("umbraco").controller("Umbraco.Editors.Media.MoveController", }); function treeLoadedHandler(args) { - if (node && node.path) { - $scope.dialogTreeApi.syncTree({ path: node.path, activate: false }); + if ($scope.source && $scope.source.path) { + $scope.dialogTreeApi.syncTree({ path: $scope.source.path, activate: false }); } } @@ -55,7 +55,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Media.MoveController", $scope.move = function () { $scope.busy = true; - mediaResource.move({ parentId: $scope.target.id, id: node.id }) + mediaResource.move({ parentId: $scope.target.id, id: $scope.source.id }) .then(function (path) { $scope.busy = false; $scope.error = false; diff --git a/src/Umbraco.Web.UI.Client/src/views/media/move.html b/src/Umbraco.Web.UI.Client/src/views/media/move.html index 6d93eb4e22..451acbdb16 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/move.html +++ b/src/Umbraco.Web.UI.Client/src/views/media/move.html @@ -11,14 +11,14 @@
- {{currentNode.name}} was moved underneath {{target.name}} + {{source.name}} was moved underneath {{target.name}}
- +

Choose where to move - {{currentNode.name}} + {{source.name}} to in the tree structure below

From 939b320971485396e25cdb1582e9c70875149bcc Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Sun, 25 Nov 2018 13:23:27 +0100 Subject: [PATCH 12/15] Fix the OK button for move and close success messages --- src/Umbraco.Web.UI.Client/src/views/content/copy.html | 2 +- src/Umbraco.Web.UI.Client/src/views/content/move.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/copy.html b/src/Umbraco.Web.UI.Client/src/views/content/copy.html index 9fff73f1cc..8f6d5d3e6d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/copy.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/copy.html @@ -14,7 +14,7 @@ {{source.name}} was copied to {{target.name}} - +

diff --git a/src/Umbraco.Web.UI.Client/src/views/content/move.html b/src/Umbraco.Web.UI.Client/src/views/content/move.html index 2607343a0d..b655917f6f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/move.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/move.html @@ -13,7 +13,7 @@

{{source.name}} was moved underneath {{target.name}}
- +

From c2a8378b899d22dd97398d0281f1f3f26a83289b Mon Sep 17 00:00:00 2001 From: Jannik Anker Date: Thu, 6 Dec 2018 11:03:08 +0100 Subject: [PATCH 13/15] V8, Getting Started: typo in URL Using HHTTPS as protocol just doesn't work :-/ --- .github/V8_GETTING_STARTED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/V8_GETTING_STARTED.md b/.github/V8_GETTING_STARTED.md index 87ddbb166a..1cc33bb126 100644 --- a/.github/V8_GETTING_STARTED.md +++ b/.github/V8_GETTING_STARTED.md @@ -33,5 +33,5 @@ We recommend running the site with the Visual Studio since you'll be able to rem We are keeping track of [known issues and limitations here](http://issues.umbraco.org/issue/U4-11279). These line items will eventually be turned into actual tasks to be worked on. Feel free to help us keep this list updated if you find issues and even help fix some of these items. If there is a particular item you'd like to help fix please mention this on the task and we'll create a sub task for the item to continue discussion there. -There's [a list of tasks for v8 that haven't been completed](hhttps://github.com/umbraco/Umbraco-CMS/labels/release%2F8.0.0). If you are interested in helping out with any of these please mention this on the task. This list will be constantly updated as we begin to document and design some of the other tasks that still need to get done. +There's [a list of tasks for v8 that haven't been completed](https://github.com/umbraco/Umbraco-CMS/labels/release%2F8.0.0). If you are interested in helping out with any of these please mention this on the task. This list will be constantly updated as we begin to document and design some of the other tasks that still need to get done. From 852b44af0e0cb74687bd06d5ec248951bbaafac2 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Sat, 1 Dec 2018 12:16:22 +0100 Subject: [PATCH 14/15] Fix member roles assignment YSOD --- src/Umbraco.Core/Services/Implement/MemberService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Core/Services/Implement/MemberService.cs b/src/Umbraco.Core/Services/Implement/MemberService.cs index 5a644cfec1..e191493736 100644 --- a/src/Umbraco.Core/Services/Implement/MemberService.cs +++ b/src/Umbraco.Core/Services/Implement/MemberService.cs @@ -1033,7 +1033,7 @@ namespace Umbraco.Core.Services.Implement scope.WriteLock(Constants.Locks.MemberTree); var ids = _memberGroupRepository.GetMemberIds(usernames); _memberGroupRepository.AssignRoles(ids, roleNames); - scope.Events.Dispatch(AssignedRoles, this, new RolesEventArgs(ids, roleNames)); + scope.Events.Dispatch(AssignedRoles, this, new RolesEventArgs(ids, roleNames), nameof(AssignedRoles)); scope.Complete(); } } @@ -1050,7 +1050,7 @@ namespace Umbraco.Core.Services.Implement scope.WriteLock(Constants.Locks.MemberTree); var ids = _memberGroupRepository.GetMemberIds(usernames); _memberGroupRepository.DissociateRoles(ids, roleNames); - scope.Events.Dispatch(RemovedRoles, this, new RolesEventArgs(ids, roleNames)); + scope.Events.Dispatch(RemovedRoles, this, new RolesEventArgs(ids, roleNames), nameof(RemovedRoles)); scope.Complete(); } } @@ -1066,7 +1066,7 @@ namespace Umbraco.Core.Services.Implement { scope.WriteLock(Constants.Locks.MemberTree); _memberGroupRepository.AssignRoles(memberIds, roleNames); - scope.Events.Dispatch(AssignedRoles, this, new RolesEventArgs(memberIds, roleNames)); + scope.Events.Dispatch(AssignedRoles, this, new RolesEventArgs(memberIds, roleNames), nameof(AssignedRoles)); scope.Complete(); } } @@ -1082,7 +1082,7 @@ namespace Umbraco.Core.Services.Implement { scope.WriteLock(Constants.Locks.MemberTree); _memberGroupRepository.DissociateRoles(memberIds, roleNames); - scope.Events.Dispatch(RemovedRoles, this, new RolesEventArgs(memberIds, roleNames)); + scope.Events.Dispatch(RemovedRoles, this, new RolesEventArgs(memberIds, roleNames), nameof(RemovedRoles)); scope.Complete(); } } From bcd908e47ddb4f86674d8848dec95d094ef28975 Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 10 Dec 2018 13:06:39 +1100 Subject: [PATCH 15/15] Changes term Indexer to Index and fixes a failing test --- src/Umbraco.Examine/ContentValueSetBuilder.cs | 8 +++--- .../ContentValueSetValidator.cs | 6 ++--- src/Umbraco.Examine/Umbraco.Examine.csproj | 6 ++--- ...ntentIndexer.cs => UmbracoContentIndex.cs} | 8 +++--- ...amineIndexer.cs => UmbracoExamineIndex.cs} | 8 +++--- .../UmbracoExamineIndexDiagnostics.cs | 20 +++++++------- ...MemberIndexer.cs => UmbracoMemberIndex.cs} | 6 ++--- .../Composing/TypeFinderTests.cs | 2 +- .../UmbracoExamine/IndexInitializer.cs | 6 ++--- src/Umbraco.Tests/UmbracoExamine/IndexTest.cs | 4 +-- .../UmbracoContentValueSetValidatorTests.cs | 26 +++++++++---------- .../Models/Mapping/EntityMapperProfile.cs | 10 +++---- .../GridPropertyIndexValueFactory.cs | 2 +- .../PropertyEditors/RichTextPropertyEditor.cs | 2 +- .../XmlPublishedCache/PublishedMediaCache.cs | 8 +++--- .../Search/UmbracoIndexesCreator.cs | 12 ++++----- 16 files changed, 67 insertions(+), 67 deletions(-) rename src/Umbraco.Examine/{UmbracoContentIndexer.cs => UmbracoContentIndex.cs} (97%) rename src/Umbraco.Examine/{UmbracoExamineIndexer.cs => UmbracoExamineIndex.cs} (98%) rename src/Umbraco.Examine/{UmbracoMemberIndexer.cs => UmbracoMemberIndex.cs} (95%) diff --git a/src/Umbraco.Examine/ContentValueSetBuilder.cs b/src/Umbraco.Examine/ContentValueSetBuilder.cs index 39ffab98d9..07e5e4565b 100644 --- a/src/Umbraco.Examine/ContentValueSetBuilder.cs +++ b/src/Umbraco.Examine/ContentValueSetBuilder.cs @@ -42,7 +42,7 @@ namespace Umbraco.Examine var values = new Dictionary> { {"icon", c.ContentType.Icon.Yield()}, - {UmbracoExamineIndexer.PublishedFieldName, new object[] {c.Published ? 1 : 0}}, //Always add invariant published value + {UmbracoExamineIndex.PublishedFieldName, new object[] {c.Published ? 1 : 0}}, //Always add invariant published value {"id", new object[] {c.Id}}, {"key", new object[] {c.Key}}, {"parentID", new object[] {c.Level > 1 ? c.ParentId : -1}}, @@ -61,12 +61,12 @@ namespace Umbraco.Examine {"writerName",(c.GetWriterProfile(_userService)?.Name ?? "??").Yield() }, {"writerID", new object[] {c.WriterId}}, {"template", new object[] {c.Template?.Id ?? 0}}, - {UmbracoContentIndexer.VariesByCultureFieldName, new object[] {0}}, + {UmbracoContentIndex.VariesByCultureFieldName, new object[] {0}}, }; if (isVariant) { - values[UmbracoContentIndexer.VariesByCultureFieldName] = new object[] { 1 }; + values[UmbracoContentIndex.VariesByCultureFieldName] = new object[] { 1 }; foreach (var culture in c.AvailableCultures) { @@ -76,7 +76,7 @@ namespace Umbraco.Examine values[$"nodeName_{lowerCulture}"] = PublishedValuesOnly ? c.GetPublishName(culture).Yield() : c.GetCultureName(culture).Yield(); - values[$"{UmbracoExamineIndexer.PublishedFieldName}_{lowerCulture}"] = (c.IsCulturePublished(culture) ? 1 : 0).Yield(); + values[$"{UmbracoExamineIndex.PublishedFieldName}_{lowerCulture}"] = (c.IsCulturePublished(culture) ? 1 : 0).Yield(); values[$"updateDate_{lowerCulture}"] = PublishedValuesOnly ? c.GetPublishDate(culture).Yield() : c.GetUpdateDate(culture).Yield(); diff --git a/src/Umbraco.Examine/ContentValueSetValidator.cs b/src/Umbraco.Examine/ContentValueSetValidator.cs index eabf15f672..d4f6ceb15f 100644 --- a/src/Umbraco.Examine/ContentValueSetValidator.cs +++ b/src/Umbraco.Examine/ContentValueSetValidator.cs @@ -92,18 +92,18 @@ namespace Umbraco.Examine //check for published content if (valueSet.Category == IndexTypes.Content && PublishedValuesOnly) { - if (!valueSet.Values.TryGetValue(UmbracoExamineIndexer.PublishedFieldName, out var published)) + if (!valueSet.Values.TryGetValue(UmbracoExamineIndex.PublishedFieldName, out var published)) return ValueSetValidationResult.Failed; if (!published[0].Equals(1)) return ValueSetValidationResult.Failed; //deal with variants, if there are unpublished variants than we need to remove them from the value set - if (valueSet.Values.TryGetValue(UmbracoContentIndexer.VariesByCultureFieldName, out var variesByCulture) + if (valueSet.Values.TryGetValue(UmbracoContentIndex.VariesByCultureFieldName, out var variesByCulture) && variesByCulture.Count > 0 && variesByCulture[0].Equals(1)) { //so this valueset is for a content that varies by culture, now check for non-published cultures and remove those values - foreach(var publishField in valueSet.Values.Where(x => x.Key.StartsWith($"{UmbracoExamineIndexer.PublishedFieldName}_")).ToList()) + foreach(var publishField in valueSet.Values.Where(x => x.Key.StartsWith($"{UmbracoExamineIndex.PublishedFieldName}_")).ToList()) { if (publishField.Value.Count <= 0 || !publishField.Value[0].Equals(1)) { diff --git a/src/Umbraco.Examine/Umbraco.Examine.csproj b/src/Umbraco.Examine/Umbraco.Examine.csproj index 9194d8332d..0aedf6e754 100644 --- a/src/Umbraco.Examine/Umbraco.Examine.csproj +++ b/src/Umbraco.Examine/Umbraco.Examine.csproj @@ -83,12 +83,12 @@ - + - + - + Properties\SolutionInfo.cs diff --git a/src/Umbraco.Examine/UmbracoContentIndexer.cs b/src/Umbraco.Examine/UmbracoContentIndex.cs similarity index 97% rename from src/Umbraco.Examine/UmbracoContentIndexer.cs rename to src/Umbraco.Examine/UmbracoContentIndex.cs index 0501fe90c6..910941ea7b 100644 --- a/src/Umbraco.Examine/UmbracoContentIndexer.cs +++ b/src/Umbraco.Examine/UmbracoContentIndex.cs @@ -21,7 +21,7 @@ namespace Umbraco.Examine /// /// An indexer for Umbraco content and media /// - public class UmbracoContentIndexer : UmbracoExamineIndexer + public class UmbracoContentIndex : UmbracoExamineIndex { public const string VariesByCultureFieldName = SpecialFieldPrefix + "VariesByCulture"; protected ILocalizationService LanguageService { get; } @@ -32,7 +32,7 @@ namespace Umbraco.Examine /// Constructor for configuration providers /// [EditorBrowsable(EditorBrowsableState.Never)] - public UmbracoContentIndexer() + public UmbracoContentIndex() { LanguageService = Current.Services.LocalizationService; @@ -50,7 +50,7 @@ namespace Umbraco.Examine /// /// /// - public UmbracoContentIndexer( + public UmbracoContentIndex( string name, IEnumerable fieldDefinitions, Directory luceneDirectory, @@ -167,7 +167,7 @@ namespace Umbraco.Examine //since the path is not valid we need to delete this item in case it exists in the index already and has now //been moved to an invalid parent. foreach (var i in group) - QueueIndexOperation(new IndexOperation(new ValueSet(i.Id), IndexOperationType.Delete)); + base.PerformDeleteFromIndex(i.Id, args => { /*noop*/ }); } else { diff --git a/src/Umbraco.Examine/UmbracoExamineIndexer.cs b/src/Umbraco.Examine/UmbracoExamineIndex.cs similarity index 98% rename from src/Umbraco.Examine/UmbracoExamineIndexer.cs rename to src/Umbraco.Examine/UmbracoExamineIndex.cs index 84c8a7d8c5..15f1a75955 100644 --- a/src/Umbraco.Examine/UmbracoExamineIndexer.cs +++ b/src/Umbraco.Examine/UmbracoExamineIndex.cs @@ -23,7 +23,7 @@ namespace Umbraco.Examine /// An abstract provider containing the basic functionality to be able to query against /// Umbraco data. /// - public abstract class UmbracoExamineIndexer : LuceneIndex, IUmbracoIndexer, IIndexDiagnostics + public abstract class UmbracoExamineIndex : LuceneIndex, IUmbracoIndexer, IIndexDiagnostics { // note // wrapping all operations that end up calling base.SafelyProcessQueueItems in a safe call @@ -48,7 +48,7 @@ namespace Umbraco.Examine /// Constructor for config provider based indexes /// [EditorBrowsable(EditorBrowsableState.Never)] - protected UmbracoExamineIndexer() + protected UmbracoExamineIndex() : base() { ProfilingLogger = Current.ProfilingLogger; @@ -56,7 +56,7 @@ namespace Umbraco.Examine } /// - /// Create a new + /// Create a new /// /// /// @@ -65,7 +65,7 @@ namespace Umbraco.Examine /// /// /// - protected UmbracoExamineIndexer( + protected UmbracoExamineIndex( string name, IEnumerable fieldDefinitions, Directory luceneDirectory, diff --git a/src/Umbraco.Examine/UmbracoExamineIndexDiagnostics.cs b/src/Umbraco.Examine/UmbracoExamineIndexDiagnostics.cs index 0812d93931..227b52e085 100644 --- a/src/Umbraco.Examine/UmbracoExamineIndexDiagnostics.cs +++ b/src/Umbraco.Examine/UmbracoExamineIndexDiagnostics.cs @@ -9,10 +9,10 @@ namespace Umbraco.Examine { public class UmbracoExamineIndexDiagnostics : IIndexDiagnostics { - private readonly UmbracoExamineIndexer _index; + private readonly UmbracoExamineIndex _index; private readonly ILogger _logger; - public UmbracoExamineIndexDiagnostics(UmbracoExamineIndexer index, ILogger logger) + public UmbracoExamineIndexDiagnostics(UmbracoExamineIndex index, ILogger logger) { _index = index; _logger = logger; @@ -28,7 +28,7 @@ namespace Umbraco.Examine } catch (AlreadyClosedException) { - _logger.Warn(typeof(UmbracoContentIndexer), "Cannot get GetIndexDocumentCount, the writer is already closed"); + _logger.Warn(typeof(UmbracoContentIndex), "Cannot get GetIndexDocumentCount, the writer is already closed"); return 0; } } @@ -44,7 +44,7 @@ namespace Umbraco.Examine } catch (AlreadyClosedException) { - _logger.Warn(typeof(UmbracoContentIndexer), "Cannot get GetIndexFieldCount, the writer is already closed"); + _logger.Warn(typeof(UmbracoContentIndex), "Cannot get GetIndexFieldCount, the writer is already closed"); return 0; } } @@ -62,15 +62,15 @@ namespace Umbraco.Examine { var d = new Dictionary { - [nameof(UmbracoExamineIndexer.CommitCount)] = _index.CommitCount, - [nameof(UmbracoExamineIndexer.DefaultAnalyzer)] = _index.DefaultAnalyzer.GetType().Name, - [nameof(UmbracoExamineIndexer.DirectoryFactory)] = _index.DirectoryFactory, - [nameof(UmbracoExamineIndexer.EnableDefaultEventHandler)] = _index.EnableDefaultEventHandler, - [nameof(UmbracoExamineIndexer.LuceneIndexFolder)] = + [nameof(UmbracoExamineIndex.CommitCount)] = _index.CommitCount, + [nameof(UmbracoExamineIndex.DefaultAnalyzer)] = _index.DefaultAnalyzer.GetType().Name, + [nameof(UmbracoExamineIndex.DirectoryFactory)] = _index.DirectoryFactory, + [nameof(UmbracoExamineIndex.EnableDefaultEventHandler)] = _index.EnableDefaultEventHandler, + [nameof(UmbracoExamineIndex.LuceneIndexFolder)] = _index.LuceneIndexFolder == null ? string.Empty : _index.LuceneIndexFolder.ToString().ToLowerInvariant().TrimStart(IOHelper.MapPath(SystemDirectories.Root).ToLowerInvariant()).Replace("\\", "/").EnsureStartsWith('/'), - [nameof(UmbracoExamineIndexer.PublishedValuesOnly)] = _index.PublishedValuesOnly, + [nameof(UmbracoExamineIndex.PublishedValuesOnly)] = _index.PublishedValuesOnly, //There's too much info here //[nameof(UmbracoExamineIndexer.FieldDefinitionCollection)] = _index.FieldDefinitionCollection, }; diff --git a/src/Umbraco.Examine/UmbracoMemberIndexer.cs b/src/Umbraco.Examine/UmbracoMemberIndex.cs similarity index 95% rename from src/Umbraco.Examine/UmbracoMemberIndexer.cs rename to src/Umbraco.Examine/UmbracoMemberIndex.cs index 4943f49825..28b46f72dd 100644 --- a/src/Umbraco.Examine/UmbracoMemberIndexer.cs +++ b/src/Umbraco.Examine/UmbracoMemberIndex.cs @@ -22,13 +22,13 @@ namespace Umbraco.Examine /// /// Custom indexer for members /// - public class UmbracoMemberIndexer : UmbracoExamineIndexer + public class UmbracoMemberIndex : UmbracoExamineIndex { /// /// Constructor for config/provider based indexes /// [EditorBrowsable(EditorBrowsableState.Never)] - public UmbracoMemberIndexer() + public UmbracoMemberIndex() { } @@ -41,7 +41,7 @@ namespace Umbraco.Examine /// /// /// - public UmbracoMemberIndexer( + public UmbracoMemberIndex( string name, IEnumerable fieldDefinitions, Directory luceneDirectory, diff --git a/src/Umbraco.Tests/Composing/TypeFinderTests.cs b/src/Umbraco.Tests/Composing/TypeFinderTests.cs index 955f6f94c8..9b52546dff 100644 --- a/src/Umbraco.Tests/Composing/TypeFinderTests.cs +++ b/src/Umbraco.Tests/Composing/TypeFinderTests.cs @@ -49,7 +49,7 @@ namespace Umbraco.Tests.Composing //typeof(TabPage).Assembly, typeof(System.Web.Mvc.ActionResult).Assembly, typeof(TypeFinder).Assembly, - typeof(global::Umbraco.Examine.UmbracoExamineIndexer).Assembly + typeof(global::Umbraco.Examine.UmbracoExamineIndex).Assembly }; } diff --git a/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs b/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs index 1f849fc1ce..cbd335a6c4 100644 --- a/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs +++ b/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs @@ -146,7 +146,7 @@ namespace Umbraco.Tests.UmbracoExamine return mediaTypeServiceMock.Object; } - public static UmbracoContentIndexer GetUmbracoIndexer( + public static UmbracoContentIndex GetUmbracoIndexer( ProfilingLogger profilingLogger, Directory luceneDir, Analyzer analyzer = null, @@ -162,9 +162,9 @@ namespace Umbraco.Tests.UmbracoExamine if (validator == null) validator = new ContentValueSetValidator(true); - var i = new UmbracoContentIndexer( + var i = new UmbracoContentIndex( "testIndexer", - UmbracoExamineIndexer.UmbracoIndexFieldDefinitions, + UmbracoExamineIndex.UmbracoIndexFieldDefinitions, luceneDir, analyzer, profilingLogger, diff --git a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs index 29abfb9234..35e3524459 100644 --- a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs +++ b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs @@ -114,8 +114,8 @@ namespace Umbraco.Tests.UmbracoExamine Assert.AreEqual("value2", result.AllValues["grid.row1"][1]); Assert.IsTrue(result.Values.ContainsKey("grid")); Assert.AreEqual("value1 value2 ", result["grid"]); - Assert.IsTrue(result.Values.ContainsKey($"{UmbracoExamineIndexer.RawFieldPrefix}grid")); - Assert.AreEqual(json, result[$"{UmbracoExamineIndexer.RawFieldPrefix}grid"]); + Assert.IsTrue(result.Values.ContainsKey($"{UmbracoExamineIndex.RawFieldPrefix}grid")); + Assert.AreEqual(json, result[$"{UmbracoExamineIndex.RawFieldPrefix}grid"]); } } diff --git a/src/Umbraco.Tests/UmbracoExamine/UmbracoContentValueSetValidatorTests.cs b/src/Umbraco.Tests/UmbracoExamine/UmbracoContentValueSetValidatorTests.cs index 934dd34503..8d7a446ccb 100644 --- a/src/Umbraco.Tests/UmbracoExamine/UmbracoContentValueSetValidatorTests.cs +++ b/src/Umbraco.Tests/UmbracoExamine/UmbracoContentValueSetValidatorTests.cs @@ -179,7 +179,7 @@ namespace Umbraco.Tests.UmbracoExamine { ["hello"] = "world", ["path"] = "-1,555", - [UmbracoExamineIndexer.PublishedFieldName] = 1 + [UmbracoExamineIndex.PublishedFieldName] = 1 })); Assert.AreEqual(ValueSetValidationResult.Valid, result); } @@ -213,7 +213,7 @@ namespace Umbraco.Tests.UmbracoExamine { ["hello"] = "world", ["path"] = "-1,555", - [UmbracoExamineIndexer.PublishedFieldName] = 0 + [UmbracoExamineIndex.PublishedFieldName] = 0 })); Assert.AreEqual(ValueSetValidationResult.Failed, result); @@ -222,7 +222,7 @@ namespace Umbraco.Tests.UmbracoExamine { ["hello"] = "world", ["path"] = "-1,555", - [UmbracoExamineIndexer.PublishedFieldName] = 1 + [UmbracoExamineIndex.PublishedFieldName] = 1 })); Assert.AreEqual(ValueSetValidationResult.Valid, result); } @@ -237,8 +237,8 @@ namespace Umbraco.Tests.UmbracoExamine { ["hello"] = "world", ["path"] = "-1,555", - [UmbracoContentIndexer.VariesByCultureFieldName] = 1, - [UmbracoExamineIndexer.PublishedFieldName] = 0 + [UmbracoContentIndex.VariesByCultureFieldName] = 1, + [UmbracoExamineIndex.PublishedFieldName] = 0 })); Assert.AreEqual(ValueSetValidationResult.Failed, result); @@ -247,8 +247,8 @@ namespace Umbraco.Tests.UmbracoExamine { ["hello"] = "world", ["path"] = "-1,555", - [UmbracoContentIndexer.VariesByCultureFieldName] = 1, - [UmbracoExamineIndexer.PublishedFieldName] = 1 + [UmbracoContentIndex.VariesByCultureFieldName] = 1, + [UmbracoExamineIndex.PublishedFieldName] = 1 })); Assert.AreEqual(ValueSetValidationResult.Valid, result); @@ -257,17 +257,17 @@ namespace Umbraco.Tests.UmbracoExamine { ["hello"] = "world", ["path"] = "-1,555", - [UmbracoContentIndexer.VariesByCultureFieldName] = 1, - [$"{UmbracoExamineIndexer.PublishedFieldName}_en-us"] = 1, + [UmbracoContentIndex.VariesByCultureFieldName] = 1, + [$"{UmbracoExamineIndex.PublishedFieldName}_en-us"] = 1, ["hello_en-us"] = "world", ["title_en-us"] = "my title", - [$"{UmbracoExamineIndexer.PublishedFieldName}_es-es"] = 0, + [$"{UmbracoExamineIndex.PublishedFieldName}_es-es"] = 0, ["hello_es-ES"] = "world", ["title_es-ES"] = "my title", - [UmbracoExamineIndexer.PublishedFieldName] = 1 + [UmbracoExamineIndex.PublishedFieldName] = 1 }); Assert.AreEqual(10, valueSet.Values.Count()); - Assert.IsTrue(valueSet.Values.ContainsKey($"{UmbracoExamineIndexer.PublishedFieldName}_es-es")); + Assert.IsTrue(valueSet.Values.ContainsKey($"{UmbracoExamineIndex.PublishedFieldName}_es-es")); Assert.IsTrue(valueSet.Values.ContainsKey("hello_es-ES")); Assert.IsTrue(valueSet.Values.ContainsKey("title_es-ES")); @@ -275,7 +275,7 @@ namespace Umbraco.Tests.UmbracoExamine Assert.AreEqual(ValueSetValidationResult.Filtered, result); Assert.AreEqual(7, valueSet.Values.Count()); //filtered to 7 values (removes es-es values) - Assert.IsFalse(valueSet.Values.ContainsKey($"{UmbracoExamineIndexer.PublishedFieldName}_es-es")); + Assert.IsFalse(valueSet.Values.ContainsKey($"{UmbracoExamineIndex.PublishedFieldName}_es-es")); Assert.IsFalse(valueSet.Values.ContainsKey("hello_es-ES")); Assert.IsFalse(valueSet.Values.ContainsKey("title_es-ES")); } diff --git a/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs index 3e42178fbd..ea76293df5 100644 --- a/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs @@ -123,15 +123,15 @@ namespace Umbraco.Web.Models.Mapping .AfterMap((src, dest) => { //get the icon if there is one - dest.Icon = src.Values.ContainsKey(UmbracoExamineIndexer.IconFieldName) - ? src.Values[UmbracoExamineIndexer.IconFieldName] + dest.Icon = src.Values.ContainsKey(UmbracoExamineIndex.IconFieldName) + ? src.Values[UmbracoExamineIndex.IconFieldName] : "icon-document"; dest.Name = src.Values.ContainsKey("nodeName") ? src.Values["nodeName"] : "[no name]"; - if (src.Values.ContainsKey(UmbracoExamineIndexer.NodeKeyFieldName)) + if (src.Values.ContainsKey(UmbracoExamineIndex.NodeKeyFieldName)) { Guid key; - if (Guid.TryParse(src.Values[UmbracoExamineIndexer.NodeKeyFieldName], out key)) + if (Guid.TryParse(src.Values[UmbracoExamineIndex.NodeKeyFieldName], out key)) { dest.Key = key; @@ -166,7 +166,7 @@ namespace Umbraco.Web.Models.Mapping dest.ParentId = -1; } } - dest.Path = src.Values.ContainsKey(UmbracoExamineIndexer.IndexPathFieldName) ? src.Values[UmbracoExamineIndexer.IndexPathFieldName] : ""; + dest.Path = src.Values.ContainsKey(UmbracoExamineIndex.IndexPathFieldName) ? src.Values[UmbracoExamineIndex.IndexPathFieldName] : ""; if (src.Values.ContainsKey(LuceneIndex.ItemTypeFieldName)) { diff --git a/src/Umbraco.Web/PropertyEditors/GridPropertyIndexValueFactory.cs b/src/Umbraco.Web/PropertyEditors/GridPropertyIndexValueFactory.cs index c8235d1d11..83279ae975 100644 --- a/src/Umbraco.Web/PropertyEditors/GridPropertyIndexValueFactory.cs +++ b/src/Umbraco.Web/PropertyEditors/GridPropertyIndexValueFactory.cs @@ -59,7 +59,7 @@ namespace Umbraco.Web.PropertyEditors if (sb.Length > 0) { //First save the raw value to a raw field - result.Add(new KeyValuePair>($"{UmbracoExamineIndexer.RawFieldPrefix}{property.Alias}", new[] { rawVal })); + result.Add(new KeyValuePair>($"{UmbracoExamineIndex.RawFieldPrefix}{property.Alias}", new[] { rawVal })); //index the property with the combined/cleaned value result.Add(new KeyValuePair>(property.Alias, new[] { sb.ToString() })); diff --git a/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs index 2deb8b8444..31b65c6357 100644 --- a/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs @@ -104,7 +104,7 @@ namespace Umbraco.Web.PropertyEditors //index the stripped html values yield return new KeyValuePair>(property.Alias, new object[] { strVal.StripHtml() }); //store the raw value - yield return new KeyValuePair>($"{UmbracoExamineIndexer.RawFieldPrefix}{property.Alias}", new object[] { strVal }); + yield return new KeyValuePair>($"{UmbracoExamineIndex.RawFieldPrefix}{property.Alias}", new object[] { strVal }); } } } diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs index d681d9296e..ac6b425e27 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs @@ -108,7 +108,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache // +(+parentID:-1) +__IndexType:media var criteria = searchProvider.CreateCriteria("media"); - var filter = criteria.ParentId(-1).Not().Field(UmbracoExamineIndexer.IndexPathFieldName, "-1,-21,".MultipleCharacterWildcard()); + var filter = criteria.ParentId(-1).Not().Field(UmbracoExamineIndex.IndexPathFieldName, "-1,-21,".MultipleCharacterWildcard()); var result = searchProvider.Search(filter.Compile()); if (result != null) @@ -294,7 +294,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache // note that since the use of the wildcard, it automatically escapes it in Lucene. var criteria = searchProvider.CreateCriteria("media"); - var filter = criteria.Id(id.ToInvariantString()).Not().Field(UmbracoExamineIndexer.IndexPathFieldName, "-1,-21,".MultipleCharacterWildcard()); + var filter = criteria.Id(id.ToInvariantString()).Not().Field(UmbracoExamineIndex.IndexPathFieldName, "-1,-21,".MultipleCharacterWildcard()); var result = searchProvider.Search(filter.Compile()).FirstOrDefault(); if (result != null) return ConvertFromSearchResult(result); @@ -476,7 +476,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache { //We are going to check for a special field however, that is because in some cases we store a 'Raw' //value in the index such as for xml/html. - var rawValue = dd.Properties.FirstOrDefault(x => x.Alias.InvariantEquals(UmbracoExamineIndexer.RawFieldPrefix + alias)); + var rawValue = dd.Properties.FirstOrDefault(x => x.Alias.InvariantEquals(UmbracoExamineIndex.RawFieldPrefix + alias)); return rawValue ?? dd.Properties.FirstOrDefault(x => x.Alias.InvariantEquals(alias)); } @@ -509,7 +509,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache //first check in Examine as this is WAY faster var criteria = searchProvider.CreateCriteria("media"); - var filter = criteria.ParentId(parentId).Not().Field(UmbracoExamineIndexer.IndexPathFieldName, "-1,-21,".MultipleCharacterWildcard()); + var filter = criteria.ParentId(parentId).Not().Field(UmbracoExamineIndex.IndexPathFieldName, "-1,-21,".MultipleCharacterWildcard()); //the above filter will create a query like this, NOTE: That since the use of the wildcard, it automatically escapes it in Lucene. //+(+parentId:3113 -__Path:-1,-21,*) +__IndexType:media diff --git a/src/Umbraco.Web/Search/UmbracoIndexesCreator.cs b/src/Umbraco.Web/Search/UmbracoIndexesCreator.cs index 623bd5b75f..f8b2c6ef8b 100644 --- a/src/Umbraco.Web/Search/UmbracoIndexesCreator.cs +++ b/src/Umbraco.Web/Search/UmbracoIndexesCreator.cs @@ -57,10 +57,10 @@ namespace Umbraco.Web.Search private IIndex CreateInternalIndex() { - var index = new UmbracoContentIndexer( + var index = new UmbracoContentIndex( Constants.UmbracoIndexes.InternalIndexName, //fixme - how to deal with languages like in UmbracoContentIndexer.CreateFieldValueTypes - UmbracoExamineIndexer.UmbracoIndexFieldDefinitions, + UmbracoExamineIndex.UmbracoIndexFieldDefinitions, GetFileSystemLuceneDirectory(Constants.UmbracoIndexes.InternalIndexPath), new CultureInvariantWhitespaceAnalyzer(), ProfilingLogger, @@ -71,10 +71,10 @@ namespace Umbraco.Web.Search private IIndex CreateExternalIndex() { - var index = new UmbracoContentIndexer( + var index = new UmbracoContentIndex( Constants.UmbracoIndexes.ExternalIndexName, //fixme - how to deal with languages like in UmbracoContentIndexer.CreateFieldValueTypes - UmbracoExamineIndexer.UmbracoIndexFieldDefinitions, + UmbracoExamineIndex.UmbracoIndexFieldDefinitions, GetFileSystemLuceneDirectory(Constants.UmbracoIndexes.ExternalIndexPath), new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_30), ProfilingLogger, @@ -85,10 +85,10 @@ namespace Umbraco.Web.Search private IIndex CreateMemberIndex() { - var index = new UmbracoMemberIndexer( + var index = new UmbracoMemberIndex( Constants.UmbracoIndexes.MembersIndexName, //fixme - how to deal with languages like in UmbracoContentIndexer.CreateFieldValueTypes - UmbracoExamineIndexer.UmbracoIndexFieldDefinitions, + UmbracoExamineIndex.UmbracoIndexFieldDefinitions, GetFileSystemLuceneDirectory(Constants.UmbracoIndexes.MembersIndexPath), new CultureInvariantWhitespaceAnalyzer(), ProfilingLogger,