-
Notifications
You must be signed in to change notification settings - Fork 3
Enhance search and add filtering #142
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
Conversation
d8df161
to
d8b184b
Compare
@FKolwa You can fix the width of the columns easily by setting the percentage based width property on the Th component https://www.patternfly.org/components/table#cell-width-breakpoint-modifiers |
1f3fa66
to
14f6020
Compare
); | ||
}; | ||
|
||
const onFilterSelect = (_: React.MouseEvent | undefined, itemId: string | number | undefined) => { |
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.
General TS question: Jest won't let my tests pass if I won't specify the entire array of possible inputs for functions that are derived from "onSelect" which in this case is "string | number | undefined". Is there a better way to declare this on a function that only accepts strings anyways?
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 tried a few things, couldn't make it work without respecting the mentioned inputs
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.
Thanks for giving it a try!
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.
@FKolwa The only shorter version I could come up with would be using the lookup type (or indexed access type) MenuProps['onSelect']
. This would still mean that the itemId
can be string | number | undefined
, but you wouldn't have to write the types all over again. This could be also applied to the ImageTableFilter onFilterSelect prop.
const onFilterSelect = (_: React.MouseEvent | undefined, itemId: string | number | undefined) => { | |
// import { MenuProps } from '@patternfly/react-core' | |
// ... | |
const onFilterSelect: MenuProps['onSelect'] = (_, itemId) => { |
Thanks! I guess there is no way to do the same thing with a predefined height, or is there? (table height, not row height) |
@FKolwa if you want to fix the maximum height check maybe this https://www.patternfly.org/components/table#sticky-columns-and-header |
346bed8
to
60574d2
Compare
Add new filter component to handle filtering of image data by region, architecture and provider Add new component to ImageTable
e1ed684
to
a63c7fd
Compare
a63c7fd
to
9044ef5
Compare
I've added a proper "empty" view to the table in case the search doesn't return any valid results which makes the fixed table height mostly irrelevant. Is there anything left you would change? |
@schogges Would you like to give me a review as well? ;) |
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
Thanks @epapbak for your review. Let's get this in as this is blocking our further development. If someone detects some severe mistakes, please comment on this issue so we can create follow ups. |
What has changed?
Screencast from 2023-08-02 10-48-22.webm
Open questions
@KKoukiou @lucasgarfield I'm not a fan of the constant resizing that is happening once filters are selected.
Can we somehow add a default size to the table so we won't have this screen shake?
What can be improved in this implementation?
closes #119 #66