Skip to content

ModelsBuilder generates different types for Color Picker values #19341

Open
@idseefeld

Description

@idseefeld

Which Umbraco version are you using?

16.0.0-rc3

Bug summary

Depending on the Include labels setting of a Color Picker Property Editor UI ModelsBuilder generates two different types for the value:

// no labels
... => this.Value<string>(_publishedValueFallback, "pageBackgroundColor");

// labels included
... => this.Value<global::Umbraco.Cms.Core.PropertyEditors.ValueConverters.ColorPickerValueConverter.PickedColor>(_publishedValueFallback, "pageBackgroundColor");

Bellissima seems to handle this already.

Specifics

Changing this will be a breaking change. Fixing this in release 16 would be cool.

Steps to reproduce

  1. Add some items to the "Approved Colors "data type
  2. Add a property of type "Approved Colors" to a document type
  3. generate the models with ModelsBuilder
  4. change the "Include labels" setting of "Approved Colors" data type
  5. generate the models with ModelsBuilder again
  6. compare generated results (when using a repository you can see the difference immediately😜)

Expected result / actual result

Property value type should always be PickedColor.

Currently it is of type string or PickedColor.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions