Migrating the rest of the files from ContentEditing\

This commit is contained in:
Elitsa Marinovska
2020-11-03 16:36:59 +01:00
parent 5104430879
commit 6d23075d9a
16 changed files with 21 additions and 48 deletions

View File

@@ -24,6 +24,13 @@ namespace Umbraco.Web.Models.ContentEditing
[Required]
public ContentSaveAction Action { get; set; }
[DataMember(Name = "properties")]
public override IEnumerable<ContentPropertyBasic> Properties
{
get => base.Properties;
set => base.Properties = value;
}
[IgnoreDataMember]
public List<ContentPropertyFile> UploadedFiles { get; }
@@ -52,6 +59,5 @@ namespace Umbraco.Web.Models.ContentEditing
public ContentPropertyCollectionDto PropertyCollectionDto { get; set; }
#endregion
}
}

View File

@@ -3,8 +3,6 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Umbraco.Web.Models.ContentEditing
{
@@ -54,7 +52,6 @@ namespace Umbraco.Web.Models.ContentEditing
/// This is nullable since it's only relevant for content (non-content like media + members will be null)
/// </remarks>
[DataMember(Name = "state")]
[JsonConverter(typeof(StringEnumConverter))]
public ContentSavedState? State { get; set; }
[DataMember(Name = "variesByCulture")]
@@ -94,12 +91,10 @@ namespace Umbraco.Web.Models.ContentEditing
private IEnumerable<T> _properties;
[DataMember(Name = "properties")]
public virtual IEnumerable<T> Properties
{
get => _properties;
set => _properties = value;
}
}
}

View File

@@ -1,10 +1,8 @@
using Newtonsoft.Json;
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using Newtonsoft.Json.Converters;
namespace Umbraco.Web.Models.ContentEditing
{
@@ -36,7 +34,6 @@ namespace Umbraco.Web.Models.ContentEditing
/// Internal property used for tests to get all properties from all tabs
/// </summary>
[IgnoreDataMember]
[JsonIgnore]
IEnumerable<ContentPropertyDisplay> IContentProperties<ContentPropertyDisplay>.Properties => Tabs.SelectMany(x => x.Properties);
/// <summary>
@@ -52,7 +49,6 @@ namespace Umbraco.Web.Models.ContentEditing
public string Segment { get; set; }
[DataMember(Name = "state")]
[JsonConverter(typeof(StringEnumConverter))]
public ContentSavedState State { get; set; }
[DataMember(Name = "updateDate")]
@@ -79,6 +75,5 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "notifications")]
[ReadOnly(true)]
public List<BackOfficeNotification> Notifications { get; private set; }
}
}

View File

@@ -1,5 +1,4 @@
using System.Runtime.Serialization;
using Umbraco.Core.Models;
namespace Umbraco.Web.Models.ContentEditing
{

View File

@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Umbraco.Core.Models;
using Umbraco.Core.Models.ContentEditing;
namespace Umbraco.Web.Models.ContentEditing

View File

@@ -1,5 +1,5 @@
using System.Runtime.Serialization;
using Umbraco.Core.Models;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace Umbraco.Web.Models.ContentEditing
{
@@ -13,5 +13,12 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "email")]
public string Email { get; set; }
[DataMember(Name = "properties")]
public override IEnumerable<ContentPropertyBasic> Properties
{
get => base.Properties;
set => base.Properties = value;
}
}
}

View File

@@ -1,8 +1,6 @@
using System.Collections.Generic;
using System.Runtime.Serialization;
using Umbraco.Core.Models;
using Umbraco.Core.Models.ContentEditing;
using Umbraco.Core.Models.Membership;
namespace Umbraco.Web.Models.ContentEditing
{

View File

@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.Runtime.Serialization;
using Umbraco.Core.Models;
using Umbraco.Core.Models.ContentEditing;
namespace Umbraco.Web.Models.ContentEditing

View File

@@ -2,9 +2,9 @@
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Validation;
using Umbraco.Core;
namespace Umbraco.Web.Models.ContentEditing
{

View File

@@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime.Serialization;
namespace Umbraco.Web.Models.ContentEditing
{
@@ -18,7 +11,6 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "alias")]
public string Alias { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
[DataMember(Name = "mode")]
public RichTextEditorCommandMode Mode { get; set; }
}

View File

@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Umbraco.Web.Models.ContentEditing
{

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using Newtonsoft.Json;
namespace Umbraco.Web.Models.ContentEditing
{
@@ -19,16 +18,6 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "tabs")]
public IEnumerable<Tab<T>> Tabs { get; set; }
// note
// once a [DataContract] has been defined on a class, with a [DataMember] property,
// one simply cannot ignore that property anymore - [IgnoreDataMember] on an overridden
// property is ignored, and 'newing' the property means that it's the base property
// which is used
//
// OTOH, Json.NET is happy having [JsonIgnore] on overrides, even though the base
// property is [JsonProperty]. so, forcing [JsonIgnore] here, but really, we should
// rethink the whole thing.
/// <summary>
/// Override the properties property to ensure we don't serialize this
/// and to simply return the properties based on the properties in the tabs collection
@@ -37,7 +26,6 @@ namespace Umbraco.Web.Models.ContentEditing
/// This property cannot be set
/// </remarks>
[IgnoreDataMember]
[JsonIgnore] // see note above on IgnoreDataMember vs JsonIgnore
public override IEnumerable<T> Properties
{
get => Tabs.SelectMany(x => x.Properties);