Merge remote-tracking branch 'origin/v9/dev' into v9/feature/language-keys-cleanup

# Conflicts:
#	src/Umbraco.Web.UI/umbraco/config/lang/nl.xml
This commit is contained in:
Bjarke Berg
2021-09-22 19:24:35 +02:00
15 changed files with 71 additions and 31 deletions

View File

@@ -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)

View File

@@ -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)));

View File

@@ -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

View File

@@ -327,7 +327,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Packaging
Assert.Multiple(() =>
{
Assert.AreEqual("umbPackage", xml.Root.Name.ToString());
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));
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));
Assert.IsNull(xml.DocumentType);
Assert.IsNull(xml.Parent);
Assert.IsNull(xml.NextNode);

View File

@@ -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<ITemplate> 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]

View File

@@ -35,8 +35,8 @@
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="1.0.3" />
<PackageReference Include="Smidge.Nuglify" Version="4.0.0-beta.376" />
<PackageReference Include="Smidge.InMemory" Version="4.0.0-beta.376" />
<PackageReference Include="Smidge.Nuglify" Version="4.0.0" />
<PackageReference Include="Smidge.InMemory" Version="4.0.0" />
<PackageReference Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
<PackageReference Include="Umbraco.Code" Version="1.2.0">
<PrivateAssets>all</PrivateAssets>

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 === 'Group') || tabs.length === 0">
ng-if="group.type === 'Group'"
ng-show="group.parentAlias === activeTabAlias || tabs.length === 0">
<div class="umb-group-panel__header">
<div id="group-{{group.id}}">{{ group.label }}</div>

View File

@@ -29,7 +29,8 @@
<div class="umb-group-panel"
data-element="group-{{group.alias}}"
ng-repeat="group in vm.model.variants[0].tabs track by group.key"
ng-show="(group.parentAlias === vm.activeTabAlias && group.type === 'Group') || vm.tabs.length === 0">
ng-if="group.type === 'Group'"
ng-show="group.parentAlias === vm.activeTabAlias || vm.tabs.length === 0">
<div class="umb-group-panel__header">
<div id="group-{{group.id}}">{{ group.label }}</div>

View File

@@ -1,5 +1,5 @@
<div class="form-horizontal" ng-controller="Umbraco.Editors.Media.Apps.ContentController as vm">
<umb-editor-tab-bar ng-if="vm.tabs.length > 0">
<umb-tabs-nav tabs="vm.tabs" on-tab-change="vm.setActiveTab(tab)"></umb-tabs-nav>
</umb-editor-tab-bar>
@@ -16,12 +16,13 @@
</umb-property>
</umb-box-content>
</umb-box>
<div
<div
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 === 'Group') || vm.tabs.length === 0">
ng-if="group.type === 'Group'"
ng-show="group.parentAlias === vm.activeTabAlias || vm.tabs.length === 0">
<div class="umb-group-panel__header">
<div>{{ group.label }}</div>

View File

@@ -17,20 +17,21 @@
</umb-box-content>
</umb-box>
<div
<div
class="umb-group-panel"
data-element="group-{{group.alias}}"
ng-repeat="group in content.tabs"
ng-show="(group.parentAlias === vm.activeTabAlias && group.type === 'Group') || vm.tabs.length === 0">
ng-if="group.type === 'Group'"
ng-show="group.parentAlias === vm.activeTabAlias || vm.tabs.length === 0">
<div class="umb-group-panel__header">
<div>{{ group.label }}</div>
</div>
<div class="umb-group-panel__content" data-element="tab-content-{{group.type === 'Group' ? group.parentAlias : group.alias}}">
<umb-property
data-element="property-{{group.alias}}"
ng-repeat="property in group.properties | filter:vm.hideSystemProperties track by property.alias"
<umb-property
data-element="property-{{group.alias}}"
ng-repeat="property in group.properties | filter:vm.hideSystemProperties track by property.alias"
property="property">
<umb-property-editor model="property"></umb-property-editor>

View File

@@ -1 +1 @@
<input name="hidden" type="hidden" ng-model="model.value" name="{{model.alias}}" />
<input name="hidden" type="hidden" ng-model="model.value" id="{{model.alias}}" />

View File

@@ -2198,7 +2198,8 @@ Echter, Runway biedt een gemakkelijke basis om je snel op weg te helpen. Als je
<key alias="confirmCancelBlockCreationMessage"><![CDATA[Ben je zeker dat je deze wijzigingen wil verwerpen?]]></key>
<key alias="elementTypeDoesNotExistHeadline">Fout!</key>
<key alias="elementTypeDoesNotExistDescription">Het Elementtype van dit blok bestaat niet meer</key>
<key alias="propertyEditorNotSupported">Eigenschap '%0%' gebruikt editor '%1%' die niet ondersteund wordt in blokken.</key>
<key alias="addBlock">Inhoud toevoegen</key>
<key alias="propertyEditorNotSupported">Eigenschap '%0%' gebruikt editor '%1%' die niet ondersteund wordt in blokken.</key>
</area>
<area alias="contentTemplatesDashboard">
<key alias="whatHeadline">Wat zijn Inhoudssjablonen?</key>