From 50da4a77def576aaa0b3b18367cd0983f184984b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Kottal?= Date: Wed, 17 Nov 2021 01:38:15 +0100 Subject: [PATCH 001/123] Adds support for simple markdown in property descriptions, and extended property descriptions (#11628) * Adds support for simple markdown in property descriptions, and extended descriptions * removes max-width for property descriptions (doesn't make sense to limit these IMO) (cherry picked from commit 8393fdecfbb24f668accf921d44bccff36bd2079) --- .../property/umbproperty.directive.js | 14 +++++++++++++ .../common/filters/simpleMarkdown.filter.js | 20 +++++++++++++++++++ src/Umbraco.Web.UI.Client/src/less/main.less | 1 - .../components/property/umb-property.html | 15 +++++++++++++- 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js index f4cfacbf70..25e55455db 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js @@ -75,7 +75,21 @@ // inheritance is (i.e.infinite editing) var found = angularHelper.traverseScopeChain($scope, s => s && s.vm && s.vm.constructor.name === "UmbPropertyController"); vm.parentUmbProperty = found ? found.vm : null; + } + + if (vm.property.description) { + // split by lines containing only '--' + var descriptionParts = vm.property.description.split(/^--$/gim); + if (descriptionParts.length > 1) { + // if more than one part, we have an extended description, + // combine to one extended description, and remove leading linebreak + vm.property.extendedDescription = descriptionParts.splice(1).join("--").substring(1); + vm.property.extendedDescriptionVisible = false; + + // set propertydescription to first part, and remove trailing linebreak + vm.property.description = descriptionParts[0].slice(0, -1); } + } } } diff --git a/src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js b/src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js new file mode 100644 index 0000000000..58d5b0ed91 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js @@ -0,0 +1,20 @@ +/** +* @ngdoc filter +* @name umbraco.filters.simpleMarkdown +* @description +* Used when rendering a string as Markdown as HTML (i.e. with ng-bind-html). Allows use of **bold**, *italics*, ![images](url) and [links](url) +**/ +angular.module("umbraco.filters").filter('simpleMarkdown', function () { + return function (text) { + if (!text) { + return ''; + } + + return text + .replace(/\*\*(.*)\*\*/gim, '$1') + .replace(/\*(.*)\*/gim, '$1') + .replace(/!\[(.*?)\]\((.*?)\)/gim, "$1") + .replace(/\[(.*?)\]\((.*?)\)/gim, "$1") + .replace(/\n/g, '
').trim(); + }; +}); diff --git a/src/Umbraco.Web.UI.Client/src/less/main.less b/src/Umbraco.Web.UI.Client/src/less/main.less index 66afbfd73f..43911fccb1 100644 --- a/src/Umbraco.Web.UI.Client/src/less/main.less +++ b/src/Umbraco.Web.UI.Client/src/less/main.less @@ -237,7 +237,6 @@ umb-property:last-of-type .umb-control-group { } .control-description { - max-width:480px;// avoiding description becoming too wide when its placed on top of property. margin-bottom: 5px; } } diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html index 650fd143c1..a037feaca2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html @@ -24,7 +24,20 @@ - + + +
+ +
+ +
+ + + +
From c3b619fbbf5c338417452a5c4deed7c3910bb4c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Jan 2022 09:04:27 +0000 Subject: [PATCH 002/123] Bump follow-redirects in /src/Umbraco.Web.UI.Client Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.4 to 1.14.7. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.4...v1.14.7) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] --- src/Umbraco.Web.UI.Client/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/package-lock.json b/src/Umbraco.Web.UI.Client/package-lock.json index 0145421fa9..c6fed4cf14 100644 --- a/src/Umbraco.Web.UI.Client/package-lock.json +++ b/src/Umbraco.Web.UI.Client/package-lock.json @@ -5036,9 +5036,9 @@ } }, "follow-redirects": { - "version": "1.14.4", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", - "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==", + "version": "1.14.7", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz", + "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==", "dev": true }, "font-awesome": { From 6a95ff366fbe1b001c7b71deeb1e9afd0e4c4770 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Sun, 2 Jan 2022 20:19:25 +0100 Subject: [PATCH 003/123] Ensure query is not null before using Trim() --- .../Controllers/ExamineManagementController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs b/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs index 008582b6b3..911e50d0a0 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs @@ -64,7 +64,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers public ActionResult GetSearchResults(string searcherName, string query, int pageIndex = 0, int pageSize = 20) { - query = query.Trim(); + query = query?.Trim(); if (query.IsNullOrWhiteSpace()) { From aae86946180a9998254abebebcaf16be0e49396f Mon Sep 17 00:00:00 2001 From: Lantzify Date: Sat, 8 Jan 2022 15:44:01 +0100 Subject: [PATCH 004/123] Added description to entityResource.getSafeAlias --- .../src/common/resources/entity.resource.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js index d94bb4e6be..a07ade2b55 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js @@ -36,6 +36,27 @@ function entityResource($q, $http, umbRequestHelper) { //the factory object returned return { + /** + * @ngdoc method + * @name umbraco.resources.entityResource#getSafeAlias + * @methodOf umbraco.resources.entityResource + * + * @description + * Converts the given string to a safe alias + * + * ##usage + *
+         * entityResource.getSafeAlias(value, camelCase)
+         *    .then(function(safeAlias) {
+         *        Do stuff...
+         *    });
+         * 
+ * + * @param {string} value the value to convert to a safe alias + * @param {boolean} camelCase if camel casing should be used + * @returns {Promise} resourcePromise object containing the safe alias. + * + */ getSafeAlias: function (value, camelCase) { if (!value) { From 477697a70cd8b10703f6cf428ceb1da47bfad257 Mon Sep 17 00:00:00 2001 From: Lennard Fonteijn Date: Fri, 22 Oct 2021 13:28:18 +0200 Subject: [PATCH 005/123] Removed if-check to allow empty values from blocks --- .../common/services/blockeditormodelobject.service.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js b/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js index 22baed8472..168abfaa6a 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js @@ -30,9 +30,8 @@ for (var p = 0; p < tab.properties.length; p++) { var prop = tab.properties[p]; - if (dataModel[prop.alias]) { - prop.value = dataModel[prop.alias]; - } + + prop.value = dataModel[prop.alias]; } } @@ -53,9 +52,8 @@ for (var p = 0; p < tab.properties.length; p++) { var prop = tab.properties[p]; - if (prop.value) { - dataModel[prop.alias] = prop.value; - } + + dataModel[prop.alias] = prop.value; } } From f2450fb539603b8ef085f9ba906c4c78bb38fe2b Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Sun, 30 Jan 2022 23:34:37 +0100 Subject: [PATCH 006/123] Constant icon blueprint (#11812) * Add constant for blueprint icon * Use constant for folder icon * Create empty array of IEntitySlim as the GetAll() method returns IEnumerable * Use constant --- src/Umbraco.Core/Constants-Icons.cs | 7 ++++++- .../Trees/ContentBlueprintTreeController.cs | 9 +++++---- .../Trees/ContentTypeTreeController.cs | 2 +- .../Trees/MediaTypeTreeController.cs | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Core/Constants-Icons.cs b/src/Umbraco.Core/Constants-Icons.cs index 62e19008dd..39980f116a 100644 --- a/src/Umbraco.Core/Constants-Icons.cs +++ b/src/Umbraco.Core/Constants-Icons.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Cms.Core +namespace Umbraco.Cms.Core { public static partial class Constants { @@ -9,6 +9,11 @@ /// public const string DefaultIcon = Content; + /// + /// System blueprint icon + /// + public const string Blueprint = "icon-blueprint"; + /// /// System content icon /// diff --git a/src/Umbraco.Web.BackOffice/Trees/ContentBlueprintTreeController.cs b/src/Umbraco.Web.BackOffice/Trees/ContentBlueprintTreeController.cs index efbc71f6cb..72bf6c299c 100644 --- a/src/Umbraco.Web.BackOffice/Trees/ContentBlueprintTreeController.cs +++ b/src/Umbraco.Web.BackOffice/Trees/ContentBlueprintTreeController.cs @@ -80,13 +80,13 @@ namespace Umbraco.Cms.Web.BackOffice.Trees if (id == Constants.System.RootString) { //get all blueprint content types - var contentTypeAliases = entities.Select(x => ((IContentEntitySlim) x).ContentTypeAlias).Distinct(); + var contentTypeAliases = entities.Select(x => ((IContentEntitySlim)x).ContentTypeAlias).Distinct(); //get the ids var contentTypeIds = _contentTypeService.GetAllContentTypeIds(contentTypeAliases.ToArray()).ToArray(); //now get the entities ... it's a bit round about but still smaller queries than getting all document types var docTypeEntities = contentTypeIds.Length == 0 - ? new IUmbracoEntity[0] + ? new IEntitySlim[0] : _entityService.GetAll(UmbracoObjectTypes.DocumentType, contentTypeIds).ToArray(); nodes.AddRange(docTypeEntities @@ -112,11 +112,11 @@ namespace Umbraco.Cms.Web.BackOffice.Trees var ct = _contentTypeService.Get(intId); if (ct == null) return nodes; - var blueprintsForDocType = entities.Where(x => ct.Alias == ((IContentEntitySlim) x).ContentTypeAlias); + var blueprintsForDocType = entities.Where(x => ct.Alias == ((IContentEntitySlim)x).ContentTypeAlias); nodes.AddRange(blueprintsForDocType .Select(entity => { - var treeNode = CreateTreeNode(entity, Constants.ObjectTypes.DocumentBlueprint, id, queryStrings, "icon-blueprint", false); + var treeNode = CreateTreeNode(entity, Constants.ObjectTypes.DocumentBlueprint, id, queryStrings, Constants.Icons.Blueprint, false); treeNode.Path = $"-1,{ct.Id},{entity.Id}"; return treeNode; })); @@ -135,6 +135,7 @@ namespace Umbraco.Cms.Web.BackOffice.Trees menu.Items.Add(new RefreshNode(LocalizedTextService, true)); return menu; } + var cte = _entityService.Get(int.Parse(id, CultureInfo.InvariantCulture), UmbracoObjectTypes.DocumentType); //only refresh & create if it's a content type if (cte != null) diff --git a/src/Umbraco.Web.BackOffice/Trees/ContentTypeTreeController.cs b/src/Umbraco.Web.BackOffice/Trees/ContentTypeTreeController.cs index 27eb5b7f6e..9fd4f98875 100644 --- a/src/Umbraco.Web.BackOffice/Trees/ContentTypeTreeController.cs +++ b/src/Umbraco.Web.BackOffice/Trees/ContentTypeTreeController.cs @@ -67,7 +67,7 @@ namespace Umbraco.Cms.Web.BackOffice.Trees .OrderBy(entity => entity.Name) .Select(dt => { - var node = CreateTreeNode(dt.Id.ToString(), id, queryStrings, dt.Name, "icon-folder", dt.HasChildren, ""); + var node = CreateTreeNode(dt.Id.ToString(), id, queryStrings, dt.Name, Constants.Icons.Folder, dt.HasChildren, ""); node.Path = dt.Path; node.NodeType = "container"; // TODO: This isn't the best way to ensure a no operation process for clicking a node but it works for now. diff --git a/src/Umbraco.Web.BackOffice/Trees/MediaTypeTreeController.cs b/src/Umbraco.Web.BackOffice/Trees/MediaTypeTreeController.cs index c19c9a800a..a631165613 100644 --- a/src/Umbraco.Web.BackOffice/Trees/MediaTypeTreeController.cs +++ b/src/Umbraco.Web.BackOffice/Trees/MediaTypeTreeController.cs @@ -54,7 +54,7 @@ namespace Umbraco.Cms.Web.BackOffice.Trees .OrderBy(entity => entity.Name) .Select(dt => { - var node = CreateTreeNode(dt.Id.ToString(), id, queryStrings, dt.Name, "icon-folder", dt.HasChildren, ""); + var node = CreateTreeNode(dt.Id.ToString(), id, queryStrings, dt.Name, Constants.Icons.Folder, dt.HasChildren, ""); node.Path = dt.Path; node.NodeType = "container"; // TODO: This isn't the best way to ensure a no operation process for clicking a node but it works for now. From 2abf455abf2e23f73cf3c51497bcfdcc4274e4cb Mon Sep 17 00:00:00 2001 From: Arul Prabakaran Date: Mon, 31 Jan 2022 04:38:51 +0530 Subject: [PATCH 007/123] Updated border radius of .umb-notifications__notification to match button radius (#11745) --- .../src/less/components/notifications/umb-notifications.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less b/src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less index 050f907acc..a63c6a521d 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less @@ -22,7 +22,7 @@ font-size: 14px; border: none; position: relative; - border-radius: 10px; + border-radius: 3px; margin: 10px; .close { From 3167c8b2131754f145d66a2997ce1d5a2cc54688 Mon Sep 17 00:00:00 2001 From: andreymkarandashov Date: Wed, 9 Jun 2021 10:17:01 +0300 Subject: [PATCH 008/123] encode group name to avoid the issue --- .../src/views/content/content.protect.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.protect.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.protect.controller.js index fcd0294849..92efb24e63 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.protect.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.protect.controller.js @@ -92,7 +92,7 @@ function save() { vm.buttonState = "busy"; - var groups = _.map(vm.groups, function (group) { return group.name; }); + var groups = _.map(vm.groups, function (group) { return encodeURIComponent(group.name); }); var usernames = _.map(vm.members, function (member) { return member.username; }); contentResource.updatePublicAccess(id, groups, usernames, vm.loginPage.id, vm.errorPage.id).then( function () { From 472cc716c464e39976d64c7f4610fff5303d50b5 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Mon, 31 Jan 2022 02:40:15 +0100 Subject: [PATCH 009/123] Accept zip as extension in local package installer (#11109) * Update ngf-pattern and accept * Restructure less * Remove ng-invalid again --- .../components/umb-package-local-install.less | 75 ++++++++++--------- .../views/install-local.controller.js | 2 +- .../views/packages/views/install-local.html | 16 ++-- 3 files changed, 49 insertions(+), 44 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-package-local-install.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-package-local-install.less index ead54ac49f..43f3c5e353 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-package-local-install.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-package-local-install.less @@ -9,44 +9,51 @@ color: @gray-5; } -.umb-upload-local__dropzone { - position: relative; - width: 500px; - height: 300px; - border: 2px dashed @ui-action-border; - border-radius: 3px; - background: @white; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - margin-bottom: 30px; - transition: 100ms box-shadow ease, 100ms border ease; +.umb-upload-local { - &.drag-over { - border-color: @ui-action-border-hover; - border-style: solid; - box-shadow: 0 3px 8px rgba(0,0,0, .1); + &__dropzone { + position: relative; + width: 500px; + height: 300px; + border: 2px dashed @ui-action-border; + border-radius: 3px; + background: @white; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin-bottom: 30px; transition: 100ms box-shadow ease, 100ms border ease; + + &.drag-over { + border-color: @ui-action-border-hover; + border-style: solid; + box-shadow: 0 3px 8px rgba(0,0,0, .1); + transition: 100ms box-shadow ease, 100ms border ease; + } + + .umb-icon { + display: block; + color: @ui-action-type; + font-size: 6.75rem; + line-height: 1; + margin: 0 auto; + } + + .umb-info-local-item { + margin: 20px; + } } - .umb-icon { - display: block; + &__select-file { + font-weight: bold; color: @ui-action-type; - font-size: 6.75rem; - line-height: 1; - margin: 0 auto; - } -} + cursor: pointer; -.umb-upload-local__select-file { - font-weight: bold; - color: @ui-action-type; - cursor: pointer; - - &:hover { - text-decoration: underline; - color: @ui-action-type-hover; + &:hover { + text-decoration: underline; + color: @ui-action-type-hover; + } } } @@ -117,7 +124,3 @@ .umb-info-local-item { margin-bottom: 20px; } - -.umb-upload-local__dropzone .umb-info-local-item { - margin:20px; -} diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/views/install-local.controller.js b/src/Umbraco.Web.UI.Client/src/views/packages/views/install-local.controller.js index 0d9341243b..5996ae105c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packages/views/install-local.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packages/views/install-local.controller.js @@ -19,7 +19,7 @@ serverErrorMessage: null }; - $scope.handleFiles = function (files, event) { + $scope.handleFiles = function (files, event, invalidFiles) { if (files) { for (var i = 0; i < files.length; i++) { upload(files[i]); diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/views/install-local.html b/src/Umbraco.Web.UI.Client/src/views/packages/views/install-local.html index 3ad15e15b9..4d44af7d6e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packages/views/install-local.html +++ b/src/Umbraco.Web.UI.Client/src/views/packages/views/install-local.html @@ -10,14 +10,15 @@
+ ngf-max-size="{{maxFileSize}}" + ngf-pattern="'.zip'" + accept=".zip" + ng-class="{ 'is-small': compact !== 'false' || (done.length + queue.length) > 0 }">
@@ -31,10 +32,11 @@
+ ngf-max-size="{{maxFileSize}}" + ngf-pattern="'.zip'" + accept=".zip"> - or click here to choose files
From 4382868f8248a3e7ce30619a68ab609d9f92dc8c Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 31 Jan 2022 14:18:55 +0100 Subject: [PATCH 010/123] Upgrade Examine to v1.2.2 --- build/NuSpecs/UmbracoCms.Web.nuspec | 2 +- src/Umbraco.Examine/Umbraco.Examine.csproj | 2 +- src/Umbraco.Tests/Umbraco.Tests.csproj | 2 +- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 2 +- src/Umbraco.Web/Umbraco.Web.csproj | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/NuSpecs/UmbracoCms.Web.nuspec b/build/NuSpecs/UmbracoCms.Web.nuspec index fa7c9b5c17..e0b41f08d8 100644 --- a/build/NuSpecs/UmbracoCms.Web.nuspec +++ b/build/NuSpecs/UmbracoCms.Web.nuspec @@ -28,7 +28,7 @@ - + diff --git a/src/Umbraco.Examine/Umbraco.Examine.csproj b/src/Umbraco.Examine/Umbraco.Examine.csproj index 39fbe927d4..d515361344 100644 --- a/src/Umbraco.Examine/Umbraco.Examine.csproj +++ b/src/Umbraco.Examine/Umbraco.Examine.csproj @@ -49,7 +49,7 @@ - + 1.0.0-beta2-19324-01 runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj index c106e0206c..48889a0694 100644 --- a/src/Umbraco.Tests/Umbraco.Tests.csproj +++ b/src/Umbraco.Tests/Umbraco.Tests.csproj @@ -81,7 +81,7 @@ - + 1.8.14 diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 6114a84b2a..92a60682e8 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -88,7 +88,7 @@ - + diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 89317e8f99..d58082ae96 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -63,7 +63,7 @@ - + 2.9.1 From 924a819baa51c73f7a5795590c66c892b2908e99 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 31 Jan 2022 15:39:34 +0100 Subject: [PATCH 011/123] Upgrade ClientDependency to 1.9.10 --- build/NuSpecs/UmbracoCms.Web.nuspec | 2 +- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 2 +- src/Umbraco.Web/Umbraco.Web.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/NuSpecs/UmbracoCms.Web.nuspec b/build/NuSpecs/UmbracoCms.Web.nuspec index e0b41f08d8..c51890397f 100644 --- a/build/NuSpecs/UmbracoCms.Web.nuspec +++ b/build/NuSpecs/UmbracoCms.Web.nuspec @@ -25,7 +25,7 @@ not want this to happen as the alpha of the next major is, really, the next major already. --> - + diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 92a60682e8..7367dc4936 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -86,7 +86,7 @@ - + diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index d58082ae96..248984c330 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -61,7 +61,7 @@ - + From ec183e481c4b02997eee5750f4a3aff0aadc32b4 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 31 Jan 2022 15:47:51 +0100 Subject: [PATCH 012/123] Bump version to 8.18.0-rc --- src/SolutionInfo.cs | 6 +++--- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index a8a04a0679..4f9fa93a31 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -2,7 +2,7 @@ using System.Resources; [assembly: AssemblyCompany("Umbraco")] -[assembly: AssemblyCopyright("Copyright © Umbraco 2021")] +[assembly: AssemblyCopyright("Copyright © Umbraco 2022")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -18,5 +18,5 @@ using System.Resources; [assembly: AssemblyVersion("8.0.0")] // these are FYI and changed automatically -[assembly: AssemblyFileVersion("8.17.2")] -[assembly: AssemblyInformationalVersion("8.17.2")] +[assembly: AssemblyFileVersion("8.18.0")] +[assembly: AssemblyInformationalVersion("8.18.0-rc")] diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 7367dc4936..b733678ec9 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -348,9 +348,9 @@ False True - 8172 + 8180 / - http://localhost:8172 + http://localhost:8180 False False @@ -433,4 +433,4 @@ - + \ No newline at end of file From 9a5bcf290d53f1def9d689831c32c8c4ea3fc6b2 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Tue, 1 Feb 2022 01:50:22 +0100 Subject: [PATCH 013/123] Retain mculture when clicking results from global search (#7192) --- .../src/common/services/navigation.service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js index c8553ec02a..b586d50d89 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js @@ -259,8 +259,8 @@ function navigationService($routeParams, $location, $q, $injector, eventsService var updated = false; retainedQueryStrings.forEach(r => { - // if mculture is set to null in nextRouteParams, the value will be undefined and we will not retain any query string that has a value of "null" - if (currRouteParams[r] && nextRouteParams[r] !== undefined && !nextRouteParams[r]) { + // testing explicitly for undefined in nextRouteParams here, as it must be possible to "unset" e.g. mculture by specifying a null value + if (currRouteParams[r] && nextRouteParams[r] === undefined) { toRetain[r] = currRouteParams[r]; updated = true; } From 0b0182f5507cf646f117aebf0f1338fdf408afa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 8 Feb 2022 10:35:06 +0100 Subject: [PATCH 014/123] Apply the Umbraco logo to BackOffice (#11949) * adding logo as text in replacement of umbraco_logo_white, this will enable existing configuration to continue to work and minimise the breaking change of this PR. * adjust logo position to fit with logged-in logomark. Allowing for the logo and customised logo to be very wide. * adding logomark in topbar of backoffice * login box style * correction of shadow * Logo modal, to display more information about the product including linking to the website * rename to modal * stop hidden when mouse is out * Version line without Umbraco * focus link and use blur as the indication for closing. * correcting to rgba * focus and click outside needs a little help to work well * use @zindexUmbOverlay to ensure right depth going forward. * adding large logo svg * append ; * tidy logo svg file --- .../application/umbappheader.directive.js | 33 +++- .../application/umb-app-header.less | 55 +++++- .../src/less/pages/login.less | 12 +- .../application/umb-app-header.html | 100 +++++++++-- .../src/views/errors/BootFailed.html | 160 +++++++++--------- .../application/umbraco_logo_large_blue.svg | 41 +++++ .../img/application/umbraco_logo_white.svg | 44 ++++- .../application/umbraco_logomark_white.svg | 3 + 8 files changed, 344 insertions(+), 104 deletions(-) create mode 100644 src/Umbraco.Web.UI/Umbraco/assets/img/application/umbraco_logo_large_blue.svg create mode 100644 src/Umbraco.Web.UI/Umbraco/assets/img/application/umbraco_logomark_white.svg diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbappheader.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbappheader.directive.js index b52b0a5763..6cf6dd85f3 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbappheader.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbappheader.directive.js @@ -1,9 +1,9 @@ (function () { "use strict"; - function AppHeaderDirective(eventsService, appState, userService, focusService, backdropService, overlayService) { + function AppHeaderDirective(eventsService, appState, userService, focusService, overlayService, $timeout) { - function link(scope, el, attr, ctrl) { + function link(scope, element) { var evts = []; @@ -84,6 +84,35 @@ overlayService.open(dialog); }; + scope.logoModal = { + show: false, + text: "", + timer: null + }; + scope.showLogoModal = function() { + $timeout.cancel(scope.logoModal.timer); + scope.logoModal.show = true; + scope.logoModal.text = "version "+Umbraco.Sys.ServerVariables.application.version; + $timeout(function () { + const anchorLink = element[0].querySelector('.umb-app-header__logo-modal'); + if(anchorLink) { + anchorLink.focus(); + } + }); + }; + scope.keepLogoModal = function() { + $timeout.cancel(scope.logoModal.timer); + }; + scope.hideLogoModal = function() { + $timeout.cancel(scope.logoModal.timer); + scope.logoModal.timer = $timeout(function () { + scope.logoModal.show = false; + }, 100); + }; + scope.stopClickEvent = function($event) { + $event.stopPropagation(); + }; + } var directive = { diff --git a/src/Umbraco.Web.UI.Client/src/less/components/application/umb-app-header.less b/src/Umbraco.Web.UI.Client/src/less/components/application/umb-app-header.less index 68a29df89e..bb346fc402 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/application/umb-app-header.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/application/umb-app-header.less @@ -2,12 +2,65 @@ background: @blueExtraDark; display: flex; align-items: center; - justify-content: space-between; max-width: 100%; height: @appHeaderHeight; padding: 0 20px; } +.umb-app-header__logo { + margin-right: 30px; + button { + img { + height: 30px; + } + } +} + +.umb-app-header__logo-modal { + position: absolute; + z-index: @zindexUmbOverlay; + top: 50px; + left: 17px; + font-size: 13px; + + border-radius: 6px; + + width: 160px; + padding: 20px 20px; + background-color:@white; + color: @blueExtraDark; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .14), 0 1px 6px 1px rgba(0, 0, 0, .14); + text-decoration: none; + + text-align: center; + + &::before { + content:''; + position: absolute; + transform: rotate(45deg); + background-color:@white; + top: -4px; + left: 14px; + width: 8px; + height: 8px; + } + + img { + display: block; + height: auto; + width: 120px; + margin-left: auto; + margin-right: auto; + margin-bottom: 3px; + } +} + +.umb-app-header__right { + display: flex; + align-items: center; + margin-left: auto; +} + .umb-app-header__actions { display: flex; list-style: none; diff --git a/src/Umbraco.Web.UI.Client/src/less/pages/login.less b/src/Umbraco.Web.UI.Client/src/less/pages/login.less index cf49af526b..015c291564 100644 --- a/src/Umbraco.Web.UI.Client/src/less/pages/login.less +++ b/src/Umbraco.Web.UI.Client/src/less/pages/login.less @@ -28,12 +28,15 @@ .login-overlay__logo { position: absolute; - top: 22px; - left: 25px; - width: 30px; + top: 12.5px; + left: 20px; + right: 25px; height: 30px; z-index: 1; } +.login-overlay__logo img { + height: 100%; +} .login-overlay .umb-modalcolumn { background: none; @@ -66,7 +69,8 @@ margin-right: 25px; margin-top: auto; margin-bottom: auto; - border-radius: @baseBorderRadius; + border-radius: @doubleBorderRadius; + box-shadow: 0 1px 6px 1px rgba(0, 0, 0, 0.12); } .login-overlay .form input[type="text"], diff --git a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-app-header.html b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-app-header.html index e0fb4aeb77..98b8d88869 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-app-header.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-app-header.html @@ -1,34 +1,99 @@ -
-
- - + -
+ + +
  • -
  • -
  • -
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/errors/BootFailed.html b/src/Umbraco.Web.UI.Client/src/views/errors/BootFailed.html index c08627739a..7b91125e09 100644 --- a/src/Umbraco.Web.UI.Client/src/views/errors/BootFailed.html +++ b/src/Umbraco.Web.UI.Client/src/views/errors/BootFailed.html @@ -1,79 +1,87 @@ - - - - Boot Failed - - - -
- -
-

Boot Failed

-

Umbraco failed to boot, if you are the owner of the website please see the log file for more details.

-
-
- + + + + Boot Failed + + + +
+ +
+

Boot Failed

+

+ Umbraco failed to boot, if you are the owner of the website + please see the log file for more details. +

+
+
+ diff --git a/src/Umbraco.Web.UI/Umbraco/assets/img/application/umbraco_logo_large_blue.svg b/src/Umbraco.Web.UI/Umbraco/assets/img/application/umbraco_logo_large_blue.svg new file mode 100644 index 0000000000..95d9bc6084 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/assets/img/application/umbraco_logo_large_blue.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + diff --git a/src/Umbraco.Web.UI/Umbraco/assets/img/application/umbraco_logo_white.svg b/src/Umbraco.Web.UI/Umbraco/assets/img/application/umbraco_logo_white.svg index b27ae89e91..c0bdbdd40c 100644 --- a/src/Umbraco.Web.UI/Umbraco/assets/img/application/umbraco_logo_white.svg +++ b/src/Umbraco.Web.UI/Umbraco/assets/img/application/umbraco_logo_white.svg @@ -1,3 +1,41 @@ - - - + + + + + + + + + + + + diff --git a/src/Umbraco.Web.UI/Umbraco/assets/img/application/umbraco_logomark_white.svg b/src/Umbraco.Web.UI/Umbraco/assets/img/application/umbraco_logomark_white.svg new file mode 100644 index 0000000000..b27ae89e91 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/assets/img/application/umbraco_logomark_white.svg @@ -0,0 +1,3 @@ + + + From 8c780573f4563b3ec3cd6b35500aed1a533813a2 Mon Sep 17 00:00:00 2001 From: Matt Brailsford Date: Tue, 8 Feb 2022 09:41:35 +0000 Subject: [PATCH 015/123] Don't hold static UmbracoContext reference Fixes #11951 by changing `UmbracoContext` to be an expression rather than being a static setter thus ensuring the current umbraco context is always returned, rather than a cached version from initial execution --- .../Extensions/FriendlyUrlHelperExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.Common/Extensions/FriendlyUrlHelperExtensions.cs b/src/Umbraco.Web.Common/Extensions/FriendlyUrlHelperExtensions.cs index 0340ce7a50..c812e77c01 100644 --- a/src/Umbraco.Web.Common/Extensions/FriendlyUrlHelperExtensions.cs +++ b/src/Umbraco.Web.Common/Extensions/FriendlyUrlHelperExtensions.cs @@ -9,7 +9,7 @@ namespace Umbraco.Extensions public static class FriendlyUrlHelperExtensions { - private static IUmbracoContext UmbracoContext { get; } = + private static IUmbracoContext UmbracoContext => StaticServiceProvider.Instance.GetRequiredService().GetRequiredUmbracoContext(); private static IDataProtectionProvider DataProtectionProvider { get; } = From 4eda091fdb997ab775fa893a67d78a7e115f714c Mon Sep 17 00:00:00 2001 From: Callum Whyte Date: Wed, 9 Feb 2022 21:56:59 +0000 Subject: [PATCH 016/123] Lookup backoffice section name in route locationTitle (#11816) * Lookup backoffice section name in route locationTitle * Getting original title from $rootScope --- src/Umbraco.Web.UI.Client/src/init.js | 74 ++++++++------------------- 1 file changed, 20 insertions(+), 54 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/init.js b/src/Umbraco.Web.UI.Client/src/init.js index b31ea0e699..92ed2c4944 100644 --- a/src/Umbraco.Web.UI.Client/src/init.js +++ b/src/Umbraco.Web.UI.Client/src/init.js @@ -1,6 +1,6 @@ /** Executed when the application starts, binds to events and set global state */ -app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService', 'appState', 'assetsService', 'eventsService', '$cookies', 'tourService', 'localStorageService', - function ($rootScope, $route, $location, urlHelper, navigationService, appState, assetsService, eventsService, $cookies, tourService, localStorageService) { +app.run(['$rootScope', '$route', '$location', '$cookies', 'urlHelper', 'appState', 'assetsService', 'eventsService', 'tourService', 'localStorageService', 'navigationService', 'localizationService', + function ($rootScope, $route, $location, $cookies, urlHelper, appState, assetsService, eventsService, tourService, localStorageService, navigationService, localizationService) { //This sets the default jquery ajax headers to include our csrf token, we // need to user the beforeSend method because our token changes per user/login so @@ -33,9 +33,7 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService', if (introTour && introTour.disabled !== true && introTour.completed !== true) { tourService.startTour(introTour); localStorageService.set("introTourShown", true); - } - else { - + } else { const introTourShown = localStorageService.get("introTourShown"); if (!introTourShown) { // Go & show email marketing tour (ONLY when intro tour is completed or been dismissed) @@ -44,7 +42,6 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService', // Unless invoked from tourService JS Client code explicitly. // Accepted mails = Completed and Declicned mails = Disabled if (emailMarketingTour && emailMarketingTour.disabled !== true && emailMarketingTour.completed !== true) { - // Only show the email tour once per logged in session // The localstorage key is removed on logout or user session timeout const emailMarketingTourShown = localStorageService.get("emailMarketingTourShown"); @@ -71,31 +68,24 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService', var currentRouteParams = null; - var originalTitle = ""; - $rootScope.$on('$changeTitle', function (event, titlePrefix) { if (titlePrefix) { - $rootScope.locationTitle = titlePrefix + " - " + originalTitle; - } else { - $rootScope.locationTitle = originalTitle; + $rootScope.locationTitle = titlePrefix + " - " + $rootScope.locationTitle; } }); /** execute code on each successful route */ $rootScope.$on('$routeChangeSuccess', function (event, current, previous) { - var toRetain = currentRouteParams ? navigationService.retainQueryStrings(currentRouteParams, current.params) : null; //if toRetain is not null it means that there are missing query strings and we need to update the current params if (toRetain) { $route.updateParams(toRetain); currentRouteParams = toRetain; - } - else { + } else { currentRouteParams = Utilities.copy(current.params); } - var deployConfig = Umbraco.Sys.ServerVariables.deploy; var deployEnv, deployEnvTitle; if (deployConfig) { @@ -104,51 +94,39 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService', } if (current.params.section) { - - //Uppercase the current section, content, media, settings, developer, forms - var currentSection = current.params.section.charAt(0).toUpperCase() + current.params.section.slice(1); - - var baseTitle = currentSection + " - " + $location.$$host; - - //Check deploy for Global Umbraco.Sys obj workspace - if (deployEnv) { - $rootScope.locationTitle = deployEnvTitle + baseTitle; - } - else { - $rootScope.locationTitle = baseTitle; - } - - } - else { - + localizationService.localize("sections_" + current.params.section) + .then(function (currentSection) { + var baseTitle = currentSection + " - " + $location.$$host; + //Check deploy for Global Umbraco.Sys obj workspace + if (deployEnv) { + $rootScope.locationTitle = deployEnvTitle + baseTitle; + } else { + $rootScope.locationTitle = baseTitle; + } + }); + } else { if (deployEnv) { $rootScope.locationTitle = deployEnvTitle + "Umbraco - " + $location.$$host; } - $rootScope.locationTitle = "Umbraco - " + $location.$$host; } - originalTitle = $rootScope.locationTitle; }); /** When the route change is rejected - based on checkAuth - we'll prevent the rejected route from executing including wiring up it's controller, etc... and then redirect to the rejected URL. */ $rootScope.$on('$routeChangeError', function (event, current, previous, rejection) { - if (rejection.path) { event.preventDefault(); - var returnPath = null; if (rejection.path == "/login" || rejection.path.startsWith("/login/")) { //Set the current path before redirecting so we know where to redirect back to returnPath = encodeURIComponent($location.url()); } - $location.path(rejection.path) if (returnPath) { $location.search("returnPath", returnPath); } } - }); //Bind to $routeUpdate which will execute anytime a location changes but the route is not triggered. @@ -156,45 +134,32 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService', //global state query strings without force re-loading views. //We can then detect if it's a location change that should force a route or not programatically. $rootScope.$on('$routeUpdate', function (event, next) { - if (!currentRouteParams) { //if there is no current route then always route which is done with reload $route.reload(); - } - else { - + } else { var toRetain = navigationService.retainQueryStrings(currentRouteParams, next.params); - //if toRetain is not null it means that there are missing query strings and we need to update the current params. if (toRetain) { $route.updateParams(toRetain); } - //check if the location being changed is only due to global/state query strings which means the location change //isn't actually going to cause a route change. if (navigationService.isRouteChangingNavigation(currentRouteParams, next.params)) { - //The location change will cause a route change, continue the route if the query strings haven't been updated. $route.reload(); - - } - else { - + } else { //navigation is not changing but we should update the currentRouteParams to include all current parameters - if (toRetain) { currentRouteParams = toRetain; - } - else { + } else { currentRouteParams = Utilities.copy(next.params); } - //always clear the 'sr' query string (soft redirect) if it exists if (currentRouteParams.sr) { currentRouteParams.sr = null; $route.updateParams(currentRouteParams); } - } } }); @@ -202,6 +167,7 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService', //check for touch device, add to global appState //var touchDevice = ("ontouchstart" in window || window.touch || window.navigator.msMaxTouchPoints === 5 || window.DocumentTouch && document instanceof DocumentTouch); var touchDevice = /android|webos|iphone|ipad|ipod|blackberry|iemobile|touch/i.test(navigator.userAgent.toLowerCase()); + appState.setGlobalState("touchDevice", touchDevice); }]); From 6f89bf2a452950d1271d1867c192828c094238a3 Mon Sep 17 00:00:00 2001 From: Mark Drake Date: Wed, 9 Feb 2022 17:00:57 -0500 Subject: [PATCH 017/123] fixes umbraco logo appearance on backoffice login page, issue #11830 (#11900) * fixes umbraco logo appearance on backoffice login page, issue #11830 * gives umbraco logo minimum width of 30px, issue #11830 --- src/Umbraco.Web.UI.Client/src/less/pages/login.less | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Web.UI.Client/src/less/pages/login.less b/src/Umbraco.Web.UI.Client/src/less/pages/login.less index 2763a879ea..00827dde64 100644 --- a/src/Umbraco.Web.UI.Client/src/less/pages/login.less +++ b/src/Umbraco.Web.UI.Client/src/less/pages/login.less @@ -30,6 +30,7 @@ position: absolute; top: 22px; left: 25px; + min-width: 30px; height: 30px; z-index: 1; } From 731b06a9877d69a5e36a6737854fecbc6e34fae9 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Mon, 3 Jan 2022 21:38:17 +0100 Subject: [PATCH 018/123] Use pointer cursor pointer for keyboard shortcuts overview --- .../views/components/umb-keyboard-shortcuts-overview.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-keyboard-shortcuts-overview.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-keyboard-shortcuts-overview.html index c1f6985257..b5b6524ce3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-keyboard-shortcuts-overview.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-keyboard-shortcuts-overview.html @@ -1,6 +1,8 @@ -
+
-
show shortcuts
+
+ show shortcuts +
From be6e0879e4c4f31a74386a9181bdb278536d41b8 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Sun, 2 Jan 2022 19:55:10 +0100 Subject: [PATCH 019/123] Align tags vertically in content type property component --- .../src/less/components/umb-group-builder.less | 5 +++-- .../components/contenttype/umb-content-type-property.html | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less index 1122558b05..cae8a1c253 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less @@ -458,7 +458,7 @@ input.umb-group-builder__group-title-input:disabled:hover { } .umb-group-builder__group-inherited-label { - font-size: 13px; + font-size: 0.9rem; display: inline-flex; align-items: center; margin-right: 10px; @@ -644,7 +644,7 @@ input.umb-group-builder__group-title-input:disabled:hover { } .umb-group-builder__property-preview-label { - font-size: 12px; + font-size: 0.75rem; position: absolute; top: 0; left: 0; @@ -740,6 +740,7 @@ input.umb-group-builder__group-title-input:disabled:hover { margin-right: 3px; display: flex; align-items: center; + line-height: 1; } /* ---------- SORTABLE ---------- */ diff --git a/src/Umbraco.Web.UI.Client/src/views/components/contenttype/umb-content-type-property.html b/src/Umbraco.Web.UI.Client/src/views/components/contenttype/umb-content-type-property.html index 14f647e761..fff779e626 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/contenttype/umb-content-type-property.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/contenttype/umb-content-type-property.html @@ -99,13 +99,13 @@
- + Inherited from {{vm.property.contentTypeName}}
- + Locked
From df6c8a4ecc349bf2972a2413960fc8dc56d7c060 Mon Sep 17 00:00:00 2001 From: Ibrahim Muhammad Nada Date: Thu, 10 Feb 2022 02:20:18 +0300 Subject: [PATCH 020/123] refactor setTitle in MediaPicker.Controller.js (#11428) * refactor setTitle in MediaPicker.Controller.js * adding vm.activeTab Co-authored-by: inada --- .../mediapicker/mediapicker.controller.js | 69 ++++++++++--------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js index 405556e2ae..b19f35034b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js @@ -103,40 +103,43 @@ angular.module("umbraco") $scope.target = dialogOptions.currentTarget; } - function setTitle() { - if (!$scope.model.title) { - localizationService.localizeMany(["defaultdialogs_selectMedia", "mediaPicker_tabClipboard"]) - .then(function (data) { - $scope.model.title = data[0]; + function setTitle(data) { + if (!$scope.model.title) + $scope.model.title = data[0]; + } - - vm.navigation = [{ - "alias": "empty", - "name": data[0], - "icon": "icon-umb-media", - "active": true, - "view": "" - }]; - - if(vm.clipboardItems) { - vm.navigation.push({ - "alias": "clipboard", - "name": data[1], - "icon": "icon-paste-in", - "view": "", - "disabled": vm.clipboardItems.length === 0 - }); - } - - vm.activeTab = vm.navigation[0]; - }); - - } + function setNavigation(data) { + if (!vm.navigation.length) { + vm.navigation = [{ + "alias": "empty", + "name": data[0], + "icon": "icon-umb-media", + "active": true, + "view": "" + }]; + if (vm.clipboardItems) { + vm.navigation.push({ + "alias": "clipboard", + "name": data[1], + "icon": "icon-paste-in", + "view": "", + "disabled": vm.clipboardItems.length === 0 + }); } + vm.activeTab = vm.navigation[0]; + } + } - function onInit() { - setTitle(); + function onInit() { + + + localizationService.localizeMany(["defaultdialogs_selectMedia", "mediaPicker_tabClipboard"]) + .then(function (localizationResult) { + setTitle(localizationResult); + setNavigation(localizationResult); + }); + userService.getCurrentUser().then(function (userData) { userStartNodes = userData.startMediaIds; @@ -425,9 +428,9 @@ angular.module("umbraco") }; function onNavigationChanged(tab) { - vm.activeTab.active = false; - vm.activeTab = tab; - vm.activeTab.active = true; + vm.activeTab.active = false; + vm.activeTab = tab; + vm.activeTab.active = true; }; function clickClearClipboard() { From d1f18177441c3f7620f9e9e2c80192f7c3698e42 Mon Sep 17 00:00:00 2001 From: Erik-Jan Westendorp Date: Thu, 10 Feb 2022 14:37:07 +0100 Subject: [PATCH 021/123] Translate "Create dictionary item" to Dutch --- src/Umbraco.Web.UI/umbraco/config/lang/nl.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml index fb6167520b..fe1b0f8539 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml @@ -533,6 +533,7 @@ Er zijn geen woordenboekitems. + Woordenboekitem aanmaken Date: Fri, 11 Feb 2022 09:44:48 +0100 Subject: [PATCH 022/123] Fix items found in PVS-Studio analysis --- .../Models/ModelsBuilderSettings.cs | 1 + .../Extensions/ObjectExtensions.cs | 1 - .../Routing/UrlProviderExtensions.cs | 12 +++------- .../Querying/ExpressionVisitorBase.cs | 4 ++-- .../Controllers/EntityController.cs | 22 +------------------ .../Controllers/UsersController.cs | 11 ++++------ .../Routing/RoutableDocumentFilter.cs | 3 ++- .../Security/MemberManager.cs | 10 ++++----- 8 files changed, 17 insertions(+), 47 deletions(-) diff --git a/src/Umbraco.Core/Configuration/Models/ModelsBuilderSettings.cs b/src/Umbraco.Core/Configuration/Models/ModelsBuilderSettings.cs index 2cf1f770b7..73d046de32 100644 --- a/src/Umbraco.Core/Configuration/Models/ModelsBuilderSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/ModelsBuilderSettings.cs @@ -49,6 +49,7 @@ namespace Umbraco.Cms.Core.Configuration.Models if (!ModelsMode.IsAuto()) { _flagOutOfDateModels = false; + return; } _flagOutOfDateModels = value; diff --git a/src/Umbraco.Core/Extensions/ObjectExtensions.cs b/src/Umbraco.Core/Extensions/ObjectExtensions.cs index d666046e4b..3ae7f65ba5 100644 --- a/src/Umbraco.Core/Extensions/ObjectExtensions.cs +++ b/src/Umbraco.Core/Extensions/ObjectExtensions.cs @@ -626,7 +626,6 @@ namespace Umbraco.Extensions if (type == typeof(sbyte)) return XmlConvert.ToString((sbyte)value); if (type == typeof(short)) return XmlConvert.ToString((short)value); if (type == typeof(TimeSpan)) return XmlConvert.ToString((TimeSpan)value); - if (type == typeof(bool)) return XmlConvert.ToString((bool)value); if (type == typeof(uint)) return XmlConvert.ToString((uint)value); if (type == typeof(ulong)) return XmlConvert.ToString((ulong)value); if (type == typeof(ushort)) return XmlConvert.ToString((ushort)value); diff --git a/src/Umbraco.Core/Routing/UrlProviderExtensions.cs b/src/Umbraco.Core/Routing/UrlProviderExtensions.cs index 3ba254112b..d68fd22498 100644 --- a/src/Umbraco.Core/Routing/UrlProviderExtensions.cs +++ b/src/Umbraco.Core/Routing/UrlProviderExtensions.cs @@ -269,16 +269,10 @@ namespace Umbraco.Extensions if (!pcr.HasPublishedContent()) { - var logMsg = nameof(DetectCollisionAsync) + + const string logMsg = nameof(DetectCollisionAsync) + " did not resolve a content item for original url: {Url}, translated to {TranslatedUrl} and culture: {Culture}"; - if (pcr.IgnorePublishedContentCollisions) - { - logger.LogDebug(logMsg, url, uri, culture); - } - else - { - logger.LogDebug(logMsg, url, uri, culture); - } + + logger.LogDebug(logMsg, url, uri, culture); var urlInfo = UrlInfo.Message(textService.Localize("content", "routeErrorCannotRoute"), culture); return Attempt.Succeed(urlInfo); diff --git a/src/Umbraco.Infrastructure/Persistence/Querying/ExpressionVisitorBase.cs b/src/Umbraco.Infrastructure/Persistence/Querying/ExpressionVisitorBase.cs index d64c0b873e..e17299649d 100644 --- a/src/Umbraco.Infrastructure/Persistence/Querying/ExpressionVisitorBase.cs +++ b/src/Umbraco.Infrastructure/Persistence/Querying/ExpressionVisitorBase.cs @@ -468,7 +468,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Querying case nameof(StringExtensions.InvariantStartsWith): case nameof(StringExtensions.InvariantEndsWith): case nameof(StringExtensions.InvariantContains): - case nameof(StringExtensions.InvariantEquals): + case nameof(StringExtensions.InvariantEquals): string compareValue; @@ -629,7 +629,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Querying if (m.Arguments.Count == 2) { var n1 = Visit(m.Arguments[0]); - var f = m.Arguments[2]; + var f = m.Arguments[1]; if (!(f is Expression> fl)) throw new NotSupportedException("Expression is not a proper lambda."); var ff = fl.Compile(); diff --git a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs index 408ae224ab..d6f45428fd 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs @@ -760,27 +760,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers if (id == Constants.System.Root && startNodes.Length > 0 && startNodes.Contains(Constants.System.Root) == false && !ignoreUserStartNodes) { - if (pageNumber > 0) - { - return new PagedResult(0, 0, 0); - } - - IEntitySlim[] nodes = _entityService.GetAll(objectType.Value, startNodes).ToArray(); - if (nodes.Length == 0) - { - return new PagedResult(0, 0, 0); - } - - if (pageSize < nodes.Length) - { - pageSize = nodes.Length; // bah - } - - var pr = new PagedResult(nodes.Length, pageNumber, pageSize) - { - Items = nodes.Select(_umbracoMapper.Map) - }; - return pr; + return new PagedResult(0, 0, 0); } // else proceed as usual diff --git a/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs b/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs index 72377c0670..fcedb34b85 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs @@ -479,7 +479,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers { if (userSave == null) { - throw new ArgumentNullException("userSave"); + throw new ArgumentNullException(nameof(userSave)); } if (userSave.Message.IsNullOrWhiteSpace()) @@ -487,7 +487,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers ModelState.AddModelError("Message", "Message cannot be empty"); } - IUser user; if (_securitySettings.UsernameIsEmail) { // ensure it's the same @@ -496,16 +495,14 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers else { // first validate the username if we're showing it - var userResult = CheckUniqueUsername(userSave.Username, u => u.LastLoginDate != default || u.EmailConfirmedDate.HasValue); - if (!(userResult.Result is null)) + ActionResult userResult = CheckUniqueUsername(userSave.Username, u => u.LastLoginDate != default || u.EmailConfirmedDate.HasValue); + if (userResult.Result is not null) { return userResult.Result; } - - user = userResult.Value; } - user = CheckUniqueEmail(userSave.Email, u => u.LastLoginDate != default || u.EmailConfirmedDate.HasValue); + IUser user = CheckUniqueEmail(userSave.Email, u => u.LastLoginDate != default || u.EmailConfirmedDate.HasValue); if (ModelState.IsValid == false) { diff --git a/src/Umbraco.Web.Common/Routing/RoutableDocumentFilter.cs b/src/Umbraco.Web.Common/Routing/RoutableDocumentFilter.cs index a4311b988c..125a11ef1c 100644 --- a/src/Umbraco.Web.Common/Routing/RoutableDocumentFilter.cs +++ b/src/Umbraco.Web.Common/Routing/RoutableDocumentFilter.cs @@ -195,7 +195,8 @@ namespace Umbraco.Cms.Web.Common.Routing var routeValues = new RouteValueDictionary(); // To get the matchedEndpoint of the provide url - RouteEndpoint matchedEndpoint = routeEndpoints + RouteEndpoint matchedEndpoint = routeEndpoints? + .Where(e => e.RoutePattern.RawText != null) .Where(e => new TemplateMatcher( TemplateParser.Parse(e.RoutePattern.RawText), new RouteValueDictionary()) diff --git a/src/Umbraco.Web.Common/Security/MemberManager.cs b/src/Umbraco.Web.Common/Security/MemberManager.cs index 9a0f26aff4..cb7a2b0835 100644 --- a/src/Umbraco.Web.Common/Security/MemberManager.cs +++ b/src/Umbraco.Web.Common/Security/MemberManager.cs @@ -73,8 +73,6 @@ namespace Umbraco.Cms.Web.Common.Security } else { - string username; - MemberIdentityUser currentMember = await GetCurrentMemberAsync(); // If a member could not be resolved from the provider, we are clearly not authorized and can break right here @@ -84,7 +82,6 @@ namespace Umbraco.Cms.Web.Common.Security } int memberId = int.Parse(currentMember.Id, CultureInfo.InvariantCulture); - username = currentMember.UserName; // If types defined, check member is of one of those types IList allowTypesList = allowTypes as IList ?? allowTypes.ToList(); @@ -95,10 +92,11 @@ namespace Umbraco.Cms.Web.Common.Security } // If specific members defined, check member is of one of those - if (allowAction && allowMembers.Any()) + var allowMembersList = allowMembers.ToList(); + if (allowAction && allowMembersList.Any()) { // Allow only if member's Id is in the list - allowAction = allowMembers.Contains(memberId); + allowAction = allowMembersList.Contains(memberId); } // If groups defined, check member is of one of those groups @@ -118,7 +116,7 @@ namespace Umbraco.Cms.Web.Common.Security public bool IsLoggedIn() { HttpContext httpContext = _httpContextAccessor.HttpContext; - return httpContext?.User != null && httpContext.User.Identity.IsAuthenticated; + return httpContext?.User.Identity?.IsAuthenticated ?? false; } /// From 461043bd82568aa77476691981fdf3e0a8857ad9 Mon Sep 17 00:00:00 2001 From: Paul Johnson Date: Mon, 14 Feb 2022 14:43:33 +0000 Subject: [PATCH 023/123] Change web projects TargetFrameworkMoniker to 4.5.2 to stop VS 2022 err --- umbraco.sln | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/umbraco.sln b/umbraco.sln index 0018c91041..49da6eb441 100644 --- a/umbraco.sln +++ b/umbraco.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29209.152 @@ -38,7 +38,7 @@ EndProject Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Umbraco.Web.UI.Client", "http://localhost:3961", "{3819A550-DCEC-4153-91B4-8BA9F7F0B9B4}" ProjectSection(WebsiteProperties) = preProject UseIISExpress = "true" - TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.5" + TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.5.2" Debug.AspNetCompiler.VirtualPath = "/localhost_3961" Debug.AspNetCompiler.PhysicalPath = "src\Umbraco.Web.UI.Client\" Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_3961\" @@ -61,7 +61,7 @@ EndProject Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Umbraco.Tests.AcceptanceTest", "http://localhost:58896", "{9E4C8A12-FBE0-4673-8CE2-DF99D5D57817}" ProjectSection(WebsiteProperties) = preProject UseIISExpress = "true" - TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.5" + TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.5.2" Debug.AspNetCompiler.VirtualPath = "/localhost_62926" Debug.AspNetCompiler.PhysicalPath = "tests\Umbraco.Tests.AcceptanceTest\" Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_62926\" From a34e278a409eeca183624627ad284b2f762e8fbe Mon Sep 17 00:00:00 2001 From: Paul Johnson Date: Mon, 14 Feb 2022 14:46:37 +0000 Subject: [PATCH 024/123] Fix whitespace in sln --- umbraco.sln | 1 - 1 file changed, 1 deletion(-) diff --git a/umbraco.sln b/umbraco.sln index 49da6eb441..497258c699 100644 --- a/umbraco.sln +++ b/umbraco.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29209.152 From de2668a62110eb432b69922755f2554c2a6fa654 Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Mon, 14 Feb 2022 17:41:12 +0100 Subject: [PATCH 025/123] Added section for promoted packages in the back-office. (#11947) * Added section for promoted packages in the back-office. * Updates from PR review. --- .../ourpackagerrepository.resource.js | 16 ++++- .../views/packages/views/repo.controller.js | 62 ++++++++++------- .../src/views/packages/views/repo.html | 66 ++++++++++--------- src/Umbraco.Web.UI/umbraco/config/lang/en.xml | 1 + .../umbraco/config/lang/en_us.xml | 1 + 5 files changed, 91 insertions(+), 55 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js index f803d7edce..be13e6d0ec 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js @@ -36,7 +36,21 @@ function ourPackageRepositoryResource($q, $http, umbDataFormatter, umbRequestHel $http.get(baseurl + "?pageIndex=0&pageSize=" + maxResults + "&category=" + category + "&order=Popular&version=" + Umbraco.Sys.ServerVariables.application.version), 'Failed to query packages'); }, - + + getPromoted: function (maxResults, category) { + + if (maxResults === undefined) { + maxResults = 20; + } + if (category === undefined) { + category = ""; + } + + return umbRequestHelper.resourcePromise( + $http.get(baseurl + "?pageIndex=0&pageSize=" + maxResults + "&category=" + category + "&order=Popular&version=" + Umbraco.Sys.ServerVariables.application.version + "&onlyPromoted=true"), + 'Failed to query packages'); + }, + search: function (pageIndex, pageSize, orderBy, category, query, canceler) { var httpConfig = {}; diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.controller.js b/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.controller.js index 05b09e8abd..a3405bc2bf 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.controller.js @@ -1,7 +1,7 @@ (function () { "use strict"; - function PackagesRepoController($scope, $timeout, ourPackageRepositoryResource, $q, packageResource, localStorageService, localizationService) { + function PackagesRepoController($scope, $timeout, ourPackageRepositoryResource, $q, localizationService) { var vm = this; @@ -24,6 +24,8 @@ vm.closeLightbox = closeLightbox; vm.search = search; vm.installCompleted = false; + vm.highlightedPackageCollections = []; + vm.labels = {}; var defaultSort = "Latest"; var currSort = defaultSort; @@ -46,28 +48,38 @@ function init() { vm.loading = true; + localizationService.localizeMany(["packager_packagesPopular", "packager_packagesPromoted"]) + .then(function (labels) { + vm.labels.popularPackages = labels[0]; + vm.labels.promotedPackages = labels[1]; - $q.all([ - ourPackageRepositoryResource.getCategories() - .then(function (cats) { - vm.categories = cats.filter(function (cat) { - return cat.name !== "Umbraco Pro"; + var popularPackages, promotedPackages; + $q.all([ + ourPackageRepositoryResource.getCategories() + .then(function (cats) { + vm.categories = cats.filter(function (cat) { + return cat.name !== "Umbraco Pro"; + }); + }), + ourPackageRepositoryResource.getPopular(10) + .then(function (pack) { + popularPackages = { title: vm.labels.popularPackages, packages: pack.packages }; + }), + ourPackageRepositoryResource.getPromoted(20) + .then(function (pack) { + promotedPackages = { title: vm.labels.promotedPackages, packages: pack.packages }; + }), + ourPackageRepositoryResource.search(vm.pagination.pageNumber - 1, vm.pagination.pageSize, currSort) + .then(function (pack) { + vm.packages = pack.packages; + vm.pagination.totalPages = Math.ceil(pack.total / vm.pagination.pageSize); + }) + ]) + .then(function () { + vm.highlightedPackageCollections = [popularPackages, promotedPackages]; + vm.loading = false; }); - }), - ourPackageRepositoryResource.getPopular(8) - .then(function (pack) { - vm.popular = pack.packages; - }), - ourPackageRepositoryResource.search(vm.pagination.pageNumber - 1, vm.pagination.pageSize, currSort) - .then(function (pack) { - vm.packages = pack.packages; - vm.pagination.totalPages = Math.ceil(pack.total / vm.pagination.pageSize); - }) - ]) - .then(function () { - vm.loading = false; }); - } function selectCategory(selectedCategory, categories) { @@ -96,10 +108,15 @@ currSort = defaultSort; + var popularPackages, promotedPackages; $q.all([ - ourPackageRepositoryResource.getPopular(8, searchCategory) + ourPackageRepositoryResource.getPopular(10, searchCategory) .then(function (pack) { - vm.popular = pack.packages; + popularPackages = { title: vm.labels.popularPackages, packages: pack.packages }; + }), + ourPackageRepositoryResource.getPromoted(20, searchCategory) + .then(function (pack) { + promotedPackages = { title: vm.labels.promotedPackages, packages: pack.packages }; }), ourPackageRepositoryResource.search(vm.pagination.pageNumber - 1, vm.pagination.pageSize, currSort, searchCategory, vm.searchQuery) .then(function (pack) { @@ -109,6 +126,7 @@ }) ]) .then(function () { + vm.highlightedPackageCollections = [popularPackages, promotedPackages]; vm.loading = false; }); } diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html b/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html index 262cf3eda6..7dc3e499fe 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html +++ b/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html @@ -36,46 +36,48 @@
-
-

Popular

-
+
+
+

{{highlightedPackageCollection.title}}

+
-
- -
+ +
-
+
+
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 4fc52fc0a7..6364d58b5d 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -1292,6 +1292,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Please try searching for another package or browse through the categories Popular + Promoted New releases has karma points diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml index 2d575ba77f..e46e917a85 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -1310,6 +1310,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Please try searching for another package or browse through the categories Popular + Promoted New releases has karma points From 62fa1695df46c36d13fa8f172efed7dc80e10bd1 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 15 Feb 2022 10:48:52 +0100 Subject: [PATCH 026/123] Add config to hide backoffice logo (#11999) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added config to hide backoffice logo * rename to hideBackofficeLogo * hide on mobile * add hideBackofficeLogo * implement hideBackofficeLogo + toggle on click * Updated c# syntax Co-authored-by: Niels Lyngsø --- .../UmbracoSettings/ContentElement.cs | 4 ++++ .../UmbracoSettings/IContentSection.cs | 5 +++-- .../application/umbappheader.directive.js | 20 +++++++++++++++---- .../application/umb-app-header.less | 7 +++++++ .../application/umb-app-header.html | 8 ++++++-- .../Editors/BackOfficeServerVariables.cs | 3 ++- 6 files changed, 38 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs index fba46c077e..a12aca1db2 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs @@ -46,6 +46,9 @@ namespace Umbraco.Core.Configuration.UmbracoSettings [ConfigurationProperty("loginLogoImage")] internal InnerTextConfigurationElement LoginLogoImage => GetOptionalTextElement("loginLogoImage", "assets/img/application/umbraco_logo_white.svg"); + [ConfigurationProperty("hideBackofficeLogo")] + internal InnerTextConfigurationElement HideBackOfficeLogo => GetOptionalTextElement("hideBackofficeLogo", false); + string IContentSection.NotificationEmailAddress => Notifications.NotificationEmailAddress; bool IContentSection.DisableHtmlEmail => Notifications.DisableHtmlEmail; @@ -71,5 +74,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings string IContentSection.LoginBackgroundImage => LoginBackgroundImage; string IContentSection.LoginLogoImage => LoginLogoImage; + bool IContentSection.HideBackOfficeLogo => HideBackOfficeLogo; } } diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs index d8ef2bb943..fd301ab397 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs @@ -12,11 +12,11 @@ namespace Umbraco.Core.Configuration.UmbracoSettings IEnumerable ImageFileTypes { get; } IEnumerable ImageAutoFillProperties { get; } - + bool ResolveUrlsFromTextString { get; } IEnumerable Error404Collection { get; } - + string PreviewBadge { get; } MacroErrorBehaviour MacroErrorBehaviour { get; } @@ -36,5 +36,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings string LoginBackgroundImage { get; } string LoginLogoImage { get; } + bool HideBackOfficeLogo { get; } } } diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbappheader.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbappheader.directive.js index 6cf6dd85f3..01e199c572 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbappheader.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbappheader.directive.js @@ -16,6 +16,7 @@ { value: "assets/img/application/logo@2x.png" }, { value: "assets/img/application/logo@3x.png" } ]; + scope.hideBackofficeLogo = Umbraco.Sys.ServerVariables.umbracoSettings.hideBackofficeLogo; // when a user logs out or timesout evts.push(eventsService.on("app.notAuthenticated", function () { @@ -104,15 +105,26 @@ $timeout.cancel(scope.logoModal.timer); }; scope.hideLogoModal = function() { - $timeout.cancel(scope.logoModal.timer); - scope.logoModal.timer = $timeout(function () { - scope.logoModal.show = false; - }, 100); + if(scope.logoModal.show === true) { + $timeout.cancel(scope.logoModal.timer); + scope.logoModal.timer = $timeout(function () { + scope.logoModal.show = false; + }, 100); + } }; scope.stopClickEvent = function($event) { $event.stopPropagation(); }; + scope.toggleLogoModal = function() { + if(scope.logoModal.show) { + $timeout.cancel(scope.logoModal.timer); + scope.logoModal.show = false; + } else { + scope.showLogoModal(); + } + }; + } var directive = { diff --git a/src/Umbraco.Web.UI.Client/src/less/components/application/umb-app-header.less b/src/Umbraco.Web.UI.Client/src/less/components/application/umb-app-header.less index bb346fc402..6e1fa29eab 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/application/umb-app-header.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/application/umb-app-header.less @@ -9,11 +9,18 @@ .umb-app-header__logo { margin-right: 30px; + flex-shrink: 0; button { img { height: 30px; } } + +} +@media (max-width: 1279px) { + .umb-app-header__logo { + display: none; + } } .umb-app-header__logo-modal { diff --git a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-app-header.html b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-app-header.html index 98b8d88869..ce3bf06853 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-app-header.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-app-header.html @@ -1,7 +1,11 @@
-