-
Notifications
You must be signed in to change notification settings - Fork 1
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
WIP - Typing simplification #73
base: main
Are you sure you want to change the base?
Conversation
threat = 'threat', | ||
other = 'other', | ||
} | ||
|
||
export const floodSpecificKeys = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could have a better name I think. Maybe floodKoboKeyMapping
or something like that @sifelix ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes the name should definitively be updated :)
Build succeeded and deployed at https://wfp-dmp-73.surge.sh |
}, | ||
{ | ||
...getGroupSetup('deathToll', FLOOD), | ||
children: [ | ||
{ field: FloodSpecific.NumTDeath }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should continue to use the string Enum to avoid any typos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This offers a check against typos as well. I proposed a few other option in the PR body. We can chat about it but it's not urgent anyway.
threat = 'threat', | ||
other = 'other', | ||
} | ||
|
||
export const floodSpecificKeys = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes the name should definitively be updated :)
This is a playground PR to explore ideas on how to simplify typing a bit for the different reports.
I explored an option using the keys of the existing mapping.
Another option would be to create a more complete mapping that could look somewhat like this and allow us to have additional key specific info in one place:
The mapping above could help with translation with text labels, see: #76 (comment)
Thoughts @sifelix ?