Value validator from array of items #20280
bjarnef
started this conversation in
Features and ideas
Replies: 1 comment
-
It doesn't seems we have much info about property except the value: ![]() ![]() It seems it is called here: @AndyButland @Zeegaan it is possible we can pass in Of course it can just be called "items" all the time, but what if one has two "items" (items 1 and 2) property in a more complex configuration or want to use same validator for two configuration properties in two different property editor (but we don't want to re-invent the wheel). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently we have a validator here, which is used for an array of items (string array) like dropdown, radiobutton and checkbox lists:
https://github.com/umbraco/Umbraco-CMS/blob/fc60b5b5ffa1db5f9f1ee786f65ad33c9f44f4e3/src/Umbraco.Infrastructure/PropertyEditors/ValueListUniqueValueValidator.cs
A few issues:
When validating it assumes property is named
items
although it probably works anyway as object value is passed in, but can it handle the name correct here?Umbraco-CMS/src/Umbraco.Infrastructure/PropertyEditors/ValueListUniqueValueValidator.cs
Lines 41 to 58 in fc60b5b
Color Picker used a custom one, which is probably fine as it does some special regex for hex value, but it would be great it handle
items
as well if one re-use this in a configuration of a custom property editor:Umbraco-CMS/src/Umbraco.Infrastructure/PropertyEditors/ColorPickerConfigurationEditor.cs
Lines 47 to 59 in fc60b5b
Assuming we sometime later support value/label for dropdown etc. it will be useful if
ValueListUniqueValueValidator
can handlevalue
in array of objects - or perhaps a different validator.Configurate text and value for prevalues in dropdown #11084
Beta Was this translation helpful? Give feedback.
All reactions