Fixes #39056 - Update CounterInput component to PF5#10855
Fixes #39056 - Update CounterInput component to PF5#10855MariaAga wants to merge 1 commit intotheforeman:developfrom
Conversation
There was a problem hiding this comment.
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.
| }); | |
| }); | |
There was a problem hiding this comment.
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.
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)
3dfa2d2 to
311bc85
Compare
|
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.
LGTM. Verfied on packit build.



WIP as there is an update the vmware page counter usage, #10817 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