Fixes up nullable State, fixes up tracking global query strings in case they are removed by other routes

This commit is contained in:
Shannon
2018-09-14 11:31:43 +10:00
parent 8c90b7fa28
commit ec71814ec2
11 changed files with 73 additions and 38 deletions

View File

@@ -20,6 +20,9 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "createDate")]
public DateTime CreateDate { get; set; }
/// <summary>
/// Boolean indicating if this item is published or not based on it's <see cref="State"/>
/// </summary>
[DataMember(Name = "published")]
public bool Published => State == ContentSavedState.Published || State == ContentSavedState.PublishedPendingChanges;
@@ -42,9 +45,15 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "sortOrder")]
public int SortOrder { get; set; }
/// <summary>
/// The saved/published state of an item
/// </summary>
/// <remarks>
/// 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; }
public ContentSavedState? State { get; set; }
protected bool Equals(ContentItemBasic other)
{