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

fix(ui): Fix node filters in UI #5162

Merged
merged 3 commits into from Feb 23, 2021
Merged

Conversation

simster7
Copy link
Member

Checklist:

Signed-off-by: Simon Behar <simbeh7@gmail.com>
(!nodeClassNames || Object.entries(nodeClassNames).find(([className, checked]) => checked && (label.classNames || '').split(' ').includes(className))) &&
(!nodeTags || Object.entries(nodeTags).find(([tag, checked]) => !label.tags || (checked && label.tags.has(tag)))) &&
!nodeSearchKeyword) ||
label.label.includes(nodeSearchKeyword)
Copy link
Member Author

Choose a reason for hiding this comment

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

This line broke the filter. If nodeSearchKeyword was empty it would match all nodes, rendering the filter moot

return true;
}
// If the node doesn't match enabled genres, don't display
if (!nodeGenres[label.genre]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we add some tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

I spent some time trying, but it's a pain: will need to extract the function out of the component, create parameters for props and all the required variables, and then mock them in the test. I'd be happy to do so, but don't think it's worth it. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

sounds like poor roi, leave it

Copy link
Member Author

Choose a reason for hiding this comment

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

@alexec Ready for review then

@alexec alexec changed the title fix: Fix node filters in UI fix(ui): Fix node filters in UI Feb 22, 2021
@alexec alexec self-assigned this Feb 22, 2021
@simster7 simster7 requested a review from alexec February 23, 2021 02:30
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

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

LGTM. I think it is easier to understand too, by removing the large expression.

@simster7 simster7 merged commit 4b78a7e into argoproj:master Feb 23, 2021
@simster7 simster7 mentioned this pull request Feb 23, 2021
34 tasks
@simster7 simster7 mentioned this pull request Mar 8, 2021
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.

None yet

2 participants