-
Notifications
You must be signed in to change notification settings - Fork 1k
Fixes #39056 - Update CounterInput component to PF5 #10855
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
base: develop
Are you sure you want to change the base?
Conversation
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.
Generally works as expected and looks good. I have few small things to point out.
I'd consider cutting off the decimal part:
But this is not a regression so I will leave that to your judgement.
And maybe units could be added to the warning and error messages too? I see them in the old implementation.
| const input = screen.getByRole('spinbutton'); | ||
| expect(input).toBeDisabled(); | ||
| }); | ||
| }); |
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.
thanks! reformatted the test file completely
...ts/javascripts/react_app/components/common/forms/CounterInput/__tests__/CounterInput.test.js
Outdated
Show resolved
Hide resolved
...ts/javascripts/react_app/components/common/forms/CounterInput/__tests__/CounterInput.test.js
Outdated
Show resolved
Hide resolved
...ts/javascripts/react_app/components/common/forms/CounterInput/__tests__/CounterInput.test.js
Outdated
Show resolved
Hide resolved
I think its out of the scope of the PR since the number comes from
Which ones are missing? |
cb29b26 to
6a01e76
Compare
6a01e76 to
3dfa2d2
Compare
| useEffect(() => { | ||
| deprecate( | ||
| 'forms/NumericInput', | ||
| 'Use components/common/forms/CounterInput/CounterInput.js , or NumberInput from @patternfly/react-core instead', | ||
| '3.20' | ||
| ); | ||
| }, []); |
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 is used on the vmware form then I can't quickly access it but I would expect the output to be slightly botched based on #10852 (comment)
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.
Updated, thanks!
3dfa2d2 to
311bc85
Compare
adamlazik1
left a comment
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.
|
No robottelo/airgun tests appear to reference the CounterInput component so I would say this doesn't break robottelo. |
311bc85 to
cefe257
Compare
|
added space in |
adamlazik1
left a comment
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. Verfied on packit build.



WIP as there is an update the vmware page counter usage, and it might be best to use the wrapper instead. anyway after the vmware page changes this pr should deprecate
common/forms/NumericInput.jsThe component is defined in
webpack/assets/javascripts/react_app/components/common/forms/CounterInput/CounterInput.jsIt uses rc-input-number library as it's base. Even though the library seems to be still maintained, it would be better to get rid of one more dependency, especially given that PF5 already has similar capabilities: https://v5-archive.patternfly.org/components/number-input/html
Used in create host -> select compute resource vmware -> virtual machines
create host -> select compute resource libvirt -> virtual machines
discovery_rules/new
and plugins
Tested were generated with AI help