Skip to content

Adds a new form field input field option NUMBER_WITH_UNIT #11018

@jpye-finch

Description

@jpye-finch

Description

This ticket is to create a new form input called NUMBER_WITH_UNIT.

It has a number input next to a unit select. N number of units can be added the unit select.

The number field and select can have their own placeholder, prefix and postfix.

As with other form inputs. The component InputField wraps NUMBER_WITH_UNIT where the form field label and optional description given is defined... @euanmillar correct? Doesn't InputField pass the placeholder, prefix and postfix to the form field. May have an issue with placeholder then as we need two for NUMBER_WITH_UNIT...

Design

Image

https://www.figma.com/design/W6Bty2ujZg29tv5CPWzCcd/OpenCRVS-Design-System....?node-id=2453-11991&t=b8SeHLf192KXIcNE-1

Time units

Using Iris exports as a reference, "Time units" should be

Years
Months
Weeks
Days
Hours
Minutes

ACs

GIVEN I have added a NUMBER_WITH_UNIT field to my configuration
THEN I can add n number of units to the unit select (eg. hours, days, weeks, months, years

If Mandatory error messages
GIVEN I have configured a NUMBER_WITH_UNIT input with the unit select
WHEN the field is mandatory
THEN both the number field and select field must be completed
THEN show the message "Number and unit required for registration"

If Optional error messages
GIVEN I have configured a NUMBER_WITH_UNIT input with the unit select
WHEN the field is optional
WHEN the user enters a number into the number field. OR user first selects a unit
THEN show the message "Number and unit required"

GIVEN I am on the declaration review page
THEN show the number and unit selected (eg. 2 days)

Metadata

Metadata

Assignees

Labels

IET requestissues that came up from IET triage

Projects

Status

In Code Review

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions