-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Entity Data Picker: Data editor and value converter #20661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entity Data Picker: Data editor and value converter #20661
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a new Entity Data Picker property editor with its backend infrastructure and frontend UI components. The implementation includes a value converter for structured data handling and integration with the picker data source system.
Key Changes:
- New property editor implementation with value converter that structures picked entity IDs
- Standardization of picker data source type using a named constant
- Frontend value structure changed from array to object with
idsproperty
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderTests.cs | Updated test assertion to account for new data editor count |
| src/Umbraco.Web.UI.Client/src/packages/property-editors/entity-data-picker/property-editor/types.ts | Changed value type from array to object structure |
| src/Umbraco.Web.UI.Client/src/packages/property-editors/entity-data-picker/property-editor/manifests.ts | Updated schema alias and replaced string literal with constant |
| src/Umbraco.Web.UI.Client/src/packages/property-editors/entity-data-picker/property-editor/entity-data-picker-property-editor-ui.element.ts | Adapted to new object-based value structure |
| src/Umbraco.Web.UI.Client/src/packages/property-editors/entity-data-picker/entry-point.ts | Replaced string literal with data source type constant |
| src/Umbraco.Web.UI.Client/src/packages/core/picker-data-source/index.ts | Exported new constant module |
| src/Umbraco.Web.UI.Client/src/packages/core/picker-data-source/constant.ts | Defined picker data source type constant |
| src/Umbraco.Web.UI.Client/examples/picker-data-source/index.ts | Updated all picker examples to use constant |
| src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/EntityDataPickerValueConverter.cs | Implemented value converter for entity data picker |
| src/Umbraco.Core/PropertyEditors/EntityDataPickerPropertyEditor.cs | Core property editor implementation with validation |
| src/Umbraco.Core/PropertyEditors/EntityDataPickerConfigurationEditor.cs | Configuration editor for entity data picker |
| src/Umbraco.Core/PropertyEditors/EntityDataPickerConfiguration.cs | Configuration model with validation limits |
| src/Umbraco.Core/Models/EntityDataPickerValue.cs | Published content model for entity data picker |
| src/Umbraco.Core/Constants-PropertyEditors.cs | Added property editor alias constant |
|
I can approve the front-end changes, still needs a backend review :-) |
…verter' of https://github.com/umbraco/Umbraco-CMS into v17/hotfix/entity-data-picker-data-editor-and-value-converter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All working as described - having tested with the backoffice, Razor rendering and the delivery API. I just pushed up some unit tests for the validation, aligning with what we have for other property value editors.
Testing this PR
First and foremost, verify that you cannot create a data type of type "Entity Data Picker" by default.
Next, register an extension of type
propertyEditorDataSource. You can use these:Restart the site, and verify that you can:
Also test that the min/max items configuration for the "Entity Data Picker" data type is enforced by the property editor.
In a template
With Models Builder
Without Models Builder