U4-10789 Headless User Editor extensibility

This commit is contained in:
Shannon
2018-01-02 17:28:16 +11:00
parent 773ef1d168
commit 0ce059d5bd
11 changed files with 512 additions and 468 deletions

View File

@@ -0,0 +1,26 @@
using System.Runtime.Serialization;
namespace Umbraco.Web.Models.ContentEditing
{
/// <summary>
/// A model representing the navigation ("apps") inside an editor in the back office
/// </summary>
[DataContract(Name = "user", Namespace = "")]
public class EditorNavigation
{
[DataMember(Name = "name")]
public string Name { get; set; }
[DataMember(Name = "alias")]
public string Alias { get; set; }
[DataMember(Name = "icon")]
public string Icon { get; set; }
[DataMember(Name = "view")]
public string View { get; set; }
[DataMember(Name = "active")]
public bool Active { get; set; }
}
}

View File

@@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
namespace Umbraco.Web.Models.ContentEditing
{
{
/// <summary>
/// Represents information for the current user
/// </summary>
@@ -29,7 +29,7 @@ namespace Umbraco.Web.Models.ContentEditing
[Obsolete("This should not be used it exists for legacy reasons only, use user groups instead, it will be removed in future versions")]
[EditorBrowsable(EditorBrowsableState.Never)]
[ReadOnly(true)]
[DataMember(Name = "userType")]
[DataMember(Name = "userType")]
public string UserType { get; set; }
[ReadOnly(true)]
@@ -64,8 +64,8 @@ namespace Umbraco.Web.Models.ContentEditing
/// A list of sections the user is allowed to view.
/// </summary>
[DataMember(Name = "allowedSections")]
public IEnumerable<string> AllowedSections { get; set; }
public IEnumerable<string> AllowedSections { get; set; }
}
}

View File

@@ -18,8 +18,13 @@ namespace Umbraco.Web.Models.ContentEditing
AvailableCultures = new Dictionary<string, string>();
StartContentIds = new List<EntityBasic>();
StartMediaIds = new List<EntityBasic>();
Navigation = new List<EditorNavigation>();
}
[DataMember(Name = "navigation")]
[ReadOnly(true)]
public IEnumerable<EditorNavigation> Navigation { get; set; }
/// <summary>
/// Gets the available cultures (i.e. to populate a drop down)
/// The key is the culture stored in the database, the value is the Name