-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat(recordings): more tools for filtering by labels #503
Conversation
Any thoughts? I will add unit tests based on these new behaviours :D For the |
I haven't looked at the implementation but just by testing it out by hand, I'm really excited to see this. It looks and feels fantastic.
To check my understanding, say I am using the |
Oh sorry actually the issue is, as in the situation above, instead we use |
2ebcc2c
to
6ad6182
Compare
Ah, I see. I suppose that's because of how the component relationships and lifecycles are set up - updating the content of the table causes the toolbar to also be re-rendered and we lose that selection state? That sounds like it matches what you said with |
Yess exactly the parent table now holds the state for currently selected category of the filters. I will try to find a better way to resolve this as rebuilding with large number of recordings for only a change in category dropdown is not ideal. |
I played around with Redux and finally got some new refinements to our recording filters. Since last time, I added:
Tests are still failing everywhere with addition of Redux. I will fix them after. Any thoughts @andrewazores @maxcao13? |
This looks great. I've looked into Redux before but never truly used it, so my review of some parts of the implementation is very superficial, but things look good. Testing it out manually this also looks and feels excellent. |
Great :D I will fix and add tests for unit tests and mark it ready when done. |
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.
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.
2022-09-12.13-03-27.mp4
Small bug with the way that the checkboxes are using state with the rowIndexes.
|
Ahh right! I think the selectAll checkbox needs updating along with filters. I will look into and fix it. |
The bug is fixed and works well! Just a couple of small things:
|
The original #441 issue does describe the union/intersection filter application :-) (as |
I think we could remove any "already selected" options for Name and Label Filters then.
That would be super nice :D Probably a little tweak from Patternfly guideline tho as said here: https://www.patternfly.org/v4/guidelines/filters/#filter-chip
|
I guess we follow the guideline for now? https://www.patternfly.org/v4/guidelines/filters/#filter-chip |
Sure, that sounds good. |
Works well! I don't see any other problems, so I'll approve when tests are fixed. Good work! |
I am trying to work around this issue with umounted components: Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
at Select (/home/thvo/workspace/cryostat-web/node_modules/@patternfly/react-core/dist/js/components/Select/Select.js:33:5)
at NameFilter (/home/thvo/workspace/cryostat-web/src/app/Recordings/Filters/NameFilter.tsx:50:37) I think the issue is:
For [1], I did add a ref to hold |
Interestingly, the issue occurs only at the second time I select an option, not any subsequent selections. |
Sorry, you've already caught up to my knowledge of React/Patternfly, so I don't have much insight to offer here :-) Would it help if the components communicated by passing each other ex. |
Oh right! Thanks for the tips! I will read and give it a try. Since its just a warning, I guess I will finish up the tests first. |
72569c7
to
310e775
Compare
93a2ff7
to
4ec8d89
Compare
Sorry, just a final touch to make sure the filter is rendered correctly. The category dropdown now does not depend on the passed recording filters but rather the static array of allow keys based on recording types to ensure the above (i.e. state filter pops up in archived view) issue does not appear. |
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.
LGTM!
Fixes #79
Fixes #488
Fixes #441
Related to #486
Fixes #440 (closing parent)
Improvements:
context.settings
calls with React.useMemo.Test:
render
to render with Context, Route, redux.Provider.