Page MenuHomePhabricator

TagMultiselectWidget: Add validation method rule for arbitrary tags
Open, Needs TriagePublic


In TagMultiselectWidget, we have 'valid' rules; we can add a list of valid tag names or validate through the menu items in the case of the child MenuMultiselectWidget.

What we're missing is an "invalid" rule. For the case of allowing arbitrary tags, there's a need to add a way to say that arbitrary is legal except for certain patterns or specific validation.

For example, TitlesMultiselectWidget (and UsersMultiselectWidget) allows arbitrary but makes suggestions from the API. While the suggestions are legal, the widget accepts any entry, and the entry given may not be legal, either by using namespaces that are not part of the API search or by any other filtering rule.

We should add another layer of customization in which these tags can be marked as invalid without having to extend the individual tag widgets and set the rules on them individually.

The validation could be passed as a function in the config, but as we do that, we should make sure it works properly with all TagMultiselectWidget combination (allowArbitrary / allowInvalidTags / etc) and with the child MenuTagMultiselectWidget.