-
Notifications
You must be signed in to change notification settings - Fork 228
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
O3-3616: Filter lab results in result tree viewer #1937
base: main
Are you sure you want to change the base?
Conversation
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.
Not a full review, but a couple of small things.
if (treeNode.subSets) { | ||
filteredSubSets = treeNode.subSets | ||
.map((child) => filterTreeNode(inputValue, child)) | ||
.filter((child) => child !== null); |
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.
This works because Boolean is function that coerces the value to a boolean and null
gets coerced to `false.
.filter((child) => child !== null); | |
.filter(Boolean); |
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.
@ibacher are you suggesting a different approach?
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.
Yep... I was suggesting you can replace the .filter(child => child !== null)
with the slightly shorter .filter(Boolean)
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.
Also in the other similar place.
.filter((child) => child !== null); | ||
} | ||
|
||
if (filteredSubSets.length > 0) { |
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.
Why not nest this in the previous if
?
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.
Improved
@reagan-meant I lost track of this one. I think the code looks fine. Are you able to resolve the conflict here? |
Ping @reagan-meant |
Requirements
Summary
https://openmrs.atlassian.net/browse/O3-3616
Screenshots
filtering.labs.mov
Related Issue
Other