-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[preferences]: Input field validation for numerical inputs #8264
[preferences]: Input field validation for numerical inputs #8264
Conversation
c14bab0
to
9752b36
Compare
packages/preferences/src/browser/util/preference-event-service.ts
Outdated
Show resolved
Hide resolved
9752b36
to
c8bc819
Compare
@colin-grant-work would you like to review the pull-request? |
Sure, I'll take a look this morning |
packages/preferences/src/browser/util/preference-event-service.ts
Outdated
Show resolved
Hide resolved
packages/preferences/src/browser/views/components/preference-number-input.tsx
Outdated
Show resolved
Hide resolved
The functionality looks great. I ran it through the tests described and behavior was as advertised. A couple of minor comments, but otherwise it's just about there. I wonder if it might be possible to abstract the behavior in such a way as to make it usable with other input types? I don't think that has to be done for this PR, though - there's a fair bit of repetition across those components that a good refactor with some suitable higher-order component could address separately. |
Good point @colin-grant-work, currently as I have noticed we don't support a lot of properties such as But adding on to your point, a general validator for all types in the future (when support is provided) should be created in a parent class, the best place in my mind could be |
cf4a879
to
15742b0
Compare
Fixes: eclipse-theia#7741 Added an input field validation in the preference widget. Updated the input field type to be `number` instead of `text` for numerical fields. Signed-off-by: Anas Shahid <muhammad.shahid@ericsson.com>
15742b0
to
fc0a5fa
Compare
@vince-fugnitto @colin-grant-work Thank you for the suggestions and reviews above. I have updated the code, and am ready for another round of review |
The functionality is working great, and I think the code is looking good, 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.
The changes work well, I'll give others a chance to review if they'd like and merge later on during the week if there are no objections.
What it does
Fixes: #7741
number
instead oftext
for numerical fields.How to test
Font Size
preferenceFont Size
preferenceFont Size
preferenceLine Height
preferenceLine Height
preferenceSigned-off-by: Anas Shahid muhammad.shahid@ericsson.com
Review checklist
Reminder for reviewers