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>
This commit is contained in:
Sven Geusens
2024-08-15 07:11:17 +02:00
committed by GitHub
parent 7a700f3029
commit fd100602c2
25 changed files with 717 additions and 10 deletions

View File

@@ -114,6 +114,15 @@ public abstract class BlockValuePropertyValueEditorBase<TValue, TLayout> : DataV
MapBlockItemDataToEditor(property, blockValue.SettingsData);
}
protected IEnumerable<Guid> ConfiguredElementTypeKeys(IBlockConfiguration configuration)
{
yield return configuration.ContentElementTypeKey;
if (configuration.SettingsElementTypeKey is not null)
{
yield return configuration.SettingsElementTypeKey.Value;
}
}
private void MapBlockItemDataToEditor(IProperty property, List<BlockItemData> items)
{
var valEditors = new Dictionary<Guid, IDataValueEditor>();