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

Restrict number formats in fields "decimal" and "increment" for a number form element #3382

Closed
GeethaParthasarathy opened this issue Jan 6, 2023 · 5 comments · Fixed by #3422
Assignees
Labels
bug Something isn't working Forms
Milestone

Comments

@GeethaParthasarathy
Copy link

Describe the bug

When we choose a number form element we could see that there are options in the properties panel to restrict the number of decimal places and increment the value of the number.

For restricting the number of decimal places we could enter a decimal number but does not really make sense to restrict the digits using a decimal number

Also in case of increments when we enter "0 "as an increment error is thrown but when we add any other number next to it we could see that the enter number is taken into account along with the 0 entered before say 05.
"0" before the number should not be accepted as it leads to confusion

Steps to reproduce

  1. Create a form
  2. Add a number field
  3. in the properties panel add the following
    decimal digits -> 5.123
    Increment->0005
  4. We could see that the decimals in decimal digit field and the "0" in front of the number in the increment field is ignored

74b14978fcaab5a7ef7f1a665265b65e

Expected behavior

To avoid ambiguity to users the above fields must be restricted to valid number formats

Environment

  • OS: [e.g. MacOS 10.2, Windows 10]
  • Camunda Modeler Version: [e.g. 2.0.0]
  • Execution Platform: [e.g. Camunda Platform, Camunda Cloud]
  • Installed plug-ins: [...]

Additional context

No response

@GeethaParthasarathy GeethaParthasarathy added the bug Something isn't working label Jan 6, 2023
@nikku nikku added the Forms label Jan 6, 2023
@Skaiir Skaiir self-assigned this Jan 9, 2023
@Skaiir
Copy link
Contributor

Skaiir commented Jan 10, 2023

Regarding the increment, this is something I've overlooked but I have a fix ready in the next version of form-js.

Regarding decimal digits, it's more of a limitation/slight bug of the number field in the properties panel. This can be replicated with any other simple number field. May be worth raising within the properties panel.

Skaiir added a commit to bpmn-io/form-js that referenced this issue Jan 10, 2023
@nikku nikku added the backlog Queued in backlog label Jan 10, 2023 — with bpmn-io-tasks
Skaiir added a commit to bpmn-io/form-js that referenced this issue Jan 11, 2023
Skaiir added a commit to bpmn-io/form-js that referenced this issue Jan 12, 2023
Skaiir added a commit to bpmn-io/form-js that referenced this issue Jan 13, 2023
Skaiir added a commit to bpmn-io/form-js that referenced this issue Jan 13, 2023
Skaiir added a commit to bpmn-io/form-js that referenced this issue Jan 13, 2023
Skaiir added a commit to bpmn-io/form-js that referenced this issue Jan 14, 2023
@Skaiir
Copy link
Contributor

Skaiir commented Jan 14, 2023

Partially fixed upstream via bpmn-io/form-js#490. We now trim the increment value to strip it of prefixed zeros.

Regarding the decimal digits property, this is just a limitation of the properties panel at the moment, there is validation but it's the default browser one which isn't super obvious to tell (you can see it by hovering on the field). I've raised a request for improvement here, which I am happy to provide a PR for as well, provided someone in the bpmn.io team considers it a valuable improvement. Otherwise unfortunately I cannot do much about it besides switching over to a text field to handle the validation, but this would have the downside of losing us the increment arrows.

@Skaiir Skaiir added needs review Review pending and removed backlog Queued in backlog labels Jan 17, 2023
@Skaiir Skaiir modified the milestones: HTO iteration 13, HTO iteration 14 Jan 17, 2023
@pinussilvestrus pinussilvestrus modified the milestones: HTO iteration 14, HTO iteration 16 Jan 31, 2023
Skaiir added a commit to bpmn-io/form-js that referenced this issue Feb 1, 2023
Skaiir added a commit to bpmn-io/form-js that referenced this issue Feb 1, 2023
Skaiir added a commit to bpmn-io/form-js that referenced this issue Feb 2, 2023
Skaiir added a commit to bpmn-io/form-js that referenced this issue Feb 2, 2023
@Skaiir Skaiir added fixed upstream Requires integration of upstream change and removed needs review Review pending labels Feb 2, 2023
@Skaiir
Copy link
Contributor

Skaiir commented Feb 2, 2023

Fully fixed upstream via bpmn-io/form-js#531

@pinussilvestrus
Copy link
Contributor

@Skaiir I added the HTO iteration 16 milestone to bpmn-io/form-js#531 so we do not swallow our calculation and the Desktop Modeler team can modify the milestone on this issue 👍

@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Feb 2, 2023
@bpmn-io-tasks bpmn-io-tasks bot removed the fixed upstream Requires integration of upstream change label Feb 2, 2023
@nikku
Copy link
Member

nikku commented Feb 2, 2023

Closed via #3422.

@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Feb 7, 2023
@nikku nikku modified the milestones: HTO iteration 16, M61 Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Forms
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants