Add FIXME to content type sort + rearrange constructor parameters
This commit is contained in:
@@ -21,7 +21,8 @@ public class ContentTypeSort : IValueObject, IDeepCloneable
|
||||
SortOrder = sortOrder;
|
||||
}
|
||||
|
||||
public ContentTypeSort(Lazy<int> id, int sortOrder, string alias, Guid key)
|
||||
// FIXME: remove integer ID in constructor
|
||||
public ContentTypeSort(Lazy<int> id, Guid key, int sortOrder, string alias)
|
||||
{
|
||||
Id = id;
|
||||
SortOrder = sortOrder;
|
||||
|
||||
@@ -1176,8 +1176,7 @@ namespace Umbraco.Cms.Infrastructure.Packaging
|
||||
continue;
|
||||
}
|
||||
|
||||
allowedChildren?.Add(new ContentTypeSort(new Lazy<int>(() => allowedChild.Id), sortOrder,
|
||||
allowedChild.Alias, allowedChild.Key));
|
||||
allowedChildren?.Add(new ContentTypeSort(new Lazy<int>(() => allowedChild.Id), allowedChild.Key, sortOrder, allowedChild.Alias));
|
||||
sortOrder++;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,9 +129,9 @@ internal class ContentTypeCommonRepository : IContentTypeCommonRepository
|
||||
|
||||
allowedContentTypes.Add(new ContentTypeSort(
|
||||
new Lazy<int>(() => allowedDto.AllowedId),
|
||||
key,
|
||||
allowedDto.SortOrder,
|
||||
alias!,
|
||||
key));
|
||||
alias!));
|
||||
allowedDtoIx++;
|
||||
}
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ public class LoadTestController : Controller
|
||||
};
|
||||
containerType.AllowedContentTypes = containerType.AllowedContentTypes.Union(new[]
|
||||
{
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType.Id), 0, contentType.Alias, contentType.Key)
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType.Id), contentType.Key, 0, contentType.Alias)
|
||||
});
|
||||
containerType.AllowedTemplates = containerType.AllowedTemplates.Union(new[] { containerTemplate });
|
||||
containerType.SetDefaultTemplate(containerTemplate);
|
||||
|
||||
@@ -53,6 +53,6 @@ public class ContentTypeSortBuilder
|
||||
var sortOrder = _sortOrder ?? 0;
|
||||
var key = Guid.NewGuid();
|
||||
|
||||
return new ContentTypeSort(new Lazy<int>(() => id), sortOrder, alias, key);
|
||||
return new ContentTypeSort(new Lazy<int>(() => id), key, sortOrder, alias);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -809,8 +809,8 @@ public class ContentTypeRepositoryTest : UmbracoIntegrationTest
|
||||
var contentType = repository.Get(_simpleContentType.Id);
|
||||
contentType.AllowedContentTypes = new List<ContentTypeSort>
|
||||
{
|
||||
new(new Lazy<int>(() => subpageContentType.Id), 0, subpageContentType.Alias, subpageContentType.Key),
|
||||
new(new Lazy<int>(() => simpleSubpageContentType.Id), 1, simpleSubpageContentType.Alias, simpleSubpageContentType.Key)
|
||||
new(new Lazy<int>(() => subpageContentType.Id), subpageContentType.Key, 0, subpageContentType.Alias),
|
||||
new(new Lazy<int>(() => simpleSubpageContentType.Id), simpleSubpageContentType.Key, 1, simpleSubpageContentType.Alias)
|
||||
};
|
||||
repository.Save(contentType);
|
||||
|
||||
|
||||
@@ -70,18 +70,18 @@ public class ContentServicePerformanceTest : UmbracoIntegrationTest
|
||||
ContentTypeService.Save(new[] { contentType1, contentType2, contentType3 });
|
||||
contentType1.AllowedContentTypes = new[]
|
||||
{
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType2.Id), 0, contentType2.Alias, contentType2.Key),
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType3.Id), 1, contentType3.Alias, contentType3.Key)
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType2.Id), contentType2.Key, 0, contentType2.Alias),
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType3.Id), contentType3.Key, 1, contentType3.Alias)
|
||||
};
|
||||
contentType2.AllowedContentTypes = new[]
|
||||
{
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType1.Id), 0, contentType1.Alias, contentType1.Key),
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType3.Id), 1, contentType3.Alias, contentType3.Key)
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType1.Id), contentType1.Key, 0, contentType1.Alias),
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType3.Id), contentType3.Key, 1, contentType3.Alias)
|
||||
};
|
||||
contentType3.AllowedContentTypes = new[]
|
||||
{
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType1.Id), 0, contentType1.Alias, contentType1.Key),
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType2.Id), 1, contentType2.Alias, contentType2.Key)
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType1.Id), contentType1.Key, 0, contentType1.Alias),
|
||||
new ContentTypeSort(new Lazy<int>(() => contentType2.Id), contentType2.Key, 1, contentType2.Alias)
|
||||
};
|
||||
ContentTypeService.Save(new[] { contentType1, contentType2, contentType3 });
|
||||
|
||||
|
||||
@@ -652,7 +652,7 @@ public class ContentServiceTagsTests : UmbracoIntegrationTest
|
||||
CreateAndAddTagsPropertyType(contentType);
|
||||
ContentTypeService.Save(contentType);
|
||||
contentType.AllowedContentTypes =
|
||||
new[] { new ContentTypeSort(new Lazy<int>(() => contentType.Id), 0, contentType.Alias, contentType.Key) };
|
||||
new[] { new ContentTypeSort(new Lazy<int>(() => contentType.Id), contentType.Key, 0, contentType.Alias) };
|
||||
|
||||
var content = ContentBuilder.CreateSimpleContent(contentType, "Tagged content");
|
||||
content.AssignTags(PropertyEditorCollection, DataTypeService, Serializer, "tags",
|
||||
|
||||
@@ -1843,7 +1843,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent
|
||||
ContentTypeBuilder.CreateSimpleContentType("umbTextpage1", "Textpage", defaultTemplateId: template.Id);
|
||||
contentType.AllowedContentTypes = new List<ContentTypeSort>
|
||||
{
|
||||
new(new Lazy<int>(() => contentType.Id), 0, contentType.Alias, contentType.Key)
|
||||
new(new Lazy<int>(() => contentType.Id), contentType.Key, 0, contentType.Alias)
|
||||
};
|
||||
ContentTypeService.Save(contentType);
|
||||
|
||||
@@ -1883,7 +1883,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent
|
||||
ContentTypeBuilder.CreateSimpleContentType("umbTextpage1", "Textpage", defaultTemplateId: template.Id);
|
||||
contentType.AllowedContentTypes = new List<ContentTypeSort>
|
||||
{
|
||||
new(new Lazy<int>(() => contentType.Id), 0, contentType.Alias, contentType.Key)
|
||||
new(new Lazy<int>(() => contentType.Id), contentType.Key, 0, contentType.Alias)
|
||||
};
|
||||
ContentTypeService.Save(contentType);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user