Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOB-9145: support isOneOf and isNotOneOf comparator #446

Merged

Conversation

darshan-iterable
Copy link

@darshan-iterable darshan-iterable commented Sep 4, 2024

JIRA Ticket(s) if any

Description

Support isOneOf and isNotOneOf comparator

Test Steps

Video attached to the ticket, See a JIRA ticket for the video

@darshan-iterable
Copy link
Author

This CI failed due to nested field, once this PR #445 merged, CI will be success

Base automatically changed from feature/MOB-9146-support-comparison-array-field-types to AUT_main September 4, 2024 17:34
@@ -362,7 +362,7 @@ class CriteriaCompletionChecker {
return this.evaluateComparison(
query.comparatorType,
valueFromObj,
query.value ? query.value : ''
query.value ? query.values : ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this one slightly different than the others?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in value we have single element and in values we have multiple element(s),
and when we create criteria for the isOneOf and isNotOneOf comparator we get values instead of value

@@ -374,14 +374,14 @@ class CriteriaCompletionChecker {
return this.evaluateComparison(
query.comparatorType,
valueFromObj,
query.value ? query.value : ''
query.value ?? query.values ?? ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if an empty string is evaluated? should we even run the evaluation at all if value or values isn't present?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So empty string is compared with the criteria value, empty string is not matched with value and gives result as false.
Yes, we run the evaluation.

@mprew97 mprew97 merged commit 25fcde1 into AUT_main Sep 6, 2024
1 check passed
@mprew97 mprew97 deleted the feature/MOB-9145-support-isOneOf-and-isNotOneOf-comparator branch September 6, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants