Files
Umbraco-CMS/src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditor.cs
Sven Geusens fd100602c2 V14/fix/element switch validation (#16421)
* Added Element <-> Document type switch validation

* Apply HasElementconfigured to block grid and block list

Fix smalle bug + optimization

* Moved some of the logic into warnings trough notifcationhandlers and eventmessages

* Cleanup

* Update openApi spec (merge changes)

* Add IsElement check between parent and child on creation

* Typos

* Transformed HasElementConfigured into HasElementConfigured

* Typo

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>

* IsElement Validation refactor

Moved validation logic regarding doctype IsElement switch into its own service as it will be consumed by more things down the line

* commit missing services...

* Naming improvements

* Bugfix

* First batch of integration tests for ElementSwitchValidator

* More integration tests!

* Little reformatting

* Changed the default values of block based configuration to match expected values.

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2024-08-15 07:11:17 +02:00

48 lines
1.6 KiB
C#

// Copyright (c) Umbraco.
// See LICENSE for more details.
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.PropertyEditors;
/// <summary>
/// Represents a block list property editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.BlockList,
ValueType = ValueTypes.Json,
ValueEditorIsReusable = false)]
public class BlockListPropertyEditor : BlockListPropertyEditorBase
{
private readonly IIOHelper _ioHelper;
public BlockListPropertyEditor(
IDataValueEditorFactory dataValueEditorFactory,
IIOHelper ioHelper,
IBlockValuePropertyIndexValueFactory blockValuePropertyIndexValueFactory,
IJsonSerializer jsonSerializer)
: base(dataValueEditorFactory, blockValuePropertyIndexValueFactory, jsonSerializer)
=> _ioHelper = ioHelper;
[Obsolete("Use constructor that doesn't take PropertyEditorCollection, scheduled for removal in V15")]
public BlockListPropertyEditor(
IDataValueEditorFactory dataValueEditorFactory,
PropertyEditorCollection propertyEditors,
IIOHelper ioHelper,
IBlockValuePropertyIndexValueFactory blockValuePropertyIndexValueFactory,
IJsonSerializer jsonSerializer)
: this(dataValueEditorFactory, ioHelper, blockValuePropertyIndexValueFactory, jsonSerializer)
{
}
public override bool SupportsConfigurableElements => true;
#region Pre Value Editor
protected override IConfigurationEditor CreateConfigurationEditor() =>
new BlockListConfigurationEditor(_ioHelper);
#endregion
}