From 893ca14859586425429271117a6f34279bd62406 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Thu, 28 Jan 2016 01:01:06 +0100 Subject: [PATCH 01/36] Config for max items --- .../relatedlinks/relatedlinks.controller.js | 28 +++++++++- .../relatedlinks/relatedlinks.html | 52 +++++++++---------- .../RelatedLinksPropertyEditor.cs | 10 ++++ 3 files changed, 60 insertions(+), 30 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js index 26d9768c29..0504378434 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js @@ -5,6 +5,8 @@ if (!$scope.model.value) { $scope.model.value = []; } + + $scope.maxNumber = isNumeric($scope.model.config.maxNumber) && $scope.model.config.maxNumber !== 0 ? $scope.model.config.maxNumber : Number.MAX_VALUE; $scope.newCaption = ''; $scope.newLink = 'http://'; @@ -141,9 +143,22 @@ $scope.model.value[index + direction] = temp; }; + //helper for determining if a user can add items + $scope.canAdd = function () { + return $scope.model.config.maxNumber > countVisible(); + } + + //helper that returns if an item can be sorted + $scope.canSort = function () { + return countVisible() > 1; + } + $scope.sortableOptions = { - containment: 'parent', + axis: 'y', + handle: '.handle', cursor: 'move', + cancel: '.no-drag', + containment: 'parent', helper: function (e, ui) { // When sorting , the cells collapse. This helper fixes that: http://www.foliotek.com/devblog/make-table-rows-sortable-using-jquery-ui-sortable/ ui.children().each(function () { @@ -151,7 +166,7 @@ }); return ui; }, - items: '> tr', + items: '> tr:not(.unsortable)', tolerance: 'pointer', update: function (e, ui) { // Get the new and old index for the moved element (using the URL as the identifier) @@ -166,6 +181,15 @@ } }; + //helper to count what is visible + function countVisible() { + return $scope.model.value.length; + } + + function isNumeric(n) { + return !isNaN(parseFloat(n)) && isFinite(n); + } + function getElementIndexByUrl(url) { for (var i = 0; i < $scope.model.value.length; i++) { if ($scope.model.value[i].link == url) { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html index a5eae94491..126982267f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html @@ -11,8 +11,8 @@ - - + + {{link.caption}} @@ -20,9 +20,7 @@
{{link.link}} - - - +
@@ -41,40 +39,38 @@ -
-
+
- - - - - + + + + - - - - -
- -
- + + + + +
+ +
+ @@ -86,4 +82,4 @@ position="right"> -
+
\ No newline at end of file diff --git a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs index 3009b39518..6001d9c54e 100644 --- a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs @@ -11,5 +11,15 @@ namespace Umbraco.Web.PropertyEditors [PropertyEditor(Constants.PropertyEditors.RelatedLinksAlias, "Related links", "relatedlinks", ValueType ="JSON", Icon="icon-thumbnail-list", Group="pickers")] public class RelatedLinksPropertyEditor : PropertyEditor { + //protected override PreValueEditor CreatePreValueEditor() + //{ + // return new RelatedLinksPreValueEditor(); + //} + + //internal class RelatedLinksPreValueEditor : PreValueEditor + //{ + // [PreValueField("maxNumber", "Maximum number of items", "number")] + // public int MaxNumber { get; set; } + //} } } From 7cf4c33d1541e1ad8536c14de30f78d9d4621120 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Mon, 1 Feb 2016 01:52:51 +0100 Subject: [PATCH 02/36] Fix max number in config and other adjustments --- .../src/less/listview.less | 3 ++- .../src/less/property-editors.less | 16 +++++++++++++++- .../relatedlinks/relatedlinks.controller.js | 4 ++-- .../relatedlinks/relatedlinks.html | 10 +++++----- .../RelatedLinksPropertyEditor.cs | 18 +++++++++--------- 5 files changed, 33 insertions(+), 18 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/listview.less b/src/Umbraco.Web.UI.Client/src/less/listview.less index b6efa9567f..87d5f9a5e2 100644 --- a/src/Umbraco.Web.UI.Client/src/less/listview.less +++ b/src/Umbraco.Web.UI.Client/src/less/listview.less @@ -243,7 +243,8 @@ background-color: @grayLighter } -.table-striped tbody i:hover { +/* don't hide all icons, e.g. for a sortable handle */ +.table-striped tbody i:not(.handle):hover { display: none !important } diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index b3cb034596..5033dacb2d 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -620,7 +620,21 @@ ul.color-picker li a { } // -// tags +// Related links +// -------------------------------------------------- +.umb-relatedlinks table > tr > td { word-wrap:break-word; word-break: break-all; } +.umb-relatedlinks .handle { cursor:move; } +.umb-relatedlinks table > tbody > tr.unsortable .handle { cursor:default; } + +/* sortable placeholder */ +.umb-relatedlinks .sortable-placeholder { + //background-color: #fff; + margin-bottom: 47px; +} + + +// +// Tags // -------------------------------------------------- .umb-tags{border: @grayLighter solid 1px; padding: 10px; font-size: 13px; text-shadow: none;} .umb-tags .tag{cursor: pointer; margin: 7px; padding: 7px; background: @blue} diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js index 0504378434..af7ea0cb24 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js @@ -6,7 +6,7 @@ $scope.model.value = []; } - $scope.maxNumber = isNumeric($scope.model.config.maxNumber) && $scope.model.config.maxNumber !== 0 ? $scope.model.config.maxNumber : Number.MAX_VALUE; + $scope.model.config.maxNumber = isNumeric($scope.model.config.maxNumber) && $scope.model.config.maxNumber !== 0 ? $scope.model.config.maxNumber : Number.MAX_VALUE; $scope.newCaption = ''; $scope.newLink = 'http://'; @@ -160,7 +160,7 @@ cancel: '.no-drag', containment: 'parent', helper: function (e, ui) { - // When sorting , the cells collapse. This helper fixes that: http://www.foliotek.com/devblog/make-table-rows-sortable-using-jquery-ui-sortable/ + // When sorting table rows, the cells collapse. This helper fixes that: http://www.foliotek.com/devblog/make-table-rows-sortable-using-jquery-ui-sortable/ ui.children().each(function () { $(this).width($(this).width()); }); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html index 126982267f..f5f49881d0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html @@ -13,11 +13,11 @@ - + {{link.caption}} - +
{{link.link}} @@ -49,10 +49,10 @@ - + - +
@@ -68,7 +68,7 @@
- +
diff --git a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs index 6001d9c54e..751774eeba 100644 --- a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs @@ -11,15 +11,15 @@ namespace Umbraco.Web.PropertyEditors [PropertyEditor(Constants.PropertyEditors.RelatedLinksAlias, "Related links", "relatedlinks", ValueType ="JSON", Icon="icon-thumbnail-list", Group="pickers")] public class RelatedLinksPropertyEditor : PropertyEditor { - //protected override PreValueEditor CreatePreValueEditor() - //{ - // return new RelatedLinksPreValueEditor(); - //} + protected override PreValueEditor CreatePreValueEditor() + { + return new RelatedLinksPreValueEditor(); + } - //internal class RelatedLinksPreValueEditor : PreValueEditor - //{ - // [PreValueField("maxNumber", "Maximum number of items", "number")] - // public int MaxNumber { get; set; } - //} + internal class RelatedLinksPreValueEditor : PreValueEditor + { + [PreValueField("maxNumber", "Maximum number of items", "number")] + public int MaxNumber { get; set; } + } } } From 6f078989797516f59b25b08a014ddf2c69f5d221 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Mon, 1 Feb 2016 02:13:05 +0100 Subject: [PATCH 03/36] Max config adjustments --- .../propertyeditors/relatedlinks/relatedlinks.controller.js | 4 ++-- src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js index af7ea0cb24..463c635570 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js @@ -6,7 +6,7 @@ $scope.model.value = []; } - $scope.model.config.maxNumber = isNumeric($scope.model.config.maxNumber) && $scope.model.config.maxNumber !== 0 ? $scope.model.config.maxNumber : Number.MAX_VALUE; + $scope.model.config.max = isNumeric($scope.model.config.max) && $scope.model.config.max !== 0 ? $scope.model.config.max : Number.MAX_VALUE; $scope.newCaption = ''; $scope.newLink = 'http://'; @@ -145,7 +145,7 @@ //helper for determining if a user can add items $scope.canAdd = function () { - return $scope.model.config.maxNumber > countVisible(); + return $scope.model.config.max <= 0 || $scope.model.config.max > countVisible(); } //helper that returns if an item can be sorted diff --git a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs index 751774eeba..732f478a80 100644 --- a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs @@ -18,7 +18,7 @@ namespace Umbraco.Web.PropertyEditors internal class RelatedLinksPreValueEditor : PreValueEditor { - [PreValueField("maxNumber", "Maximum number of items", "number")] + [PreValueField("max", "Maximum number of links", "number", Description = "Enter the maximum amount of links to be added, enter 0 for unlimited")] public int MaxNumber { get; set; } } } From 6d4364a8b9b7fe38f5c349b7fc9226dfa46f0ca6 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Tue, 2 Feb 2016 03:47:10 +0100 Subject: [PATCH 04/36] Modify sortable table row --- .../src/less/property-editors.less | 12 ++++++++-- .../relatedlinks/relatedlinks.controller.js | 23 +++++++++++++++++++ .../relatedlinks/relatedlinks.html | 1 + 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index 5033dacb2d..f67b1d804c 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -628,8 +628,16 @@ ul.color-picker li a { /* sortable placeholder */ .umb-relatedlinks .sortable-placeholder { - //background-color: #fff; - margin-bottom: 47px; + background-color: #efefef; + display: table-row; +} +.umb-relatedlinks .sortable-placeholder > td { + display: table-cell; + padding: 8px; +} +.umb-relatedlinks .ui-sortable-helper { + background-color: #fff; + opacity: 0.5; } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js index 463c635570..cc13dd33c9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js @@ -75,6 +75,9 @@ $scope.model.value[idx].edit = true; }; + $scope.cancelEdit = function (idx) { + $scope.model.value[idx].edit = false; + }; $scope.saveEdit = function (idx) { $scope.model.value[idx].title = $scope.model.value[idx].caption; @@ -159,6 +162,8 @@ cursor: 'move', cancel: '.no-drag', containment: 'parent', + placeholder: 'sortable-placeholder', + forcePlaceholderSize: true, helper: function (e, ui) { // When sorting table rows, the cells collapse. This helper fixes that: http://www.foliotek.com/devblog/make-table-rows-sortable-using-jquery-ui-sortable/ ui.children().each(function () { @@ -178,6 +183,24 @@ var movedElement = $scope.model.value[originalIndex]; $scope.model.value.splice(originalIndex, 1); $scope.model.value.splice(newIndex, 0, movedElement); + }, + start: function (e, ui) { + //ui.placeholder.html(""); + + // Build a placeholder cell that spans all the cells in the row: http://stackoverflow.com/questions/25845310/jquery-ui-sortable-and-table-cell-size + var cellCount = 0; + $('td, th', ui.helper).each(function () { + // For each td or th try and get it's colspan attribute, and add that or 1 to the total + var colspan = 1; + var colspanAttr = $(this).attr('colspan'); + if (colspanAttr > 1) { + colspan = colspanAttr; + } + cellCount += colspan; + }); + + // Add the placeholder UI - note that this is the item's content, so td rather than tr + ui.placeholder.html(' '); } }; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html index f5f49881d0..578d6a576a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html @@ -45,6 +45,7 @@
+
From b8c7b09d25222b5746e5f6e293c5d1ecee8b33c0 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Wed, 3 Feb 2016 02:29:21 +0100 Subject: [PATCH 05/36] Update styles + adjust sort of table row --- .../src/less/property-editors.less | 24 +++++++++-- .../relatedlinks/relatedlinks.controller.js | 8 +--- .../relatedlinks/relatedlinks.html | 43 +++++++++++-------- 3 files changed, 48 insertions(+), 27 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index f67b1d804c..d99c35f485 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -622,13 +622,24 @@ ul.color-picker li a { // // Related links // -------------------------------------------------- -.umb-relatedlinks table > tr > td { word-wrap:break-word; word-break: break-all; } +.umb-relatedlinks table > tr > td { word-wrap:break-word; word-break: break-all; border-bottom: 1px solid transparent; } .umb-relatedlinks .handle { cursor:move; } .umb-relatedlinks table > tbody > tr.unsortable .handle { cursor:default; } +.umb-relatedlinks table td.col-sort { width: 20px; } +.umb-relatedlinks table td.col-caption { min-width: 200px; } +.umb-relatedlinks table td.col-link { min-width: 200px; } +.umb-relatedlinks table td.col-actions { min-width: 120px; } + +.umb-relatedlinks table td.col-caption .control-wrapper, +.umb-relatedlinks table td.col-link .control-wrapper { display: flex; } + +.umb-relatedlinks table td.col-caption .control-wrapper input[type="text"], +.umb-relatedlinks table td.col-link .control-wrapper input[type="text"] { width: auto; flex: 1; } + /* sortable placeholder */ .umb-relatedlinks .sortable-placeholder { - background-color: #efefef; + background-color: @tableBackgroundAccent; display: table-row; } .umb-relatedlinks .sortable-placeholder > td { @@ -636,8 +647,13 @@ ul.color-picker li a { padding: 8px; } .umb-relatedlinks .ui-sortable-helper { - background-color: #fff; - opacity: 0.5; + display: table-row; + background-color: @white; + opacity: 0.7; +} +.umb-relatedlinks .ui-sortable-helper > td { + display: table-cell; + border-bottom: 1px solid @tableBorder; } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js index cc13dd33c9..01b465daba 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js @@ -74,10 +74,6 @@ } $scope.model.value[idx].edit = true; }; - - $scope.cancelEdit = function (idx) { - $scope.model.value[idx].edit = false; - }; $scope.saveEdit = function (idx) { $scope.model.value[idx].title = $scope.model.value[idx].caption; @@ -199,8 +195,8 @@ cellCount += colspan; }); - // Add the placeholder UI - note that this is the item's content, so td rather than tr - ui.placeholder.html(' '); + // Add the placeholder UI - note that this is the item's content, so td rather than tr - and set height of tr + ui.placeholder.html('').height(ui.item.height()); } }; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html index 578d6a576a..17358e0628 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html @@ -12,21 +12,25 @@ - - + + {{link.caption}} - +
+ +
- +
Choose
@@ -34,30 +38,35 @@
- + {{link.newWindow}} - +
-
- - - + + +
+ +
+ +
- -
or +
+ +
+ or choose internal page
@@ -66,8 +75,8 @@ or enter external link
- - + +
From 4bcee1df711bad2208d9840cd17f0ffa691c8c35 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Wed, 3 Feb 2016 02:42:47 +0100 Subject: [PATCH 06/36] Change property to maximum --- src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs index 732f478a80..1fc4d7f471 100644 --- a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs @@ -19,7 +19,7 @@ namespace Umbraco.Web.PropertyEditors internal class RelatedLinksPreValueEditor : PreValueEditor { [PreValueField("max", "Maximum number of links", "number", Description = "Enter the maximum amount of links to be added, enter 0 for unlimited")] - public int MaxNumber { get; set; } + public int Maximum { get; set; } } } } From 87667ec2d1ce61cd78c6b06f0f6a1861104c13d6 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 8 Mar 2016 20:56:24 +0100 Subject: [PATCH 07/36] Fixes: U4-8016 Pick only images from media --- .../components/umbmediagrid.directive.js | 10 +++++++++- .../common/overlays/mediaPicker/mediapicker.html | 3 ++- .../mediapicker/mediapicker.controller.js | 15 ++++++++------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbmediagrid.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbmediagrid.directive.js index eed0cffadb..70cbb6d9c3 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbmediagrid.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbmediagrid.directive.js @@ -34,6 +34,13 @@ var item = scope.items[i]; setItemData(item); setOriginalSize(item, itemMaxHeight); + + // remove non images when onlyImages is set to true + if(scope.onlyImages === "true" && !item.isFolder && !item.thumbnail){ + scope.items.splice(i, 1); + i--; + } + } if (scope.items.length > 0) { @@ -181,7 +188,8 @@ itemMaxWidth: "@", itemMaxHeight: "@", itemMinWidth: "@", - itemMinHeight: "@" + itemMinHeight: "@", + onlyImages: "@" }, link: link }; diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/mediaPicker/mediapicker.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/mediaPicker/mediapicker.html index 5bcbfbb3d2..51f05fea00 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/mediaPicker/mediapicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/mediaPicker/mediapicker.html @@ -80,7 +80,8 @@ item-max-width="150" item-max-height="150" item-min-width="100" - item-min-height="100"> + item-min-height="100" + only-images={{onlyImages}}> diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js index bf82efae24..9969af937d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js @@ -12,10 +12,10 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl $scope.model.config.startNodeId = userData.startMediaId; }); } - + function setupViewModel() { $scope.images = []; - $scope.ids = []; + $scope.ids = []; if ($scope.model.value) { var ids = $scope.model.value.split(','); @@ -30,16 +30,16 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl entityResource.getByIds(ids, "Media").then(function (medias) { _.each(medias, function (media, i) { - + //only show non-trashed items if (media.parentId >= -1) { - if (!media.thumbnail) { + if (!media.thumbnail) { media.thumbnail = mediaHelper.resolveFileFromEntity(media, true); } $scope.images.push(media); - $scope.ids.push(media.id); + $scope.ids.push(media.id); } }); @@ -67,6 +67,7 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl title: "Select media", startNodeId: $scope.model.config.startNodeId, multiPicker: multiPicker, + onlyImages: onlyImages, show: true, submit: function(model) { @@ -93,8 +94,8 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl $scope.sortableOptions = { update: function(e, ui) { var r = []; - //TODO: Instead of doing this with a half second delay would be better to use a watch like we do in the - // content picker. THen we don't have to worry about setting ids, render models, models, we just set one and let the + //TODO: Instead of doing this with a half second delay would be better to use a watch like we do in the + // content picker. THen we don't have to worry about setting ids, render models, models, we just set one and let the // watch do all the rest. $timeout(function(){ angular.forEach($scope.images, function(value, key){ From effe7c1669b664e5021504853e3981f7d9c00eac Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 10 Mar 2016 11:20:44 +0100 Subject: [PATCH 08/36] Fixes unit test --- src/Umbraco.Tests/Plugins/TypeFinderTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Tests/Plugins/TypeFinderTests.cs b/src/Umbraco.Tests/Plugins/TypeFinderTests.cs index 906027086d..50ab053668 100644 --- a/src/Umbraco.Tests/Plugins/TypeFinderTests.cs +++ b/src/Umbraco.Tests/Plugins/TypeFinderTests.cs @@ -79,8 +79,8 @@ namespace Umbraco.Tests.Plugins var originalTypesFound = TypeFinderOriginal.FindClassesOfType(_assemblies); Assert.AreEqual(originalTypesFound.Count(), typesFound.Count()); - Assert.AreEqual(8, typesFound.Count()); - Assert.AreEqual(8, originalTypesFound.Count()); + Assert.AreEqual(9, typesFound.Count()); + Assert.AreEqual(9, originalTypesFound.Count()); } [Test] From b9af6f631a38696010a03a3efb8e211fd2abc5fa Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 22 Mar 2016 11:23:09 +0100 Subject: [PATCH 09/36] U4-8220 ModelState and ViewData is not carried through when using the obsolete Content.GetGridHtml method --- ...tialViewMacroViewContextFilterAttribute.cs | 34 ++++++++++++++++--- .../Mvc/UmbracoViewPageOfTModel.cs | 10 ++++-- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web/Mvc/EnsurePartialViewMacroViewContextFilterAttribute.cs b/src/Umbraco.Web/Mvc/EnsurePartialViewMacroViewContextFilterAttribute.cs index afd40330ea..5be98f338b 100644 --- a/src/Umbraco.Web/Mvc/EnsurePartialViewMacroViewContextFilterAttribute.cs +++ b/src/Umbraco.Web/Mvc/EnsurePartialViewMacroViewContextFilterAttribute.cs @@ -21,20 +21,46 @@ namespace Umbraco.Web.Mvc /// internal class EnsurePartialViewMacroViewContextFilterAttribute : ActionFilterAttribute { + /// + /// Ensures the custom ViewContext datatoken is set before the RenderController action is invoked, + /// this ensures that any calls to GetPropertyValue with regards to RTE or Grid editors can still + /// render any PartialViewMacro with a form and maintain ModelState + /// + /// public override void OnActionExecuting(ActionExecutingContext filterContext) { //ignore anything that is not IRenderController if ((filterContext.Controller is IRenderController) == false) return; + SetViewContext(filterContext); + } + + /// + /// Ensures that the custom ViewContext datatoken is set after the RenderController action is invoked, + /// this ensures that any custom ModelState that may have been added in the RenderController itself is + /// passed onwards in case it is required when rendering a PartialViewMacro with a form + /// + /// The filter context. + public override void OnResultExecuting(ResultExecutingContext filterContext) + { + //ignore anything that is not IRenderController + if ((filterContext.Controller is IRenderController) == false) + return; + + SetViewContext(filterContext); + } + + private void SetViewContext(ControllerContext controllerContext) + { var viewCtx = new ViewContext( - filterContext.Controller.ControllerContext, - new DummyView(), - filterContext.Controller.ViewData, filterContext.Controller.TempData, + controllerContext, + new DummyView(), + controllerContext.Controller.ViewData, controllerContext.Controller.TempData, new StringWriter()); //set the special data token - filterContext.RequestContext.RouteData.DataTokens[Constants.DataTokenCurrentViewContext] = viewCtx; + controllerContext.RequestContext.RouteData.DataTokens[Constants.DataTokenCurrentViewContext] = viewCtx; } private class DummyView : IView diff --git a/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs b/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs index 0c45c24c4a..3d1a41d289 100644 --- a/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs +++ b/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs @@ -120,9 +120,13 @@ namespace Umbraco.Web.Mvc base.InitializePage(); if (ViewContext.IsChildAction == false) { - //always ensure the special data token is set - this is used purely for partial view macros that contain forms - // and mostly just when rendered within the RTE - ViewContext.RouteData.DataTokens[Constants.DataTokenCurrentViewContext] = ViewContext; + //this is used purely for partial view macros that contain forms + // and mostly just when rendered within the RTE - This should already be set with the + // EnsurePartialViewMacroViewContextFilterAttribute + if (ViewContext.RouteData.DataTokens.ContainsKey(Constants.DataTokenCurrentViewContext) == false) + { + ViewContext.RouteData.DataTokens.Add(Constants.DataTokenCurrentViewContext, ViewContext); + } } } From 43e23829ae3affbccbb95e1ee4ca330949145336 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 23 Mar 2016 10:06:13 +0100 Subject: [PATCH 10/36] updates EnsurePartialViewMacroViewContextFilterAttribute to check for child actions --- .../Mvc/EnsurePartialViewMacroViewContextFilterAttribute.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Mvc/EnsurePartialViewMacroViewContextFilterAttribute.cs b/src/Umbraco.Web/Mvc/EnsurePartialViewMacroViewContextFilterAttribute.cs index 5be98f338b..625b67b2b2 100644 --- a/src/Umbraco.Web/Mvc/EnsurePartialViewMacroViewContextFilterAttribute.cs +++ b/src/Umbraco.Web/Mvc/EnsurePartialViewMacroViewContextFilterAttribute.cs @@ -30,7 +30,7 @@ namespace Umbraco.Web.Mvc public override void OnActionExecuting(ActionExecutingContext filterContext) { //ignore anything that is not IRenderController - if ((filterContext.Controller is IRenderController) == false) + if ((filterContext.Controller is IRenderController) == false && filterContext.IsChildAction == false) return; SetViewContext(filterContext); @@ -45,7 +45,7 @@ namespace Umbraco.Web.Mvc public override void OnResultExecuting(ResultExecutingContext filterContext) { //ignore anything that is not IRenderController - if ((filterContext.Controller is IRenderController) == false) + if ((filterContext.Controller is IRenderController) == false && filterContext.IsChildAction == false) return; SetViewContext(filterContext); From 08070e319a8dca9a722b9d86b64741d319e5c045 Mon Sep 17 00:00:00 2001 From: paulsterling Date: Mon, 28 Mar 2016 16:46:31 -0700 Subject: [PATCH 11/36] Update number of sites running --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5fb4cb868b..53070b6917 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,11 @@ If you're interested in making changes to Belle make sure to read the [Belle Rea ## Umbraco - the simple, flexible and friendly ASP.NET CMS ## -**More than 177,000 sites trust Umbraco** +**More than 350,000 sites trust Umbraco** For the first time on the Microsoft platform, there is a free user and developer friendly CMS that makes it quick and easy to create websites - or a breeze to build complex web applications. Umbraco has award-winning integration capabilities and supports ASP.NET MVC or Web Forms, including User and Custom Controls, out of the box. It's a developer's dream and your users will love it too. -Used by more than 177,000 active websites including [http://daviscup.com](http://daviscup.com), [http://heinz.com](http://heinz.com), [http://peugeot.com](http://peugeot.com), [http://www.hersheys.com/](http://www.hersheys.com/) and **The Official ASP.NET and IIS.NET website from Microsoft** ([http://asp.net](http://asp.net) / [http://iis.net](http://iis.net)), you can be sure that the technology is proven, stable and scales. +Used by more than 350,000 active websites including [http://daviscup.com](http://daviscup.com), [http://heinz.com](http://heinz.com), [http://peugeot.com](http://peugeot.com), [http://www.hersheys.com/](http://www.hersheys.com/) and **The Official ASP.NET and IIS.NET website from Microsoft** ([http://asp.net](http://asp.net) / [http://iis.net](http://iis.net)), you can be sure that the technology is proven, stable and scales. To view more examples, please visit [http://umbraco.com/why-umbraco/#caseStudies](http://umbraco.com/why-umbraco/#caseStudies) From c427c51053a970fa440209ef166f26e100a2968d Mon Sep 17 00:00:00 2001 From: Claus Date: Tue, 29 Mar 2016 14:29:27 +0200 Subject: [PATCH 12/36] U4-7862 Brackets cause issues in the stylesheet editor --- src/Umbraco.Core/StringExtensions.cs | 24 +++++++++++++++++++ .../Strings/Css/StylesheetHelper.cs | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/StringExtensions.cs b/src/Umbraco.Core/StringExtensions.cs index 5aae1dbd4a..b92df5f1cf 100644 --- a/src/Umbraco.Core/StringExtensions.cs +++ b/src/Umbraco.Core/StringExtensions.cs @@ -1380,6 +1380,30 @@ namespace Umbraco.Core */ } + public static string EscapeRegexSpecialCharacters(this string text) + { + var regexSpecialCharacters = new Dictionary + { + {".", @"\."}, + {"(", @"\("}, + {")", @"\)"}, + {"]", @"\]"}, + {"[", @"\["}, + {"{", @"\{"}, + {"}", @"\}"}, + {"?", @"\?"}, + {"!", @"\!"}, + {"$", @"\$"}, + {"^", @"\^"}, + {"+", @"\+"}, + {"*", @"\*"}, + {"|", @"\|"}, + {"<", @"\<"}, + {">", @"\>"} + }; + return ReplaceMany(text, regexSpecialCharacters); + } + public static bool ContainsAny(this string haystack, IEnumerable needles, StringComparison comparison = StringComparison.CurrentCulture) { if (haystack == null) throw new ArgumentNullException("haystack"); diff --git a/src/Umbraco.Core/Strings/Css/StylesheetHelper.cs b/src/Umbraco.Core/Strings/Css/StylesheetHelper.cs index ff7591c6b5..260e8e5159 100644 --- a/src/Umbraco.Core/Strings/Css/StylesheetHelper.cs +++ b/src/Umbraco.Core/Strings/Css/StylesheetHelper.cs @@ -39,7 +39,7 @@ namespace Umbraco.Core.Strings.Css public static string ReplaceRule(string input, string oldRuleName, StylesheetRule rule) { var contents = input; - var ruleRegex = new Regex(string.Format(RuleRegexFormat, oldRuleName), RegexOptions.IgnoreCase | RegexOptions.Singleline); + var ruleRegex = new Regex(string.Format(RuleRegexFormat, oldRuleName.EscapeRegexSpecialCharacters()), RegexOptions.IgnoreCase | RegexOptions.Singleline); contents = ruleRegex.Replace(contents, rule != null ? rule.ToString() : ""); return contents; } From d1c865480f9586e777dd8bbeb2d750e27d38a251 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Tue, 29 Mar 2016 23:22:42 +0200 Subject: [PATCH 13/36] Add tooltip for listview layout + cursor style for listview table row. --- .../src/less/components/umb-table.less | 4 +--- .../src/views/components/umb-layout-selector.html | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-table.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-table.less index e94aa81898..e53fe2ba94 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-table.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-table.less @@ -85,7 +85,7 @@ input.umb-table__input { .umb-table-body .umb-table-row { color: fade(@gray, 75%); border-top: 1px solid @grayLight; - + cursor: pointer; font-size: 13px; &:hover { @@ -205,8 +205,6 @@ input.umb-table__input { overflow: hidden; white-space: nowrap; //NOTE Disable/Enable this to keep textstring on one line text-overflow: ellipsis; - - cursor: default; } .umb-table-cell:first-of-type { diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-layout-selector.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-layout-selector.html index a7b2e0e556..c7dba13bae 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-layout-selector.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-layout-selector.html @@ -5,10 +5,9 @@
- -
- -
+
+ +
From 61fe0a4a93ed55518804a83d2387cfe9607f84c0 Mon Sep 17 00:00:00 2001 From: Stephan Date: Wed, 30 Mar 2016 17:56:34 +0200 Subject: [PATCH 14/36] U4-2954 - refresh domain cache when emptying recycle bin --- src/Umbraco.Web/Cache/DomainCacheRefresher.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Umbraco.Web/Cache/DomainCacheRefresher.cs b/src/Umbraco.Web/Cache/DomainCacheRefresher.cs index 955d87ff59..d19d4f6ea0 100644 --- a/src/Umbraco.Web/Cache/DomainCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/DomainCacheRefresher.cs @@ -28,6 +28,12 @@ namespace Umbraco.Web.Cache get { return "Domain cache refresher"; } } + public override void RefreshAll() + { + ClearCache(); + base.RefreshAll(); + } + public override void Refresh(int id) { ClearCache(); From 5e7db1047be50f395dc9cddfd310df1bf22030d8 Mon Sep 17 00:00:00 2001 From: Chriztian Steinmeier Date: Wed, 30 Mar 2016 21:09:14 +0200 Subject: [PATCH 15/36] Add the missing 't' :zap: --- .../src/views/dashboard/settings/settingsdashboardintro.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html index 16bb80c0d1..32e7c01920 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html @@ -1,6 +1,6 @@

Start here

This section contains the building blocks for your Umbraco site

-

Follow the below links to find out more about working with the items in the Setings section:

+

Follow the below links to find out more about working with the items in the Settings section:

Find out more:

From e325e06efc9be7e65a12d829a389bcffe9eed1dd Mon Sep 17 00:00:00 2001 From: Chriztian Steinmeier Date: Wed, 30 Mar 2016 21:10:41 +0200 Subject: [PATCH 16/36] Update link to Our on Backoffice sections --- .../src/views/dashboard/settings/settingsdashboardintro.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html index 32e7c01920..f573ace7d4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html @@ -5,9 +5,9 @@

Find out more:

    -
  • Read more about working with the Items in Settings in the Community Wiki
  • Download the Editors Manual for details on working with the Umbraco UI
  • Ask a question in the Community Forum
  • +
  • Read more about working with the Items in Settings in the Documentation section of Our Umbraco
  • Watch our tutorial videos (some are free, some require a subscription)
  • Find out about our productivity boosting tools and commercial support
  • Find out about real-life training and certification opportunities
  • From 5f0fe69c82ebb07e38db20a5646b018ec9b61a17 Mon Sep 17 00:00:00 2001 From: Chriztian Steinmeier Date: Wed, 30 Mar 2016 21:11:29 +0200 Subject: [PATCH 17/36] Update links to https --- .../src/views/dashboard/settings/settingsdashboardintro.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html index f573ace7d4..fa9849022c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html @@ -5,9 +5,9 @@

    Find out more:

      -
    • Download the Editors Manual for details on working with the Umbraco UI
    • -
    • Ask a question in the Community Forum
    • Read more about working with the Items in Settings in the Documentation section of Our Umbraco
    • +
    • Download the Editors Manual for details on working with the Umbraco UI
    • +
    • Ask a question in the Community Forum
    • Watch our tutorial videos (some are free, some require a subscription)
    • Find out about our productivity boosting tools and commercial support
    • Find out about real-life training and certification opportunities
    • From 9e0ed94d77947bda6af9f1d7357f7dbace6705f7 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 31 Mar 2016 12:56:24 +0200 Subject: [PATCH 18/36] Fix typo in lang xml files --- src/Umbraco.Web.UI/umbraco/config/lang/en.xml | 2 +- .../umbraco/config/lang/en_us.xml | 2 +- src/Umbraco.Web.UI/umbraco/config/lang/ja.xml | 2 +- src/Umbraco.Web.UI/umbraco/config/lang/ru.xml | 58 +++++++++---------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 0842755da3..3fdaf8110b 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -271,7 +271,7 @@ External login providers Exception Details - Stacktrace + Stacktrace Link your Un-Link your diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml index ce25e990c8..dca808c4c8 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -271,7 +271,7 @@ External login providers Exception Details - Stacktrace + Stacktrace Link your Un-Link your diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml index a59a020455..44d2433664 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml @@ -267,7 +267,7 @@ 外部ログイン プロバイダー 例外の詳細 - スタックトレース + スタックトレース 次をリンク: 次をリンク解除: diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml index fec3e5f897..a8c69ea0f4 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml @@ -189,10 +189,10 @@ Унаследован от Добавить свойство Обязательная метка - + Представление в формате списка Устанавливает представление документа данного типа в виде сортируемого списка дочерних документов с функцией поиска, в отличие от обычного представления дочерних документов в виде дерева - + Допустимые шаблоны Выберите перечень допустимых шаблонов для сопоставления документам данного типа Разрешить в качестве корневого @@ -206,31 +206,31 @@ Унаследовать вкладки и свойства из уже существующего типа документов. Вкладки будут либо добавлены в создаваемый тип, либо в случае совпадения названий вкладок будут добавлены наследуемые свойства. Этот тип документов уже участвует в композиции другого типа, поэтому сам не может быть композицией. В настоящее время нет типов документов, допустимых для построения композиции. - + Доступные редакторы Переиспользовать Установки редактора - + Конфигурирование - + ДА, удалить - + была перемещена внутрь Выбрать папку для перемещения в структуре дерева - + Все типы документов Все документы Все медиа-элементы - + , использующие этот тип документов, будут безвозвратно удалены, пожалуйста, подтвердите это действие. , использующие этот тип медиа, будут безвозвратно удалены, пожалуйста, подтвердите это действие. , использующие этот тип участников, будут безвозвратно удалены, пожалуйста, подтвердите это действие. - + и все документы, использующие данный тип и все медиа-элементы, использующие данный тип и все участники, использующие данный тип - + , использующие этот редактор, будут обновлены с применением этих установок Участник может изменить @@ -302,18 +302,18 @@ Выберите элемент Просмотр элемента кэша Создать папку... - + Связать с оригиналом Самое дружелюбное сообщество - + Ссылка на страницу - + Открывает документ по ссылке в новом окне или вкладке браузера Открывает документ по ссылке в полноэкранном режиме Открывает документ по ссылке в родительском фрейме - + Ссылка на медиа-файл - + Выбрать медиа Выбрать значок Выбрать элемент @@ -322,23 +322,23 @@ Выбрать содержимое Выбрать участника Выбрать группу участников - + Это макрос без параметров - + Провайдеры аутентификации Подробное сообщение об ошибке - Трассировка стека - + Трассировка стека + Связать Разорвать связь - + учетную запись - + Выбрать редактор %0%'
      Добавить другие языки можно, воспользовавшись пунктом 'Языки' в меню слева + Ниже Вы можете указать различные переводы данной статьи словаря '%0%'
      Добавить другие языки можно, воспользовавшись пунктом 'Языки' в меню слева ]]>
      Название языка (культуры) @@ -397,7 +397,7 @@ Ошибка загрузки внешнего типа (сборка: %0%, тип: '%1%') Ошибка загрузки макроса (файл: %0%) "Ошибка разбора кода XSLT в файле: %0% - "Ошибка чтения XSLT-файла: %0% + "Ошибка чтения XSLT-файла: %0% Ошибка в конфигурации типа данных, используемого для свойства, проверьте тип данных Укажите заголовок Выберите тип @@ -876,7 +876,7 @@ ]]> + ]]> @@ -959,14 +959,14 @@ Добавить шаблон Добавить дочерний узел Добавить дочерний - + Изменить тип данных - + Навигация по разделам - + Ярлыки показать ярлыки - + В формате списка Разрешить в качестве корневого @@ -1108,7 +1108,7 @@ http://%3%. Удачи! - + Генератор уведомлений Umbraco. ]]> [%0%] Задание по переводу %1% From 4cca36451195cc4d05736193eeefd82521119398 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 31 Mar 2016 16:36:36 +0200 Subject: [PATCH 19/36] U4-8103 - refactor YSOD overlay to display inner exceptions --- .../common/overlays/ysod/ysod.controller.js | 12 ++++++++++ .../src/views/common/overlays/ysod/ysod.html | 8 +++++++ src/Umbraco.Web.UI/umbraco/config/lang/en.xml | 1 + .../umbraco/config/lang/en_us.xml | 1 + src/Umbraco.Web.UI/umbraco/config/lang/ja.xml | 23 ++++++++++--------- src/Umbraco.Web.UI/umbraco/config/lang/ru.xml | 1 + 6 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/ysod/ysod.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/overlays/ysod/ysod.controller.js index a6d66a0f99..5d42edd3a5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/ysod/ysod.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/ysod/ysod.controller.js @@ -10,4 +10,16 @@ angular.module("umbraco") $scope.model.error.data.StackTrace = $scope.model.error.data.StackTrace.trim(); } + if ($scope.model.error && $scope.model.error.data) { + $scope.model.error.data.InnerExceptions = []; + var ex = $scope.model.error.data.InnerException; + while (ex) { + if (ex.StackTrace) { + ex.StackTrace = ex.StackTrace.trim(); + } + $scope.model.error.data.InnerExceptions.push(ex); + ex = ex.InnerException; + } + } + }); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/ysod/ysod.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/ysod/ysod.html index 6c35763069..9a4ff7cb81 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/ysod/ysod.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/ysod/ysod.html @@ -16,4 +16,12 @@
      {{model.error.data.StackTrace}}
      + +
      +
      + Inner Exception: +
      +
      {{e.ExceptionType}}: {{e.ExceptionMessage}}
      +
      {{e.StackTrace}}
      +
      diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 3fdaf8110b..b810183d42 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -272,6 +272,7 @@ External login providers Exception Details Stacktrace + Inner Exception Link your Un-Link your diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml index dca808c4c8..aa2518a372 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -272,6 +272,7 @@ External login providers Exception Details Stacktrace + Inner Exception Link your Un-Link your diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml index 44d2433664..e1b675b208 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml @@ -242,7 +242,7 @@ 項目の選択 キャッシュされている項目の表示 フォルダーの作成... - + オリジナルに関連付ける フレンドリーなコミュニティ @@ -268,6 +268,7 @@ 外部ログイン プロバイダー 例外の詳細 スタックトレース + Inner Exception 次をリンク: 次をリンク解除: @@ -475,7 +476,7 @@ 移動 埋め込み - + ブラック グリーン @@ -484,7 +485,7 @@ ブルー レッド - + タブの追加 プロパティの追加 @@ -503,7 +504,7 @@ リスト ビューの切り替え ルートとして許可に切り替え - + 背景色 太字 @@ -537,7 +538,7 @@ アップグレードボタンを押すとUmbraco %0% 用にデータベースをアップグレードします。

      心配ありません。 - コンテントが消える事はありませんし、後で続けることもできます。 -

      +

      ]]> 次へ を押して続行してください。]]> @@ -583,7 +584,7 @@ ]]> スクラッチから始めたい どうしたらいいの?) 後からRunwayをインストールする事もできます。そうしたくなった時は、Developerセクションのパッケージへどうぞ。 ]]> @@ -597,8 +598,8 @@ 簡単なウェブサイトから始めたい - "Runway"(≈滑走路)は幾つかの基本的なテンプレートから簡単なウェブサイトを用意します。このインストーラーは自動的にRnwayをセットアップできますが、 - これを編集したり、拡張したり、削除する事も簡単にできます。もしUmbracoを完璧に使いこなせるならばこれは不要です。とはいえ、 + "Runway"(≈滑走路)は幾つかの基本的なテンプレートから簡単なウェブサイトを用意します。このインストーラーは自動的にRnwayをセットアップできますが、 + これを編集したり、拡張したり、削除する事も簡単にできます。もしUmbracoを完璧に使いこなせるならばこれは不要です。とはいえ、 Runwayを使う事は、手間なく簡単にUmbracoを始める為には良い選択肢です。 Runwayをインストールすれば、必要に応じてRunwayによる基本的な構成のページをRunwayのモジュールから選択できます。

      @@ -692,7 +693,7 @@ Runwayをインストールして作られた新しいウェブサイトがど

      ユーザー '%3%' によりページ '%2%' 上のタスク '%1%' から自動的にメールします。

      @@ -704,7 +705,7 @@ Runwayをインストールして作られた新しいウェブサイトがど

      @@ -1064,7 +1065,7 @@ Runwayをインストールして作られた新しいウェブサイトがど このエディターを使用すると新しい設定で更新されます - + 代替フィールド 代替テキスト diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml index a8c69ea0f4..fbf0e0adf2 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml @@ -328,6 +328,7 @@ Провайдеры аутентификации Подробное сообщение об ошибке Трассировка стека + Inner Exception Связать Разорвать связь From c3055ca43fc6f10ee8b79ad89599c189cfac1fcd Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 31 Mar 2016 16:37:16 +0200 Subject: [PATCH 20/36] U4-8103 - fix DisableBrowserCacheAttribute to handle exceptions --- .../Filters/DisableBrowserCacheAttribute.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs b/src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs index e1890326fb..0bb283bd1a 100644 --- a/src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs @@ -1,15 +1,6 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; using System.Net.Http.Headers; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using System.Web; -using System.Web.Http.Controllers; using System.Web.Http.Filters; -using Umbraco.Core; namespace Umbraco.Web.WebApi.Filters { @@ -24,6 +15,9 @@ namespace Umbraco.Web.WebApi.Filters base.OnActionExecuted(actionExecutedContext); + // happens if exception + if (actionExecutedContext.Response == null) return; + //NOTE: Until we upgraded to WebApi 2, this didn't work correctly and we had to revert to using // HttpContext.Current responses. I've changed this back to what it should be now since it works // and now with WebApi2, the HttpContext.Current responses dont! Anyways, all good now. @@ -42,9 +36,6 @@ namespace Umbraco.Web.WebApi.Filters //Mon, 01 Jan 1990 00:00:00 GMT new DateTimeOffset(1990, 1, 1, 0, 0, 0, TimeSpan.Zero); } - - - } } } From 40f7e87e048100e2e061971dceaba8cd84061ae8 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Sat, 2 Apr 2016 13:36:55 +0200 Subject: [PATCH 21/36] Fix issues when using custom font icons in backoffice. --- .../src/less/components/umb-content-grid.less | 4 +++- .../src/less/components/umb-folder-grid.less | 4 +++- .../src/less/components/umb-layout-selector.less | 4 +++- .../src/less/components/umb-table.less | 11 ++++++++--- src/Umbraco.Web.UI.Client/src/less/tree.less | 7 +++++-- .../src/views/components/umb-content-grid.html | 2 +- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-content-grid.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-content-grid.less index b34face8ba..aef523887c 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-content-grid.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-content-grid.less @@ -26,7 +26,9 @@ justify-content: center; } -.umb-content-grid__icon { +.umb-content-grid__icon, +.umb-content-grid__icon[class^="icon-"], +.umb-content-grid__icon[class*=" icon-"] { font-size: 40px; color: lighten(@gray, 20%); } diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-folder-grid.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-folder-grid.less index 14e343652d..c7c7fb78e5 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-folder-grid.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-folder-grid.less @@ -37,7 +37,9 @@ align-items: center; } -.umb-folder-grid__folder-icon { +.umb-folder-grid__folder-icon, +.umb-folder-grid__folder-icon[class^="icon-"], +.umb-folder-grid__folder-icon[class*=" icon-"] { font-size: 20px; margin-right: 15px; color: @black; diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-layout-selector.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-layout-selector.less index 122107f88c..74d85461fa 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-layout-selector.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-layout-selector.less @@ -51,7 +51,9 @@ border: 1px solid @blue; } -.umb-layout-selector__dropdown-item-icon { +.umb-layout-selector__dropdown-item-icon, +.umb-layout-selector__dropdown-item-icon[class^="icon-"], +.umb-layout-selector__dropdown-item-icon[class*=" icon-"] { font-size: 20px; color: @gray; text-align: center; diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-table.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-table.less index e53fe2ba94..874f9e9551 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-table.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-table.less @@ -101,16 +101,21 @@ input.umb-table__input { } } -.umb-table-body__icon { +.umb-table-body__icon, +.umb-table-body__icon[class^="icon-"], +.umb-table-body__icon[class*=" icon-"] { margin: 0 auto; - font-size: 22px; + line-height: 22px; color: @blueDark; } -.umb-table-body__checkicon { +.umb-table-body__checkicon, +.umb-table-body__checkicon[class^="icon-"], +.umb-table-body__checkicon[class*=" icon-"] { display: none; font-size: 16px; + line-height: 22px; } .umb-table-body .umb-table__name { diff --git a/src/Umbraco.Web.UI.Client/src/less/tree.less b/src/Umbraco.Web.UI.Client/src/less/tree.less index 185b5a6e3b..35de441137 100644 --- a/src/Umbraco.Web.UI.Client/src/less/tree.less +++ b/src/Umbraco.Web.UI.Client/src/less/tree.less @@ -418,9 +418,9 @@ div.locked:before{ padding-left: 10px; } .umb-actions-child li .menu-label { - font-size: 12px; + font-size: 14px; color: #000; - margin-left: 20px; + margin-left: 10px; } .umb-actions-child li .menu-label small { @@ -436,6 +436,9 @@ div.locked:before{ } .umb-actions-child i { font-size: 32px; + min-width: 32px; + text-align: center; + line-height: 24px; /* set line-height to ensure all icons use same line-height */ } .umb-actions-child li.add { diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-content-grid.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-content-grid.html index 7443cdd393..499594253e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-content-grid.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-content-grid.html @@ -9,7 +9,7 @@
      - +
      From 4e4ea594330e63d33b8cf008ad1a20926e6add28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Riis-Knudsen?= Date: Sat, 2 Apr 2016 19:07:35 +0200 Subject: [PATCH 22/36] * Only restrict to image files when onlyImages is active* Handle disallowed filetypes as per other upload controls * Only restrict to image files when onlyImages is active * Handle disallowed filetypes as per other upload controls --- .../common/overlays/mediaPicker/mediapicker.controller.js | 7 ++++++- 1 file changed, 6 insertions(+), 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 a63dfdc951..430fdc707f 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 @@ -16,7 +16,12 @@ angular.module("umbraco") $scope.startNodeId = dialogOptions.startNodeId ? dialogOptions.startNodeId : -1; $scope.cropSize = dialogOptions.cropSize; $scope.lastOpenedNode = $cookieStore.get("umbLastOpenedMediaNodeId"); - $scope.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes); + if($scope.onlyImages){ + $scope.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes); + } + else { + $scope.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles).replace(/\./g, "!."); + } $scope.maxFileSize = Umbraco.Sys.ServerVariables.umbracoSettings.maxFileSize + "KB"; $scope.model.selectedImages = []; From 680396daabf11f052c58c1f25c50efda748a7fdc Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Sun, 3 Apr 2016 11:06:37 +0200 Subject: [PATCH 23/36] Localize server-side error message for disallowed file uploads --- .../src/views/components/upload/umb-file-dropzone.html | 6 +++--- src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml | 1 + src/Umbraco.Web/Editors/MediaController.cs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/upload/umb-file-dropzone.html b/src/Umbraco.Web.UI.Client/src/views/components/upload/umb-file-dropzone.html index c1d5ad9de8..60cec9996f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/upload/umb-file-dropzone.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/upload/umb-file-dropzone.html @@ -78,12 +78,12 @@ {{ file.name }} - (: "{{ accept }}") - ( "{{maxFileSize}}") + + "{{maxFileSize}}" - ({{file.serverErrorMessage}}) + {{file.serverErrorMessage}}
      diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml index aa2518a372..402902f48c 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -175,6 +175,7 @@ Link to media or click here to choose files Only allowed file types are + Cannot upload this file, it does not have an approved file type Max file size is diff --git a/src/Umbraco.Web/Editors/MediaController.cs b/src/Umbraco.Web/Editors/MediaController.cs index 66889e2206..9e845e4649 100644 --- a/src/Umbraco.Web/Editors/MediaController.cs +++ b/src/Umbraco.Web/Editors/MediaController.cs @@ -571,7 +571,7 @@ namespace Umbraco.Web.Editors { tempFiles.Notifications.Add(new Notification( Services.TextService.Localize("speechBubbles/operationFailedHeader"), - "Cannot upload file " + file.Headers.ContentDisposition.FileName + ", it is not an approved file type", + Services.TextService.Localize("media/disallowedFileType"), SpeechBubbleIcon.Warning)); } } From 65024707086fb5554fd1a837ffa23bc1fc4e5a6c Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Sun, 3 Apr 2016 12:01:10 +0200 Subject: [PATCH 24/36] U4-8265 Listview list and listview grid does not handle acceptedFileTypes in same way --- .../listview/layouts/grid/grid.listviewlayout.controller.js | 4 +--- .../listview/layouts/list/list.listviewlayout.controller.js | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.listviewlayout.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.listviewlayout.controller.js index e1754dd89d..9ffe69306b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.listviewlayout.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.listviewlayout.controller.js @@ -14,10 +14,8 @@ var vm = this; vm.nodeId = $scope.contentId; - //vm.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes); - //instead of passing in a whitelist, we pass in a blacklist by adding ! to the ext + //we pass in a blacklist by adding ! to the file extensions, allowing everything EXCEPT for disallowedUploadFiles vm.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles).replace(/\./g, "!."); - vm.maxFileSize = Umbraco.Sys.ServerVariables.umbracoSettings.maxFileSize + "KB"; vm.activeDrag = false; vm.mediaDetailsTooltip = {}; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js index 1d2d361f28..909e2dee49 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js @@ -6,9 +6,8 @@ var vm = this; vm.nodeId = $scope.contentId; - //vm.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes); - //instead of passing in a whitelist, we pass in a blacklist by adding ! to the ext - vm.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles).replace(/./g, "!."); + //we pass in a blacklist by adding ! to the file extensions, allowing everything EXCEPT for disallowedUploadFiles + vm.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles).replace(/\./g, "!."); vm.maxFileSize = Umbraco.Sys.ServerVariables.umbracoSettings.maxFileSize + "KB"; vm.activeDrag = false; vm.isRecycleBin = $scope.contentId === '-21' || $scope.contentId === '-20'; From d8c781f97f344792b2d21936605f2045baa112cf Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Sun, 3 Apr 2016 13:39:05 +0200 Subject: [PATCH 25/36] Make the file exclusion filter more readable --- .../views/common/overlays/mediaPicker/mediapicker.controller.js | 2 +- .../listview/layouts/grid/grid.listviewlayout.controller.js | 2 +- .../listview/layouts/list/list.listviewlayout.controller.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 430fdc707f..774e14f50e 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 @@ -20,7 +20,7 @@ angular.module("umbraco") $scope.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes); } else { - $scope.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles).replace(/\./g, "!."); + $scope.acceptedFileTypes = !mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles); } $scope.maxFileSize = Umbraco.Sys.ServerVariables.umbracoSettings.maxFileSize + "KB"; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.listviewlayout.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.listviewlayout.controller.js index 9ffe69306b..24c00ebe1d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.listviewlayout.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.listviewlayout.controller.js @@ -15,7 +15,7 @@ vm.nodeId = $scope.contentId; //we pass in a blacklist by adding ! to the file extensions, allowing everything EXCEPT for disallowedUploadFiles - vm.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles).replace(/\./g, "!."); + vm.acceptedFileTypes = !mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles); vm.maxFileSize = Umbraco.Sys.ServerVariables.umbracoSettings.maxFileSize + "KB"; vm.activeDrag = false; vm.mediaDetailsTooltip = {}; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js index 909e2dee49..eb29e542e6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js @@ -7,7 +7,7 @@ vm.nodeId = $scope.contentId; //we pass in a blacklist by adding ! to the file extensions, allowing everything EXCEPT for disallowedUploadFiles - vm.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles).replace(/\./g, "!."); + vm.acceptedFileTypes = !mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles); vm.maxFileSize = Umbraco.Sys.ServerVariables.umbracoSettings.maxFileSize + "KB"; vm.activeDrag = false; vm.isRecycleBin = $scope.contentId === '-21' || $scope.contentId === '-20'; From 8e8b8bdea10c2ea7d28d60fa3ae91c564f3d8ee4 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 4 Apr 2016 09:20:59 +0200 Subject: [PATCH 26/36] Revert "Removes old obsoleted ping.aspx" This reverts commit 453efc02a5370b477a36bd4aadb7a8084d348438. Conflicts: src/Umbraco.Web.UI/Umbraco.Web.UI.csproj U4-8274 '/umbraco/ping.aspx' is missing --- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 3 ++ src/Umbraco.Web.UI/umbraco/ping.aspx | 2 + src/Umbraco.Web/Umbraco.Web.csproj | 3 ++ .../umbraco.presentation/umbraco/ping.aspx.cs | 38 +++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 src/Umbraco.Web.UI/umbraco/ping.aspx create mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 8f1f01f137..2f48f4a2e3 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -2241,6 +2241,9 @@ Form + + Form + diff --git a/src/Umbraco.Web.UI/umbraco/ping.aspx b/src/Umbraco.Web.UI/umbraco/ping.aspx new file mode 100644 index 0000000000..d79e25b2a1 --- /dev/null +++ b/src/Umbraco.Web.UI/umbraco/ping.aspx @@ -0,0 +1,2 @@ +<%@ Page language="c#" AutoEventWireup="True" %> +I'm alive! \ No newline at end of file diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 7aec0b676f..35dc036fd3 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -1088,6 +1088,9 @@ ASPXCodeBehind + + ASPXCodeBehind + diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs new file mode 100644 index 0000000000..410ada9f4d --- /dev/null +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Web; +using System.Web.SessionState; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.HtmlControls; + +namespace umbraco.presentation +{ + + [Obsolete("This class will be removed in future versions.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public partial class ping : System.Web.UI.Page + { + #region Web Form Designer generated code + override protected void OnInit(EventArgs e) + { + // + // CODEGEN: This call is required by the ASP.NET Web Form Designer. + // + InitializeComponent(); + base.OnInit(e); + } + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + } + #endregion + } +} From 2d514ac09ef547fb67a4a8217334bb550486939c Mon Sep 17 00:00:00 2001 From: madden-tom Date: Tue, 5 Apr 2016 07:01:05 +0100 Subject: [PATCH 27/36] =?UTF-8?q?Added=20check=20for=20publish=20permissio?= =?UTF-8?q?ns=20to=20remove=20option=20for=20Publish=20At=20a=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit U4-287 "Publish at" circumvents "Send for approval/publishing" --- src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs b/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs index 1f36eb6c5b..90d4efa963 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs @@ -164,6 +164,7 @@ namespace Umbraco.Web.Models.Mapping TabsAndPropertiesResolver.AddListView(display, "content", dataTypeService, localizedText); } + //Added check for publish permissions before adding releaseDate and expireDate var properties = new List { new ContentPropertyDisplay @@ -173,19 +174,19 @@ namespace Umbraco.Web.Models.Mapping Value = localizedText.UmbracoDictionaryTranslate(display.ContentTypeName), View = PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View }, - new ContentPropertyDisplay + new ContentPropertyDisplay { Alias = string.Format("{0}releasedate", Constants.PropertyEditors.InternalGenericPropertiesPrefix), Label = localizedText.Localize("content/releaseDate"), Value = display.ReleaseDate.HasValue ? display.ReleaseDate.Value.ToIsoString() : null, - View = "datepicker" //TODO: Hard coding this because the templatepicker doesn't necessarily need to be a resolvable (real) property editor - }, + View = display.AllowedActions.Contains('P') ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View //TODO: Hard coding this because the templatepicker doesn't necessarily need to be a resolvable (real) property editor + } , new ContentPropertyDisplay { Alias = string.Format("{0}expiredate", Constants.PropertyEditors.InternalGenericPropertiesPrefix), Label = localizedText.Localize("content/unpublishDate"), Value = display.ExpireDate.HasValue ? display.ExpireDate.Value.ToIsoString() : null, - View = "datepicker" //TODO: Hard coding this because the templatepicker doesn't necessarily need to be a resolvable (real) property editor + View = display.AllowedActions.Contains('P') ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View //TODO: Hard coding this because the templatepicker doesn't necessarily need to be a resolvable (real) property editor }, new ContentPropertyDisplay { From c856795cb77ad7cdebd71cb052b4a299ea26b075 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Tue, 5 Apr 2016 08:03:47 +0200 Subject: [PATCH 28/36] Fix hilariously wrong copy/pasted TODO comments.. --- src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs b/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs index 90d4efa963..ede1dfc78d 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs @@ -164,7 +164,6 @@ namespace Umbraco.Web.Models.Mapping TabsAndPropertiesResolver.AddListView(display, "content", dataTypeService, localizedText); } - //Added check for publish permissions before adding releaseDate and expireDate var properties = new List { new ContentPropertyDisplay @@ -179,14 +178,18 @@ namespace Umbraco.Web.Models.Mapping Alias = string.Format("{0}releasedate", Constants.PropertyEditors.InternalGenericPropertiesPrefix), Label = localizedText.Localize("content/releaseDate"), Value = display.ReleaseDate.HasValue ? display.ReleaseDate.Value.ToIsoString() : null, - View = display.AllowedActions.Contains('P') ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View //TODO: Hard coding this because the templatepicker doesn't necessarily need to be a resolvable (real) property editor + //Not editible for people without publish permission (U4-287) + View = display.AllowedActions.Contains('P') ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View + //TODO: Fix up hard coded datepicker } , new ContentPropertyDisplay { Alias = string.Format("{0}expiredate", Constants.PropertyEditors.InternalGenericPropertiesPrefix), Label = localizedText.Localize("content/unpublishDate"), Value = display.ExpireDate.HasValue ? display.ExpireDate.Value.ToIsoString() : null, - View = display.AllowedActions.Contains('P') ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View //TODO: Hard coding this because the templatepicker doesn't necessarily need to be a resolvable (real) property editor + //Not editible for people without publish permission (U4-287) + View = display.AllowedActions.Contains('P') ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View + //TODO: Fix up hard coded datepicker }, new ContentPropertyDisplay { From 2d6b8712d5c220b3bdeb71e1cd52871ca9095df8 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Wed, 6 Apr 2016 19:44:09 +0200 Subject: [PATCH 29/36] Limit this to listview, so it doesn't affect other property editors. --- src/Umbraco.Web.UI.Client/src/less/listview.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/listview.less b/src/Umbraco.Web.UI.Client/src/less/listview.less index 87d5f9a5e2..88762edf0c 100644 --- a/src/Umbraco.Web.UI.Client/src/less/listview.less +++ b/src/Umbraco.Web.UI.Client/src/less/listview.less @@ -244,7 +244,7 @@ } /* don't hide all icons, e.g. for a sortable handle */ -.table-striped tbody i:not(.handle):hover { +.umb-listview .table-striped tbody i:not(.handle):hover { display: none !important } From 2c29e422bc17d284022061533177221fa049db2d Mon Sep 17 00:00:00 2001 From: bjarnef Date: Wed, 6 Apr 2016 19:47:05 +0200 Subject: [PATCH 30/36] Add icons for internal links. --- .../relatedlinks/relatedlinks.controller.js | 8 ++++++-- .../views/propertyeditors/relatedlinks/relatedlinks.html | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js index 01b465daba..cb6c8e595a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js @@ -1,6 +1,6 @@ angular.module("umbraco") .controller("Umbraco.PropertyEditors.RelatedLinksController", - function ($rootScope, $scope, dialogService) { + function ($rootScope, $scope, dialogService, iconHelper) { if (!$scope.model.value) { $scope.model.value = []; @@ -13,6 +13,7 @@ $scope.newNewWindow = false; $scope.newInternal = null; $scope.newInternalName = ''; + $scope.newInternalIcon = null; $scope.addExternal = true; $scope.currentEditLink = null; $scope.hasError = false; @@ -108,6 +109,7 @@ this.edit = false; this.isInternal = true; this.internalName = $scope.newInternalName; + this.internalIcon = $scope.newInternalIcon; this.type = "internal"; this.title = $scope.newCaption; }; @@ -118,7 +120,7 @@ $scope.newNewWindow = false; $scope.newInternal = null; $scope.newInternalName = ''; - + $scope.newInternalIcon = null; } $event.preventDefault(); }; @@ -223,10 +225,12 @@ if ($scope.currentEditLink != null) { $scope.currentEditLink.internal = data.id; $scope.currentEditLink.internalName = data.name; + $scope.currentEditLink.internalIcon = iconHelper.convertFromLegacyIcon(data.icon); $scope.currentEditLink.link = data.id; } else { $scope.newInternal = data.id; $scope.newInternalName = data.name; + $scope.newInternalIcon = iconHelper.convertFromLegacyIcon(data.icon); } } }); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html index 17358e0628..e3f74c6e21 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html @@ -21,6 +21,7 @@ @@ -33,6 +34,7 @@ @@ -71,6 +73,7 @@ From ae154885e4ee7206f9232acf5f7e74d118e17e79 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Wed, 6 Apr 2016 19:52:21 +0200 Subject: [PATCH 31/36] Ensure icon has a value. --- .../views/propertyeditors/relatedlinks/relatedlinks.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html index e3f74c6e21..e7d3b67de3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html @@ -21,7 +21,7 @@ @@ -34,7 +34,7 @@ @@ -73,7 +73,7 @@ From 1e5b6a6a0f16887291a4e5228229f0e6913c7072 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 7 Apr 2016 15:42:51 +0200 Subject: [PATCH 32/36] Fixes: U4-8298 CacheRefresher authorization logic reversed - traditional load balancing will not work --- .../webservices/CacheRefresher.asmx.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CacheRefresher.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CacheRefresher.asmx.cs index a58a81dfc7..2cda4a0593 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CacheRefresher.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CacheRefresher.asmx.cs @@ -60,7 +60,7 @@ namespace umbraco.presentation.webservices return jsonRefresher; } - private bool NotAutorized(string login, string rawPassword) + private bool Autorized(string login, string rawPassword) { //TODO: This technique of passing the raw password in is a legacy idea and isn't really // a very happy way to secure this webservice. To prevent brute force attacks, we need @@ -92,7 +92,7 @@ namespace umbraco.presentation.webservices [WebMethod] public void BulkRefresh(RefreshInstruction[] instructions, string appId, string login, string password) { - if (NotAutorized(login, password)) return; + if (Autorized(login, password) == false) return; if (SelfMessage(appId)) return; // do not process self-messages // only execute distinct instructions - no sense in running the same one more than once @@ -131,29 +131,29 @@ namespace umbraco.presentation.webservices [WebMethod] public void RefreshAll(Guid uniqueIdentifier, string Login, string Password) { - if (NotAutorized(Login, Password)) return; + if (Autorized(Login, Password) == false) return; GetRefresher(uniqueIdentifier).RefreshAll(); } [WebMethod] public void RefreshByGuid(Guid uniqueIdentifier, Guid Id, string Login, string Password) { - if (NotAutorized(Login, Password)) return; + if (Autorized(Login, Password) == false) return; GetRefresher(uniqueIdentifier).Refresh(Id); } [WebMethod] public void RefreshById(Guid uniqueIdentifier, int Id, string Login, string Password) { - if (NotAutorized(Login, Password)) return; + if (Autorized(Login, Password) == false) return; GetRefresher(uniqueIdentifier).Refresh(Id); } [WebMethod] public void RefreshByIds(Guid uniqueIdentifier, string jsonIds, string Login, string Password) { - if (NotAutorized(Login, Password)) return; - var refresher = GetRefresher(uniqueIdentifier); + if (Autorized(Login, Password) == false) return; + var refresher = GetRefresher(uniqueIdentifier); foreach (var id in JsonConvert.DeserializeObject(jsonIds)) refresher.Refresh(id); } @@ -161,21 +161,21 @@ namespace umbraco.presentation.webservices [WebMethod] public void RefreshByJson(Guid uniqueIdentifier, string jsonPayload, string Login, string Password) { - if (NotAutorized(Login, Password)) return; + if (Autorized(Login, Password) == false) return; GetJsonRefresher(uniqueIdentifier).Refresh(jsonPayload); } [WebMethod] public void RemoveById(Guid uniqueIdentifier, int Id, string Login, string Password) { - if (NotAutorized(Login, Password)) return; + if (Autorized(Login, Password) == false) return; GetRefresher(uniqueIdentifier).Remove(Id); } [WebMethod] public XmlDocument GetRefreshers(string Login, string Password) { - if (NotAutorized(Login, Password)) return null; + if (Autorized(Login, Password) == false) return null; var xd = new XmlDocument(); xd.LoadXml(""); From f87bec398d1fa3d58d200d9b866458bd49badf7b Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 7 Apr 2016 16:44:45 +0200 Subject: [PATCH 33/36] U4-8239 DisableBrowserCacheAttribute causing YSOD when a previous exceptions is thrown before the filter kicks in --- src/Umbraco.Web/Mvc/DisableBrowserCacheAttribute.cs | 7 +++++++ .../WebApi/Filters/DisableBrowserCacheAttribute.cs | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Mvc/DisableBrowserCacheAttribute.cs b/src/Umbraco.Web/Mvc/DisableBrowserCacheAttribute.cs index c1b5b88643..c1c2186171 100644 --- a/src/Umbraco.Web/Mvc/DisableBrowserCacheAttribute.cs +++ b/src/Umbraco.Web/Mvc/DisableBrowserCacheAttribute.cs @@ -13,6 +13,13 @@ namespace Umbraco.Web.Mvc { base.OnActionExecuted(filterContext); + // could happens if exception (but afaik this wouldn't happen in MVC) + if (filterContext.HttpContext == null || filterContext.HttpContext.Response == null || + filterContext.HttpContext.Response.Cache == null) + { + return; + } + filterContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache); filterContext.HttpContext.Response.Cache.SetMaxAge(TimeSpan.Zero); filterContext.HttpContext.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); diff --git a/src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs b/src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs index 0bb283bd1a..3deddde831 100644 --- a/src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs @@ -16,7 +16,11 @@ namespace Umbraco.Web.WebApi.Filters base.OnActionExecuted(actionExecutedContext); // happens if exception - if (actionExecutedContext.Response == null) return; + if (actionExecutedContext == null || actionExecutedContext.Response == null || + actionExecutedContext.Response.Headers == null) + { + return; + } //NOTE: Until we upgraded to WebApi 2, this didn't work correctly and we had to revert to using // HttpContext.Current responses. I've changed this back to what it should be now since it works From 506ed9f866deeca3d0c74fdb0adb91e97daea40e Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 7 Apr 2016 17:51:09 +0200 Subject: [PATCH 34/36] U4-8286 Add OWIN startup events to the UmbracoDefaultOwinStartup class --- src/Umbraco.Core/UmbracoApplicationBase.cs | 5 +++++ .../OwinMiddlewareConfiguredEventArgs.cs | 15 +++++++++++++ .../Security/Identity/AppBuilderExtensions.cs | 21 +++++++++++++++++++ src/Umbraco.Web/Umbraco.Web.csproj | 1 + src/Umbraco.Web/UmbracoDefaultOwinStartup.cs | 17 +++++++++++++-- 5 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 src/Umbraco.Web/OwinMiddlewareConfiguredEventArgs.cs diff --git a/src/Umbraco.Core/UmbracoApplicationBase.cs b/src/Umbraco.Core/UmbracoApplicationBase.cs index 225493b57b..bb81c79f2a 100644 --- a/src/Umbraco.Core/UmbracoApplicationBase.cs +++ b/src/Umbraco.Core/UmbracoApplicationBase.cs @@ -72,6 +72,11 @@ namespace Umbraco.Core /// /// Override init and raise the event /// + /// + /// DID YOU KNOW? The Global.asax Init call is the thing that initializes all of the httpmodules, ties up a bunch of stuff with IIS, etc... + /// Therefore, since OWIN is an HttpModule when running in IIS/ASP.Net the OWIN startup is not executed until this method fires and by that + /// time, Umbraco has performed it's bootup sequence. + /// public override void Init() { base.Init(); diff --git a/src/Umbraco.Web/OwinMiddlewareConfiguredEventArgs.cs b/src/Umbraco.Web/OwinMiddlewareConfiguredEventArgs.cs new file mode 100644 index 0000000000..03c2dc631d --- /dev/null +++ b/src/Umbraco.Web/OwinMiddlewareConfiguredEventArgs.cs @@ -0,0 +1,15 @@ +using System; +using Owin; + +namespace Umbraco.Web +{ + public class OwinMiddlewareConfiguredEventArgs : EventArgs + { + public OwinMiddlewareConfiguredEventArgs(IAppBuilder appBuilder) + { + AppBuilder = appBuilder; + } + + public IAppBuilder AppBuilder { get; private set; } + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/Security/Identity/AppBuilderExtensions.cs b/src/Umbraco.Web/Security/Identity/AppBuilderExtensions.cs index 3097407de3..be4c8923d7 100644 --- a/src/Umbraco.Web/Security/Identity/AppBuilderExtensions.cs +++ b/src/Umbraco.Web/Security/Identity/AppBuilderExtensions.cs @@ -24,10 +24,31 @@ namespace Umbraco.Web.Security.Identity { public static class AppBuilderExtensions { + /// + /// Called at the end of configuring middleware + /// + /// + /// + /// This could be used for something else in the future - maybe to inform Umbraco that middleware is done/ready, but for + /// now this is used to raise the custom event + /// + /// This is an extension method in case developer entirely replace the UmbracoDefaultOwinStartup class, in which case they will + /// need to ensure they call this extension method in their startup class. + /// + /// TODO: Move this method in v8, it doesn't belong in this namespace/extension class + /// + public static void FinalizeMiddlewareConfiguration(this IAppBuilder app) + { + UmbracoDefaultOwinStartup.OnMiddlewareConfigured(new OwinMiddlewareConfiguredEventArgs(app)); + } + /// /// Sets the OWIN logger to use Umbraco's logging system /// /// + /// + /// TODO: Move this method in v8, it doesn't belong in this namespace/extension class + /// public static void SetUmbracoLoggerFactory(this IAppBuilder app) { app.SetLoggerFactory(new OwinLoggerFactory()); diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 35dc036fd3..3aeffcfe16 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -349,6 +349,7 @@ + diff --git a/src/Umbraco.Web/UmbracoDefaultOwinStartup.cs b/src/Umbraco.Web/UmbracoDefaultOwinStartup.cs index 5b3fadd0f3..046b2167d5 100644 --- a/src/Umbraco.Web/UmbracoDefaultOwinStartup.cs +++ b/src/Umbraco.Web/UmbracoDefaultOwinStartup.cs @@ -1,4 +1,5 @@ -using System.Web; +using System; +using System.Web; using Microsoft.Owin; using Microsoft.Owin.Extensions; using Microsoft.Owin.Logging; @@ -59,12 +60,24 @@ namespace Umbraco.Web app .UseUmbracoBackOfficeCookieAuthentication(ApplicationContext, PipelineStage.Authenticate) .UseUmbracoBackOfficeExternalCookieAuthentication(ApplicationContext, PipelineStage.Authenticate) - .UseUmbracoPreviewAuthentication(ApplicationContext, PipelineStage.Authorize); + .UseUmbracoPreviewAuthentication(ApplicationContext, PipelineStage.Authorize) + .FinalizeMiddlewareConfiguration(); } + /// + /// Raised when the middelware has been configured + /// + public static event EventHandler MiddlewareConfigured; + protected virtual ApplicationContext ApplicationContext { get { return ApplicationContext.Current; } } + + internal static void OnMiddlewareConfigured(OwinMiddlewareConfiguredEventArgs args) + { + var handler = MiddlewareConfigured; + if (handler != null) handler(null, args); + } } } From 36255709e61525b25f213eae86aa559f8e3b5b14 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 7 Apr 2016 18:16:03 +0200 Subject: [PATCH 35/36] U4-8297 Custom MembershipProvider search doesn't work in the listview --- src/Umbraco.Web/Editors/MemberController.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Editors/MemberController.cs b/src/Umbraco.Web/Editors/MemberController.cs index 909189b7ad..377647d3ba 100644 --- a/src/Umbraco.Web/Editors/MemberController.cs +++ b/src/Umbraco.Web/Editors/MemberController.cs @@ -103,7 +103,24 @@ namespace Umbraco.Web.Editors else { int totalRecords; - var members = _provider.GetAllUsers((pageNumber - 1), pageSize, out totalRecords); + + MembershipUserCollection members; + if (filter.IsNullOrWhiteSpace()) + { + members = _provider.GetAllUsers((pageNumber - 1), pageSize, out totalRecords); + } + else + { + //we need to search! + + //try by name first + members = _provider.FindUsersByName(filter, (pageNumber - 1), pageSize, out totalRecords); + if (totalRecords == 0) + { + //try by email then + members = _provider.FindUsersByEmail(filter, (pageNumber - 1), pageSize, out totalRecords); + } + } if (totalRecords == 0) { return new PagedResult(0, 0, 0); From 20347c1ccd9665fe0fa775a283d6ebbd332f860d Mon Sep 17 00:00:00 2001 From: Claus Date: Tue, 12 Apr 2016 13:17:41 +0200 Subject: [PATCH 36/36] Fixing typo. --- .../umbraco/webservices/CacheRefresher.asmx.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CacheRefresher.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CacheRefresher.asmx.cs index 2cda4a0593..cb6bd451b0 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CacheRefresher.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CacheRefresher.asmx.cs @@ -60,7 +60,7 @@ namespace umbraco.presentation.webservices return jsonRefresher; } - private bool Autorized(string login, string rawPassword) + private bool Authorized(string login, string rawPassword) { //TODO: This technique of passing the raw password in is a legacy idea and isn't really // a very happy way to secure this webservice. To prevent brute force attacks, we need @@ -92,7 +92,7 @@ namespace umbraco.presentation.webservices [WebMethod] public void BulkRefresh(RefreshInstruction[] instructions, string appId, string login, string password) { - if (Autorized(login, password) == false) return; + if (Authorized(login, password) == false) return; if (SelfMessage(appId)) return; // do not process self-messages // only execute distinct instructions - no sense in running the same one more than once @@ -131,28 +131,28 @@ namespace umbraco.presentation.webservices [WebMethod] public void RefreshAll(Guid uniqueIdentifier, string Login, string Password) { - if (Autorized(Login, Password) == false) return; + if (Authorized(Login, Password) == false) return; GetRefresher(uniqueIdentifier).RefreshAll(); } [WebMethod] public void RefreshByGuid(Guid uniqueIdentifier, Guid Id, string Login, string Password) { - if (Autorized(Login, Password) == false) return; + if (Authorized(Login, Password) == false) return; GetRefresher(uniqueIdentifier).Refresh(Id); } [WebMethod] public void RefreshById(Guid uniqueIdentifier, int Id, string Login, string Password) { - if (Autorized(Login, Password) == false) return; + if (Authorized(Login, Password) == false) return; GetRefresher(uniqueIdentifier).Refresh(Id); } [WebMethod] public void RefreshByIds(Guid uniqueIdentifier, string jsonIds, string Login, string Password) { - if (Autorized(Login, Password) == false) return; + if (Authorized(Login, Password) == false) return; var refresher = GetRefresher(uniqueIdentifier); foreach (var id in JsonConvert.DeserializeObject(jsonIds)) refresher.Refresh(id); @@ -161,21 +161,21 @@ namespace umbraco.presentation.webservices [WebMethod] public void RefreshByJson(Guid uniqueIdentifier, string jsonPayload, string Login, string Password) { - if (Autorized(Login, Password) == false) return; + if (Authorized(Login, Password) == false) return; GetJsonRefresher(uniqueIdentifier).Refresh(jsonPayload); } [WebMethod] public void RemoveById(Guid uniqueIdentifier, int Id, string Login, string Password) { - if (Autorized(Login, Password) == false) return; + if (Authorized(Login, Password) == false) return; GetRefresher(uniqueIdentifier).Remove(Id); } [WebMethod] public XmlDocument GetRefreshers(string Login, string Password) { - if (Autorized(Login, Password) == false) return null; + if (Authorized(Login, Password) == false) return null; var xd = new XmlDocument(); xd.LoadXml("");