-
Notifications
You must be signed in to change notification settings - Fork 180
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
Refactor: reuse table filter component in recurring actions feature #7328
Refactor: reuse table filter component in recurring actions feature #7328
Conversation
ec90e0d
to
633ef80
Compare
import { SelectSearchField } from "components/table/SelectSearchField"; | ||
|
||
const renderSearchField = (props) => { | ||
const { field } = props; |
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, but feels a bit weird. I think it would make sense to either destruct everything (const { field, criteria, placeholder, onSearch, name } = props
), or destruct nothing and use props.field
in the line below this one. I think the latter makes more sense, but either way is fine with me as long as it's consistent.
|
||
export const TableFilter = (props) => { | ||
// Dummy model and onChange to reuse the Select component as it requires a Form | ||
let model = {}; |
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.
If this doesn't change it can be const
.
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 looks really good, the suggestions I have are purely cosmetic and not important. Thanks a lot for cleaning this up, it looks a lot better now. 👍
What does this PR change?
It extracts common table filter code to a separate component (
TableFilter.tsx
) and reuses it in systems list and recurring action features.GUI diff
No difference.
Documentation
No documentation needed: only internal and user invisible changes
DONE
Test coverage
No tests: already covered
DONE
Links
Changelogs
Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run: