Cleans up code, fixes tests, adds comments
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Umbraco.Web.Models.ContentEditing
|
||||
public DateTime CreateDate { get; set; }
|
||||
|
||||
[DataMember(Name = "published")]
|
||||
public bool Published { get; set; }
|
||||
public bool Published => State == ContentSavedState.Published || State == ContentSavedState.PublishedPendingChanges;
|
||||
|
||||
/// <summary>
|
||||
/// Determines if the content item is a draft
|
||||
@@ -44,7 +44,7 @@ namespace Umbraco.Web.Models.ContentEditing
|
||||
|
||||
[DataMember(Name = "state")]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public ContentSavedState? State { get; set; } = null;
|
||||
public ContentSavedState State { get; set; }
|
||||
|
||||
protected bool Equals(ContentItemBasic other)
|
||||
{
|
||||
|
||||
@@ -5,24 +5,29 @@
|
||||
/// </summary>
|
||||
public enum ContentSavedState
|
||||
{
|
||||
/// <summary>
|
||||
/// The state has not been set
|
||||
/// </summary>
|
||||
NotSet = -1,
|
||||
|
||||
/// <summary>
|
||||
/// The item isn't created yet
|
||||
/// </summary>
|
||||
NotCreated,
|
||||
NotCreated = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The item is saved but isn't published
|
||||
/// </summary>
|
||||
Draft,
|
||||
Draft = 2,
|
||||
|
||||
/// <summary>
|
||||
/// The item is published and there are no pending changes
|
||||
/// </summary>
|
||||
Published,
|
||||
Published = 3,
|
||||
|
||||
/// <summary>
|
||||
/// The item is published and there are pending changes
|
||||
/// </summary>
|
||||
PublishedPendingChanges
|
||||
PublishedPendingChanges = 4
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user