Ensures the whole doc gets unpublished if a mandatory culture is unpublished, updates content service Unpublish to have it's own status result enum since that is needed.

This commit is contained in:
Shannon
2018-05-08 00:37:41 +10:00
parent 5a991c9424
commit 97cb752cda
11 changed files with 141 additions and 44 deletions

View File

@@ -35,7 +35,11 @@ namespace Umbraco.Web.Models.Mapping
Mandatory = x.Mandatory,
Name = source.GetName(x.IsoCode),
Exists = source.IsCultureAvailable(x.IsoCode), // segments ??
PublishedState = (source.IsCulturePublished(x.IsoCode) ? PublishedState.Published : PublishedState.Unpublished).ToString(),
PublishedState = (source.PublishedState == PublishedState.Unpublished //if the entire document is unpublished, then flag every variant as unpublished
? PublishedState.Unpublished
: source.IsCulturePublished(x.IsoCode)
? PublishedState.Published
: PublishedState.Unpublished).ToString(),
IsEdited = source.IsCultureEdited(x.IsoCode)
//Segment = ?? We'll need to populate this one day when we support segments
}).ToList();