Improve document schedule (#17535)

* Expose schedule date for on document get endpoint

* typo fix

* stupid stuff

* Enable content scheduling features in the publishing service

* Replace obsoleted non async calls

* Add content scheduling test

* Publush and schedule combination test

* More invariantCulture notation allignment and more tests

* Link up api with updated document scheduling

* More invariant culture notation allignment

* Fix breaking change

* Return expected status codes.

* Fix constructor

* Forward Default implementation to actual core implementation

Co-authored-by: Bjarke Berg <mail@bergmania.dk>

* Forward default implementation to core implementation

Co-authored-by: Bjarke Berg <mail@bergmania.dk>

* Make content with scheduling retrieval scope safe

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Sven Geusens
2025-01-08 12:39:34 +01:00
committed by GitHub
parent 413398afc6
commit e425f0ba41
26 changed files with 2045 additions and 40 deletions

View File

@@ -28,6 +28,8 @@ public class ContentEditingServiceTests : UmbracoIntegrationTestWithContent
private ILanguageService LanguageService => GetRequiredService<ILanguageService>();
private ITemplateService TemplateService => GetRequiredService<ITemplateService>();
[Test]
public async Task Only_Supplied_Cultures_Are_Updated()
{
@@ -107,7 +109,7 @@ public class ContentEditingServiceTests : UmbracoIntegrationTestWithContent
await LanguageService.CreateAsync(langDa, Constants.Security.SuperUserKey);
var template = TemplateBuilder.CreateTextPageTemplate();
FileService.SaveTemplate(template);
await TemplateService.CreateAsync(template, Constants.Security.SuperUserKey);
var contentType = new ContentTypeBuilder()
.WithAlias("variantContent")
@@ -127,7 +129,7 @@ public class ContentEditingServiceTests : UmbracoIntegrationTestWithContent
.Build();
contentType.AllowedAsRoot = true;
ContentTypeService.Save(contentType);
await ContentTypeService.CreateAsync(contentType, Constants.Security.SuperUserKey);
return (langEn, langDa, contentType);
}

View File

@@ -328,7 +328,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent
contentSchedule = ContentService.GetContentScheduleByContentId(content.Id);
var sched = contentSchedule.FullSchedule;
Assert.AreEqual(1, sched.Count);
Assert.AreEqual(1, sched.Count(x => x.Culture == string.Empty));
Assert.AreEqual(1, sched.Count(x => x.Culture == Constants.System.InvariantCulture));
contentSchedule.Clear(ContentScheduleAction.Expire);
ContentService.Save(content, Constants.Security.SuperUserId, contentSchedule);