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

[forms] Validate value length for value maps #57690

Merged
merged 3 commits into from
Jun 7, 2024

Conversation

elpaso
Copy link
Contributor

@elpaso elpaso commented Jun 6, 2024

Display errors and trim the values.

This also works when importing from CSV or from layer.

Fix #57634

gh_57634_2

Display errors and trim the values.

Fix qgis#57634
@elpaso elpaso added GUI/UX Related to QGIS application GUI or User Experience Bug Either a bug report, or a bug fix. Let's hope for the latter! labels Jun 6, 2024
@github-actions github-actions bot added this to the 3.38.0 milestone Jun 6, 2024
Copy link

github-actions bot commented Jun 6, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit d4cf6b0)

src/gui/editorwidgets/qgsvaluemapconfigdlg.h Outdated Show resolved Hide resolved
src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp Outdated Show resolved Hide resolved
src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp Outdated Show resolved Hide resolved
src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp Outdated Show resolved Hide resolved
src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp Outdated Show resolved Hide resolved
@roya0045
Copy link
Contributor

roya0045 commented Jun 6, 2024

This widget always had an issue with unconstrained inputs. I agree with the proposed approach, though the more arduous problems are data mismatch. The widget will accept any value, even if the field type doesn't support this value.

I don't know if this is good to include in this pr or as another one.

@elpaso
Copy link
Contributor Author

elpaso commented Jun 7, 2024

This widget always had an issue with unconstrained inputs. I agree with the proposed approach, though the more arduous problems are data mismatch. The widget will accept any value, even if the field type doesn't support this value.

I don't know if this is good to include in this pr or as another one.

I think this PR is a step forward, in the sense that it provides the API to call validation and to display errors to the user.

Given the limited amount of time that I have left for this bugfixing round I'd rather prefer to keep the scope limited to fixing this particular issue, more validation rules could be added later.

It would be nice to have a new ticket that lists the missing validation rules, for example the type compatibility, and I'm not sure if there is a check for unique values and descriptions.

@elpaso elpaso merged commit 8aff964 into qgis:master Jun 7, 2024
28 checks passed
@elpaso elpaso deleted the bugfix-gh57634-value-map-length branch June 7, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! GUI/UX Related to QGIS application GUI or User Experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

value maps ignore field length
3 participants