Added missing property index value factories (#13819)
* Added missing PropertyIndexValueFactories, for Block Grid, Block List, Nested Content, Tags and added No-op for image picker, image cropper etc, where the content dont make any sense anyway. Made it replace for block grid/list, nested content and tags * Fixed tests * Ensure raw-fields are the prefix * Code clean up * build fix * Minor cleanup * Fixed issue with published values / external index --------- Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Serialization;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
|
||||
namespace Umbraco.Cms.Core.PropertyEditors;
|
||||
|
||||
internal sealed class NestedContentPropertyIndexValueFactory
|
||||
: NestedPropertyIndexValueFactoryBase<
|
||||
NestedContentPropertyEditor.NestedContentValues.NestedContentRowValue[],
|
||||
NestedContentPropertyEditor.NestedContentValues.NestedContentRowValue>,
|
||||
INestedContentPropertyIndexValueFactory
|
||||
{
|
||||
private readonly IContentTypeService _contentTypeService;
|
||||
|
||||
|
||||
public NestedContentPropertyIndexValueFactory(
|
||||
PropertyEditorCollection propertyEditorCollection,
|
||||
IContentTypeService contentTypeService,
|
||||
IJsonSerializer jsonSerializer) : base(propertyEditorCollection, jsonSerializer)
|
||||
{
|
||||
_contentTypeService = contentTypeService;
|
||||
}
|
||||
|
||||
protected override IContentType? GetContentTypeOfNestedItem(
|
||||
NestedContentPropertyEditor.NestedContentValues.NestedContentRowValue input)
|
||||
=> _contentTypeService.Get(input.ContentTypeAlias);
|
||||
|
||||
protected override IDictionary<string, object?> GetRawProperty(
|
||||
NestedContentPropertyEditor.NestedContentValues.NestedContentRowValue nestedContentRowValue) =>
|
||||
nestedContentRowValue.RawPropertyValues;
|
||||
|
||||
protected override IEnumerable<NestedContentPropertyEditor.NestedContentValues.NestedContentRowValue> GetDataItems(
|
||||
NestedContentPropertyEditor.NestedContentValues.NestedContentRowValue[] input) => input;
|
||||
}
|
||||
Reference in New Issue
Block a user