Skip to content

Conversation

@madsrasmussen
Copy link
Contributor

@madsrasmussen madsrasmussen commented Oct 27, 2025

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:

  1. Create a data type of type "Entity Data Picker" using the registered editor data source.
  2. Create content using this data type to pick one or more entities.
  3. Render out the IDs of the picked entities for published content.
    • This might be easiest to test using the Delivery API.

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

@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<EntityDataPickerTest>
@{
    Layout = null;
}
<html lang="en">
<head>
    <title>Entity Data Picker</title>
</head>
<body>
@if (Model.MyEntityPicker is null)
{
    <p>No entity picker value found</p>
}
else
{
    <p>Data source: <strong>@Model.MyEntityPicker.DataSource</strong></p>
    <p>Picked IDs:</p>
    <ul>
        @foreach (string id in Model.MyEntityPicker.Ids)
        {
            <li>@id</li>
        }
    </ul>
}
</body>
</html>

Without Models Builder

@using Umbraco.Cms.Core.Models
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
@{
    Layout = null;
    var entityDataPickerValue = Model.Value<EntityDataPickerValue>("myEntityPicker");
}
<html lang="en">
<head>
    <title>Entity Data Picker</title>
</head>
<body>
@if (entityDataPickerValue is null)
{
    <p>No entity picker value found</p>
}
else
{
    <p>Data source: <strong>@entityDataPickerValue.DataSource</strong></p>
    <p>Picked IDs:</p>
    <ul>
        @foreach (string id in @entityDataPickerValue.Ids)
        {
            <li>@id</li>
        }
    </ul>
}
</body>
</html>

Copilot AI review requested due to automatic review settings October 27, 2025 11:38
Copy link
Contributor

Copilot AI left a 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 ids property

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

@madsrasmussen madsrasmussen changed the title Entity Data Picker: Data Editor and value converter Entity Data Picker: Data dditor and value converter Oct 27, 2025
@madsrasmussen madsrasmussen changed the title Entity Data Picker: Data dditor and value converter Entity Data Picker: Data editor and value converter Oct 27, 2025
@nielslyngsoe nielslyngsoe enabled auto-merge (squash) October 27, 2025 14:27
@nielslyngsoe
Copy link
Member

I can approve the front-end changes, still needs a backend review :-)

Copy link
Contributor

@AndyButland AndyButland left a 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.

@nielslyngsoe nielslyngsoe merged commit a3d6b4f into release/17.0 Oct 27, 2025
23 checks passed
@nielslyngsoe nielslyngsoe deleted the v17/hotfix/entity-data-picker-data-editor-and-value-converter branch October 27, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants