-
Notifications
You must be signed in to change notification settings - Fork 65
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
Range widget #1500
Range widget #1500
Conversation
7ae8ee5
to
d2fdda0
Compare
Few comments:
|
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.
good work!
One top-level question about "constrains [soft/hard]" and "invalid field" etc. In general from QML point of view it is just "string" to show/not show below the field and if user can/cannot save the features. I am wondering if the whole separation of constrains (qgis code concept) and validity (newly introduced input concept) shouldn't be just internal/private implementation detail of attribute controller ....
@wonder-sk @tomasMizera what do you think?
I am 100% for. We could maybe still have two types of constraints:
@PeterPetrik in this case, would you still keep the formItem's |
maybe just |
Hm, so AttributeController would set the |
ce8cd4d
to
fc05017
Compare
@PeterPetrik @wonder-sk I have created a separate ticket for the invalid values topic we discussed |
3bda1d0
to
9a4ffef
Compare
let me know when it its ready for review, I still see "WIP" in the title? |
9a4ffef
to
b0f39a9
Compare
@PeterPetrik ready for final review, there are some remarks but it is not blocking review |
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.
just 1/2 of the review
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.
- position of value and suffix (iOS + A)
- still buggy for values that are completely out of the range (too big numbers): +- buttons doesn't work (iOS + A):
- different behaviour as in QGIS: when value is out of range, +- buttons sets value to edge range value (QGIS), Input just in/decreases value by a step. Assuming we want to keep invalid values visible for a user, it is just a note that it works differently.
- not only "invalid value text" disappears, but also (hard) constrain disappears on second click on a field (iOS + A)
Generally besides known issues and small remarks, I can approve it since it works with most of the user cases. |
Yes, that is just project discrepancy between field name and actual values in range. |
d9f365e
to
d57d81d
Compare
Complete rework of range widget.
Important parts:
SpinBox
many bugs were coming from there. It is now just RowLayout with:convertCompatible
) or is outside of specified min/max rangeAttributeController
serves as validatorCurrent workflow:
Number.fromLocaleString
Number.toLocaleString
Also, there was this toast when user inserted some invalid value to a field, something like "Value x is not compatible with field y". It was not working in recent versions, I would just remove it, what do you think?
Needs to be properly tested, best in combinations with default values and apply-on-update values. I have used projects:
lutraconsulting/test_decimals
,tomas/decimals
andtomas/another-decimals
.There are still some edge case bugs and I also need to completely change the tests because in the end, we are not using any validator (
AttributeController
is our validator). Please add all spotted bugs to comments. Best to test it on mobile device, desktop might handle scope differently (mainly due to a virtual keyboard).Todo:
Resolves #1426
Resolves #1435
Resolves #1422
Should fix also #1183 and #493 but need to double checkNeeds to be fixed with #1507, we are currently not ideally deal null valuesLet me know what you think
Screen_Recording_20210618-084502.mp4