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

Implement "get initial values" and "get all values" for form data #8218

Open
rikukissa opened this issue Dec 16, 2024 · 0 comments
Open

Implement "get initial values" and "get all values" for form data #8218

rikukissa opened this issue Dec 16, 2024 · 0 comments
Assignees
Labels

Comments

@rikukissa
Copy link
Member

Problem number 1

Image

This seems like a side-effect of us improperly supplying the form without some initial values. We need to write a function that comes up with proper initial values for inputs

'applicant.firstname': ""
'applicant.surname': ""
'applicant.dob': ?
'applicant.image': ?

Ideas

  • Force countries to define initial values for all inputs OR alternatively make input components export their initial values easily for our logic to use
    • For some inputs it might not be even possible to assign a default value. "FILE" or "DATE" for instance? Or maybe the default value is null.
    • If you decide to define export const initialValue = "" or similar for the input components, you can do this as addition in the component files in the components package or by creating new wrapper components in packages/client/src/v2-events for each input. We might want to add an export function toString(value: SomeType): string in the next problem

Problem number 2

Image

This place in the code would then again need a function that returns either the values as strings or empty strings so we don't get the error.

'applicant.firstname': "Riku"
'applicant.surname': ""
'applicant.dob': ""
'applicant.image': ""
@rikukissa rikukissa added the Tech label Dec 16, 2024
@rikukissa rikukissa moved this from Backlog to Ready to build in OpenCRVS Core Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Ready to build
Development

No branches or pull requests

2 participants