From f7b485a199117de43a6fbf9f1568848022804211 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 21 Sep 2021 11:18:34 +0200 Subject: [PATCH 01/12] filter out tabs and groups in tabs for nested content --- src/Umbraco.Web/PropertyEditors/NestedContentController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/PropertyEditors/NestedContentController.cs b/src/Umbraco.Web/PropertyEditors/NestedContentController.cs index 590a286c5d..23ca91841c 100644 --- a/src/Umbraco.Web/PropertyEditors/NestedContentController.cs +++ b/src/Umbraco.Web/PropertyEditors/NestedContentController.cs @@ -22,7 +22,7 @@ namespace Umbraco.Web.PropertyEditors name = x.Name, alias = x.Alias, icon = x.Icon, - tabs = x.CompositionPropertyGroups.Select(y => y.Name).Distinct() + tabs = x.CompositionPropertyGroups.Where(y => y.Type == Core.Models.PropertyGroupType.Group && !y.Alias.Contains("/")).Select(y => y.Name).Distinct() }); } } From 426050374da6880535610f6abcbd7ec9af1cb5f4 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 21 Sep 2021 11:19:04 +0200 Subject: [PATCH 02/12] alias is changed. We need to compare with label instead --- .../propertyeditors/nestedcontent/nestedcontent.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js index 64fc40d84d..3510da73a6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js @@ -535,7 +535,7 @@ // remove all tabs except the specified tab var tabs = scaffold.variants[0].tabs; var tab = _.find(tabs, function (tab) { - return tab.id !== 0 && (tab.alias.toLowerCase() === contentType.ncTabAlias.toLowerCase() || contentType.ncTabAlias === ""); + return tab.id !== 0 && (tab.label.toLowerCase() === contentType.ncTabAlias.toLowerCase() || contentType.ncTabAlias === ""); }); scaffold.variants[0].tabs = []; if (tab) { From 5796b841e3801a2ae6b6111aae4ed62775103fb8 Mon Sep 17 00:00:00 2001 From: Ronald Barendse Date: Tue, 21 Sep 2021 12:01:02 +0200 Subject: [PATCH 03/12] Updated predicate to use GetParentAlias() --- src/Umbraco.Web/PropertyEditors/NestedContentController.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/PropertyEditors/NestedContentController.cs b/src/Umbraco.Web/PropertyEditors/NestedContentController.cs index 23ca91841c..71c2217709 100644 --- a/src/Umbraco.Web/PropertyEditors/NestedContentController.cs +++ b/src/Umbraco.Web/PropertyEditors/NestedContentController.cs @@ -1,5 +1,6 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; +using Umbraco.Core.Models; using Umbraco.Core.Services; using Umbraco.Web.Editors; using Umbraco.Web.Mvc; @@ -22,7 +23,7 @@ namespace Umbraco.Web.PropertyEditors name = x.Name, alias = x.Alias, icon = x.Icon, - tabs = x.CompositionPropertyGroups.Where(y => y.Type == Core.Models.PropertyGroupType.Group && !y.Alias.Contains("/")).Select(y => y.Name).Distinct() + tabs = x.CompositionPropertyGroups.Where(x => x.Type == PropertyGroupType.Group && x.GetParentAlias() == null).Select(y => y.Name).Distinct() }); } } From b6338cacb3ac9ac6cdfc76a38f3cde95f747cd0d Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 22 Sep 2021 09:26:02 +0200 Subject: [PATCH 04/12] prevent tab properties to be rendered twice --- .../src/views/components/content/umb-tabbed-content.html | 3 ++- .../elementeditor/umb-element-editor-content.component.html | 3 ++- .../src/views/media/apps/content/content.html | 3 ++- .../src/views/member/apps/content/content.html | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-tabbed-content.html b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-tabbed-content.html index e742e32f8c..f906ee6d4a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-tabbed-content.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-tabbed-content.html @@ -29,7 +29,8 @@ data-app-anchor="{{group.id}}" data-element="group-{{group.alias}}" ng-repeat="group in content.tabs track by group.key" - ng-show="(group.parentAlias === activeTabAlias && group.type === 0) || tabs.length === 0"> + ng-if="group.type === 0" + ng-show="group.parentAlias === activeTabAlias || tabs.length === 0">
{{ group.label }}
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/elementeditor/umb-element-editor-content.component.html b/src/Umbraco.Web.UI.Client/src/views/components/elementeditor/umb-element-editor-content.component.html index 5005edadc5..cd98aecc03 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/elementeditor/umb-element-editor-content.component.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/elementeditor/umb-element-editor-content.component.html @@ -29,7 +29,8 @@
+ ng-if="group.type === 0" + ng-show="group.parentAlias === vm.activeTabAlias || vm.tabs.length === 0">
{{ group.label }}
diff --git a/src/Umbraco.Web.UI.Client/src/views/media/apps/content/content.html b/src/Umbraco.Web.UI.Client/src/views/media/apps/content/content.html index b4be9027b5..fc3b3fefce 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/apps/content/content.html +++ b/src/Umbraco.Web.UI.Client/src/views/media/apps/content/content.html @@ -21,7 +21,8 @@ class="umb-group-panel" data-element="group-{{group.alias}}" ng-repeat="group in content.tabs | filter: { hide : '!' + true } track by group.id" - ng-show="(group.parentAlias === vm.activeTabAlias && group.type === 0) || vm.tabs.length === 0"> + ng-if="group.type === 0" + ng-show="group.parentAlias === vm.activeTabAlias || vm.tabs.length === 0">
{{ group.label }}
diff --git a/src/Umbraco.Web.UI.Client/src/views/member/apps/content/content.html b/src/Umbraco.Web.UI.Client/src/views/member/apps/content/content.html index 305b5d4e77..e11ccfcc38 100644 --- a/src/Umbraco.Web.UI.Client/src/views/member/apps/content/content.html +++ b/src/Umbraco.Web.UI.Client/src/views/member/apps/content/content.html @@ -21,7 +21,8 @@ class="umb-group-panel" data-element="group-{{group.alias}}" ng-repeat="group in content.tabs" - ng-show="(group.parentAlias === vm.activeTabAlias && group.type === 0) || vm.tabs.length === 0"> + ng-if="group.type === 0" + ng-show="group.parentAlias === vm.activeTabAlias || vm.tabs.length === 0">
{{ group.label }}
From 46f55b8477beaa5faf4b96719a746841ca15868a Mon Sep 17 00:00:00 2001 From: Zeegaan <70372949+Zeegaan@users.noreply.github.com> Date: Wed, 22 Sep 2021 09:57:03 +0200 Subject: [PATCH 05/12] Updated cypress test --- .../cypress/integration/Users/userGroups.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Users/userGroups.js b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Users/userGroups.js index afef0e7701..ce2e366f2c 100644 --- a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Users/userGroups.js +++ b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Users/userGroups.js @@ -19,7 +19,7 @@ context('User Groups', () => { // Assign sections cy.get('.umb-box:nth-child(1) .umb-property:nth-child(1) localize').click(); - cy.get('.umb-tree-item span').click({multiple:true}); + cy.get('.umb-tree-item__inner').click({multiple:true, timeout: 10000}); cy.get('.btn-success').last().click(); // Save From 7548074fa390e44a706eb4e98bfccbfff27a093a Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Thu, 16 Sep 2021 10:39:49 +0200 Subject: [PATCH 06/12] Fix incorrect attribute (cherry picked from commit 6c512107a4687ce02a36bc482215219386876c0e) --- src/Umbraco.Web.UI.Client/src/views/prevalueeditors/hidden.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/hidden.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/hidden.html index d0ebd994f9..93cacef8c8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/hidden.html +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/hidden.html @@ -1 +1 @@ - \ No newline at end of file + From a09103dc82e523d931b622b47895bf9d11dbfed4 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Sun, 19 Sep 2021 20:35:43 +0200 Subject: [PATCH 07/12] Align sortable handle vertically in multivalues prevalue editor (cherry picked from commit 46e6f050cbab33cb6898ecf5b618cea42fc3aee8) --- .../src/less/components/prevalues/multivalues.less | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/prevalues/multivalues.less b/src/Umbraco.Web.UI.Client/src/less/components/prevalues/multivalues.less index 6cdc5b1c99..48d581b313 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/prevalues/multivalues.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/prevalues/multivalues.less @@ -45,15 +45,15 @@ &.ui-sortable-handle, .ui-sortable-handle, - .handle - { + .handle { cursor: move; } - i { + .umb-icon, + i.icon { display: flex; - align-items: center; - margin-right: 5px + align-self: center; + margin-right: 5px; } a { From f776dbb6162c469751c9582e8029849e7630ea95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corn=C3=A9=20Strijkert?= Date: Mon, 20 Sep 2021 13:53:41 +0200 Subject: [PATCH 08/12] Missing nl translation for blockEditor_addBlock (cherry picked from commit 674edd3a97c0d5383af9358f365a065e606267ce) --- 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 b50f49ad8e..04c6fb2ce7 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/nl.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/nl.xml @@ -2342,6 +2342,7 @@ Echter, Runway biedt een gemakkelijke basis om je snel op weg te helpen. Als je Fout! Het Elementtype van dit blok bestaat niet meer + Inhoud toevoegen Eigenschap '%0%' gebruikt editor '%1%' die niet ondersteund wordt in blokken. From 52f3350e7629e522fe0d82c25a794624d990e8b4 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Sun, 19 Sep 2021 14:01:09 +0200 Subject: [PATCH 09/12] Adjust icon in umb-checkbox and ensure icon is centered (cherry picked from commit c49c5369e305773b646329e0b682c2d82ef87a50) --- .../src/less/components/umb-form-check.less | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-form-check.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-form-check.less index f13ae198d6..bb4af5e05c 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-form-check.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-form-check.less @@ -97,7 +97,8 @@ .icon, .umb-icon { - font-size: 1.2rem; + font-size: 0.9rem; + line-height: 1; } &__state { @@ -110,6 +111,8 @@ &__check { display: flex; + align-items: center; + justify-content: center; position: relative; background: @white; border: 1px solid @inputBorder; From e269d1bcd04e379fd2e50db990401d71b3dfcd7b Mon Sep 17 00:00:00 2001 From: Jan Skovgaard <1932158+BatJan@users.noreply.github.com> Date: Wed, 22 Sep 2021 01:49:49 +0200 Subject: [PATCH 10/12] Grid: Add button styling fix (#10978) * Add missing focus styling * Ensure add button is perfectly rounded and remove unused / uneeded CSS. * Remove redundant border-color property * Revert removal of unused css Co-authored-by: BatJan Co-authored-by: Jan Skovgaard Olsen (cherry picked from commit 31ecc146d1ad34a4540a84e7753877c753ae5ab4) --- .../src/less/components/umb-grid.less | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less index b92d1db05a..98438a3447 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less @@ -565,12 +565,11 @@ // ICONS // ------------------------- .umb-grid .iconBox { - padding: 4px 6px; - display: inline-block; - cursor: pointer; + padding: 6px; + display: flex; border-radius: 200px; border: 1px solid @ui-action-discreet-border; - margin: 2px; + margin: 0 auto; &:hover, &:hover * { background: @ui-action-discreet-type-hover !important; @@ -599,8 +598,6 @@ -webkit-appearance: none; background-image: linear-gradient(to bottom,@gray-9,@gray-7); background-repeat: repeat-x; - zoom: 1; - border-color: @gray-7 @gray-7 @gray-6; border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25); box-shadow: inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05); border-radius: 3px; From 5fab8f22c79dbdf319167950d6fa872320420679 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 22 Sep 2021 15:55:24 +0200 Subject: [PATCH 11/12] Bump Smidge to 4.0.0 final --- src/Umbraco.Web.Common/Umbraco.Web.Common.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj index ea4194431f..fcd62febf4 100644 --- a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj +++ b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj @@ -35,8 +35,8 @@ - - + + all From fee3d0778a57f3f15398e891eeade00d7571d1ce Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Wed, 22 Sep 2021 18:21:53 +0200 Subject: [PATCH 12/12] =?UTF-8?q?Serializes=20key=20for=20templates=20in?= =?UTF-8?q?=20package=20definition=20and=20imports=20if=20ava=E2=80=A6=20(?= =?UTF-8?q?#11163)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Packaging/PackageDataInstallation.cs | 8 ++++++ .../Services/Implement/EntityXmlSerializer.cs | 3 +- .../CreatedPackagesRepositoryTests.cs | 2 +- .../Packaging/PackageDataInstallationTests.cs | 28 +++++++++++++++++++ 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs index f63df1d0d2..8f9352ce22 100644 --- a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs +++ b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs @@ -1558,7 +1558,15 @@ namespace Umbraco.Cms.Infrastructure.Packaging var masterElement = templateElement.Element("Master"); var existingTemplate = _fileService.GetTemplate(alias) as Template; + var template = existingTemplate ?? new Template(_shortStringHelper, templateName, alias); + + // For new templates, use the serialized key if avaialble. + if (existingTemplate == null && Guid.TryParse(templateElement.Element("Key")?.Value, out var key)) + { + template.Key = key; + } + template.Content = design; if (masterElement != null && string.IsNullOrEmpty((string)masterElement) == false) diff --git a/src/Umbraco.Infrastructure/Services/Implement/EntityXmlSerializer.cs b/src/Umbraco.Infrastructure/Services/Implement/EntityXmlSerializer.cs index 568e18b13e..d2c3189447 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/EntityXmlSerializer.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/EntityXmlSerializer.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; using System.Globalization; -using System.IO; using System.Linq; using System.Net; using System.Xml.Linq; -using Umbraco.Cms.Core.IO; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.PropertyEditors; using Umbraco.Cms.Core.Serialization; @@ -319,6 +317,7 @@ namespace Umbraco.Cms.Core.Services.Implement { var xml = new XElement("Template"); xml.Add(new XElement("Name", template.Name)); + xml.Add(new XElement("Key", template.Key)); xml.Add(new XElement("Alias", template.Alias)); xml.Add(new XElement("Design", new XCData(template.Content))); diff --git a/src/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs b/src/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs index b1f3fbf847..3eca38be76 100644 --- a/src/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs +++ b/src/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs @@ -327,7 +327,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Packaging Assert.Multiple(() => { Assert.AreEqual("umbPackage", xml.Root.Name.ToString()); - Assert.AreEqual($"", xml.Element("umbPackage").Element("Templates").ToString(SaveOptions.DisableFormatting)); + Assert.AreEqual($"", xml.Element("umbPackage").Element("Templates").ToString(SaveOptions.DisableFormatting)); Assert.IsNull(xml.DocumentType); Assert.IsNull(xml.Parent); Assert.IsNull(xml.NextNode); diff --git a/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs b/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs index 6e45d1708a..39ca764f94 100644 --- a/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs +++ b/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs @@ -233,6 +233,34 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging Assert.That(templates, Is.Not.Null); Assert.That(templates.Any(), Is.True); Assert.That(templates.Count(), Is.EqualTo(1)); + + var template = templates.First(); + Assert.AreEqual(template.Name, "Articles"); + } + + [Test] + public void Can_Import_Single_Template_With_Key() + { + // Arrange + string strXml = ImportResources.StandardMvc_Package; + var xml = XElement.Parse(strXml); + XElement element = xml.Descendants("Templates").First(); + + var firstTemplateElement = element.Elements("Template").First(); + var key = Guid.NewGuid(); + firstTemplateElement.Add(new XElement("Key", key)); + + // Act + IEnumerable templates = PackageDataInstallation.ImportTemplate(firstTemplateElement, 0); + + // Assert + Assert.That(templates, Is.Not.Null); + Assert.That(templates.Any(), Is.True); + Assert.That(templates.Count(), Is.EqualTo(1)); + + var template = templates.First(); + Assert.AreEqual(template.Name, "Articles"); + Assert.AreEqual(template.Key, key); } [Test]