Add editor ui alias to package xml (#16420)

* Add editor ui alias to package xml

* Update src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs

* Add AllowAtRoot and AllowInAreas

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
This commit is contained in:
Mole
2024-05-27 14:10:19 +02:00
committed by GitHub
parent f4a77ce217
commit 806fce8ed9
3 changed files with 9 additions and 1 deletions

View File

@@ -26,6 +26,10 @@ public class BlockGridConfiguration
public Guid ContentElementTypeKey { get; set; }
public Guid? SettingsElementTypeKey { get; set; }
public bool AllowAtRoot { get; set; }
public bool AllowInAreas { get; set; }
}
public class NumberRange

View File

@@ -211,6 +211,7 @@ internal class EntityXmlSerializer : IEntityXmlSerializer
// The 'ID' when exporting is actually the property editor alias (in pre v7 it was the IDataType GUID id)
xml.Add(new XAttribute("Id", dataType.EditorAlias));
xml.Add(new XAttribute("EditorUiAlias", dataType.EditorUiAlias ?? dataType.EditorAlias));
xml.Add(new XAttribute("Definition", dataType.Key));
xml.Add(new XAttribute("DatabaseType", dataType.DatabaseType.ToString()));
xml.Add(new XAttribute("Configuration", _configurationEditorJsonSerializer.Serialize(dataType.ConfigurationObject)));

View File

@@ -1257,12 +1257,15 @@ namespace Umbraco.Cms.Infrastructure.Packaging
editor = new VoidEditor(_dataValueEditorFactory) {Alias = editorAlias ?? string.Empty};
}
var editorUiAlias = dataTypeElement.Attribute("EditorUiAlias")?.Value?.Trim() ?? editorAlias;
var dataType = new DataType(editor, _serializer)
{
Key = dataTypeDefinitionId,
Name = dataTypeDefinitionName,
DatabaseType = databaseType,
ParentId = parentId
ParentId = parentId,
EditorUiAlias = editorUiAlias,
};
var configurationAttributeValue = dataTypeElement.Attribute("Configuration")?.Value;