We have implemented support for formatting numbers in input fields. There are still some improvements that can be made here.
Considerations
Suggestions that have come up:
Direct support for (right) align of numbers in field with property (currently this is supported indirectly through the use of the style property)
Configure show/hide for add-button (same as for delete/save button already implemented) Removed because this is part of #540, and has nothing to do with number field formatting :shrug:
Language support - support for defining different formats based on which language the end user has chosen
Review our chosen default values and update if relevant (we currently use defaults from the react-number-formatting library, might be more relevant for us to use defaults that match with Norwegian number formatting).
Support for adding/setting up number formatting in Studio
Possibly some (configurable?) automatic setup available based on type in xsd
Support for pre-defined "formats" that can be re-used
As long as it's impossible to type letters into a field with number formatting, we should give the user some feedback on why typing anything other than a number fails (beware of WCAG and screen readers!)
Implement generic support for limiting which letters/characters/numbers can be typed into a field (regex? types from JsonSchema?).
Write proper Cypress tests to make sure this behaviour does not accidentally break. See #394 (closed in order to keep remaining issues localized here).
Ops requirements
These are frontend changes and should not trigger any specific ops requirements.
Acceptance criteria
Describe criteria here (i.e. What is allowed/not allowed (negative tesing), validations, error messages and warnings etc.)
Specification tasks
[ ] Development tasks are defined
Development tasks
Add tasks here
Test
Add test cases here as checkboxes that are being tested as part of the changes.
Definition of done
Verify that this issue meets DoD (Only for project members) before closing.
[ ] Documentation is updated (if relevant)
[ ] Technical documentation (docs.altinn.studio)
[ ] User documentation (altinn.github.io/docs)
[ ] QA
[ ] Manual test is complete (if relevant)
[ ] Automated test is implemented (if relevant)
[ ] All tasks in this userstory are closed (i.e. remaining tasks are moved to other user stories or marked obsolete)
Description
We have implemented support for formatting numbers in input fields. There are still some improvements that can be made here.
Considerations
Suggestions that have come up:
Configure show/hide for add-button (same as for delete/save button already implemented)Removed because this is part of #540, and has nothing to do with number field formatting :shrug:react-number-formatting
library, might be more relevant for us to use defaults that match with Norwegian number formatting).Ops requirements
These are frontend changes and should not trigger any specific ops requirements.
Acceptance criteria
Specification tasks
Development tasks
Test
Definition of done
Verify that this issue meets DoD (Only for project members) before closing.