Merge remote-tracking branch 'origin/v8/dev' into v8/feature/block-editor-list
This commit is contained in:
@@ -178,6 +178,7 @@ namespace Umbraco.Core.Models
|
||||
/// </summary>
|
||||
/// <remarks>For generic properties, the value is <c>null</c>.</remarks>
|
||||
[DataMember]
|
||||
[DoNotClone]
|
||||
public Lazy<int> PropertyGroupId
|
||||
{
|
||||
get => _propertyGroupId;
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Umbraco.ModelsBuilder.Embedded.Building
|
||||
//
|
||||
private static void WriteGeneratedCodeAttribute(StringBuilder sb, string tabs)
|
||||
{
|
||||
sb.AppendFormat("{0}[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Umbraco.ModelsBuilder\", \"{1}\")]\n", tabs, ApiVersion.Current.Version);
|
||||
sb.AppendFormat("{0}[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Umbraco.ModelsBuilder.Embedded\", \"{1}\")]\n", tabs, ApiVersion.Current.Version);
|
||||
}
|
||||
|
||||
private void WriteContentType(StringBuilder sb, TypeModel type)
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Umbraco.ModelsBuilder.Embedded.Building
|
||||
sb.Append("// <auto-generated>\n");
|
||||
sb.Append("// This code was generated by a tool.\n");
|
||||
sb.Append("//\n");
|
||||
sb.AppendFormat("// Umbraco.ModelsBuilder v{0}\n", ApiVersion.Current.Version);
|
||||
sb.AppendFormat("// Umbraco.ModelsBuilder.Embedded v{0}\n", ApiVersion.Current.Version);
|
||||
sb.Append("//\n");
|
||||
sb.Append("// Changes to this file will be lost if the code is regenerated.\n");
|
||||
sb.Append("// </auto-generated>\n");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("Umbraco.ModelsBuilder")]
|
||||
[assembly: AssemblyTitle("Umbraco.ModelsBuilder.Embedded")]
|
||||
[assembly: AssemblyDescription("Umbraco ModelsBuilder")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("Umbraco CMS")]
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Serialization;
|
||||
@@ -49,9 +51,9 @@ namespace Umbraco.Tests.Models
|
||||
Assert.AreEqual(clone.ValidationRegExp, pt.ValidationRegExp);
|
||||
Assert.AreEqual(clone.ValueStorageType, pt.ValueStorageType);
|
||||
|
||||
//This double verifies by reflection
|
||||
//This double verifies by reflection (don't test properties marked with [DoNotClone]
|
||||
var allProps = clone.GetType().GetProperties();
|
||||
foreach (var propertyInfo in allProps)
|
||||
foreach (var propertyInfo in allProps.Where(p => p.GetCustomAttribute<DoNotCloneAttribute>(false) == null))
|
||||
{
|
||||
Assert.AreEqual(propertyInfo.GetValue(clone, null), propertyInfo.GetValue(pt, null));
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Umbraco.Tests.ModelsBuilder
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Umbraco.ModelsBuilder v" + version + @"
|
||||
// Umbraco.ModelsBuilder.Embedded v" + version + @"
|
||||
//
|
||||
// Changes to this file will be lost if the code is regenerated.
|
||||
// </auto-generated>
|
||||
@@ -76,14 +76,14 @@ namespace Umbraco.Web.PublishedModels
|
||||
{
|
||||
// helpers
|
||||
#pragma warning disable 0109 // new is redundant
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
|
||||
public new const string ModelTypeAlias = ""type1"";
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
|
||||
public new const PublishedItemType ModelItemType = PublishedItemType.Content;
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
|
||||
public new static IPublishedContentType GetModelContentType()
|
||||
=> PublishedModelUtility.GetModelContentType(ModelItemType, ModelTypeAlias);
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
|
||||
public static IPublishedPropertyType GetModelPropertyType<TValue>(Expression<Func<Type1, TValue>> selector)
|
||||
=> PublishedModelUtility.GetModelPropertyType(GetModelContentType(), selector);
|
||||
#pragma warning restore 0109
|
||||
@@ -95,7 +95,7 @@ namespace Umbraco.Web.PublishedModels
|
||||
|
||||
// properties
|
||||
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
|
||||
[ImplementPropertyType(""prop1"")]
|
||||
public string Prop1 => this.Value<string>(""prop1"");
|
||||
}
|
||||
@@ -169,7 +169,7 @@ namespace Umbraco.Web.PublishedModels
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Umbraco.ModelsBuilder v" + version + @"
|
||||
// Umbraco.ModelsBuilder.Embedded v" + version + @"
|
||||
//
|
||||
// Changes to this file will be lost if the code is regenerated.
|
||||
// </auto-generated>
|
||||
@@ -191,14 +191,14 @@ namespace Umbraco.Web.PublishedModels
|
||||
{
|
||||
// helpers
|
||||
#pragma warning disable 0109 // new is redundant
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
|
||||
public new const string ModelTypeAlias = ""type1"";
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
|
||||
public new const PublishedItemType ModelItemType = PublishedItemType.Content;
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
|
||||
public new static IPublishedContentType GetModelContentType()
|
||||
=> PublishedModelUtility.GetModelContentType(ModelItemType, ModelTypeAlias);
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
|
||||
public static IPublishedPropertyType GetModelPropertyType<TValue>(Expression<Func<Type1, TValue>> selector)
|
||||
=> PublishedModelUtility.GetModelPropertyType(GetModelContentType(), selector);
|
||||
#pragma warning restore 0109
|
||||
@@ -210,7 +210,7 @@ namespace Umbraco.Web.PublishedModels
|
||||
|
||||
// properties
|
||||
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
|
||||
[ImplementPropertyType(""foo"")]
|
||||
public global::System.Collections.Generic.IEnumerable<global::Foo> Foo => this.Value<global::System.Collections.Generic.IEnumerable<global::Foo>>(""foo"");
|
||||
}
|
||||
|
||||
@@ -297,7 +297,6 @@ select[size] {
|
||||
}
|
||||
|
||||
// Focus for select, file, radio, and checkbox
|
||||
select,
|
||||
input[type="file"],
|
||||
input[type="radio"],
|
||||
input[type="checkbox"] {
|
||||
|
||||
@@ -88,6 +88,12 @@ namespace Umbraco.Web.Composing
|
||||
|
||||
public static UmbracoHelper UmbracoHelper
|
||||
=> Factory.GetInstance<UmbracoHelper>();
|
||||
public static IUmbracoComponentRenderer UmbracoComponentRenderer
|
||||
=> Factory.GetInstance<IUmbracoComponentRenderer>();
|
||||
public static ITagQuery TagQuery
|
||||
=> Factory.GetInstance<ITagQuery>();
|
||||
public static IPublishedContentQuery PublishedContentQuery
|
||||
=> Factory.GetInstance<IPublishedContentQuery>();
|
||||
|
||||
public static DistributedCache DistributedCache
|
||||
=> Factory.GetInstance<DistributedCache>();
|
||||
|
||||
@@ -5,7 +5,6 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Web.Security;
|
||||
using Current = Umbraco.Web.Composing.Current;
|
||||
|
||||
@@ -65,7 +64,7 @@ namespace Umbraco.Web.Models
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string Password { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The username of the model, if UsernameIsEmail is true then this is ignored.
|
||||
/// </summary>
|
||||
|
||||
@@ -37,9 +37,9 @@ namespace Umbraco.Web.Routing
|
||||
reason = "No template exists to render the document at url '{0}'.";
|
||||
|
||||
response.Write("<html><body><h1>Page not found</h1>");
|
||||
response.Write("<h3>");
|
||||
response.Write("<h2>");
|
||||
response.Write(string.Format(reason, HttpUtility.HtmlEncode(Current.UmbracoContext.OriginalRequestUrl.PathAndQuery)));
|
||||
response.Write("</h3>");
|
||||
response.Write("</h2>");
|
||||
if (string.IsNullOrWhiteSpace(_message) == false)
|
||||
response.Write("<p>" + _message + "</p>");
|
||||
response.Write("<p>This page can be replaced with a custom 404. Check the documentation for \"custom 404\".</p>");
|
||||
|
||||
@@ -70,24 +70,31 @@ namespace Umbraco.Web
|
||||
#endregion
|
||||
|
||||
// ensures that we can return the specified value
|
||||
[Obsolete("This method is only used in Obsolete properties")]
|
||||
T Ensure<T>(T o) where T : class => o ?? throw new InvalidOperationException("This UmbracoHelper instance has not been initialized.");
|
||||
|
||||
[Obsolete("Inject and use an instance of " + nameof(IUmbracoComponentRenderer) + " in the constructor for using it in classes or get it from Current.UmbracoComponentRenderer in views.")]
|
||||
private IUmbracoComponentRenderer ComponentRenderer => Ensure(_componentRenderer);
|
||||
|
||||
[Obsolete("Inject and use an instance of " + nameof(ICultureDictionaryFactory) + " in the constructor for using it in classes or get it from Current.CultureDictionaryFactory in views.")]
|
||||
private ICultureDictionaryFactory CultureDictionaryFactory => Ensure(_cultureDictionaryFactory);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tag context.
|
||||
/// </summary>
|
||||
[Obsolete("Inject and use an instance of " + nameof(ITagQuery) + " in the constructor for using it in classes or get it from Current.TagQuery in views.")]
|
||||
public ITagQuery TagQuery => Ensure(_tagQuery);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the query context.
|
||||
/// </summary>
|
||||
[Obsolete("Inject and use an instance of " + nameof(IPublishedContentQuery) + " in the constructor for using it in classes or get it from Current.PublishedContentQuery in views")]
|
||||
public IPublishedContentQuery ContentQuery => Ensure(_publishedContentQuery);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the membership helper.
|
||||
/// </summary>
|
||||
[Obsolete("Inject and use an instance of " + nameof(Security.MembershipHelper) + " in the constructor instead. In views you can use @Members.")]
|
||||
public MembershipHelper MembershipHelper => Ensure(_membershipHelper);
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user