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

O3-3616: Filter lab results in result tree viewer #1937

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

reagan-meant
Copy link

Requirements

  • [ x] This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

https://openmrs.atlassian.net/browse/O3-3616

Screenshots

filtering.labs.mov

Related Issue

Other

Copy link
Member

@ibacher ibacher left a 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);
Copy link
Member

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.

Suggested change
.filter((child) => child !== null);
.filter(Boolean);

Copy link
Author

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?

Copy link
Member

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)

Copy link
Member

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) {
Copy link
Member

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?

Copy link
Author

Choose a reason for hiding this comment

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

Improved

@ibacher
Copy link
Member

ibacher commented Aug 8, 2024

@reagan-meant I lost track of this one. I think the code looks fine. Are you able to resolve the conflict here?

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