-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support finding samples with multiple parent matches #1391
Conversation
} | ||
} | ||
|
||
if (missingValueError == true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (missingValueError == true) { | |
if (missingValueError) { |
}); | ||
return 'Missing filter values for: ' + parentMsgs.join('; ') + '.'; | ||
} | ||
|
||
if (maxMatchAllErrorField) | ||
return ( | ||
"A max of 10 values can be selected for 'Equals All Of' filter type for '" + maxMatchAllErrorField + "'." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"A max of 10 values can be selected for 'Equals All Of' filter type for '" + maxMatchAllErrorField + "'." | |
"At most 10 values can be selected for 'Equals All Of' filter type for '" + maxMatchAllErrorField + "'." |
const filterType = | ||
newFilterType?.value === ANCESTOR_MATCHES_ALL_OF_FILTER_TYPE.getURLSuffix() | ||
? ANCESTOR_MATCHES_ALL_OF_FILTER_TYPE | ||
: resolveFilterType(newFilterType?.value, field); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to incorporate the check for ANCESTOR_MATCHES_ALL
into resolveFilterType
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. updated
// skip optimization for ANCESTOR_MATCHES_ALL filter type | ||
if (isAncestorMatchesAllFilter) { | ||
if ((newValue === ALL_VALUE_DISPLAY && !check) || newCheckedValues.length === 0) | ||
return Filter.create(fieldKey, [], ANCESTOR_MATCHES_ALL_OF_FILTER_TYPE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably not reading this properly, but doesn't this result in a "no filter value" error for the filter? Seems like we would return null
here but maybe we want to show the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to retain the filter type when user is on Choose Value tab . If we return null, the filter will get automatically get changed to equals (one of) as user starts to select value.
const filterType = filter.getFilterType(); | ||
const columnNameSelect = getLegalIdentifier(filter.getColumnName(), tableAlias); | ||
let operatorSql = null; | ||
|
||
const values = filterType.parseValue(filter.getValue()); | ||
|
||
const sqlValues = []; | ||
const negate = filterType.getURLSuffix() === Filter.Types.NOT_IN.getURLSuffix(); | ||
const negate = filterType.getURLSuffix() === Filter.Types.NOT_IN.getURLSuffix() && !noNegate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A triple negative! Can we be more positive somehow? The flipNegative
from the calling methods reads better to me.
# Conflicts: # packages/components/package-lock.json # packages/components/package.json # packages/components/releaseNotes/components.md
# Conflicts: # package-lock.json # package.json
Rationale
A sample may have multiple parents from the same data type. This PR adds support to find samples in Sample Finder by matching multiple parents using a new "Equals All Of" filter type. This new filter type will be available for parent cards only and is currently limited to the Name/Id columns.
Related Pull Requests
Changes