-
Notifications
You must be signed in to change notification settings - Fork 14
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
Report argument modal translation #5483
base: develop
Are you sure you want to change the base?
Conversation
Also made a PR to update reports repo docs: https://github.com/msupply-foundation/open-msupply-reports/pull/118 |
@@ -154,8 +161,18 @@ const FormComponent = ({ | |||
// This allows "default" values to be set in the JSON schema | |||
const handleDefaultsAjv = createAjv({ useDefaults: true }); | |||
|
|||
const commonKeys = useMemo(() => new Set(Object.keys(common)), []); |
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.
memoized keys in case checking Object.keys repeatedly is expensive. Unsure if it would be for how many keys we have.
Looks great, does it work for our patient schema too:
Can you do an example of how it works for enums in that default patient schema ? Also do you have a list of tasks to finish this issue fully ? |
I hadn't considered the patient schema! I'll have a look. I do not have a list of tasks to finish this issue fully |
Yes with a small modification of how we add enums in our schema. I will create an example of this and update the docs |
Bundle size differenceComparing this PR to
|
I've had a look and this requires a few more changes. It is a little over my head so will take a bit of time to figure out. There are a couple of factors:
|
Fixes #4951
π©π»βπ» What does this PR do?
Adds translations to report modal via json schema or UI schema.
Utilised inbuilt JSON form translation.
Maintains type safety of locale keys!
π Any notes for the reviewer?
π§ͺ Testing
You can test by running the 'Report-argument-modal-translation-example' branch which includes an example translation in the itemUsage report for both methods of adding translations
Note - you may need to clear out existing reports in your database to view.
Delete reports, then run your back end. This will populate with updated report automatically
π Documentation