Update conditional spect and add support for new operators#35
Merged
Update conditional spect and add support for new operators#35
Conversation
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.
Proposed Changes
src/common/types.ts
V2ConditionOperatorIS_EMPTYIS_NOT_EMPTYIS_EXACTLYIS_CONTAINED_BYIS_NOT_CONTAINED_BYV2Condition.valueto includestring[]for multi-value conditionssrc/v2/conditions.ts
buildContainsSchemaanyOfwith array (contains), object (required), and string (pattern) branchesbuildIsEmptySchema(fieldName)anyOfchecking not-required, empty array, null, empty object, empty stringbuildIsExactlySchema(value)anyOfwith per-type branches (array/boolean/number/object/string); boolean and number branches resolve the parsed value for single strings, become const: null for arraysbuildIsContainedBySchema(value)anyOfwith items.enum / propertyNames.enum / enum branchesbuildIsNotContainedBySchema(value)anyOfwith negated items.enum / propertyNames.enum / enum branchesbuildConditionSchemaIS_EMPTYto its root-level schema directly instead of wrapping in properties/requiredbuildSchemaBasedConditionIS_EMPTYcondition uses scope:#; all others use scope:#/properties/fieldNamegetOperatorSchemaHAS_INPUTandIS_NOT_EMPTYshare the same buildervalidateConditionsImplementation Test
In React Native client app, e.g. EarthRanger
Unit Tests