Service refactoring to "fully" enable segments (#19114)

* Refactor serverside content editing to support all variance combinations

* Fix build errors

* Reintroduce the tests ignored by #19060

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
This commit is contained in:
Kenn Jacobsen
2025-04-23 14:54:51 +02:00
committed by GitHub
parent 53b94a8f57
commit 2cf28271cd
46 changed files with 1321 additions and 1028 deletions

View File

@@ -17,10 +17,11 @@ public static class DocumentUpdateHelper
{
Segment = null,
Culture = null,
Name = createModel.InvariantName!,
Name = createModel.Variants.FirstOrDefault(v => v.Culture is null && v.Segment is null)?.Name
?? throw new ArgumentException("Could not find an invariant variant for the model name", nameof(createModel)),
}
];
updateRequestModel.Values = createModel.InvariantProperties.Select(x => new DocumentValueModel
updateRequestModel.Values = createModel.Properties.Select(x => new DocumentValueModel
{
Alias = x.Alias,
Value = x.Value,
@@ -44,10 +45,11 @@ public static class DocumentUpdateHelper
{
Segment = null,
Culture = null,
Name = createModel.InvariantName!,
Name = createModel.Variants.FirstOrDefault(v => v.Culture is null && v.Segment is null)?.Name
?? throw new ArgumentException("Could not find an invariant variant for the model name", nameof(createModel)),
}
];
createDocumentRequestModel.Values = createModel.InvariantProperties.Select(x => new DocumentValueModel
createDocumentRequestModel.Values = createModel.Properties.Select(x => new DocumentValueModel
{
Alias = x.Alias,
Value = x.Value,