Fix: don't offer the contains conditions for string values#2042
Open
stevecassidy wants to merge 3 commits intomainfrom
Open
Fix: don't offer the contains conditions for string values#2042stevecassidy wants to merge 3 commits intomainfrom
stevecassidy wants to merge 3 commits intomainfrom
Conversation
Signed-off-by: Steve Cassidy <steve@fieldnote.au>
…g-contains instead Signed-off-by: Steve Cassidy <steve@fieldnote.au>
…lect Signed-off-by: Steve Cassidy <steve@fieldnote.au>
PeterBaker0
approved these changes
Apr 8, 2026
Contributor
PeterBaker0
left a comment
There was a problem hiding this comment.
Approving - as my only comment pertains to a likely existing bug/risk - just wanting you to critically assess the runtime safety of the current compile functions since we never assert anything about the data being of the string/array type before calling 'includes' (that I can see via quick inspection)
Contributor
There was a problem hiding this comment.
This may be an existing issue - but RecordValues type is just Record<string, any> - right? So can we assume that the value has the includes method - what if you craft a condition over a non string data type such as a JSON - wouldn't this cause a runtime crash?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: don't offer the contains conditions for string values
Ticket
#1872
Description
There is some inconsistency with the definitions of 'contains' and 'does-not-contain' conditions
which are defined to operate on list values. In the condition editor, these are only offered for
use with non-list values.
In addition, the operators offered for other value types were not correct.
Proposed Changes
Effectively deprecates 'contains' and 'does-not-contain' by not offering them in the editor. They
are not useful for multi-select since we have 'contains-one-of' and 'contains all of' instead which make
more sense since you can select more than one option for 'value' in this case.
Refactor the selection of operators to
getAllowedOperatorsForFieldand add options for number/date fields.Adds new operators
string-containsandstring-does-not-containfor string valued fields and offer thesein the editor.
Instead of displaying the raw operator name, use the existing translations in allOperators to create a nicer
select drop-down.
How to Test
In the designer, add a condition to a field and see the updated operator menus for different field types.
Additional Information
The translations in allOperators should really go in the operator definitions themselves.
A better way of knowing what type a value is would be really useful here!
Checklist