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

Number widget #4068

Open
stefan-korn opened this issue Nov 27, 2023 · 4 comments
Open

Number widget #4068

stefan-korn opened this issue Nov 27, 2023 · 4 comments
Assignees

Comments

@stefan-korn
Copy link
Contributor

User Story

Would be nice to have a number widget available for specific schema properties.

Proposal:

"ui:options" {
  "widget": "number",
  "step": "0.01",
  "min": "10",
  "max": "20"
}

step, min and max are optional.

Acceptance Criteria

stefan-korn added a commit to stefan-korn/dkan that referenced this issue Nov 27, 2023
stefan-korn added a commit to stefan-korn/dkan that referenced this issue Nov 27, 2023
@dafeder
Copy link
Member

dafeder commented Dec 9, 2023

How would this be different from a text widget? Would we possibly have issues here with the ui options conflicting with the schema validation? Open to this just want to understand the use-case and implications better.

@stefan-korn
Copy link
Contributor Author

stefan-korn commented Dec 11, 2023

@dafeder : it would provide a number widget, that has some numerical validation and the "stepper". I consider this an UI improvement if you want to collect numerical input.
Regarding schema validation I am not sure: The value being saved in the json data should not differ from collecting via text widget, except that only numbers are allowed. So there should be no problem validating.
If there is also schema validation for schema.ui.json too, there might be problems. But I tested this change and did not have problems so far.

@dafeder
Copy link
Member

dafeder commented Dec 11, 2023

There really should be a spec for the UI schema both for validation and documentation purposes, it's a longtime todo. But yeah for now I see the value of this.

@dafeder dafeder self-assigned this Apr 5, 2024
@dafeder
Copy link
Member

dafeder commented Apr 8, 2024

@stefan-korn I did another review of your PR on this, interested in your response and whether you have some capacity to work more on this.

@dafeder dafeder assigned stefan-korn and unassigned dafeder Apr 8, 2024
stefan-korn added a commit to stefan-korn/dkan that referenced this issue Apr 24, 2024
stefan-korn added a commit to stefan-korn/dkan that referenced this issue Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants