Migrations from PropertyEditors folder without dependencies to DataValueEditor or ConfigurationEditor<TConfiguration>
This commit is contained in:
@@ -25,7 +25,7 @@ namespace Umbraco.Core.PropertyEditors
|
||||
//TODO: We will need to change this once we support tracking via variants/segments
|
||||
// for now, we are tracking values from ALL variants
|
||||
|
||||
foreach(var propertyVal in p.Values)
|
||||
foreach (var propertyVal in p.Values)
|
||||
{
|
||||
var val = propertyVal.EditedValue;
|
||||
|
||||
@@ -33,9 +33,9 @@ namespace Umbraco.Core.PropertyEditors
|
||||
if (valueEditor is IDataValueReference reference)
|
||||
{
|
||||
var refs = reference.GetReferences(val);
|
||||
foreach(var r in refs)
|
||||
foreach (var r in refs)
|
||||
trackedRelations.Add(r);
|
||||
}
|
||||
}
|
||||
|
||||
// Loop over collection that may be add to existing property editors
|
||||
// implementation of GetReferences in IDataValueReference.
|
||||
@@ -48,14 +48,11 @@ namespace Umbraco.Core.PropertyEditors
|
||||
// in the dataeditor/property has referecnes to media/content items
|
||||
if (item.IsForEditor(editor))
|
||||
{
|
||||
foreach(var r in item.GetDataValueReference().GetReferences(val))
|
||||
foreach (var r in item.GetDataValueReference().GetReferences(val))
|
||||
trackedRelations.Add(r);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return trackedRelations;
|
||||
@@ -1,5 +1,4 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.PropertyEditors.Validators;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors
|
||||
@@ -7,7 +6,7 @@ namespace Umbraco.Web.PropertyEditors
|
||||
/// <summary>
|
||||
/// A custom pre-value editor class to deal with the legacy way that the pre-value data is stored.
|
||||
/// </summary>
|
||||
internal class DecimalConfigurationEditor : ConfigurationEditor
|
||||
public class DecimalConfigurationEditor : ConfigurationEditor
|
||||
{
|
||||
public DecimalConfigurationEditor()
|
||||
{
|
||||
@@ -13,6 +13,6 @@ namespace Umbraco.Core.PropertyEditors
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
IEnumerable<UmbracoEntityReference> GetReferences(object value);
|
||||
IEnumerable<UmbracoEntityReference> GetReferences(object value);
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the DataValueReference lookup supports a datatype (data editor).
|
||||
/// </summary>
|
||||
/// <param name="dataType">The datatype.</param>
|
||||
/// <param name="dataEditor"></param>
|
||||
/// <returns>A value indicating whether the converter supports a datatype.</returns>
|
||||
bool IsForEditor(IDataEditor dataEditor);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.PropertyEditors.Validators;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors
|
||||
@@ -7,7 +6,7 @@ namespace Umbraco.Web.PropertyEditors
|
||||
/// <summary>
|
||||
/// A custom pre-value editor class to deal with the legacy way that the pre-value data is stored.
|
||||
/// </summary>
|
||||
internal class IntegerConfigurationEditor : ConfigurationEditor
|
||||
public class IntegerConfigurationEditor : ConfigurationEditor
|
||||
{
|
||||
public IntegerConfigurationEditor()
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors
|
||||
@@ -31,7 +31,7 @@ namespace Umbraco.Web.PropertyEditors
|
||||
new Layout { Name = "grid", Icon = "icon-thumbnails-small", IsSystem = 1, Selected = true, Path = "views/propertyeditors/listview/layouts/grid/grid.html" }
|
||||
};
|
||||
|
||||
IncludeProperties = new []
|
||||
IncludeProperties = new[]
|
||||
{
|
||||
new Property { Alias = "sortOrder", Header = "Sort order", IsSystem = 1 },
|
||||
new Property { Alias = "updateDate", Header = "Last edited", IsSystem = 1 },
|
||||
@@ -41,7 +41,7 @@ namespace Umbraco.Web.PropertyEditors
|
||||
|
||||
[ConfigurationField("pageSize", "Page Size", "number", Description = "Number of items per page")]
|
||||
public int PageSize { get; set; }
|
||||
|
||||
|
||||
[ConfigurationField("orderBy", "Order By", "views/propertyeditors/listview/sortby.prevalues.html",
|
||||
Description = "The default sort order for the list")]
|
||||
public string OrderBy { get; set; }
|
||||
@@ -69,54 +69,57 @@ namespace Umbraco.Web.PropertyEditors
|
||||
[ConfigurationField("showContentFirst", "Show Content App First", "boolean", Description = "Enable this to show the content app by default instead of the list view app")]
|
||||
public bool ShowContentFirst { get; set; }
|
||||
|
||||
[DataContract]
|
||||
public class Property
|
||||
{
|
||||
[JsonProperty("alias")]
|
||||
[DataMember(Name = "alias")]
|
||||
public string Alias { get; set; }
|
||||
|
||||
[JsonProperty("header")]
|
||||
[DataMember(Name = "header")]
|
||||
public string Header { get; set; }
|
||||
|
||||
[JsonProperty("nameTemplate")]
|
||||
[DataMember(Name = "nameTemplate")]
|
||||
public string Template { get; set; }
|
||||
|
||||
[JsonProperty("isSystem")]
|
||||
[DataMember(Name = "isSystem")]
|
||||
public int IsSystem { get; set; } // TODO: bool
|
||||
}
|
||||
|
||||
[DataContract]
|
||||
public class Layout
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
[DataMember(Name = "name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("path")]
|
||||
[DataMember(Name = "path")]
|
||||
public string Path { get; set; }
|
||||
|
||||
[JsonProperty("icon")]
|
||||
[DataMember(Name = "icon")]
|
||||
public string Icon { get; set; }
|
||||
|
||||
[JsonProperty("isSystem")]
|
||||
[DataMember(Name = "isSystem")]
|
||||
public int IsSystem { get; set; } // TODO: bool
|
||||
|
||||
[JsonProperty("selected")]
|
||||
[DataMember(Name = "selected")]
|
||||
public bool Selected { get; set; }
|
||||
}
|
||||
|
||||
[DataContract]
|
||||
public class BulkActionPermissionSettings
|
||||
{
|
||||
[JsonProperty("allowBulkPublish")]
|
||||
[DataMember(Name = "allowBulkPublish")]
|
||||
public bool AllowBulkPublish { get; set; } = true;
|
||||
|
||||
[JsonProperty("allowBulkUnpublish")]
|
||||
[DataMember(Name = "allowBulkUnpublish")]
|
||||
public bool AllowBulkUnpublish { get; set; } = true;
|
||||
|
||||
[JsonProperty("allowBulkCopy")]
|
||||
[DataMember(Name = "allowBulkCopy")]
|
||||
public bool AllowBulkCopy { get; set; } = true;
|
||||
|
||||
[JsonProperty("allowBulkMove")]
|
||||
[DataMember(Name = "allowBulkMove")]
|
||||
public bool AllowBulkMove { get; set; } = true;
|
||||
|
||||
[JsonProperty("allowBulkDelete")]
|
||||
[DataMember(Name = "allowBulkDelete")]
|
||||
public bool AllowBulkDelete { get; set; } = true;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors
|
||||
{
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the 'startNode' value for the <see cref="Umbraco.Web.PropertyEditors.MultiNodePickerConfiguration"/>
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class MultiNodePickerConfigurationTreeSource
|
||||
{
|
||||
[DataMember(Name = "type")]
|
||||
public string ObjectType { get; set; }
|
||||
|
||||
[DataMember(Name = "query")]
|
||||
public string StartNodeQuery { get; set; }
|
||||
|
||||
[DataMember(Name = "id")]
|
||||
public Udi StartNodeId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors
|
||||
@@ -27,15 +27,17 @@ namespace Umbraco.Web.PropertyEditors
|
||||
[ConfigurationField("hideLabel", "Hide Label", "boolean", Description = "Hide the property label and let the item list span the full width of the editor window.")]
|
||||
public bool HideLabel { get; set; }
|
||||
|
||||
|
||||
[DataContract]
|
||||
public class ContentType
|
||||
{
|
||||
[JsonProperty("ncAlias")]
|
||||
[DataMember(Name = "ncAlias")]
|
||||
public string Alias { get; set; }
|
||||
|
||||
[JsonProperty("ncTabAlias")]
|
||||
[DataMember(Name = "ncTabAlias")]
|
||||
public string TabAlias { get; set; }
|
||||
|
||||
[JsonProperty("nameTemplate")]
|
||||
[DataMember(Name = "nameTemplate")]
|
||||
public string Template { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors
|
||||
@@ -1,21 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the 'startNode' value for the <see cref="MultiNodePickerConfiguration"/>
|
||||
/// </summary>
|
||||
[JsonObject]
|
||||
public class MultiNodePickerConfigurationTreeSource
|
||||
{
|
||||
[JsonProperty("type")]
|
||||
public string ObjectType {get;set;}
|
||||
|
||||
[JsonProperty("query")]
|
||||
public string StartNodeQuery {get;set;}
|
||||
|
||||
[JsonProperty("id")]
|
||||
public Udi StartNodeId {get;set;}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user