Open tim06927 opened 4 months ago
On thing we can do, which is fairly easy, is add more built-in options for string format when configuring attributes. Most obvious are various ISO date and ISO country code formats, but we could also do email
, uri
, ipv4
, etc. These formats can be used for validation, but also providing a better UI (e.g. datetime picker or dropdown with all possible country codes).
A more advanced version, which will be harder to implement, is full JSON Schema support to allow arbitrary regex validation, min/max length, and more.
@jdorn what if a text field is added to configure the values of the targeting attribute? It would be like typing the only possible and case-sensitive values of the attribute. Of course, this would be optional and the current option would be the default.
@fabianmarinog I believe what you're asking for already exists. You can set up an "enum" attribute and then list out all the possible values. Users will be shown a drop-down instead of a freeform text box.
You can set up an "enum" attribute and then list out all the possible values. Users will be shown a drop-down instead of a freeform text box.
@jdorn We use the enum
approach for ISO codes (country/locale) but it breaks down when using the is in the list
operator which is free text and doesn't offer the enum values as options.
Even so, when working with ISO codes, some of the country/language values are too similar and easy to confuse. If enums were instead a name/value pair we could use the full name of a country and its matching ISO code.
I think there are a few small changes we can make for this that should be pretty easy
in the list
operator input
Description of Feature
Regularly, our users make mistakes in the format and possible values a targeting attribute can contain. It would be great if in the UI there are additional columns for targeting attributes that contain possible and example values and describe the formatting. For example in an attribute like country it is not instantly clear if a user should enter the long name of a country ("United States", "Germany") or something shorter ("us", "de"). Further, in many environments, the field is case-sensitive. Best case, there would be some Regex validation when setting up a rule with an attribute.