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

Allows the search filters to be cleared or reset to the default #1216

Open
jelly opened this issue Feb 27, 2023 · 7 comments · May be fixed by #1292
Open

Allows the search filters to be cleared or reset to the default #1216

jelly opened this issue Feb 27, 2023 · 7 comments · May be fixed by #1292
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jelly
Copy link
Member

jelly commented Feb 27, 2023

Add the same clear filter functionality as the logs page in Cockpit.

image

This probably means we have to change the TextInput into a SearchInput and FormSelect into a Select which supports onClear=()

@jelly jelly added enhancement New feature or request good first issue Good for newcomers labels Feb 27, 2023
@KKoukiou
Copy link
Contributor

I think you suggest to use https://www.patternfly.org/v4/components/search-input/#basic component.

@shubhit7
Copy link
Contributor

@KKoukiou @jelly
I tried to use Select instead of FormSelect , getting error on console. Please refer to screenshot.
I have configured all the things properly imo, not able to figure out why this error is popping up.
One reason which I can think of is the incorrect patternfly dependencies.

Following are being used in cockpit-podman:

"@patternfly/patternfly": "5.0.0-alpha.40",
"@patternfly/react-core": "5.0.0-alpha.72",
"@patternfly/react-icons": "5.0.0-alpha.10",
"@patternfly/react-styles": "5.0.0-alpha.7",
"@patternfly/react-table": "5.0.0-alpha.74",

While the cockpit project is using:

"@patternfly/patternfly": "5.0.0-alpha.43",
"@patternfly/react-core": "5.0.0-alpha.83",
"@patternfly/react-icons": "5.0.0-alpha.12",
"@patternfly/react-styles": "5.0.0-alpha.8",
"@patternfly/react-table": "5.0.0-alpha.85",

image

I also tried to run the similar code on patternfly v4 website inside editor for Select component, and everything works fine over there.

@jelly
Copy link
Member Author

jelly commented May 15, 2023

Do you have a branch pushed somewhere we can check out to aid debugging?

@jelly
Copy link
Member Author

jelly commented May 15, 2023

As we use the patternfly alpha release now, maybe you need to adjust the onChange? cockpit-project/cockpit@e9c78af#diff-3186be17476309370c4a7e009de79f2dc8d63591778b712d32a58e2e83c7c915R164

@shubhit7
Copy link
Contributor

shubhit7 commented May 15, 2023

@jelly
Here is the branch.
https://github.com/shubhit7/cockpit-podman/blob/fix-Issue%231216-Allow-the-search-filters-to-be-cleared-or-reset-to-the-default/src/ContainerHeader.jsx

So there are two parts to this issue.

  1. Changing owner filter, from FormSelect to Select. This is where I am getting the error.
  2. Changing the search field beside owner filter, from TextInput to SearchInput. Working as expected.

@shubhit7
Copy link
Contributor

The Select.tsx component of patternfly contains toggle instead of onToggle
Not sure how this discrepancy has been introduced.

@shubhit7
Copy link
Contributor

The Select.tsx component of patternfly contains toggle instead of onToggle Not sure how this discrepancy has been introduced.

Figured out that Select has been deprecated, and Select next is promoted in patternfly alpha release.

KKoukiou pushed a commit to shubhit7/cockpit-podman that referenced this issue Jun 6, 2023
KKoukiou pushed a commit that referenced this issue Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
3 participants