From 1c12e96c65c7319235f009e12ba8b1bd948825d7 Mon Sep 17 00:00:00 2001 From: Tiffany Date: Sat, 22 Oct 2022 02:36:46 +0100 Subject: [PATCH 01/46] Fixed user invited badge color (cherry picked from commit 52098405977946f6459ee5e5204db68b29cc370f) --- .../src/common/services/usershelper.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/usershelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/usershelper.service.js index e6450798fb..65296d6d84 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/usershelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/usershelper.service.js @@ -8,7 +8,7 @@ { "value": 0, "name": "Active", "key": "Active", "color": "success" }, { "value": 1, "name": "Disabled", "key": "Disabled", "color": "danger" }, { "value": 2, "name": "Locked out", "key": "LockedOut", "color": "danger" }, - { "value": 3, "name": "Invited", "key": "Invited", "color": "warning" }, + { "value": 3, "name": "Invited", "key": "Invited", "color": "primary" }, { "value": 4, "name": "Inactive", "key": "Inactive", "color": "warning" } ]; From ded4424b9847924ee8a885f16f6881c24149cead Mon Sep 17 00:00:00 2001 From: bakersbakebread Date: Fri, 30 Sep 2022 12:18:22 +0100 Subject: [PATCH 02/46] add setDirty() logic to remove actions on mediaPicker3 property editor (cherry picked from commit 3377a7c96b1e8a8a2b4b05b9f8815beb05b4371e) --- .../mediapicker3/umbMediaPicker3PropertyEditor.component.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker3/umbMediaPicker3PropertyEditor.component.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker3/umbMediaPicker3PropertyEditor.component.js index e052e7c1c6..0e61b4b5fa 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker3/umbMediaPicker3PropertyEditor.component.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker3/umbMediaPicker3PropertyEditor.component.js @@ -302,6 +302,8 @@ if (onSuccess) { onSuccess(); } + + setDirty(); }, close: function () { editorService.close(); @@ -350,12 +352,15 @@ if (index !== -1) { vm.model.value.splice(index, 1); } + + setDirty(); } function deleteAllMedias() { if (!vm.allowRemoveMedia) return; vm.model.value = []; + setDirty(); } function setActiveMedia(mediaEntryOrNull) { From a3c259482c80193a8fe7862688a3367084f1f3df Mon Sep 17 00:00:00 2001 From: Jesse Date: Mon, 28 Nov 2022 14:38:12 -0500 Subject: [PATCH 03/46] added fix for ncNodeName filter in list view (#13086) (cherry picked from commit e87701c482d6a59c6f6965467208a53929fe81b9) --- .../src/views/components/umb-content-grid.html | 2 +- .../src/views/components/umb-table.html | 4 ++-- .../listview/listview.controller.js | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) 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 3a07a233c7..4adf75fd93 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 @@ -23,7 +23,7 @@
  • {{ property.header }}:
    -
    {{ item[property.alias] }}
    +
    {{ item[property.alias].expression ? item[property.alias].expression({value: item[property.alias].value}) : item[property.alias] }}
  • diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-table.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-table.html index 0e9cd5c705..339ee29c90 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-table.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-table.html @@ -57,10 +57,10 @@
    - +
    - {{item[column.alias]}} + {{item[column.alias].expression ? item[column.alias].expression({value: item[column.alias].value}) : item[column.alias]}}
    diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js index ae611468b6..ffbbcb72d0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js @@ -682,9 +682,18 @@ function listViewController($scope, $interpolate, $routeParams, $injector, $time } if (e.nameExp) { - var newValue = e.nameExp({ value }); - if (newValue && (newValue = newValue.trim())) { - value = newValue; + if (/{{.*\s*\w+\s*\|\s*\w+\s*.*}}/.test(e.nameTemplate)) { //check whether the name template has a filter + value = { + value, + expression: e.nameExp + }; + } + else { + var newValue = e.nameExp({ value }); + + if (newValue && (newValue = newValue.trim())) { + value = newValue; + } } } From 3c89b5271cccb99bf01676022ae60bf81f9563ab Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Mon, 28 Nov 2022 21:33:59 +0100 Subject: [PATCH 04/46] Add input id to args in toggleValue event (#13108) (cherry picked from commit a7368542d85ac4b8abd37df0a5d2a8a7e0ceaa11) --- .../components/buttons/umbtoggle.directive.js | 4 ++-- .../multicolorpicker.controller.js | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbtoggle.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbtoggle.directive.js index 6f0e03cc5a..7a5eb9fc29 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbtoggle.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbtoggle.directive.js @@ -82,7 +82,7 @@ // Must wait until the current digest cycle is finished before we emit this event on init, // otherwise other property editors might not yet be ready to receive the event $timeout(function () { - eventsService.emit("toggleValue", { value: scope.checked }); + eventsService.emit("toggleValue", { value: scope.checked, inputId: scope.inputId }); }, 100); } @@ -122,7 +122,7 @@ } if (scope.onClick) { - eventsService.emit("toggleValue", { value: !scope.checked }); + eventsService.emit("toggleValue", { value: !scope.checked, inputId: scope.inputId }); scope.onClick(); } }; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/multicolorpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/multicolorpicker.controller.js index cb5905e2c9..87dd85df04 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/multicolorpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/multicolorpicker.controller.js @@ -1,7 +1,7 @@ -angular.module("umbraco").controller("Umbraco.PrevalueEditors.MultiColorPickerController", +angular.module("umbraco").controller("Umbraco.PrevalueEditors.MultiColorPickerController", function ($scope, angularHelper, $element, eventsService) { - var vm = this; + const vm = this; vm.add = add; vm.remove = remove; @@ -15,10 +15,10 @@ vm.labelEnabled = false; vm.editItem = null; - //NOTE: We need to make each color an object, not just a string because you cannot 2-way bind to a primitive. - var defaultColor = "000000"; - var defaultLabel = null; - + // NOTE: We need to make each color an object, not just a string because you cannot 2-way bind to a primitive. + const defaultColor = "000000"; + const defaultLabel = null; + $scope.newColor = defaultColor; $scope.newLabel = defaultLabel; $scope.hasError = false; @@ -48,15 +48,20 @@ } }); } + var evts = []; evts.push(eventsService.on("toggleValue", function (e, args) { - vm.labelEnabled = args.value; + if (args.inputId === "useLabel") { + vm.labelEnabled = args.value; + } })); + $scope.$on('$destroy', function () { for (var e in evts) { eventsService.unsubscribe(evts[e]); } }); + if (!Utilities.isArray($scope.model.value)) { //make an array from the dictionary var items = []; From ce9766eb69256a3ffb85ede655b90258603cbbb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Riis-Knudsen?= Date: Mon, 28 Nov 2022 22:44:59 +0100 Subject: [PATCH 05/46] Skip populating the PropertyTypeGroup alias column if it is already populated (#13109) (cherry picked from commit 50d361c4e68f7b2755575b43d01b94acf03ffcf7) --- .../Migrations/Upgrade/V_8_17_0/AddPropertyTypeGroupColumns.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_17_0/AddPropertyTypeGroupColumns.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_17_0/AddPropertyTypeGroupColumns.cs index cef69d6bd3..a085244bae 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_17_0/AddPropertyTypeGroupColumns.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_17_0/AddPropertyTypeGroupColumns.cs @@ -55,7 +55,7 @@ public class AddPropertyTypeGroupColumns : MigrationBase AddColumn("alias", out IEnumerable sqls); // Populate non-null alias column - List? dtos = Database.Fetch(); + List? dtos = Database.Query().Where(x => x.Alias == null).ToList(); foreach (PropertyTypeGroupDto dto in PopulateAliases(dtos)) { Database.Update(dto, x => new { x.Alias }); From 39e59efd2268c2bb2a2b02006ae150dededfe8d6 Mon Sep 17 00:00:00 2001 From: Jan Skovgaard <1932158+BatJan@users.noreply.github.com> Date: Mon, 28 Nov 2022 22:54:54 +0100 Subject: [PATCH 06/46] Accessibility: Fix - Missing table description: A data table is present with no description associated to it (#13117) (cherry picked from commit 97fa4d76dcf09a61f026b039479f7ba58bfa97fe) --- src/Umbraco.Core/EmbeddedResources/Lang/en.xml | 1 + src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml | 1 + .../src/views/dashboard/settings/examinemanagement.html | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml index 4d873076c9..641ae75fbb 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml @@ -602,6 +602,7 @@ The health status of the index and if it can be read Indexers Index info + Content in index Lists the properties of the index Manage Examine's indexes Allows you to view the details of each index and provides some tools for diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml index b0f46f7b5c..0fcb0e2959 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml @@ -618,6 +618,7 @@ The health status of the index and if it can be read Indexers Index info + Content in index Lists the properties of the index Manage Examine's indexes Allows you to view the details of each index and provides some tools for diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/examinemanagement.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/examinemanagement.html index 29a9b2efdd..63ef3d9279 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/examinemanagement.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/examinemanagement.html @@ -321,8 +321,8 @@ {{ ::result.values[field] | umbCmsJoinArray:', ' }} - @@ -370,7 +370,7 @@
    - + From 2e271ba766f33c42a0e72d89e62ed3eafcd7f76b Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Wed, 14 Dec 2022 10:35:41 +0100 Subject: [PATCH 07/46] Fix unpublished state for culture variant content in a single language site (#13570) --- src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs b/src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs index 4728ebbca8..7491cbce33 100644 --- a/src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs +++ b/src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs @@ -131,7 +131,7 @@ public class ContentTreeController : ContentTreeControllerBase, ISearchableTreeW var documentEntity = (IDocumentEntitySlim)entity; - if (!documentEntity.Variations.VariesByCulture()) + if (!documentEntity.Variations.VariesByCulture() || culture.IsNullOrWhiteSpace()) { if (!documentEntity.Published) { From ae31c2f5e4b5cdda5c208bec62e369c5051ad147 Mon Sep 17 00:00:00 2001 From: bkclerke Date: Fri, 7 Oct 2022 19:26:24 -0700 Subject: [PATCH 08/46] add aria-labelledby attribute to tags input (cherry picked from commit 1009238f326912d91cfdeec03b8b1323d2f63276) --- .../src/views/components/tags/umb-tags-editor.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/tags/umb-tags-editor.html b/src/Umbraco.Web.UI.Client/src/views/components/tags/umb-tags-editor.html index 35aef1d09b..d52539b86b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/tags/umb-tags-editor.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/tags/umb-tags-editor.html @@ -39,6 +39,7 @@ maxlength="200" localize="placeholder" placeholder="@placeholders_enterTags" + aria-labelledby="{{vm.inputId}}" ng-readonly="vm.readonly" /> From 481d496641ebfd3d8c5428bcf2b8fcb85fabdae4 Mon Sep 17 00:00:00 2001 From: patrickdemooij9 Date: Mon, 28 Nov 2022 22:12:30 +0100 Subject: [PATCH 09/46] Use span in StripFileExtension to speed up and use less memory (#13101) (cherry picked from commit 475cea40a19112e5df9b52e3656fdbf5c89cbe98) --- .../Extensions/StringExtensions.cs | 9 ++- .../StringFileExtensionBenchmark.cs | 80 +++++++++++++++++++ 2 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 tests/Umbraco.Tests.Benchmarks/StringFileExtensionBenchmark.cs diff --git a/src/Umbraco.Core/Extensions/StringExtensions.cs b/src/Umbraco.Core/Extensions/StringExtensions.cs index db3b8e5898..b284a071f9 100644 --- a/src/Umbraco.Core/Extensions/StringExtensions.cs +++ b/src/Umbraco.Core/Extensions/StringExtensions.cs @@ -83,18 +83,19 @@ public static class StringExtensions return fileName; } - var lastIndex = fileName.LastIndexOf('.'); + var spanFileName = fileName.AsSpan(); + var lastIndex = spanFileName.LastIndexOf('.'); if (lastIndex > 0) { - var ext = fileName.Substring(lastIndex); + var ext = spanFileName[lastIndex..]; // file extensions cannot contain whitespace - if (ext.Contains(" ")) + if (ext.Contains(' ')) { return fileName; } - return string.Format("{0}", fileName.Substring(0, fileName.IndexOf(ext, StringComparison.Ordinal))); + return new string(spanFileName[..lastIndex]); } return fileName; diff --git a/tests/Umbraco.Tests.Benchmarks/StringFileExtensionBenchmark.cs b/tests/Umbraco.Tests.Benchmarks/StringFileExtensionBenchmark.cs new file mode 100644 index 0000000000..0c9af70db9 --- /dev/null +++ b/tests/Umbraco.Tests.Benchmarks/StringFileExtensionBenchmark.cs @@ -0,0 +1,80 @@ +using System; +using BenchmarkDotNet.Attributes; +using Umbraco.Tests.Benchmarks.Config; + +namespace Umbraco.Tests.Benchmarks +{ + [QuickRunWithMemoryDiagnoserConfig] + public class StringFileExtensionBenchmark + { + [Arguments("smallText.txt")] + [Arguments("aVeryLongTextThatContainsALotOfCharacters.txt")] + [Arguments("NotEvenAFile")] + [Benchmark(Baseline = true)] + public string StringStrip(string fileName) + { + // filenames cannot contain line breaks + if (fileName.Contains(Environment.NewLine) || fileName.Contains("\r") || fileName.Contains("\n")) + { + return fileName; + } + + var lastIndex = fileName.LastIndexOf('.'); + if (lastIndex > 0) + { + var ext = fileName.Substring(lastIndex); + + // file extensions cannot contain whitespace + if (ext.Contains(" ")) + { + return fileName; + } + + return string.Format("{0}", fileName.Substring(0, fileName.IndexOf(ext, StringComparison.Ordinal))); + } + + return fileName; + } + + [Arguments("smallText.txt")] + [Arguments("aVeryLongTextThatContainsALotOfCharacters.txt")] + [Arguments("NotEvenAFile")] + [Benchmark] + public string SpanStrip(string fileName) + { + // filenames cannot contain line breaks + if (fileName.Contains(Environment.NewLine) || fileName.Contains("\r") || fileName.Contains("\n")) + { + return fileName; + } + + var spanFileName = fileName.AsSpan(); + var lastIndex = spanFileName.LastIndexOf('.'); + if (lastIndex > 0) + { + var ext = spanFileName[lastIndex..]; + + // file extensions cannot contain whitespace + if (ext.Contains(' ')) + { + return fileName; + } + + return new string(spanFileName[..lastIndex]); + } + + return fileName; + } + } + + //| Method | fileName | Mean | Error | StdDev | Ratio | Gen 0 | Allocated | + //|------------ |--------------------- |----------:|----------:|---------:|------:|-------:|----------:| + //| StringStrip | NotEvenAFile | 45.08 ns | 1.277 ns | 0.070 ns | 1.00 | - | - | + //| SpanStrip | NotEvenAFile | 45.13 ns | 6.131 ns | 0.336 ns | 1.00 | - | - | + //| | | | | | | | | + //| StringStrip | aVery(...)s.txt[45] | 234.10 ns | 28.303 ns | 1.551 ns | 1.00 | 0.0751 | 240 B | + //| SpanStrip | aVery(...)s.txt[45] | 98.37 ns | 14.839 ns | 0.813 ns | 0.42 | 0.0331 | 104 B | + //| | | | | | | | | + //| StringStrip | smallText.txt | 187.79 ns | 35.672 ns | 1.955 ns | 1.00 | 0.0348 | 112 B | + //| SpanStrip | smallText.txt | 62.46 ns | 13.795 ns | 0.756 ns | 0.33 | 0.0124 | 40 B | +} From 303abaea28b26b2b6f6e904ee2811b3d8f6b4fe8 Mon Sep 17 00:00:00 2001 From: Karl Butler Date: Mon, 28 Nov 2022 20:17:04 +0000 Subject: [PATCH 10/46] Accessibility Fixes for Users and Packages pages (#13087) (cherry picked from commit 2d560e976600cff20e5010483b6327b229b74086) --- .../src/views/components/html/umb-control-group.html | 2 +- .../src/views/packages/views/installed.html | 2 +- .../src/views/users/views/users/users.html | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/html/umb-control-group.html b/src/Umbraco.Web.UI.Client/src/views/components/html/umb-control-group.html index 1d635d2bc5..dff71a0c4d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/html/umb-control-group.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/html/umb-control-group.html @@ -1,7 +1,7 @@
    -
    -

    +

    Create user -

    +

    Create new users to give them access to Umbraco. When a new user is created a password will be generated that you can share with the user.

    @@ -319,7 +319,7 @@
    - Required @@ -329,7 +329,7 @@ - Required @@ -339,7 +339,7 @@ - Required From c0d5b544f5616c1d9638c8286c1736676e9b8bbc Mon Sep 17 00:00:00 2001 From: Lars-Erik Aabech Date: Mon, 10 Oct 2022 12:40:02 +0200 Subject: [PATCH 11/46] Ensure culture is always set in `LocalizeText` (cherry picked from commit 4d23e8a6bd1c5e8637089a7c5d49cdffbf7495d6) --- .../Controllers/BackOfficeController.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs index f8d579e952..43e99622c1 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs @@ -263,7 +263,7 @@ public class BackOfficeController : UmbracoController [AllowAnonymous] public async Task>> LocalizedText(string? culture = null) { - CultureInfo? cultureInfo; + CultureInfo? cultureInfo = null; if (string.IsNullOrWhiteSpace(culture)) { // Force authentication to occur since this is not an authorized endpoint, we need this to get a user. @@ -272,9 +272,12 @@ public class BackOfficeController : UmbracoController // It's entirely likely for a user to have a different culture in the backoffice, than their system. IIdentity? user = authenticationResult.Principal?.Identity; - cultureInfo = authenticationResult.Succeeded && user is not null - ? user.GetCulture() - : CultureInfo.GetCultureInfo(_globalSettings.DefaultUILanguage); + if (authenticationResult.Succeeded && user is not null) + { + cultureInfo = user.GetCulture(); + } + + cultureInfo ??= CultureInfo.GetCultureInfo(_globalSettings.DefaultUILanguage); } else { From d46d5aac0dad1aa54950edb8f165618e11bfceeb Mon Sep 17 00:00:00 2001 From: CyberReiter Date: Wed, 12 Oct 2022 07:51:43 +0200 Subject: [PATCH 12/46] Use ToArray instead of ToList (cherry picked from commit f99378c5d3e98565ada31d8c43466021cb30be7e) --- .../Persistence/NuCacheContentRepository.cs | 8 +-- .../CollectionBenchmarks.cs | 57 +++++++++++++++++++ 2 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 tests/Umbraco.Tests.Benchmarks/CollectionBenchmarks.cs diff --git a/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs b/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs index cb4439f2ae..cb2feb55c3 100644 --- a/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs +++ b/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs @@ -486,7 +486,7 @@ WHERE cmsContentNu.nodeId IN ( Guid mediaObjectType = Constants.ObjectTypes.Media; // remove all - if anything fails the transaction will rollback - if (contentTypeIds == null || contentTypeIds.Count == 0) + if (contentTypeIds is null || contentTypeIds.Count == 0) { // must support SQL-CE Database.Execute( @@ -513,7 +513,7 @@ WHERE cmsContentNu.nodeId IN ( // insert back - if anything fails the transaction will rollback IQuery query = SqlContext.Query(); - if (contentTypeIds != null && contentTypeIds.Count > 0) + if (contentTypeIds is not null && contentTypeIds.Count > 0) { query = query.WhereIn(x => x.ContentTypeId, contentTypeIds); // assume number of ctypes won't blow IN(...) } @@ -526,9 +526,9 @@ WHERE cmsContentNu.nodeId IN ( // the tree is locked, counting and comparing to total is safe IEnumerable descendants = _mediaRepository.GetPage(query, pageIndex++, groupSize, out total, null, Ordering.By("Path")); - var items = descendants.Select(m => GetDto(m, false, serializer)).ToList(); + var items = descendants.Select(m => GetDto(m, false, serializer)).ToArray(); Database.BulkInsertRecords(items); - processed += items.Count; + processed += items.Length; } while (processed < total); } diff --git a/tests/Umbraco.Tests.Benchmarks/CollectionBenchmarks.cs b/tests/Umbraco.Tests.Benchmarks/CollectionBenchmarks.cs new file mode 100644 index 0000000000..7944e7bbe3 --- /dev/null +++ b/tests/Umbraco.Tests.Benchmarks/CollectionBenchmarks.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; +using System.Linq; +using BenchmarkDotNet.Attributes; + +namespace Umbraco.Tests.Benchmarks +{ + [MemoryDiagnoser] + public class CollectionBenchmarks + { + private static readonly IEnumerable _enumerable = Enumerable.Range(0, 1000); + private static readonly int[] _array = _enumerable.ToArray(); + private static readonly List _list = _enumerable.ToList(); + + [Benchmark] + public int[] ToArray() + { + return _enumerable.ToArray(); + } + + [Benchmark] + public List ToList() + { + return _enumerable.ToList(); + } + + [Benchmark] + public void IterateArray() + { + foreach (int item in _array) + { + + } + } + + [Benchmark] + public void IterateList() + { + foreach (int item in _list) + { + } + } + + //BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19044.2006 (21H2) + //Intel Core i9-10885H CPU 2.40GHz, 1 CPU, 16 logical and 8 physical cores + //.NET SDK= 6.0.401 + // [Host] : .NET 6.0.9 (6.0.922.41905), X64 RyuJIT + // DefaultJob : .NET 6.0.9 (6.0.922.41905), X64 RyuJIT + // + // + //| Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Allocated | + //|------------- |-----------:|---------:|---------:|-------:|-------:|----------:| + //| ToArray | 503.8 ns | 5.11 ns | 4.53 ns | 0.4807 | 0.0067 | 4,024 B | + //| ToList | 1,369.0 ns | 25.38 ns | 49.50 ns | 0.4845 | 0.0134 | 4,056 B | + //| IterateArray | 244.9 ns | 3.29 ns | 2.75 ns | - | - | - | + //| IterateList | 620.5 ns | 4.45 ns | 3.95 ns | - | - | - | + } +} From 2f1ef296905702f3cdfc206210dee28ccca2ce5e Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Tue, 22 Nov 2022 10:57:31 +0100 Subject: [PATCH 13/46] Adjust sorting of block grid editor groups to y-axis only (#13225) fixes https://github.com/umbraco/Umbraco-CMS/issues/13180 (cherry picked from commit d4c5f5017f636f1b6ffb8286a576789cc8e82a27) # Conflicts: # src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.controller.js --- ...blockgrid.blockconfiguration.controller.js | 62 ++++++++++--------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.controller.js index 993088e2eb..5db003520b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.controller.js @@ -38,12 +38,12 @@ "groupKey": null }; - function BlockConfigurationController($scope, $element, $http, elementTypeResource, overlayService, localizationService, editorService, eventsService, udiService, dataTypeResource, umbRequestHelper) { var unsubscribe = []; - - var vm = this; + + const vm = this; + vm.openBlock = null; vm.showSampleDataCTA = false; @@ -57,6 +57,7 @@ if (blockGroupModel.value == null) { blockGroupModel.value = []; } + vm.blockGroups = blockGroupModel.value; if (!$scope.model.value) { @@ -72,12 +73,10 @@ }); loadElementTypes(); - } - function loadElementTypes() { - return elementTypeResource.getAll().then(function (elementTypes) { + return elementTypeResource.getAll().then(elementTypes => { vm.elementTypes = elementTypes; }); } @@ -90,6 +89,7 @@ } } } + unsubscribe.push(eventsService.on("editors.documentType.saved", updateUsedElementTypes)); function removeReferencesToElementTypeKey(contentElementTypeKey) { @@ -134,25 +134,27 @@ vm.removeBlockByIndex = function (index) { const blockType = $scope.model.value[index]; - if(blockType) { + if (blockType) { $scope.model.value.splice(index, 1); removeReferencesToElementTypeKey(blockType.contentElementTypeKey); } }; const defaultOptions = { - axis: '', tolerance: "pointer", opacity: 0.7, scroll: true }; + vm.groupSortableOptions = { - ...defaultOptions, + ...defaultOptions, + axis: 'y', handle: '.__handle', items: ".umb-block-card-group", cursor: "grabbing", placeholder: 'umb-block-card-group --sortable-placeholder' }; + vm.blockSortableOptions = { ...defaultOptions, "ui-floating": true, @@ -170,7 +172,6 @@ } }; - vm.getAvailableElementTypes = function () { return vm.elementTypes.filter(function (type) { return !$scope.model.value.find(function (entry) { @@ -201,18 +202,18 @@ if (node.metaData.isElement === true) { var key = udiService.getKey(node.udi); // If a Block with this ElementType as content already exists, we will emit it as a possible option. - return $scope.model.value.find(function (entry) { + return $scope.model.value.find(function(entry) { return key === entry.contentElementTypeKey; }); } return true; }, filterCssClass: "not-allowed", - select: function (node) { + select: function(node) { vm.addBlockFromElementTypeKey(udiService.getKey(node.udi), groupKey); editorService.close(); }, - close: function () { + close: function() { editorService.close(); }, extraActions: [ @@ -241,13 +242,13 @@ infiniteMode: true, noTemplate: true, isElement: true, - submit: function (model) { - loadElementTypes().then( function () { + submit: function(model) { + loadElementTypes().then(function() { callback(model.documentTypeKey); }); editorService.close(); }, - close: function () { + close: function() { editorService.close(); } }; @@ -261,24 +262,19 @@ $scope.model.value.push(blockType); vm.openBlockOverlay(blockType); - }; - - - - vm.openBlockOverlay = function (block, openAreas) { var elementType = vm.getElementTypeByKey(block.contentElementTypeKey); - - if(elementType) { + + if (elementType) { localizationService.localize("blockEditor_blockConfigurationOverlayTitle", [elementType.name]).then(function (data) { var clonedBlockData = Utilities.copy(block); vm.openBlock = block; - var overlayModel = { + const overlayModel = { block: clonedBlockData, allBlockTypes: $scope.model.value, allBlockGroups: vm.blockGroups, @@ -305,14 +301,24 @@ }); } else { - alert("Cannot be edited cause ElementType does not exist."); + + const overlay = { + close: () => { + overlayService.close() + } + }; + + localizationService.localize("blockEditor_elementTypeDoesNotExist").then(data => { + overlay.content = data; + overlayService.open(overlay); + }); } }; vm.requestRemoveGroup = function(blockGroup) { - if(blockGroup.key) { + if (blockGroup.key) { localizationService.localizeMany(["general_delete", "blockEditor_confirmDeleteBlockGroupMessage", "blockEditor_confirmDeleteBlockGroupNotice"]).then(function (data) { overlayService.confirmDelete({ title: data[0], @@ -354,10 +360,8 @@ } } - - dataTypeResource.getAll().then(function(dataTypes) { - if(dataTypes.filter(x => x.alias === "Umbraco.BlockGrid").length === 0) { + if (dataTypes.filter(x => x.alias === "Umbraco.BlockGrid").length === 0) { vm.showSampleDataCTA = true; } }); From c0d022be10306cbf9d31027d8d87db6abea1540a Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Wed, 14 Dec 2022 11:00:12 +0100 Subject: [PATCH 14/46] Fix wrongfully reported pending package migrations (#13574) --- .../Services/Implement/PackagingService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs b/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs index 62663e165c..a0330d75fd 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs @@ -133,7 +133,7 @@ public class PackagingService : IPackagingService var currentPlans = installedPackage.PackageMigrationPlans.ToList(); if (keyValues is null || keyValues.TryGetValue( Constants.Conventions.Migrations.KeyValuePrefix + plan.Name, - out var currentState)) + out var currentState) is false) { currentState = null; } From b87b9bebe25008e7ca0af1f0502ff2a1fe5ab721 Mon Sep 17 00:00:00 2001 From: Marc Goodson Date: Wed, 30 Nov 2022 14:36:23 +0000 Subject: [PATCH 15/46] Adjust the wording of some of the helper text around the new Block Grid editor (#13484) (cherry picked from commit 2461b7d805cb2f279d8e2df7f63d6fbc923e8af3) # Conflicts: # src/Umbraco.Core/EmbeddedResources/Lang/en.xml # src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml --- src/Umbraco.Core/EmbeddedResources/Lang/en.xml | 12 ++++++------ src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml | 12 ++++++------ .../PropertyEditors/BlockGridConfiguration.cs | 8 ++++---- .../blockgrid.blockconfiguration.area.overlay.html | 4 ++-- .../blockgrid.blockconfiguration.overlay.html | 2 +- .../umb-block-grid-area-allowance-editor.html | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml index 641ae75fbb..86d7dcec77 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml @@ -2777,29 +2777,29 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Size options Define one or more size options, this enables resizing of the Block Available column spans - Define the different number of columns this block is allowed to span across. This does not prevent Blocks to be placed in Areas of a smaller column span. + Define the different number of columns this block is allowed to span across. This does not prevent Blocks from being placed in Areas with a smaller column span. Available row spans Define the range of layout rows this block is allowed to span across. Allow in root Make this block available in the root of the layout. Allow in areas - Make this block available within other Blocks. - When empty all Blocks allowed for Areas can be created. + Make this block available for use within the areas of other Blocks (unless explicit permissions are set for these areas). + By default, all block types are allowed in an Area, Use this option to allow only selected types. Areas Grid Columns for Areas Define how many columns that will be available for areas. If not defined, the number of columns defined for the entire layout will be used. Areas - To enable nesting of blocks within this block, define one or more areas for blocks to be nested within. Areas follow their own layout witch is defined by the Grid Columns for Areas. Each Area column span and row span can be adjusted by using the scale-handler in the bottom right corner. + To enable the nesting of blocks within this block, define one or more areas. Areas follow the layout defined by their own grid column configuration. The 'column span' and 'row span' for each area can be adjusted by using the scale-handler box in the bottom right hand corner of the selected area. %0% is not allowed at this spot.]]> Default layout stylesheet Disallowed content was rejected - + Drag to scale Create Button Label - Overwrite the label on the create button of this Area. + Override the label text for adding a new Block to this Area, Example: 'Add Widget' Show resize options Add Block Add group diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml index 0fcb0e2959..9c8a9fa6c0 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml @@ -2879,29 +2879,29 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Size options Define one or more size options, this enables resizing of the Block Available column spans - Define the different number of columns this block is allowed to span across. This does not prevent Blocks to be placed in Areas of a smaller column span. + Define the different number of columns this block is allowed to span across. This does not prevent Blocks from being placed in Areas with a smaller column span. Available row spans Define the range of layout rows this block is allowed to span across. Allow in root Make this block available in the root of the layout. Allow in areas - Make this block available within other Blocks. - When empty all Blocks allowed for Areas can be created. + Make this block available for use within the areas of other Blocks (unless explicit permissions are set for these areas). + By default, all block types are allowed in an Area, Use this option to allow only selected types. Areas Grid Columns for Areas Define how many columns that will be available for areas. If not defined, the number of columns defined for the entire layout will be used. Areas - To enable nesting of blocks within this block, define one or more areas for blocks to be nested within. Areas follow their own layout witch is defined by the Grid Columns for Areas. Each Area column span and row span can be adjusted by using the scale-handler in the bottom right corner. + To enable the nesting of blocks within this block, define one or more areas. Areas follow the layout defined by their own grid column configuration. The 'column span' and 'row span' for each area can be adjusted by using the scale-handler box in the bottom right hand corner of the selected area. %0% is not allowed at this spot.]]> Default layout stylesheet Disallowed content was rejected - + Drag to scale Create Button Label - Overwrite the label on the create button of this Area. + Override the label text for adding a new Block to this Area, Example: 'Add Widget' Show resize options Add Block Add group diff --git a/src/Umbraco.Core/PropertyEditors/BlockGridConfiguration.cs b/src/Umbraco.Core/PropertyEditors/BlockGridConfiguration.cs index f635eb6324..1fab493825 100644 --- a/src/Umbraco.Core/PropertyEditors/BlockGridConfiguration.cs +++ b/src/Umbraco.Core/PropertyEditors/BlockGridConfiguration.cs @@ -10,13 +10,13 @@ namespace Umbraco.Cms.Core.PropertyEditors; /// public class BlockGridConfiguration { - [ConfigurationField("blocks", "Blocks", "views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.html", Description = "Define Blocks based on Element Types.")] + [ConfigurationField("blocks", "Blocks", "views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.html", Description = "Define Blocks based on Element Types. Use Groups to help organise their selection. Example Groups: 'Layout' and 'Content'")] public BlockGridBlockConfiguration[] Blocks { get; set; } = Array.Empty(); [ConfigurationField("blockGroups", "Block Groups", "views/propertyeditors/blockgrid/prevalue/blockgrid.groupconfiguration.html", HideLabel = true)] public BlockGridGroupConfiguration[] BlockGroups { get; set; } = Array.Empty(); - [ConfigurationField("validationLimit", "Amount", "numberrange", Description = "Set a required range of blocks")] + [ConfigurationField("validationLimit", "Amount", "numberrange", Description = "Set the required range for the allowed number of blocks")] public NumberRange ValidationLimit { get; set; } = new NumberRange(); [ConfigurationField("useLiveEditing", "Live editing mode", "boolean", Description = "Live update content when editing in overlay")] @@ -28,10 +28,10 @@ public class BlockGridConfiguration [ConfigurationField("gridColumns", "Grid Columns", "number", Description = "Set the number of columns for the layout. (defaults to 12)")] public int? GridColumns { get; set; } - [ConfigurationField("layoutStylesheet", "Layout Stylesheet", "views/propertyeditors/blockgrid/prevalue/blockgrid.stylesheetpicker.html", Description = "Overwrite default stylesheet for layout.")] + [ConfigurationField("layoutStylesheet", "Layout Stylesheet", "views/propertyeditors/blockgrid/prevalue/blockgrid.stylesheetpicker.html", Description = "Override default stylesheet for backoffice layout.")] public string? LayoutStylesheet { get; set; } - [ConfigurationField("createLabel", "Create Button Label", "textstring", Description = "Overwrite the root create button label")] + [ConfigurationField("createLabel", "Create Button Label", "textstring", Description = "Override the label text for adding a new block, Example 'Add Widget'")] public string? CreateLabel { get; set; } [DataContract] diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.area.overlay.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.area.overlay.html index a4ba0db72e..650ca29629 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.area.overlay.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.area.overlay.html @@ -29,7 +29,7 @@ * - The alias will be printed by GetBlockGridHTML(), use the alias to target the Element representing this area. Ex. .umb-block-grid__area[data-area-alias="MyAreaAlias"] { ... } + When using GetBlockGridHTML() to render the Block Grid, the alias will be rendered in the markup as a 'data-area-alias' attribute. Use the alias attribute to target the element for the area. Example. .umb-block-grid__area[data-area-alias="MyAreaAlias"] { ... }
    @@ -48,7 +48,7 @@
    - Overwrite the label on the create button of this Area. + Override the label text for adding a new Block to this Area, Example: 'Add Widget'
    diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.overlay.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.overlay.html index 0dbaf98b3c..7a55d3a0b6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.overlay.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.overlay.html @@ -210,7 +210,7 @@
    - To enable nesting of blocks within this block, define one or more areas for blocks to be nested within. Areas follow their own layout witch is defined by the Area Layout Columns. Each Areas column and row span can be adjusted by using the scale-handler in the bottom right. + To enable the nesting of blocks within this block, define one or more areas. Areas follow the layout defined by their own grid column configuration. The 'column span' and 'row span' for each area can be adjusted by using the scale-handler box in the bottom right hand corner of the selected area.
    diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-area-allowance-editor.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-area-allowance-editor.html index 55ceb941bb..f6d22780d7 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-area-allowance-editor.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-area-allowance-editor.html @@ -57,7 +57,7 @@
    - When empty all Blocks allowed for Areas can be created. + By default, all block types are allowed in an Area, Use this option to allow only selected types.
    From dc2701cb5eb12a4050428c572e86199ea70927b5 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Wed, 14 Dec 2022 11:39:36 +0100 Subject: [PATCH 16/46] Handle StringValues in ObjectExtensions.TryConvertTo (#13575) --- .../Extensions/ObjectExtensions.cs | 6 ++- .../CoreThings/ObjectExtensionsTests.cs | 51 +++++++++++++++++++ 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Extensions/ObjectExtensions.cs b/src/Umbraco.Core/Extensions/ObjectExtensions.cs index 6dc220446b..f0f10d8cc6 100644 --- a/src/Umbraco.Core/Extensions/ObjectExtensions.cs +++ b/src/Umbraco.Core/Extensions/ObjectExtensions.cs @@ -8,6 +8,7 @@ using System.Linq.Expressions; using System.Reflection; using System.Runtime.CompilerServices; using System.Xml; +using Microsoft.Extensions.Primitives; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Collections; @@ -189,9 +190,10 @@ public static class ObjectExtensions else { // target is not a generic type - if (input is string inputString) + var inputString = input as string ?? (input is StringValues sv ? sv.ToString() : null); + if (inputString != null) { - // Try convert from string, returns an Attempt if the string could be + // Try convert from string or StringValues, returns an Attempt if the string could be // processed (either succeeded or failed), else null if we need to try // other methods Attempt? result = TryConvertToFromString(inputString, target); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/ObjectExtensionsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/ObjectExtensionsTests.cs index dc87f7094c..bfbe581f2e 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/ObjectExtensionsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/ObjectExtensionsTests.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Threading; +using Microsoft.Extensions.Primitives; using NUnit.Framework; using Umbraco.Cms.Core.PropertyEditors; using Umbraco.Cms.Tests.Common.TestHelpers; @@ -281,6 +282,56 @@ public class ObjectExtensionsTests Assert.AreEqual(new DateTime(2016, 6, 7), conv.Result); } + [TestCase("d72f12a9-29db-42b4-9ffb-25a3ba4dcef5")] + [TestCase("D72F12A9-29DB-42B4-9FFB-25A3BA4DCEF5")] + public void CanConvertToGuid(string guidValue) + { + var conv = guidValue.TryConvertTo(); + Assert.IsTrue(conv); + Assert.AreEqual(Guid.Parse(guidValue), conv.Result); + } + + [TestCase("d72f12a9-29db-42b4-9ffb-25a3ba4dcef5")] + [TestCase("D72F12A9-29DB-42B4-9FFB-25A3BA4DCEF5")] + public void CanConvertToNullableGuid(string guidValue) + { + var conv = guidValue.TryConvertTo(); + Assert.IsTrue(conv); + Assert.AreEqual(Guid.Parse(guidValue), conv.Result); + } + + [TestCase("d72f12a9-29db-42b4-9ffb-25a3ba4dcef5")] + [TestCase("D72F12A9-29DB-42B4-9FFB-25A3BA4DCEF5")] + public void CanConvertStringValuesToNullableGuid(string guidValue) + { + StringValues stringValues = guidValue; + var conv = stringValues.TryConvertTo(); + Assert.IsTrue(conv); + Assert.AreEqual(Guid.Parse(guidValue), conv.Result); + } + + [TestCase(10)] + [TestCase(0)] + [TestCase(-10)] + [TestCase(int.MinValue)] + [TestCase(int.MaxValue)] + public void CanConvertStringValuesToInt(int intValue) + { + StringValues stringValues = intValue.ToString(); + var conv = stringValues.TryConvertTo(); + Assert.IsTrue(conv); + Assert.AreEqual(intValue, conv.Result); + } + + [Test] + public void CanConvertStringValuesToString() + { + StringValues stringValues = "This is a string"; + var conv = stringValues.TryConvertTo(); + Assert.IsTrue(conv); + Assert.AreEqual("This is a string", conv.Result); + } + [Test] public void Value_Editor_Can_Convert_Decimal_To_Decimal_Clr_Type() { From ea3c862228084f41491b98de1b9c87574d889e54 Mon Sep 17 00:00:00 2001 From: Vitor Rodrigues Date: Wed, 26 Oct 2022 09:28:07 +0200 Subject: [PATCH 17/46] Added missing content-type header to BootFailedMiddleware response When Umbraco is configured with X-Content-Type-Options nosniff as is recommended (there's even a health check for it), any boot failure would simply show the html source code in the browser instead of properly rendering the html, as the content-type wasn't being set. (cherry picked from commit d4c921264d50cd8adc31b1671e00b9b218d54761) --- src/Umbraco.Web.Common/Middleware/BootFailedMiddleware.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Umbraco.Web.Common/Middleware/BootFailedMiddleware.cs b/src/Umbraco.Web.Common/Middleware/BootFailedMiddleware.cs index 11abf725c2..70c4d0c8b8 100644 --- a/src/Umbraco.Web.Common/Middleware/BootFailedMiddleware.cs +++ b/src/Umbraco.Web.Common/Middleware/BootFailedMiddleware.cs @@ -1,3 +1,4 @@ +using System.Net.Mime; using System.Text; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; @@ -51,6 +52,7 @@ public class BootFailedMiddleware : IMiddleware // Print a nice error page context.Response.Clear(); context.Response.StatusCode = 500; + context.Response.ContentType = MediaTypeNames.Text.Html; IFileInfo? fileInfo = GetBootErrorFileInfo(); if (fileInfo is not null) From 57a29e40856d854ba9efdf2cc144685aebaca82e Mon Sep 17 00:00:00 2001 From: Vitor Rodrigues Date: Thu, 27 Oct 2022 11:42:01 +0200 Subject: [PATCH 18/46] Re-use any existing ReloadableLogger It's possible that consumers have already set up a bootstrap logger themselves before Umbraco had a chance too, if that's the case we just reload it. (cherry picked from commit 7ad1e638e6f269fe278d97b550797f8a8db22a2f) --- .../Extensions/ServiceCollectionExtensions.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.Common/Extensions/ServiceCollectionExtensions.cs b/src/Umbraco.Web.Common/Extensions/ServiceCollectionExtensions.cs index 9a9d606644..c9cd08516d 100644 --- a/src/Umbraco.Web.Common/Extensions/ServiceCollectionExtensions.cs +++ b/src/Umbraco.Web.Common/Extensions/ServiceCollectionExtensions.cs @@ -96,11 +96,18 @@ public static class ServiceCollectionExtensions // Bootstrap logger setup /////////////////////////////////////////////// - LoggerConfiguration serilogConfig = new LoggerConfiguration() + Func serilogConfig = cfg => cfg .MinimalConfiguration(hostEnvironment, loggingConfig, umbracoFileConfiguration) .ReadFrom.Configuration(configuration); - Log.Logger = serilogConfig.CreateBootstrapLogger(); + if (Log.Logger is ReloadableLogger reloadableLogger) + { + reloadableLogger.Reload(serilogConfig); + } + else + { + Log.Logger = serilogConfig(new LoggerConfiguration()).CreateBootstrapLogger(); + } /////////////////////////////////////////////// // Runtime logger setup From 328f5e08171de5da3c554e660f62e12ffe44b9ca Mon Sep 17 00:00:00 2001 From: CyberReiter Date: Wed, 5 Oct 2022 08:00:36 +0200 Subject: [PATCH 19/46] make use of spans in UriExtensions to make them faster (cherry picked from commit 02dcf98e3d7e7ba8f7be05ea8d1a5c7c96bab515) --- src/Umbraco.Core/Extensions/UriExtensions.cs | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Core/Extensions/UriExtensions.cs b/src/Umbraco.Core/Extensions/UriExtensions.cs index 60ef7b6a7e..3868586e44 100644 --- a/src/Umbraco.Core/Extensions/UriExtensions.cs +++ b/src/Umbraco.Core/Extensions/UriExtensions.cs @@ -1,6 +1,7 @@ // Copyright (c) Umbraco. // See LICENSE for more details. +using System; using System.Net; using System.Web; using Umbraco.Cms.Core; @@ -75,14 +76,14 @@ public static class UriExtensions } // cannot get .AbsolutePath on relative uri (InvalidOperation) - var s = uri.OriginalString; + var s = uri.OriginalString.AsSpan(); // TODO: Shouldn't this just use Uri.GetLeftPart? - var posq = s.IndexOf("?", StringComparison.Ordinal); - var posf = s.IndexOf("#", StringComparison.Ordinal); + var posq = s.IndexOf('?'); + var posf = s.IndexOf('#'); var pos = posq > 0 ? posq : posf > 0 ? posf : 0; - var path = pos > 0 ? s.Substring(0, pos) : s; - return path; + var path = pos > 0 ? s[..pos] : s; + return new string(path); } /// @@ -188,12 +189,12 @@ public static class UriExtensions } // cannot get .Query on relative uri (InvalidOperation) - var s = uri.OriginalString; - var posq = s.IndexOf("?", StringComparison.Ordinal); - var posf = s.IndexOf("#", StringComparison.Ordinal); - var query = posq < 0 ? null : (posf < 0 ? s.Substring(posq) : s.Substring(posq, posf - posq)); + var s = uri.OriginalString.AsSpan(); + var posq = s.IndexOf('?'); + var posf = s.IndexOf('#'); + var query = posq < 0 ? null : (posf < 0 ? s[posq..] : s.Slice(posq, posf - posq)); - return query; + return new string(query); } /// From a0e8049916478ea046857c85c7968d959935db92 Mon Sep 17 00:00:00 2001 From: Lotte Pitcher Date: Wed, 30 Nov 2022 15:08:54 +0000 Subject: [PATCH 20/46] Remove reference to installing a local package via backoffice (#13330) (cherry picked from commit da9eae1252cae9e847d9b0c9f545f48011e42634) --- src/Umbraco.Core/EmbeddedResources/Lang/en.xml | 4 ++-- src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml | 4 ++-- .../src/views/packages/views/installed.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml index 86d7dcec77..812b46693d 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml @@ -1301,9 +1301,9 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Install instructions This package has no configuration view No packages have been created yet - You don’t have any packages installed + No packages have been installed - 'Packages' icon in the top right of your screen]]> + 'Packages' icon in the top right of your screen]]> Package Content License Search for packages diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml index 9c8a9fa6c0..bacfa4e387 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml @@ -1329,9 +1329,9 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Install instructions This package has no configuration view No packages have been created yet - You don’t have any packages installed + No packages have been installed - 'Packages' icon in the top right of your screen]]> + 'Packages' icon in the top right of your screen]]> Package Content License Search for packages diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/views/installed.html b/src/Umbraco.Web.UI.Client/src/views/packages/views/installed.html index b68af6065e..248e926c98 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packages/views/installed.html +++ b/src/Umbraco.Web.UI.Client/src/views/packages/views/installed.html @@ -52,8 +52,8 @@ -

    You don’t have any packages installed.

    -

    You don’t have any packages installed. Either install a local package by selecting it from your machine, or browse through available packages using the "Packages" icon in the top right of your screen.

    +

    No packages have been installed.

    +

    Browse through the available packages using the 'Packages' icon in the top right of your screen.

    From 3bd9da00ccebb0bb96e7aee20d13820df54cb500 Mon Sep 17 00:00:00 2001 From: Markus Johansson Date: Mon, 7 Nov 2022 00:55:02 +0100 Subject: [PATCH 21/46] LogViewe: Adding support for destructed properties (cherry picked from commit d2ab80534a9ed2794e9ae607d5a275cd26e14597) --- src/Umbraco.Web.UI.Client/src/views/logViewer/search.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/logViewer/search.html b/src/Umbraco.Web.UI.Client/src/views/logViewer/search.html index f506ab11ae..2b79474355 100644 --- a/src/Umbraco.Web.UI.Client/src/views/logViewer/search.html +++ b/src/Umbraco.Web.UI.Client/src/views/logViewer/search.html @@ -203,7 +203,12 @@ {{val.Value}} - {{val.Value}} + + + {{val.Value}} + +
    {{val | json}}
    +
    From 04be6889ab3260f063765a5a01c590d4f1592841 Mon Sep 17 00:00:00 2001 From: Justin Neville Date: Thu, 17 Nov 2022 15:04:25 +0000 Subject: [PATCH 22/46] Allow empty valuesets to be indexed so the back-offce does not hang when rebuilding empty indexes (cherry picked from commit 88ff05a8364981025362f335be97a6d770e20a1a) --- .../Examine/ContentIndexPopulator.cs | 52 ++++++++----------- .../Examine/MediaIndexPopulator.cs | 9 ++-- .../Examine/MemberIndexPopulator.cs | 9 ++-- 3 files changed, 29 insertions(+), 41 deletions(-) diff --git a/src/Umbraco.Infrastructure/Examine/ContentIndexPopulator.cs b/src/Umbraco.Infrastructure/Examine/ContentIndexPopulator.cs index 647429ebc4..24a21d1cb8 100644 --- a/src/Umbraco.Infrastructure/Examine/ContentIndexPopulator.cs +++ b/src/Umbraco.Infrastructure/Examine/ContentIndexPopulator.cs @@ -99,15 +99,12 @@ public class ContentIndexPopulator : IndexPopulator { content = _contentService.GetPagedDescendants(contentParentId, pageIndex, pageSize, out _).ToArray(); - if (content.Length > 0) - { - var valueSets = _contentValueSetBuilder.GetValueSets(content).ToList(); + var valueSets = _contentValueSetBuilder.GetValueSets(content).ToList(); - // ReSharper disable once PossibleMultipleEnumeration - foreach (IIndex index in indexes) - { - index.IndexItems(valueSets); - } + // ReSharper disable once PossibleMultipleEnumeration + foreach (IIndex index in indexes) + { + index.IndexItems(valueSets); } pageIndex++; @@ -127,35 +124,32 @@ public class ContentIndexPopulator : IndexPopulator // note: We will filter for published variants in the validator content = _contentService.GetPagedDescendants(contentParentId, pageIndex, pageSize, out _, PublishedQuery, Ordering.By("Path")).ToArray(); - if (content.Length > 0) + var indexableContent = new List(); + + foreach (IContent item in content) { - var indexableContent = new List(); - - foreach (IContent item in content) + if (item.Level == 1) { - if (item.Level == 1) + // first level pages are always published so no need to filter them + indexableContent.Add(item); + publishedPages.Add(item.Id); + } + else + { + if (publishedPages.Contains(item.ParentId)) { - // first level pages are always published so no need to filter them - indexableContent.Add(item); + // only index when parent is published publishedPages.Add(item.Id); - } - else - { - if (publishedPages.Contains(item.ParentId)) - { - // only index when parent is published - publishedPages.Add(item.Id); - indexableContent.Add(item); - } + indexableContent.Add(item); } } + } - var valueSets = _contentValueSetBuilder.GetValueSets(indexableContent.ToArray()).ToList(); + var valueSets = _contentValueSetBuilder.GetValueSets(indexableContent.ToArray()).ToList(); - foreach (IIndex index in indexes) - { - index.IndexItems(valueSets); - } + foreach (IIndex index in indexes) + { + index.IndexItems(valueSets); } pageIndex++; diff --git a/src/Umbraco.Infrastructure/Examine/MediaIndexPopulator.cs b/src/Umbraco.Infrastructure/Examine/MediaIndexPopulator.cs index 19a2a96160..20df2c229e 100644 --- a/src/Umbraco.Infrastructure/Examine/MediaIndexPopulator.cs +++ b/src/Umbraco.Infrastructure/Examine/MediaIndexPopulator.cs @@ -59,13 +59,10 @@ public class MediaIndexPopulator : IndexPopulator { media = _mediaService.GetPagedDescendants(mediaParentId, pageIndex, pageSize, out _).ToArray(); - if (media.Length > 0) + // ReSharper disable once PossibleMultipleEnumeration + foreach (IIndex index in indexes) { - // ReSharper disable once PossibleMultipleEnumeration - foreach (IIndex index in indexes) - { - index.IndexItems(_mediaValueSetBuilder.GetValueSets(media)); - } + index.IndexItems(_mediaValueSetBuilder.GetValueSets(media)); } pageIndex++; diff --git a/src/Umbraco.Infrastructure/Examine/MemberIndexPopulator.cs b/src/Umbraco.Infrastructure/Examine/MemberIndexPopulator.cs index 9dc2102d5e..29f0763e28 100644 --- a/src/Umbraco.Infrastructure/Examine/MemberIndexPopulator.cs +++ b/src/Umbraco.Infrastructure/Examine/MemberIndexPopulator.cs @@ -32,13 +32,10 @@ public class MemberIndexPopulator : IndexPopulator { members = _memberService.GetAll(pageIndex, pageSize, out _).ToArray(); - if (members.Length > 0) + // ReSharper disable once PossibleMultipleEnumeration + foreach (IIndex index in indexes) { - // ReSharper disable once PossibleMultipleEnumeration - foreach (IIndex index in indexes) - { - index.IndexItems(_valueSetBuilder.GetValueSets(members)); - } + index.IndexItems(_valueSetBuilder.GetValueSets(members)); } pageIndex++; From 5f4dc7a9940537d530d99c8ba08bcab6aebf7ba7 Mon Sep 17 00:00:00 2001 From: Justin Neville Date: Thu, 17 Nov 2022 17:00:42 +0000 Subject: [PATCH 23/46] Added aria label to time period on log dashboard (cherry picked from commit 8bf6a9246fe129edfa1d883f3feb99853ab54d7f) --- .../directives/components/umbdatetimepicker.directive.js | 5 +++-- src/Umbraco.Web.UI.Client/src/views/logViewer/overview.html | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbdatetimepicker.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbdatetimepicker.directive.js index 63319fedc2..0a9c01edc4 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbdatetimepicker.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbdatetimepicker.directive.js @@ -72,7 +72,7 @@ Use this directive to render a date time picker var umbDateTimePicker = { template: '' + - '' + + '' + '
    ' + '
    ', controller: umbDateTimePickerCtrl, @@ -88,7 +88,8 @@ Use this directive to render a date time picker onYearChange: '&?', onReady: '&?', onValueUpdate: '&?', - onDayCreate: '&?' + onDayCreate: '&?', + label: '@' } }; diff --git a/src/Umbraco.Web.UI.Client/src/views/logViewer/overview.html b/src/Umbraco.Web.UI.Client/src/views/logViewer/overview.html index eb018db541..b312d0b789 100644 --- a/src/Umbraco.Web.UI.Client/src/views/logViewer/overview.html +++ b/src/Umbraco.Web.UI.Client/src/views/logViewer/overview.html @@ -83,12 +83,13 @@ - + + on-close="vm.dateRangeChange(selectedDates, dateStr, instance)" + label="timePeriod"> From 0b36c1195e55f2417d317ca3079889221b3732c7 Mon Sep 17 00:00:00 2001 From: Erik-Jan Westendorp Date: Fri, 4 Nov 2022 09:28:28 +0100 Subject: [PATCH 24/46] Use constants instead of hardcoded strings (cherry picked from commit 4f129baebd168a62433b019e4691a5a20974ab04) --- src/Umbraco.Core/Dashboards/AnalyticsDashboard.cs | 2 +- src/Umbraco.Core/Dashboards/ContentDashboard.cs | 2 +- src/Umbraco.Core/Dashboards/ExamineDashboard.cs | 2 +- src/Umbraco.Core/Dashboards/HealthCheckDashboard.cs | 2 +- src/Umbraco.Core/Dashboards/MediaDashboard.cs | 2 +- src/Umbraco.Core/Dashboards/MembersDashboard.cs | 2 +- src/Umbraco.Core/Dashboards/ModelsBuilderDashboard.cs | 2 +- src/Umbraco.Core/Dashboards/ProfilerDashboard.cs | 2 +- src/Umbraco.Core/Dashboards/PublishedStatusDashboard.cs | 2 +- src/Umbraco.Core/Dashboards/RedirectUrlDashboard.cs | 2 +- src/Umbraco.Core/Dashboards/SettingsDashboards.cs | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Core/Dashboards/AnalyticsDashboard.cs b/src/Umbraco.Core/Dashboards/AnalyticsDashboard.cs index 07688832f6..ca56204f5c 100644 --- a/src/Umbraco.Core/Dashboards/AnalyticsDashboard.cs +++ b/src/Umbraco.Core/Dashboards/AnalyticsDashboard.cs @@ -4,7 +4,7 @@ public class AnalyticsDashboard : IDashboard { public string Alias => "settingsAnalytics"; - public string[] Sections => new[] { "settings" }; + public string[] Sections => new[] { Constants.Applications.Settings }; public string View => "views/dashboard/settings/analytics.html"; diff --git a/src/Umbraco.Core/Dashboards/ContentDashboard.cs b/src/Umbraco.Core/Dashboards/ContentDashboard.cs index ff3a0031b3..fecb23aaba 100644 --- a/src/Umbraco.Core/Dashboards/ContentDashboard.cs +++ b/src/Umbraco.Core/Dashboards/ContentDashboard.cs @@ -7,7 +7,7 @@ public class ContentDashboard : IDashboard { public string Alias => "contentIntro"; - public string[] Sections => new[] { "content" }; + public string[] Sections => new[] { Constants.Applications.Content }; public string View => "views/dashboard/default/startupdashboardintro.html"; diff --git a/src/Umbraco.Core/Dashboards/ExamineDashboard.cs b/src/Umbraco.Core/Dashboards/ExamineDashboard.cs index ddd048c99e..c4a68982a9 100644 --- a/src/Umbraco.Core/Dashboards/ExamineDashboard.cs +++ b/src/Umbraco.Core/Dashboards/ExamineDashboard.cs @@ -7,7 +7,7 @@ public class ExamineDashboard : IDashboard { public string Alias => "settingsExamine"; - public string[] Sections => new[] { "settings" }; + public string[] Sections => new[] { Constants.Applications.Settings }; public string View => "views/dashboard/settings/examinemanagement.html"; diff --git a/src/Umbraco.Core/Dashboards/HealthCheckDashboard.cs b/src/Umbraco.Core/Dashboards/HealthCheckDashboard.cs index 85c2053450..2804372d7f 100644 --- a/src/Umbraco.Core/Dashboards/HealthCheckDashboard.cs +++ b/src/Umbraco.Core/Dashboards/HealthCheckDashboard.cs @@ -7,7 +7,7 @@ public class HealthCheckDashboard : IDashboard { public string Alias => "settingsHealthCheck"; - public string[] Sections => new[] { "settings" }; + public string[] Sections => new[] { Constants.Applications.Settings }; public string View => "views/dashboard/settings/healthcheck.html"; diff --git a/src/Umbraco.Core/Dashboards/MediaDashboard.cs b/src/Umbraco.Core/Dashboards/MediaDashboard.cs index 47e45c4270..122b886b50 100644 --- a/src/Umbraco.Core/Dashboards/MediaDashboard.cs +++ b/src/Umbraco.Core/Dashboards/MediaDashboard.cs @@ -7,7 +7,7 @@ public class MediaDashboard : IDashboard { public string Alias => "mediaFolderBrowser"; - public string[] Sections => new[] { "media" }; + public string[] Sections => new[] { Constants.Applications.Media }; public string View => "views/dashboard/media/mediafolderbrowser.html"; diff --git a/src/Umbraco.Core/Dashboards/MembersDashboard.cs b/src/Umbraco.Core/Dashboards/MembersDashboard.cs index f69d0a1ed0..0394fda4a0 100644 --- a/src/Umbraco.Core/Dashboards/MembersDashboard.cs +++ b/src/Umbraco.Core/Dashboards/MembersDashboard.cs @@ -7,7 +7,7 @@ public class MembersDashboard : IDashboard { public string Alias => "memberIntro"; - public string[] Sections => new[] { "member" }; + public string[] Sections => new[] { Constants.Applications.Members }; public string View => "views/dashboard/members/membersdashboardvideos.html"; diff --git a/src/Umbraco.Core/Dashboards/ModelsBuilderDashboard.cs b/src/Umbraco.Core/Dashboards/ModelsBuilderDashboard.cs index 640f6daf6e..30bcd202c2 100644 --- a/src/Umbraco.Core/Dashboards/ModelsBuilderDashboard.cs +++ b/src/Umbraco.Core/Dashboards/ModelsBuilderDashboard.cs @@ -7,7 +7,7 @@ public class ModelsBuilderDashboard : IDashboard { public string Alias => "settingsModelsBuilder"; - public string[] Sections => new[] { "settings" }; + public string[] Sections => new[] {Constants.Applications.Settings }; public string View => "views/dashboard/settings/modelsbuildermanagement.html"; diff --git a/src/Umbraco.Core/Dashboards/ProfilerDashboard.cs b/src/Umbraco.Core/Dashboards/ProfilerDashboard.cs index b84b1529c3..ef6edd51e7 100644 --- a/src/Umbraco.Core/Dashboards/ProfilerDashboard.cs +++ b/src/Umbraco.Core/Dashboards/ProfilerDashboard.cs @@ -7,7 +7,7 @@ public class ProfilerDashboard : IDashboard { public string Alias => "settingsProfiler"; - public string[] Sections => new[] { "settings" }; + public string[] Sections => new[] { Constants.Applications.Settings }; public string View => "views/dashboard/settings/profiler.html"; diff --git a/src/Umbraco.Core/Dashboards/PublishedStatusDashboard.cs b/src/Umbraco.Core/Dashboards/PublishedStatusDashboard.cs index 49709436ab..c852d79adb 100644 --- a/src/Umbraco.Core/Dashboards/PublishedStatusDashboard.cs +++ b/src/Umbraco.Core/Dashboards/PublishedStatusDashboard.cs @@ -7,7 +7,7 @@ public class PublishedStatusDashboard : IDashboard { public string Alias => "settingsPublishedStatus"; - public string[] Sections => new[] { "settings" }; + public string[] Sections => new[] { Constants.Applications.Settings }; public string View => "views/dashboard/settings/publishedstatus.html"; diff --git a/src/Umbraco.Core/Dashboards/RedirectUrlDashboard.cs b/src/Umbraco.Core/Dashboards/RedirectUrlDashboard.cs index 25b064154b..839494c5d9 100644 --- a/src/Umbraco.Core/Dashboards/RedirectUrlDashboard.cs +++ b/src/Umbraco.Core/Dashboards/RedirectUrlDashboard.cs @@ -7,7 +7,7 @@ public class RedirectUrlDashboard : IDashboard { public string Alias => "contentRedirectManager"; - public string[] Sections => new[] { "content" }; + public string[] Sections => new[] { Constants.Applications.Content }; public string View => "views/dashboard/content/redirecturls.html"; diff --git a/src/Umbraco.Core/Dashboards/SettingsDashboards.cs b/src/Umbraco.Core/Dashboards/SettingsDashboards.cs index b9cb572240..f46c52ba90 100644 --- a/src/Umbraco.Core/Dashboards/SettingsDashboards.cs +++ b/src/Umbraco.Core/Dashboards/SettingsDashboards.cs @@ -7,7 +7,7 @@ public class SettingsDashboard : IDashboard { public string Alias => "settingsWelcome"; - public string[] Sections => new[] { "settings" }; + public string[] Sections => new[] { Constants.Applications.Settings }; public string View => "views/dashboard/settings/settingsdashboardintro.html"; From a810c5977423e9503d74cefe03497688d47ca2d1 Mon Sep 17 00:00:00 2001 From: Vlael Layug Date: Fri, 21 Oct 2022 17:35:51 +0800 Subject: [PATCH 25/46] add default culture when there's only 1 language configured (cherry picked from commit f7b42a50cce87d18a23c9a8a11e98c75d30f4bb2) --- src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs b/src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs index 7491cbce33..4cdd8cef7c 100644 --- a/src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs +++ b/src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs @@ -109,6 +109,11 @@ public class ContentTreeController : ContentTreeControllerBase, ISearchableTreeW { var culture = queryStrings?["culture"].ToString(); + if(culture.IsNullOrWhiteSpace()) + { + culture = _localizationService.GetDefaultLanguageIsoCode(); + } + IEnumerable allowedUserOptions = GetAllowedUserMenuItemsForNode(entity); if (CanUserAccessNode(entity, allowedUserOptions, culture)) { From 93c0a4ee38148f591b36727a2a6992ae8988178e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corn=C3=A9=20Hoskam?= Date: Mon, 28 Nov 2022 14:54:03 +0100 Subject: [PATCH 26/46] Added various Block Grid translations (EN & NL) (#13488) * Added various translations * Added another translation * Change request (cherry picked from commit a4e67bf44402776e9e59ecb5fadc02a43929427f) # Conflicts: # src/Umbraco.Core/EmbeddedResources/Lang/en.xml # src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml --- .../EmbeddedResources/Lang/nl.xml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml b/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml index dd1fbfbad6..9e8032c65a 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml @@ -2517,6 +2517,38 @@ Echter, Runway biedt een gemakkelijke basis om je snel op weg te helpen. Als je Eigenschap '%0%' gebruikt editor '%1%' die niet ondersteund wordt in blokken. + Geef focus aan het container blok + Identificatie + Validatie + %0% moet minimaal %2% keer aanwezig zijn.]]> + %0%mag maximaal %3% keer aanwezig zijn.]]> + Hoeveelheid blokken + Sta alleen specifiek bloktype toe + Toegestane bloktypes + Definieer de type blokken die zijn toegestaan in dit gebied, en optioneel hoeveel van ieder type aanwezig moet zijn. + Weet je zeker dat je dit gebied wilt verwijderen? + Alle blokken op dit moment aangemaakt binnen dit gebied zullen worden verwijderd. + Lay-out opties + Structuur + Afmetingen + Definiëer een of meer afmetingen, dit maakt het mogelijk blokken te vergroten/verkleinen + Beschikbare kolommen + Definieer de verschillende aantal kolombreedtes dat dit blok mag in nemen. Dit voorkomt niet dat blokken in gebieden met kleine kolombreedtes kan worden geplaatst. + Beschikbare rijen + Definiëer de verschillende aantal rijen dat dit blok mag innemen. + Sta toe in root + Maak dit blok beschikbaar in de root van de lay-out + Sta toe in gebieden + Blok + Blokken + Instellingen + Maak dit blok standaard beschikbaar binnen de gebieden van andere blokken (behalve wanneer expliciete rechten zijn gezet voor deze gebieden). + Gebieden + Gebieden + Geadvanceerd + Rechten + Configureer gebied + Verwijder gebied Wat zijn Inhoudssjablonen? From 479dde280f854734402769ffe171b6c08e9a7b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corn=C3=A9=20Hoskam?= Date: Thu, 1 Dec 2022 14:26:58 +0100 Subject: [PATCH 27/46] Added various Block Grid translations (NL) - Pt 2. (#13508) * Added various translations * Added another translation * Change request * Added various other area translations * Resolve conflict * Forgot one! * Update nl.xml (cherry picked from commit 9099bf44aceab384a85f3d9f6fd3e43f594be5cd) --- .../EmbeddedResources/Lang/nl.xml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml b/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml index 9e8032c65a..9c17715e50 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml @@ -2543,10 +2543,33 @@ Echter, Runway biedt een gemakkelijke basis om je snel op weg te helpen. Als je Blokken Instellingen Maak dit blok standaard beschikbaar binnen de gebieden van andere blokken (behalve wanneer expliciete rechten zijn gezet voor deze gebieden). + Indien leeg kunnen alle blokken toegestaand in gebieden worden toegevoegd. + Grid Kolommen voor Gebieden. + Definiëer hoeveel kolommen beschikbaar zijn in gebiede. Indien niet gedefinieerd wordt het aantal kolommen gedefinieerd voor de gehele lay-out gebruikt. + Gebieden + Om het nesten van blokken binnen-in dit blok toe te staan, definieer een of meer gebieden voor blokken om binnenin te nesten. Gebieden volgen hun eigen lay-out welke gedefinieerd is bij de Grid Kolommen voor Gebieden. Elk Gebied kolombreedte can worden gewijzigd door het gebruik van de schaal in de hoek rechtsonderin + %0% is niet toegestaan op deze locatie.]]> + Standaard lay-out stylesheet + Niet-toegestane content is geweigerd + + + Sleep om te vergroten/verkleinen + Maak Button Label + Overschrijf het label van de create button van dit Gebied. + Toon vergroot/verklein opties + Voeg Blok toe + Voeg groep toep + Selecteer groep of Blok + Zet een minimale vereiste Gebieden Gebieden Geadvanceerd Rechten + Installeer Voorbeeld Configuratie + Installeer + Sorteer mode + Sluit sorteer mode + Dit Gebieds' Alias moet uniek zijn ten opzichte van andere Gebieden in dit Blok. Configureer gebied Verwijder gebied From 5db507cb9617fc3ec4072e96018da90b434359be Mon Sep 17 00:00:00 2001 From: Paul Seal Date: Fri, 25 Nov 2022 01:07:03 +0000 Subject: [PATCH 28/46] =?UTF-8?q?created=20an=20add=20current=20domain=20b?= =?UTF-8?q?utton=20to=20the=20cultures=20and=20hostnames=20sc=E2=80=A6=20(?= =?UTF-8?q?#13436)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * created an add current domain button to the cultures and hostnames screen * removed unwanted space (cherry picked from commit d86d29807d758f4a959688ed99ca65d2bd94a1b2) --- src/Umbraco.Core/EmbeddedResources/Lang/en.xml | 3 ++- src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml | 3 ++- .../src/views/content/assigndomain.html | 7 +++++++ .../content/content.assigndomain.controller.js | 15 ++++++++++++++- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml index 812b46693d..a9458171bd 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml @@ -90,7 +90,8 @@ Permission denied. - Add new Domain + Add new domain + Add current domain remove Invalid node. One or more domains have an invalid format. diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml index bacfa4e387..c548d0d423 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml @@ -92,7 +92,8 @@ Permission denied. - Add new Domain + Add new domain + Add current domain remove Invalid node. One or more domains have an invalid format. diff --git a/src/Umbraco.Web.UI.Client/src/views/content/assigndomain.html b/src/Umbraco.Web.UI.Client/src/views/content/assigndomain.html index 1625552955..b8287eb6fd 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/assigndomain.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/assigndomain.html @@ -83,6 +83,13 @@ button-style="info"> + + + diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.assigndomain.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.assigndomain.controller.js index daa3ed21cb..2cec5fb17a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.assigndomain.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.assigndomain.controller.js @@ -1,11 +1,12 @@ (function () { "use strict"; - function AssignDomainController($scope, localizationService, languageResource, contentResource, navigationService, notificationsService) { + function AssignDomainController($scope, localizationService, languageResource, contentResource, navigationService, notificationsService, $location) { var vm = this; vm.closeDialog = closeDialog; vm.addDomain = addDomain; + vm.addCurrentDomain = addCurrentDomain; vm.removeDomain = removeDomain; vm.save = save; vm.languages = []; @@ -82,6 +83,18 @@ }); } + function addCurrentDomain() { + var domainToAdd = $location.host(); + var port = $location.port(); + if (port != 80 && port != 443) { + domainToAdd += ":" + port; + } + vm.domains.push({ + name: domainToAdd, + lang: vm.defaultLanguage + }); + } + function removeDomain(index) { vm.domains.splice(index, 1); } From faf69e43498c46a3377cf9215a2962a0364a1e77 Mon Sep 17 00:00:00 2001 From: ustadstar <36473707+ustadstar@users.noreply.github.com> Date: Sun, 4 Dec 2022 23:14:55 +0100 Subject: [PATCH 29/46] Fix check for existing userStatesFilter (cherry picked from commit f7e73fbff5216888031ff571023efa30aef567ab) --- .../users/views/users/users.controller.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.controller.js b/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.controller.js index 79edd32319..99cbe31f66 100644 --- a/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.controller.js @@ -187,7 +187,23 @@ } function initUserStateSelections() { - initUsersOptionsFilterSelections(vm.userStatesFilter, vm.usersOptions.userStates, "key"); + if (!vm.usersOptions.userStates && vm.userStatesFilter) { + // create a new empty userStates array + vm.usersOptions.userStates = []; + + // add selected userStatesFilters to usersOptions.userStates array + for (var i = 0; i < vm.userStatesFilter.length; i++) { + if (vm.userStatesFilter[i].selected) { + vm.usersOptions.userStates.push(vm.userStatesFilter[i].key); + } + } + + // If there are any selected userStates, update location and change pagenumber + if (vm.usersOptions.userStates.length > 0) { + updateLocation("userStates", vm.usersOptions.userStates.join(",")); + changePageNumber(1); + } + } } function initUserGroupSelections() { From ba53b47b72fe81b98e8e241f393e097271a705b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Tolleshaug=20M=C3=B8rch?= Date: Thu, 10 Nov 2022 13:56:29 +0100 Subject: [PATCH 30/46] Ensure format processor is before quality processor. (cherry picked from commit 69c725b3ec71bd6cd67f93be4de7a666be547d24) --- .../Media/ImageSharpImageUrlGenerator.cs | 8 +++++- .../Media/ImageSharpImageUrlGeneratorTests.cs | 27 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.Common/Media/ImageSharpImageUrlGenerator.cs b/src/Umbraco.Web.Common/Media/ImageSharpImageUrlGenerator.cs index d91b6706c9..b1b96ddc10 100644 --- a/src/Umbraco.Web.Common/Media/ImageSharpImageUrlGenerator.cs +++ b/src/Umbraco.Web.Common/Media/ImageSharpImageUrlGenerator.cs @@ -47,6 +47,7 @@ public class ImageSharpImageUrlGenerator : IImageUrlGenerator } var queryString = new Dictionary(); + Dictionary furtherOptions = QueryHelpers.ParseQuery(options.FurtherOptions); if (options.Crop is not null) { @@ -81,12 +82,17 @@ public class ImageSharpImageUrlGenerator : IImageUrlGenerator queryString.Add(ResizeWebProcessor.Height, options.Height?.ToString(CultureInfo.InvariantCulture)); } + if (furtherOptions.Remove(FormatWebProcessor.Format, out StringValues format)) + { + queryString.Add(FormatWebProcessor.Format, format[0]); + } + if (options.Quality is not null) { queryString.Add(QualityWebProcessor.Quality, options.Quality?.ToString(CultureInfo.InvariantCulture)); } - foreach (KeyValuePair kvp in QueryHelpers.ParseQuery(options.FurtherOptions)) + foreach (KeyValuePair kvp in furtherOptions) { queryString.Add(kvp.Key, kvp.Value); } diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Media/ImageSharpImageUrlGeneratorTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Media/ImageSharpImageUrlGeneratorTests.cs index bc2c26727f..093e9b075c 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Media/ImageSharpImageUrlGeneratorTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Media/ImageSharpImageUrlGeneratorTests.cs @@ -63,6 +63,33 @@ public class ImageSharpImageUrlGeneratorTests urlString); } + [Test] + public void GetImageUrlFurtherOptionsModeAndQualityTest() + { + var urlString = s_generator.GetImageUrl(new ImageUrlGenerationOptions(MediaPath) + { + Quality = 10, + FurtherOptions = "format=webp", + }); + Assert.AreEqual( + MediaPath + + "?format=webp&quality=10", + urlString); + } + + [Test] + public void GetImageUrlFurtherOptionsWithModeAndQualityTest() + { + var urlString = s_generator.GetImageUrl(new ImageUrlGenerationOptions(MediaPath) + { + FurtherOptions = "quality=10&format=webp", + }); + Assert.AreEqual( + MediaPath + + "?format=webp&quality=10", + urlString); + } + /// /// Test that if options is null, the generated image URL is also null. /// From 508898c4ee84cfc7fdfe46469a90c478651d443e Mon Sep 17 00:00:00 2001 From: Matthew Wise <6782865+Matthew-Wise@users.noreply.github.com> Date: Sat, 22 Oct 2022 15:10:13 +0100 Subject: [PATCH 31/46] standarising ActionLetter and ActionName for IAction (cherry picked from commit ec56778c9f23c120b6b0df7709e1b3e124e8fe2e) --- .../Actions/ActionAssignDomain.cs | 14 ++++++------- src/Umbraco.Core/Actions/ActionBrowse.cs | 14 +++++++------ src/Umbraco.Core/Actions/ActionCopy.cs | 15 +++++++------- .../ActionCreateBlueprintFromContent.cs | 16 ++++++++++----- src/Umbraco.Core/Actions/ActionDelete.cs | 14 +++++-------- src/Umbraco.Core/Actions/ActionMove.cs | 17 ++++++++-------- src/Umbraco.Core/Actions/ActionNew.cs | 20 ++++++++----------- src/Umbraco.Core/Actions/ActionNotify.cs | 20 ++++++++++++------- src/Umbraco.Core/Actions/ActionProtect.cs | 17 ++++++++-------- src/Umbraco.Core/Actions/ActionPublish.cs | 15 +++++++------- src/Umbraco.Core/Actions/ActionRestore.cs | 17 ++++++++-------- src/Umbraco.Core/Actions/ActionRights.cs | 17 ++++++++-------- src/Umbraco.Core/Actions/ActionRollback.cs | 17 ++++++++-------- src/Umbraco.Core/Actions/ActionSort.cs | 17 ++++++++-------- src/Umbraco.Core/Actions/ActionToPublish.cs | 17 ++++++++-------- src/Umbraco.Core/Actions/ActionUnpublish.cs | 17 ++++++++-------- src/Umbraco.Core/Actions/ActionUpdate.cs | 17 ++++++++-------- src/Umbraco.Core/Actions/IAction.cs | 11 ++++++++-- 18 files changed, 158 insertions(+), 134 deletions(-) diff --git a/src/Umbraco.Core/Actions/ActionAssignDomain.cs b/src/Umbraco.Core/Actions/ActionAssignDomain.cs index 3bd946837f..7ef7b9ca83 100644 --- a/src/Umbraco.Core/Actions/ActionAssignDomain.cs +++ b/src/Umbraco.Core/Actions/ActionAssignDomain.cs @@ -8,17 +8,17 @@ namespace Umbraco.Cms.Core.Actions; /// public class ActionAssignDomain : IAction { - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'I'; - /// + /// + public const string ActionAlias = "assigndomain"; + + /// public char Letter => ActionLetter; - /// - // This is all lower-case because of case sensitive filesystems, see issue: https://github.com/umbraco/Umbraco-CMS/issues/11670 - public string Alias => "assigndomain"; + /// + public string Alias => ActionAlias; /// public string Category => Constants.Conventions.PermissionCategories.AdministrationCategory; diff --git a/src/Umbraco.Core/Actions/ActionBrowse.cs b/src/Umbraco.Core/Actions/ActionBrowse.cs index 2620888a30..ff217ac43a 100644 --- a/src/Umbraco.Core/Actions/ActionBrowse.cs +++ b/src/Umbraco.Core/Actions/ActionBrowse.cs @@ -16,14 +16,18 @@ namespace Umbraco.Cms.Core.Actions; /// public class ActionBrowse : IAction { - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'F'; - /// + /// + public const string ActionAlias = "browse"; + + /// public char Letter => ActionLetter; + /// + public string Alias => ActionAlias; + /// public bool ShowInNotifier => false; @@ -33,8 +37,6 @@ public class ActionBrowse : IAction /// public string Icon => string.Empty; - /// - public string Alias => "browse"; /// public string Category => Constants.Conventions.PermissionCategories.ContentCategory; diff --git a/src/Umbraco.Core/Actions/ActionCopy.cs b/src/Umbraco.Core/Actions/ActionCopy.cs index f7d9d699a5..f4afb3906c 100644 --- a/src/Umbraco.Core/Actions/ActionCopy.cs +++ b/src/Umbraco.Core/Actions/ActionCopy.cs @@ -1,4 +1,4 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. namespace Umbraco.Cms.Core.Actions; @@ -8,16 +8,17 @@ namespace Umbraco.Cms.Core.Actions; /// public class ActionCopy : IAction { - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'O'; - /// + /// + public const string ActionAlias = "copy"; + + /// public char Letter => ActionLetter; - /// - public string Alias => "copy"; + /// + public string Alias => ActionAlias; /// public string Category => Constants.Conventions.PermissionCategories.StructureCategory; diff --git a/src/Umbraco.Core/Actions/ActionCreateBlueprintFromContent.cs b/src/Umbraco.Core/Actions/ActionCreateBlueprintFromContent.cs index ee249d9ef8..f23e5cac84 100644 --- a/src/Umbraco.Core/Actions/ActionCreateBlueprintFromContent.cs +++ b/src/Umbraco.Core/Actions/ActionCreateBlueprintFromContent.cs @@ -8,8 +8,17 @@ namespace Umbraco.Cms.Core.Actions; /// public class ActionCreateBlueprintFromContent : IAction { - /// - public char Letter => 'ï'; + /// + public const char ActionLetter = 'ï'; + + /// + public const string ActionAlias = "createblueprint"; + + /// + public char Letter => ActionLetter; + + /// + public string Alias => ActionAlias; /// public bool ShowInNotifier => false; @@ -20,9 +29,6 @@ public class ActionCreateBlueprintFromContent : IAction /// public string Icon => Constants.Icons.Blueprint; - /// - public string Alias => "createblueprint"; - /// public string Category => Constants.Conventions.PermissionCategories.ContentCategory; } diff --git a/src/Umbraco.Core/Actions/ActionDelete.cs b/src/Umbraco.Core/Actions/ActionDelete.cs index 055b2a8f98..ea8517c794 100644 --- a/src/Umbraco.Core/Actions/ActionDelete.cs +++ b/src/Umbraco.Core/Actions/ActionDelete.cs @@ -1,4 +1,4 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. namespace Umbraco.Cms.Core.Actions; @@ -8,16 +8,12 @@ namespace Umbraco.Cms.Core.Actions; /// public class ActionDelete : IAction { - /// - /// The unique action alias - /// - public const string ActionAlias = "delete"; - - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'D'; + /// + public const string ActionAlias = "delete"; + /// public char Letter => ActionLetter; diff --git a/src/Umbraco.Core/Actions/ActionMove.cs b/src/Umbraco.Core/Actions/ActionMove.cs index c1f6089793..a145e86fab 100644 --- a/src/Umbraco.Core/Actions/ActionMove.cs +++ b/src/Umbraco.Core/Actions/ActionMove.cs @@ -1,23 +1,24 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. namespace Umbraco.Cms.Core.Actions; /// -/// This action is invoked upon creation of a document, media, member +/// This action is invoked upon creation of a document, media, member. /// public class ActionMove : IAction { - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'M'; - /// + /// + public const string ActionAlias = "move"; + + /// public char Letter => ActionLetter; - /// - public string Alias => "move"; + /// + public string Alias => ActionAlias; /// public string Category => Constants.Conventions.PermissionCategories.StructureCategory; diff --git a/src/Umbraco.Core/Actions/ActionNew.cs b/src/Umbraco.Core/Actions/ActionNew.cs index bd08a95ac5..25ac603532 100644 --- a/src/Umbraco.Core/Actions/ActionNew.cs +++ b/src/Umbraco.Core/Actions/ActionNew.cs @@ -1,27 +1,23 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. namespace Umbraco.Cms.Core.Actions; /// -/// This action is invoked upon creation of a document +/// This action is invoked upon creation of a document. /// public class ActionNew : IAction { - /// - /// The unique action alias - /// - public const string ActionAlias = "create"; - - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'C'; - /// + /// + public const string ActionAlias = "create"; + + /// public char Letter => ActionLetter; - /// + /// public string Alias => ActionAlias; /// diff --git a/src/Umbraco.Core/Actions/ActionNotify.cs b/src/Umbraco.Core/Actions/ActionNotify.cs index 10845b01b9..8ad650a74a 100644 --- a/src/Umbraco.Core/Actions/ActionNotify.cs +++ b/src/Umbraco.Core/Actions/ActionNotify.cs @@ -1,15 +1,24 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. namespace Umbraco.Cms.Core.Actions; /// -/// This action is invoked upon modifying the notification of a content +/// This action is invoked upon modifying the notification of a content. /// public class ActionNotify : IAction { - /// - public char Letter => 'N'; + /// + public const char ActionLetter = 'N'; + + /// + public const string ActionAlias = "notify"; + + /// + public char Letter => ActionLetter; + + /// + public string Alias => ActionAlias; /// public bool ShowInNotifier => false; @@ -20,9 +29,6 @@ public class ActionNotify : IAction /// public string Icon => "icon-megaphone"; - /// - public string Alias => "notify"; - /// public string Category => Constants.Conventions.PermissionCategories.ContentCategory; } diff --git a/src/Umbraco.Core/Actions/ActionProtect.cs b/src/Umbraco.Core/Actions/ActionProtect.cs index 7b54a0ec98..21c985961b 100644 --- a/src/Umbraco.Core/Actions/ActionProtect.cs +++ b/src/Umbraco.Core/Actions/ActionProtect.cs @@ -1,23 +1,24 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. namespace Umbraco.Cms.Core.Actions; /// -/// This action is invoked when a document is protected or unprotected +/// This action is invoked when a document is protected or unprotected. /// public class ActionProtect : IAction { - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'P'; - /// + /// + public const string ActionAlias = "protect"; + + /// public char Letter => ActionLetter; - /// - public string Alias => "protect"; + /// + public string Alias => ActionAlias; /// public string Category => Constants.Conventions.PermissionCategories.AdministrationCategory; diff --git a/src/Umbraco.Core/Actions/ActionPublish.cs b/src/Umbraco.Core/Actions/ActionPublish.cs index e07b0935bc..09f6c831e9 100644 --- a/src/Umbraco.Core/Actions/ActionPublish.cs +++ b/src/Umbraco.Core/Actions/ActionPublish.cs @@ -4,20 +4,21 @@ namespace Umbraco.Cms.Core.Actions; /// -/// This action is invoked when a document is being published +/// This action is invoked when a document is being published. /// public class ActionPublish : IAction { - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'U'; - /// + /// + public const string ActionAlias = "publish"; + + /// public char Letter => ActionLetter; - /// - public string Alias => "publish"; + /// + public string Alias => ActionAlias; /// public string Category => Constants.Conventions.PermissionCategories.ContentCategory; diff --git a/src/Umbraco.Core/Actions/ActionRestore.cs b/src/Umbraco.Core/Actions/ActionRestore.cs index 395c678fe4..dcdfc86521 100644 --- a/src/Umbraco.Core/Actions/ActionRestore.cs +++ b/src/Umbraco.Core/Actions/ActionRestore.cs @@ -1,22 +1,23 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. namespace Umbraco.Cms.Core.Actions; /// -/// This action is invoked when the content/media item is to be restored from the recycle bin +/// This action is invoked when the content/media item is to be restored from the recycle bin. /// public class ActionRestore : IAction { - /// - /// The unique action alias - /// + /// + public const char ActionLetter = 'V'; + + /// public const string ActionAlias = "restore"; - /// - public char Letter => 'V'; + /// + public char Letter => ActionLetter; - /// + /// public string Alias => ActionAlias; /// diff --git a/src/Umbraco.Core/Actions/ActionRights.cs b/src/Umbraco.Core/Actions/ActionRights.cs index 4cd8674122..7e493d6c16 100644 --- a/src/Umbraco.Core/Actions/ActionRights.cs +++ b/src/Umbraco.Core/Actions/ActionRights.cs @@ -1,23 +1,24 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. namespace Umbraco.Cms.Core.Actions; /// -/// This action is invoked when rights are changed on a document +/// This action is invoked when rights are changed on a document. /// public class ActionRights : IAction { - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'R'; - /// + /// + public const string ActionAlias = "rights"; + + /// public char Letter => ActionLetter; - /// - public string Alias => "rights"; + /// + public string Alias => ActionAlias; /// public string Category => Constants.Conventions.PermissionCategories.ContentCategory; diff --git a/src/Umbraco.Core/Actions/ActionRollback.cs b/src/Umbraco.Core/Actions/ActionRollback.cs index 63021a2ae3..7e1dab6467 100644 --- a/src/Umbraco.Core/Actions/ActionRollback.cs +++ b/src/Umbraco.Core/Actions/ActionRollback.cs @@ -1,23 +1,24 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. namespace Umbraco.Cms.Core.Actions; /// -/// This action is invoked when copying a document is being rolled back +/// This action is invoked when copying a document is being rolled back. /// public class ActionRollback : IAction { - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'K'; - /// + /// + public const string ActionAlias = "rollback"; + + /// public char Letter => ActionLetter; - /// - public string Alias => "rollback"; + /// + public string Alias => ActionAlias; /// public string Category => Constants.Conventions.PermissionCategories.AdministrationCategory; diff --git a/src/Umbraco.Core/Actions/ActionSort.cs b/src/Umbraco.Core/Actions/ActionSort.cs index 23e65d7533..4f90e404c8 100644 --- a/src/Umbraco.Core/Actions/ActionSort.cs +++ b/src/Umbraco.Core/Actions/ActionSort.cs @@ -1,23 +1,24 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. namespace Umbraco.Cms.Core.Actions; /// -/// This action is invoked when children to a document, media, member is being sorted +/// This action is invoked when children to a document, media, member is being sorted. /// public class ActionSort : IAction { - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'S'; - /// + /// + public const string ActionAlias = "sort"; + + /// public char Letter => ActionLetter; - /// - public string Alias => "sort"; + /// + public string Alias => ActionAlias; /// public string Category => Constants.Conventions.PermissionCategories.StructureCategory; diff --git a/src/Umbraco.Core/Actions/ActionToPublish.cs b/src/Umbraco.Core/Actions/ActionToPublish.cs index 8df53b3e4a..e7af16bc99 100644 --- a/src/Umbraco.Core/Actions/ActionToPublish.cs +++ b/src/Umbraco.Core/Actions/ActionToPublish.cs @@ -1,23 +1,24 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. namespace Umbraco.Cms.Core.Actions; /// -/// This action is invoked when children to a document is being sent to published (by an editor without publishrights) +/// This action is invoked when children to a document is being sent to published (by an editor without publishrights). /// public class ActionToPublish : IAction { - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'H'; - /// + /// + public const string ActionAlias = "sendtopublish"; + + /// public char Letter => ActionLetter; - /// - public string Alias => "sendtopublish"; + /// + public string Alias => ActionAlias; /// public string Category => Constants.Conventions.PermissionCategories.ContentCategory; diff --git a/src/Umbraco.Core/Actions/ActionUnpublish.cs b/src/Umbraco.Core/Actions/ActionUnpublish.cs index f8ebb918f9..f10159b403 100644 --- a/src/Umbraco.Core/Actions/ActionUnpublish.cs +++ b/src/Umbraco.Core/Actions/ActionUnpublish.cs @@ -1,23 +1,24 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. namespace Umbraco.Cms.Core.Actions; /// -/// This action is invoked when a document is being unpublished +/// This action is invoked when a document is being unpublished. /// public class ActionUnpublish : IAction { - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'Z'; - /// + /// + public const string ActionAlias = "unpublish"; + + /// public char Letter => ActionLetter; - /// - public string Alias => "unpublish"; + /// + public string Alias => ActionAlias; /// public string Category => Constants.Conventions.PermissionCategories.ContentCategory; diff --git a/src/Umbraco.Core/Actions/ActionUpdate.cs b/src/Umbraco.Core/Actions/ActionUpdate.cs index 2d01ef176c..aa6b0e9950 100644 --- a/src/Umbraco.Core/Actions/ActionUpdate.cs +++ b/src/Umbraco.Core/Actions/ActionUpdate.cs @@ -1,23 +1,24 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. namespace Umbraco.Cms.Core.Actions; /// -/// This action is invoked when copying a document or media +/// This action is invoked when copying a document or media. /// public class ActionUpdate : IAction { - /// - /// The unique action letter - /// + /// public const char ActionLetter = 'A'; - /// + /// + public const string ActionAlias = "update"; + + /// public char Letter => ActionLetter; - /// - public string Alias => "update"; + /// + public string Alias => ActionAlias; /// public string Category => Constants.Conventions.PermissionCategories.ContentCategory; diff --git a/src/Umbraco.Core/Actions/IAction.cs b/src/Umbraco.Core/Actions/IAction.cs index f57e697a2e..6afe147e69 100644 --- a/src/Umbraco.Core/Actions/IAction.cs +++ b/src/Umbraco.Core/Actions/IAction.cs @@ -13,8 +13,14 @@ namespace Umbraco.Cms.Core.Actions; /// public interface IAction : IDiscoverable { + /// + const char ActionLetter = default; + + /// + const string ActionAlias = default; + /// - /// Gets the letter used to assign a permission (must be unique) + /// Gets the letter used to assign a permission (must be unique). /// char Letter { get; } @@ -34,7 +40,8 @@ public interface IAction : IDiscoverable string Icon { get; } /// - /// Gets the alias for this action (must be unique) + /// Gets the alias for this action (must be unique). + /// This is all lower-case because of case sensitive filesystems, see issue: https://github.com/umbraco/Umbraco-CMS/issues/11670. /// string Alias { get; } From 4dbd7de0d6da0c7f904968af57f0144d7841e080 Mon Sep 17 00:00:00 2001 From: Tiffany Date: Thu, 27 Oct 2022 18:05:09 +0100 Subject: [PATCH 32/46] Tree Roots are H1 (cherry picked from commit 105670dcc186c7a65057c067b880b0fb9fcfd65e) --- .../src/views/components/tree/umb-tree.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/tree/umb-tree.html b/src/Umbraco.Web.UI.Client/src/views/components/tree/umb-tree.html index 9f430a0215..0aa1be85b5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/tree/umb-tree.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/tree/umb-tree.html @@ -42,7 +42,7 @@ ng-repeat="group in tree.root.children">
    -
    +

    {{group.name}} -

    + Date: Thu, 20 Oct 2022 17:34:52 +0200 Subject: [PATCH 33/46] Added shortcut="esc" to RTE HTML editor close button (cherry picked from commit 4922144528e00e56aeeba484dd4ee58caa25022c) --- .../src/views/propertyeditors/rte/codeeditor.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/codeeditor.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/codeeditor.html index 11d77d4dd4..2bccd039db 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/codeeditor.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/codeeditor.html @@ -25,6 +25,7 @@ type="button" button-style="link" label-key="general_close" + shortcut="esc" action="vm.close()"> -
    \ No newline at end of file + From 67d6e9f3df9700e4aad7645c66d33ef8e2da5be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20M=C3=B8nster?= Date: Fri, 21 Oct 2022 21:21:21 +0200 Subject: [PATCH 34/46] Renames Installer form from "myForm" to "installerForm" (#12806) Co-authored-by: Joe Glombek (cherry picked from commit 6cad4013e48c1b2f1442025911ce1f1f4c3ebf7c) --- .../src/installer/steps/database.controller.js | 2 +- .../src/installer/steps/database.html | 6 +++--- .../src/installer/steps/user.controller.js | 2 +- .../src/installer/steps/user.html | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/database.controller.js b/src/Umbraco.Web.UI.Client/src/installer/steps/database.controller.js index 33c0ffca12..30d42299b5 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/steps/database.controller.js +++ b/src/Umbraco.Web.UI.Client/src/installer/steps/database.controller.js @@ -29,7 +29,7 @@ angular.module("umbraco.install").controller("Umbraco.Installer.DataBaseControll $scope.validateAndForward = function() { - if (!$scope.checking && this.myForm.$valid) + if (!$scope.checking && this.installerForm.$valid) { $scope.checking = true; $scope.invalidDbDns = false; diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/database.html b/src/Umbraco.Web.UI.Client/src/installer/steps/database.html index e75a82f9df..4282770e75 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/steps/database.html +++ b/src/Umbraco.Web.UI.Client/src/installer/steps/database.html @@ -6,7 +6,7 @@

    Go back diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js b/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js index 6654fe447c..28a781a8ec 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js +++ b/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js @@ -81,7 +81,7 @@ angular.module("umbraco.install").controller("Umbraco.Install.UserController", f }; $scope.validateAndForward = function () { - if (this.myForm.$valid) { + if (this.installerForm.$valid) { installerService.forward(); } }; diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/user.html b/src/Umbraco.Web.UI.Client/src/installer/steps/user.html index 7e37c57328..20c406aefe 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/steps/user.html +++ b/src/Umbraco.Web.UI.Client/src/installer/steps/user.html @@ -8,7 +8,7 @@ @@ -137,7 +137,7 @@ -
    +
    Change Database -
    @@ -159,7 +159,7 @@
    Date: Tue, 25 Oct 2022 13:49:07 +0200 Subject: [PATCH 36/46] adding some german translations (cherry picked from commit ce60e72452df1ff750af9004b213d0726caf3b06) --- src/Umbraco.Core/EmbeddedResources/Lang/de.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/de.xml b/src/Umbraco.Core/EmbeddedResources/Lang/de.xml index 582b62baf2..017e56602e 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/de.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/de.xml @@ -9,6 +9,7 @@ Protokoll Durchsuchen Dokumenttyp ändern + Datentyp ändern Kopieren Neu Exportieren @@ -16,6 +17,8 @@ Neue Gruppe Entfernen Deaktivieren + Inhalt bearbeiten + Einstellungen bearbeiten Papierkorb leeren Aktivieren Dokumenttyp exportieren @@ -30,13 +33,18 @@ Veröffentlichung zurücknehmen Aktualisieren Erneut veröffentlichen + Entfernen Umbenennen Wiederherstellen Wähle worunter kopiert werden soll Wähle worunter verschoben werden soll + Wähle wohin importiert werden soll + Wähle wohin die ausgewählten Elemente kopiert werden soll + Wähle wohin die ausgewählten Elemente verschoben werden soll in der Baumstrukture wurde verschoben nach wurde kopiert nach + wurde gelöscht Berechtigungen Zurücksetzen Zur Veröffentlichung einreichen @@ -76,6 +84,7 @@ Erlaube Übersetzung Erlaube Sichern von Änderungen Erlaube Anlegen von Inhaltsvorlagen + Erlaube das Einrichten von Benachrichtungen für Inhalte Inhalt @@ -145,10 +154,10 @@ TAG entfernen Abbrechen Bestätigen + Senden Anzeigen als - Inhalt gelöscht Inhalt unveröffentlicht Inhalt unveröffentlicht für Sprache: %0% @@ -162,6 +171,8 @@ Veröffentlichung für Inhalt angefordert Veröffentlichung für Inhalt angefordert in Sprache: %0% Unterknoten wurden sortiert von Benutzer + Versionsbereinigung deaktiviert für Version: %0% + Versionsbereinigung aktiviert für Version: %0% Kopieren Veröffentlichen Veröffentlichen @@ -175,6 +186,8 @@ Veröffentlichung anfordern Veröffentlichung anfordern Sortieren + Speichern + Speichern Verlauf (alle Variationen) From 90ffd25d96bd41edcd4fe7f25b37813898206ab8 Mon Sep 17 00:00:00 2001 From: Jason Elkin Date: Tue, 11 Oct 2022 01:41:50 +0100 Subject: [PATCH 37/46] Swap HSTS healthcheck status on localhost (cherry picked from commit 6cb53fd703ac7a66922c2d19c5118a3263c522af) --- .../EmbeddedResources/Lang/en.xml | 6 +++ .../EmbeddedResources/Lang/en_us.xml | 6 +++ .../HealthChecks/Checks/Security/HstsCheck.cs | 54 ++++++++++++++++++- 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml index c3d2ab8bb4..b04155137b 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml @@ -2349,6 +2349,12 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Strict-Transport-Security, also known as the HSTS-header, was found.]]> Strict-Transport-Security was not found.]]> + + Strict-Transport-Security, also known as the HSTS-header, was found. This header should not be present on localhost.]]> + + + Strict-Transport-Security was not found. This header should not be present on localhost.]]> + X-XSS-Protection was found.]]> X-XSS-Protection was not found.]]> diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml index 6ddedc7797..4a025ed25c 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml @@ -2451,6 +2451,12 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Strict-Transport-Security, also known as the HSTS-header, was found.]]> Strict-Transport-Security was not found.]]> + + Strict-Transport-Security, also known as the HSTS-header, was found. This header should not be present on localhost.]]> + + + Strict-Transport-Security was not found. This header should not be present on localhost.]]> + X-XSS-Protection was found.]]> X-XSS-Protection was not found.]]> diff --git a/src/Umbraco.Core/HealthChecks/Checks/Security/HstsCheck.cs b/src/Umbraco.Core/HealthChecks/Checks/Security/HstsCheck.cs index 229999472e..0637404045 100644 --- a/src/Umbraco.Core/HealthChecks/Checks/Security/HstsCheck.cs +++ b/src/Umbraco.Core/HealthChecks/Checks/Security/HstsCheck.cs @@ -3,6 +3,7 @@ using Umbraco.Cms.Core.Hosting; using Umbraco.Cms.Core.Services; +using Umbraco.Extensions; namespace Umbraco.Cms.Core.HealthChecks.Checks.Security; @@ -16,6 +17,11 @@ namespace Umbraco.Cms.Core.HealthChecks.Checks.Security; Group = "Security")] public class HstsCheck : BaseHttpHeaderCheck { + private const string LocalizationPrefix = "hSTS"; + + private readonly IHostingEnvironment _hostingEnvironment; + private readonly ILocalizedTextService _textService; + /// /// Initializes a new instance of the class. /// @@ -27,10 +33,56 @@ public class HstsCheck : BaseHttpHeaderCheck /// but then you should include subdomains and I wouldn't suggest to do that for Umbraco-sites. /// public HstsCheck(IHostingEnvironment hostingEnvironment, ILocalizedTextService textService) - : base(hostingEnvironment, textService, "Strict-Transport-Security", "hSTS", true) + : base(hostingEnvironment, textService, "Strict-Transport-Security", LocalizationPrefix, true) { + _hostingEnvironment = hostingEnvironment; + _textService = textService; } /// protected override string ReadMoreLink => Constants.HealthChecks.DocumentationLinks.Security.HstsCheck; + + /// + public override async Task> GetStatus() => + new HealthCheckStatus[] { await CheckForHeader() }; + + /// + /// The health check task. + /// + /// A with the result type reversed on localhost. + protected new async Task CheckForHeader() + { + HealthCheckStatus checkHeaderResult = await base.CheckForHeader(); + + var isLocalhost = _hostingEnvironment.ApplicationMainUrl?.Host.ToLowerInvariant() == "localhost"; + + // when not on localhost, the header should exist. + if (!isLocalhost) + { + return checkHeaderResult; + } + + string message; + StatusResultType statusResultType; + + // on localhost the header should not exist, so invert the status. + if (checkHeaderResult.ResultType == StatusResultType.Success) + { + statusResultType = StatusResultType.Error; + + message = _textService.Localize("healthcheck", $"{LocalizationPrefix}CheckHeaderFoundOnLocalhost"); + } + else + { + statusResultType = StatusResultType.Success; + + message = _textService.Localize("healthcheck", $"{LocalizationPrefix}CheckHeaderNotFoundOnLocalhost"); + } + + return new HealthCheckStatus(message) + { + ResultType = statusResultType, + ReadMoreLink = ReadMoreLink, + }; + } } From 8bee709720130f44f1bb63f71d571304395bb42c Mon Sep 17 00:00:00 2001 From: SimonJansson2 Date: Wed, 26 Oct 2022 16:59:52 +0200 Subject: [PATCH 38/46] Adding swedish backoffice translations (cherry picked from commit 2071224d1f5791c7a801fe65a9c092d69f987c84) --- src/Umbraco.Core/EmbeddedResources/Lang/sv.xml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml b/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml index c0a90e1dbb..3d89a94af1 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml @@ -126,6 +126,7 @@ Skapa en ny dokumenttyp Infoga bild Publicera och stäng + Publicera med undersidor Ändra relation Återvänd till lista Spara @@ -149,6 +150,7 @@ (hur skulle du beskriva denna bild för någon över telefon) Alternativa länkar Alternativ text (optionell) + Bildtext (optionell) Underliggande noder Klicka för att redigera detta objekt Skapad av @@ -196,6 +198,11 @@ Uppdaterad av Ta bort fil Länk till dokument + Avpublicerad + Publicerad (osparade ändringar) + Inga undernoder har lagts till + Inga ändringar har gjorts + Ej skapad Var vill du skapa den nya %0% @@ -222,10 +229,10 @@ Installera Umbraco Forms - Stay - Discard changes - You have unsaved changes - Are you sure you want to navigate away from this page? - you have unsaved changes + Stanna + Ignorera ändringar + Du har osparade ändringar + Är du säker på att du vill lämna sidan? - Du har osparade ändringar. Klar @@ -723,6 +730,7 @@ Sortering klar Välj i vilken ordning du vill ha sidorna genom att dra dem upp eller ner i listan. Du kan också klicka på kolumnrubrikerna för att sortera grupper av sidor + Den här noden har inga undernoder att sortera Publiceringen avbröts av ett tredjepartstillägg From f4012115a375a34c109df7bc4d1dfdb8a49b287b Mon Sep 17 00:00:00 2001 From: Anders Bjerner Date: Tue, 8 Nov 2022 09:22:23 +0100 Subject: [PATCH 39/46] NullOrWhiteSpaceAsNull should be nullable (cherry picked from commit 5ffc2b1ccb46690924be1c3aa81e0a1dccaaa0e1) --- src/Umbraco.Core/Extensions/StringExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Extensions/StringExtensions.cs b/src/Umbraco.Core/Extensions/StringExtensions.cs index b284a071f9..b885137d83 100644 --- a/src/Umbraco.Core/Extensions/StringExtensions.cs +++ b/src/Umbraco.Core/Extensions/StringExtensions.cs @@ -1240,7 +1240,7 @@ public static class StringExtensions /// /// Turns an null-or-whitespace string into a null string. /// - public static string? NullOrWhiteSpaceAsNull(this string text) + public static string? NullOrWhiteSpaceAsNull(this string? text) => string.IsNullOrWhiteSpace(text) ? null : text; /// From 345feaf16af6cabc6e3846e1dc89624163d781b8 Mon Sep 17 00:00:00 2001 From: Owain Jones Date: Wed, 16 Nov 2022 18:58:54 +0000 Subject: [PATCH 40/46] Updated welsh translations file (cherry picked from commit 079b2b74524a30359d2c2e08e749fada276b7574) --- .../EmbeddedResources/Lang/cy.xml | 257 +++++++++++++++++- 1 file changed, 256 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/cy.xml b/src/Umbraco.Core/EmbeddedResources/Lang/cy.xml index ba77f76f81..836d4705b3 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/cy.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/cy.xml @@ -56,6 +56,8 @@ Datgloi Creu Templed Gynnwys Ail-anfon Gwahoddiad + Golygu cynnwys + Dewiswch ble i fewnforio Cynnwys @@ -83,6 +85,7 @@ Caniatáu hawl i gyfiethu nod Caniatáu hawl i achub nod Caniatáu hawl i greu Templed Cynnwys + Caniatáu mynediad i osod hysbysiadau ar gyfer nodau cynnwys Cynnwys @@ -196,6 +199,10 @@ Tefnu Arferu Hanes (pob amrywiad) + Mae glanhau wedi'i analluogi ar gyfer y fersiwn: %0% + Mae glanhau wedi'i alluogi ar gyfer fersiwn:: %0% + Achub + Achub Methwyd creu ffolder o dan id rhiant %0% @@ -316,6 +323,12 @@ Creu newydd Gludo o'r clipfwrdd Mae'r eitem yma yn y Bin Ailgylchu + Nid yw'r math o elfen a ddewiswyd yn cynnwys unrhyw grwpiau a gefnogir (nid yw tabiau'n cael eu cefnogi gan y golygydd hwn, naill ai eu newid i grwpiau neu ddefnyddio golygydd y Rhestr Bloc). + Ni chaniateir arbed + Ni chaniateir cyhoeddi + Ni chaniateir anfon am gymeradwyaeth + Ni chaniateir amserlennu + Ni chaniateir dad-gyhoeddi Creu Templed Cynnwys newydd o '%0%' @@ -343,11 +356,18 @@ Methwyd ailenwi'r ffolder gyda id %0% Llusgo a gollwng eich ffeil(iau) i mewn i'r ardal Ni chaniateir llwytho i fyny yn y lleoliad hwn. + Ni ellir lanlwytho'r ffeil yma, ni chaniateir y math cyfrwng gydag alias '%0%' yma + Ni ellir lanlwytho'r ffeil yma, nid oes ganddi enw ffeil dilys Creu aelod newydd Pob Aelod Nid oes gan grwpiau aelodau unrhyw eiddo ychwanegol ar gyfer golygu. + Mae aelod gyda'r mewngofnodi hwn yn bodoli yn barod + Mae'r aelod yn y grŵp '%0%' yn barod + Mae gan yr aelod gyfrinair yn barod + Nid yw cloi allan wedi'i alluogi ar gyfer yr aelod hwn + Nid yw'r aelod yn y grŵp '%0%' Wedi methu copïo'r fath cynnwys @@ -549,9 +569,21 @@ %0%.]]> %0% o'r grŵp %1%]]> Ydw, dileu + Dewiswch ieithoedd + Rydych chi'n dileu'r gosodiad + Bydd addasu'r gosodiad yn arwain at golli data ar gyfer unrhyw gynnwys presennol sy'n seiliedig ar y ffurfweddiad hwn. Nid oes unrhyw eitemau geiriadur. + + I fewnforio eitem geiriadur, dewch o hyd i'r ffeil ".udt" ar eich cyfrifiadur trwy glicio + ar y botwm "Mewnforio" (bydd gofyn i chi am gadarnhad ar y sgrin nesaf) + + Nid yw eitem geiriadur yn bodoli. + Nid yw eitem rhiant yn bodoli. + Nid oes unrhyw eitemau geiriadur yn y ffeil hon. + Ni chanfuwyd unrhyw eitemau geiriadur. + Creu eitem geiriadur @@ -664,9 +696,9 @@ Dewiswch y ffolder i symud i'r strwythyr goeden isod wedi symud o dan - %0% yn dileu'r briodweddau a'i data o'r eitemau canlynol]]> Rwy'n deall y weithred hon yn dileu'r holl briodweddau a data sy'n seiliedig ar Fath o Ddata hon + Mae newid golygydd eiddo ar fath o ddata, â gwerthoedd wedi'u storio, wedi'i analluogi. I ganiatáu hyn gallwch newid y gosodiad Umbraco:CMS:DataTypes:CanBeChanged yn appssettings.json. Mae eich data wedi'i achub, ond cyn i chi allu cyhoeddi'r dudalen yma, mae yna wallau yr ydych angen eu gwirio yn gyntaf: @@ -707,6 +739,8 @@ Gwall yn y ffynhonnell XSLT Nid yw'r XSLTwedi'i achub gan ei fod yn cynnwys gwall(au) Mae gwall ffurfwedd gyda'r math o ddata sy'n cael ei ddefnyddio ar gyfer y priodwedd yma, gwiriwch y fath o ddata + Mae methiant anhysbys wedi digwydd + Methiant cydsyniadau optimistaidd, gwrthrych wedi'i addasu Dewisiadau @@ -870,6 +904,17 @@ Clirio Arsefydlu Avatar am + + Cyfryngau + Enw Nôd + Darllen fwy + Dychwelyd + Cyfrannol + Enw Fath + Dilysu + Pennawd + maes system + Diweddarwyd Diwethaf Du @@ -928,9 +973,14 @@ Tudalen + Methu cadw'r ffeil web.config. Addaswch y llinyn cysylltu â llaw os gwelwch yn dda. Ni all y gosodydd gysylltu â'r gronfa ddata. Canfwyd eich cronfa ddata ac mae'n cael ei adnabod fel Ffurfwedd gronfa ddata + Trwy glicio ar y botwm nesaf (neu addasu'r umbracoConfigurationStatus yn web.config), rydych chi'n derbyn y drwydded ar gyfer y feddalwedd hon fel y nodir yn y blwch isod. Sylwch fod y dosbarthiad Umbraco hwn yn cynnwys dwy drwydded wahanol, y drwydded MIT ffynhonnell agored ar gyfer y fframwaith a thrwydded radwedd Umbraco sy'n cwmpasu'r UI. + To finish the installation, you'll need to manually edit the + <strong>/web.config file</strong> a diweddaru'r allwedd AppSetting <strong>UmbracoConfigurationStatus</strong> yn y gwaelod i'r werth <strong>'%0%'</strong>. + gosod i osod y gronfa ddata %0% Umbraco @@ -1182,6 +1232,12 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang ]]> + Un cam olaf + Rydych chi wedi galluogi dilysu 2-ffactor ac mae'n rhaid i chi wirio pwy ydych chi. + Dewiswch ddarparwr 2 ffactor + Cod dilysu + Rhowch y cod dilysu os gwelwch yn dda + Cod annilys wedi'i nodi Dashfwrdd @@ -1411,6 +1467,11 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang Cliciwch 'Cwblhau' i orffen y gosodiad ac adnewyddu'r dudalen. Lanlwytho pecyn... Wedi gwirio i weithio ar Umbraco Cloud + Cyfarwyddiadau gosod + Wedi'i hyrwyddo + Rhedeg ymfudiadau pecyn tra'n aros + Mae mudo pecynnau wedi'u cwblhau'n llwyddiannus. + Mae'r holl fudiadau pecyn wedi'u cwblhau'n llwyddiannus. Gludo gyda fformatio llawn (Heb ei argymell) @@ -1502,6 +1563,11 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang Dileu pob cyfryngau? Clipfwrdd Ni chaniateir + Agor dewisydd cyfryngau + + + Dewiswch Olygydd Eiddo + Dewiswch Olygydd Eiddo Darparwch ddolen allanol @@ -1529,6 +1595,11 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang Rolio yn ôl at Dewis fersiwn Gwedd + + Yn dangos fersiwn %0% i %1% o %2% fersiynau. + Fersiynau + Fersiwn drafft cyfredol + Fersiwn cyhoeddedig cyfredol Golygu ffeil sgript @@ -1559,6 +1630,8 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang Y fideos tiwtorial Umbraco gorau Ymweld â our.umbraco.com Ymweld â umbraco.tv + Gwyliwch ein fideos tiwtorial am ddim + ar Ganolfan Ddysgu Umbraco Templed diofyn @@ -1704,6 +1777,20 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang Ni all drefnu'r ddogfen i'w chyhoeddi oherwydd mae ganddo'r gofynnol '%0%' ddyddiad cyhoeddi yn hwyrach nag iaith nad yw'n orfodol Ni all y dyddiad terfyn fod yn y gorffennol Ni all y dyddiad terfyn fod cyn y dyddiad rhyddhau + Mae'r ffeil hon yn cael ei lanlwytho fel rhan o ffolder, ond ni chaniateir creu ffolder newydd yma + Ni chaniateir creu ffolder newydd yma + Templed Cynnwys wedi'i gadw + Mae newidiadau wedi'u cadw'n llwyddiannus + Mae Grŵp Aelodau arall gyda'r un enw yn bodoli yn barod + Allforiwyd eitem(au) geiriadur i ffeil + Mae gwall wedi digwydd wrth allforio'r eitem(au) geiriadur + Mae'r eitem(au) geiriadur canlynol wedi ei mewnforio! + Nid yw parthau wedi'u ffurfweddu ar gyfer gwefan amlieithog, cysylltwch â gweinyddwr, gweler y log am ragor o wybodaeth + Nid oes parth wedi ei ffurfweddu ar gyfer %0%, cysylltwch â gweinyddwr, gweler y log am fwy o wybodaeth + Digwyddodd gwall wrth alluogi glanhau fersiwn ar gyfer %0% + Digwyddodd gwall wrth analluogi glanhau fersiwn ar gyfer %0% + Mae gwybodaeth eich system wedi'i chopïo'n llwyddiannus i'r clipfwrdd + Methu â chopïo gwybodaeth eich system i'r clipfwrdd Yn defnyddio cystrawen CSS e.e: h1, .coch, .glas @@ -1813,6 +1900,7 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang esgynnol disgynnol Templed + Nid oes modd golygu cynnwys wrth ddefnyddio modd amser rhedeg <code>Production</code>. Golygydd Testun Gyfoethog @@ -1863,6 +1951,9 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang Rhybudd Rydych chi'n dileu'r ffurfwedd rhes Bydd dileu enw ffurfwedd rhes yn arwain at golli data ar gyfer unrhyw gynnwys cynfodol sy'n seiliedig ar ffurfwedd hwn. + <p>Bydd addasu enw cyfluniad rhes yn arwain at golli data ar gyfer unrhyw gynnwys presennol sy'n seiliedig ar y ffurfweddiad hwn.</p> <p><strong>Ni fydd addasu'r label yn unig yn arwain at golli data.</strong></p> + Rydych chi'n dileu'r gosodiad + Bydd addasu cynllun yn arwain at golli data ar gyfer unrhyw gynnwys presennol sy'n seiliedig ar y ffurfweddiad hwn. Cyfansoddiadau @@ -1947,6 +2038,17 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang Ychwanegu tab Trawsnewid i dab Llusgwch eiddo yma i'w gosod yn syth ar y tab + Rydych chi'n cael gwared ar y nod plentyn + Bydd tynnu nod plentyn yn cyfyngu ar opsiynau'r golygydd i greu gwahanol fathau o gynnwys o dan nod. + bydd defnyddio'r golygydd hwn yn cael ei ddiweddaru gyda'r gosodiadau newydd. + Glanhau hanes + Caniatáu diystyru'r gosodiadau glanhau hanes byd-eang. + Cadwch bob fersiwn yn fwy newydd na dyddiau + Cadwch y fersiwn diweddaraf y dydd am ddyddiau + Atal glanhau + Galluogi glanhau + <strong>NODYN!</strong> Mae glanhau fersiynau cynnwys hanesyddol wedi'u hanalluogi'n fyd-eang. Ni fydd y gosodiadau hyn yn dod i rym cyn iddo gael ei alluogi. + Mae newid math o ddata gyda gwerthoedd storio wedi'i analluogi. I ganiatáu hyn gallwch newid y gosodiad Umbraco:CMS:DataTypes:CanBeChanged yn appssettings.json. Ychwanegu iaith @@ -1960,6 +2062,12 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang Er mwyn caniatáu i gynnwys amlieithog ddisgyn yn ôl i iaith arall os nad yw'n bresennol yn yr iaith y gofynnwyd amdani, dewiswch hi yma. Iaith cwympo yn ôl dim + Cod ISO + <strong>%0%</strong> yn cael ei rannu ar draws ieithoedd a segmentau. + <strong>%0%</strong> yn cael ei rannu ar draws pob iaith. + <strong>%0%</strong> yn cael ei rannu ar draws pob segment. + Wedi'i rannu: Ieithoedd + Wedi'i rannu: Segments Ychwanegu paramedr @@ -2323,6 +2431,26 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang Diweddaraf Mewngofnodi diweddaraf No user groups have been added + Mae defnyddiwr gyda'r mewngofnodi hwn eisoes yn bodoli + Rhaid bod gan y cyfrinair o leiaf un digid ('0'-'9') + Rhaid bod gan y cyfrinair o leiaf un llythrennau bach ('a'-'z') + Rhaid i'r cyfrinair gynnwys o leiaf un nod nad yw'n alffaniwmerig + Rhaid i'r cyfrinair ddefnyddio o leiaf %0% o nodau gwahanol + Rhaid bod gan y cyfrinair o leiaf un priflythrennau ('A'-'Z') + Rhaid i'r cyfrinair fod o leiaf %0% nod + Cyfyngu ar yr ieithoedd y mae gan ddefnyddwyr fynediad i olygu + Caniatáu mynediad i bob iaith + Mae gan y defnyddiwr set cyfrinair yn barod + Mae'r defnyddiwr yn y grŵp '%0%' yn barod + Nid yw cloi allan wedi'i alluogi ar gyfer y defnyddiwr hwn + Nid yw'r defnyddiwr yn y grŵp '%0%' + Ffurfweddu Dau-Ffactor + Cymeradwy + Os ydych chi am analluogi'r darparwr dau ffactor hwn, yna rhaid i chi nodi'r cod a ddangosir ar eich dyfais ddilysu: + Mae'r darparwr dau ffactor hwn wedi'i alluogi + Mae'r darparwr dau-ffactor hwn bellach wedi'i analluogi + Aeth rhywbeth o'i le wrth geisio analluogi'r darparwr dau ffactor hwn + Ydych chi am analluogi'r darparwr dau ffactor hwn ar gyfer y defnyddiwr hwn? Dilysiad @@ -2352,6 +2480,15 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang Dilysiad arferu %1% mwy.]]> %1% gormod.]]> + Enw grŵp aelod annilys + Enw grŵp defnyddiwr annilys + Tocyn annilys + Enw defnyddiwr annilys + Mae e-bost '%0%' wedi'i gymryd yn barod + Mae enw grŵp defnyddiwr '%0%' wedi'i gymryd yn barod + Mae enw grŵp aelod '%0%' wedi'i gymryd yn barod + Mae'r enw defnyddiwr '%0%' wedi'i gymryd yn barod + Nid yw'r gofynion maint cynnwys yn cael eu bodloni ar gyfer un maes neu fwy.
     Content In Index
    {{key}} {{val}}