Skip to content

Commit 0411d94

Browse files
committed
Merge remote-tracking branch 'origin/v9/dev' into v9/feature/language-keys-cleanup
# Conflicts: # src/Umbraco.Web.UI/umbraco/config/lang/nl.xml
2 parents e00038d + fee3d07 commit 0411d94

File tree

15 files changed

+71
-31
lines changed

15 files changed

+71
-31
lines changed

src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,15 @@ public IReadOnlyList<ITemplate> ImportTemplates(IReadOnlyCollection<XElement> te
15581558
var masterElement = templateElement.Element("Master");
15591559

15601560
var existingTemplate = _fileService.GetTemplate(alias) as Template;
1561+
15611562
var template = existingTemplate ?? new Template(_shortStringHelper, templateName, alias);
1563+
1564+
// For new templates, use the serialized key if avaialble.
1565+
if (existingTemplate == null && Guid.TryParse(templateElement.Element("Key")?.Value, out var key))
1566+
{
1567+
template.Key = key;
1568+
}
1569+
15621570
template.Content = design;
15631571

15641572
if (masterElement != null && string.IsNullOrEmpty((string)masterElement) == false)

src/Umbraco.Infrastructure/Services/Implement/EntityXmlSerializer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Globalization;
4-
using System.IO;
54
using System.Linq;
65
using System.Net;
76
using System.Xml.Linq;
8-
using Umbraco.Cms.Core.IO;
97
using Umbraco.Cms.Core.Models;
108
using Umbraco.Cms.Core.PropertyEditors;
119
using Umbraco.Cms.Core.Serialization;
@@ -319,6 +317,7 @@ public XElement Serialize(ITemplate template)
319317
{
320318
var xml = new XElement("Template");
321319
xml.Add(new XElement("Name", template.Name));
320+
xml.Add(new XElement("Key", template.Key));
322321
xml.Add(new XElement("Alias", template.Alias));
323322
xml.Add(new XElement("Design", new XCData(template.Content)));
324323

src/Umbraco.Tests.AcceptanceTest/cypress/integration/Users/userGroups.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ context('User Groups', () => {
1919

2020
// Assign sections
2121
cy.get('.umb-box:nth-child(1) .umb-property:nth-child(1) localize').click();
22-
cy.get('.umb-tree-item span').click({multiple:true});
22+
cy.get('.umb-tree-item__inner').click({multiple:true, timeout: 10000});
2323
cy.get('.btn-success').last().click();
2424

2525
// Save

src/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public void Export_Xml()
327327
Assert.Multiple(() =>
328328
{
329329
Assert.AreEqual("umbPackage", xml.Root.Name.ToString());
330-
Assert.AreEqual($"<Templates><Template><Name>Text page</Name><Alias>textPage</Alias><Design><![CDATA[@using Umbraco.Cms.Web.Common.PublishedModels;{Environment.NewLine}@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage{Environment.NewLine}@{{{Environment.NewLine}\tLayout = null;{Environment.NewLine}}}]]></Design></Template></Templates>", xml.Element("umbPackage").Element("Templates").ToString(SaveOptions.DisableFormatting));
330+
Assert.AreEqual($"<Templates><Template><Name>Text page</Name><Key>{template.Key}</Key><Alias>textPage</Alias><Design><![CDATA[@using Umbraco.Cms.Web.Common.PublishedModels;{Environment.NewLine}@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage{Environment.NewLine}@{{{Environment.NewLine}\tLayout = null;{Environment.NewLine}}}]]></Design></Template></Templates>", xml.Element("umbPackage").Element("Templates").ToString(SaveOptions.DisableFormatting));
331331
Assert.IsNull(xml.DocumentType);
332332
Assert.IsNull(xml.Parent);
333333
Assert.IsNull(xml.NextNode);

src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,34 @@ public void Can_Import_Single_Template()
233233
Assert.That(templates, Is.Not.Null);
234234
Assert.That(templates.Any(), Is.True);
235235
Assert.That(templates.Count(), Is.EqualTo(1));
236+
237+
var template = templates.First();
238+
Assert.AreEqual(template.Name, "Articles");
239+
}
240+
241+
[Test]
242+
public void Can_Import_Single_Template_With_Key()
243+
{
244+
// Arrange
245+
string strXml = ImportResources.StandardMvc_Package;
246+
var xml = XElement.Parse(strXml);
247+
XElement element = xml.Descendants("Templates").First();
248+
249+
var firstTemplateElement = element.Elements("Template").First();
250+
var key = Guid.NewGuid();
251+
firstTemplateElement.Add(new XElement("Key", key));
252+
253+
// Act
254+
IEnumerable<ITemplate> templates = PackageDataInstallation.ImportTemplate(firstTemplateElement, 0);
255+
256+
// Assert
257+
Assert.That(templates, Is.Not.Null);
258+
Assert.That(templates.Any(), Is.True);
259+
Assert.That(templates.Count(), Is.EqualTo(1));
260+
261+
var template = templates.First();
262+
Assert.AreEqual(template.Name, "Articles");
263+
Assert.AreEqual(template.Key, key);
236264
}
237265

238266
[Test]

src/Umbraco.Web.Common/Umbraco.Web.Common.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
3636
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
3737
<PackageReference Include="SixLabors.ImageSharp.Web" Version="1.0.3" />
38-
<PackageReference Include="Smidge.Nuglify" Version="4.0.0-beta.376" />
39-
<PackageReference Include="Smidge.InMemory" Version="4.0.0-beta.376" />
38+
<PackageReference Include="Smidge.Nuglify" Version="4.0.0" />
39+
<PackageReference Include="Smidge.InMemory" Version="4.0.0" />
4040
<PackageReference Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
4141
<PackageReference Include="Umbraco.Code" Version="1.2.0">
4242
<PrivateAssets>all</PrivateAssets>

src/Umbraco.Web.UI.Client/src/less/components/prevalues/multivalues.less

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@
4545

4646
&.ui-sortable-handle,
4747
.ui-sortable-handle,
48-
.handle
49-
{
48+
.handle {
5049
cursor: move;
5150
}
5251

53-
i {
52+
.umb-icon,
53+
i.icon {
5454
display: flex;
55-
align-items: center;
56-
margin-right: 5px
55+
align-self: center;
56+
margin-right: 5px;
5757
}
5858

5959
a {

src/Umbraco.Web.UI.Client/src/less/components/umb-form-check.less

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@
9797

9898
.icon,
9999
.umb-icon {
100-
font-size: 1.2rem;
100+
font-size: 0.9rem;
101+
line-height: 1;
101102
}
102103

103104
&__state {
@@ -110,6 +111,8 @@
110111

111112
&__check {
112113
display: flex;
114+
align-items: center;
115+
justify-content: center;
113116
position: relative;
114117
background: @white;
115118
border: 1px solid @inputBorder;

src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -565,12 +565,11 @@
565565
// ICONS
566566
// -------------------------
567567
.umb-grid .iconBox {
568-
padding: 4px 6px;
569-
display: inline-block;
570-
cursor: pointer;
568+
padding: 6px;
569+
display: flex;
571570
border-radius: 200px;
572571
border: 1px solid @ui-action-discreet-border;
573-
margin: 2px;
572+
margin: 0 auto;
574573

575574
&:hover, &:hover * {
576575
background: @ui-action-discreet-type-hover !important;
@@ -599,8 +598,6 @@
599598
-webkit-appearance: none;
600599
background-image: linear-gradient(to bottom,@gray-9,@gray-7);
601600
background-repeat: repeat-x;
602-
zoom: 1;
603-
border-color: @gray-7 @gray-7 @gray-6;
604601
border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);
605602
box-shadow: inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);
606603
border-radius: 3px;

src/Umbraco.Web.UI.Client/src/views/components/content/umb-tabbed-content.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
data-app-anchor="{{group.id}}"
3030
data-element="group-{{group.alias}}"
3131
ng-repeat="group in content.tabs track by group.key"
32-
ng-show="(group.parentAlias === activeTabAlias && group.type === 'Group') || tabs.length === 0">
32+
ng-if="group.type === 'Group'"
33+
ng-show="group.parentAlias === activeTabAlias || tabs.length === 0">
3334

3435
<div class="umb-group-panel__header">
3536
<div id="group-{{group.id}}">{{ group.label }}</div>

0 commit comments

Comments
 (0)