Merge branch 'main' into v17/dev
# Conflicts: # tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/PropertyTypeBuilderTests.cs
This commit is contained in:
@@ -232,7 +232,11 @@ public static class BuilderExtensions
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static T WithPropertyValues<T>(this T builder, object propertyValues, string? culture = null, string? segment = null)
|
||||
public static T WithPropertyValues<T>(
|
||||
this T builder,
|
||||
object propertyValues,
|
||||
string? culture = null,
|
||||
string? segment = null)
|
||||
where T : IWithPropertyValues
|
||||
{
|
||||
builder.PropertyValues = propertyValues;
|
||||
|
||||
@@ -41,7 +41,9 @@ public class MediaTypeEditingBuilder : ContentTypeEditingBaseBuilder<MediaTypeEd
|
||||
.Build();
|
||||
}
|
||||
|
||||
public static MediaTypeCreateModel CreateBasicFolderMediaType(string alias = "basicFolder", string name = "BasicFolder")
|
||||
public static MediaTypeCreateModel CreateBasicFolderMediaType(
|
||||
string alias = "basicFolder",
|
||||
string name = "BasicFolder")
|
||||
{
|
||||
var builder = new MediaTypeEditingBuilder();
|
||||
return (MediaTypeCreateModel)builder
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
using System;
|
||||
using Umbraco.Cms.Core;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Strings;
|
||||
@@ -38,6 +37,7 @@ public class PropertyTypeBuilder<TParent>
|
||||
private string _alias;
|
||||
private DateTime? _createDate;
|
||||
private int? _dataTypeId;
|
||||
private Guid? _dataTypeKey;
|
||||
private string _description;
|
||||
private int? _id;
|
||||
private Guid? _key;
|
||||
@@ -132,6 +132,12 @@ public class PropertyTypeBuilder<TParent>
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyTypeBuilder<TParent> WithDataTypeKey(Guid dataTypeKey)
|
||||
{
|
||||
_dataTypeKey = dataTypeKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyTypeBuilder<TParent> WithPropertyGroupId(int propertyGroupId)
|
||||
{
|
||||
_propertyGroupId = new Lazy<int>(() => propertyGroupId);
|
||||
@@ -176,6 +182,7 @@ public class PropertyTypeBuilder<TParent>
|
||||
var updateDate = _updateDate ?? DateTime.UtcNow;
|
||||
var sortOrder = _sortOrder ?? 0;
|
||||
var dataTypeId = _dataTypeId ?? -88;
|
||||
var dataTypeKey = _dataTypeKey ?? Guid.Empty;
|
||||
var description = _description ?? string.Empty;
|
||||
var propertyGroupId = _propertyGroupId;
|
||||
var mandatory = _mandatory ?? false;
|
||||
@@ -196,6 +203,7 @@ public class PropertyTypeBuilder<TParent>
|
||||
Name = name,
|
||||
SortOrder = sortOrder,
|
||||
DataTypeId = dataTypeId,
|
||||
DataTypeKey = dataTypeKey,
|
||||
Description = description,
|
||||
CreateDate = createDate,
|
||||
UpdateDate = updateDate,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<IsPackable>true</IsPackable>
|
||||
<EnablePackageValidation>$(BaseEnablePackageValidation)</EnablePackageValidation>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
TODO: Fix and remove overrides:
|
||||
|
||||
Reference in New Issue
Block a user