Files
Umbraco-CMS/src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyIndexValueFactory.cs
Bjarke Berg d9f342bee7 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>
2023-02-13 14:47:26 +01:00

38 lines
1.5 KiB
C#

// 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;
}