Fixes Publishing/Unpublishing variants and it's nuances

This commit is contained in:
Shannon
2018-05-07 23:22:52 +10:00
parent 7a92691bf5
commit 5a991c9424
21 changed files with 281 additions and 128 deletions

View File

@@ -1,14 +1,24 @@
namespace Umbraco.Core.Models.Entities
using System.Collections.Generic;
namespace Umbraco.Core.Models.Entities
{
/// <summary>
/// Implements <see cref="IDocumentEntitySlim"/>.
/// </summary>
public class DocumentEntitySlim : ContentEntitySlim, IDocumentEntitySlim
{
private static readonly IReadOnlyDictionary<string, string> Empty = new Dictionary<string, string>();
private IReadOnlyDictionary<string, string> _cultureNames;
public IReadOnlyDictionary<string, string> CultureNames
{
get => _cultureNames ?? Empty;
set => _cultureNames = value;
}
/// <inheritdoc />
public bool Published { get; set; }
/// <inheritdoc />
public bool Edited { get; set; }
}
}
}

View File

@@ -1,18 +1,30 @@
namespace Umbraco.Core.Models.Entities
using System.Collections.Generic;
namespace Umbraco.Core.Models.Entities
{
/// <summary>
/// Represents a lightweight document entity, managed by the entity service.
/// </summary>
public interface IDocumentEntitySlim : IContentEntitySlim
{
/// <summary>
/// Gets a value indicating whether the document is published.
/// </summary>
bool Published { get; }
//fixme we need to supply more information than this and change this property name. This will need to include Published/Editor per variation since we need this information for the tree
IReadOnlyDictionary<string, string> CultureNames { get; }
/// <summary>
/// Gets a value indicating whether the document has edited properties.
/// At least one variation is published
/// </summary>
bool Edited { get; }
/// <remarks>
/// If the document is invariant, this simply means there is a published version
/// </remarks>
bool Published { get; set; }
/// <summary>
/// At least one variation has pending changes
/// </summary>
/// <remarks>
/// If the document is invariant, this simply means there is pending changes
/// </remarks>
bool Edited { get; set; }
}
}
}