-
Notifications
You must be signed in to change notification settings - Fork 34
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
Create shared config, layers and translations #1157
Conversation
Build succeeded and deployed at https://prism-1157.surge.sh |
Thanks @ericboucher, this will be a big help when ready. A few things:
|
@wadhwamatic:
Here is an example: shared file: local file result: |
@@ -1805,14 +1805,6 @@ | |||
}, | |||
"rainfall_agg_1month": { |
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.
@wadhwamatic you can even remove this from the layers.json altogether if there is no difference with what's in the shared file
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.
@ericboucher - the title text is slightly different for Mozambique.
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.
ok, does it need to be? you could just update the shared title maybe? Or is it not always CHIRPS?
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.
We won't always include CHIRPS in the title. It's only for countries where we have local rainfall data and CHIRPS rainfall data.
@ericboucher - before the shared layer concept, the order of layers in layers.json controlled the order of the 'select charts' dropdown list. Now, the shared layers are first, and then local layers. Can we reverse this? For Mozambique, I want the blended layers to show up first, then CHIRPS layers (which is how it worked before this change). |
@ericboucher - ok, I finished setting this up for Mozambique and I think it should be straightforward to apply to others. Making those configuration changes for all will take a while so I'd rather just do Mozambique in this one. Two things:
|
@wadhwamatic I updated the readme, feel free to adjust as needed and merge when you think it's ready. Two other changse we could make:
|
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.
Everything looks and works OK for me here. Maybe we should split "General" and mozambique specific translations and use both mozambique/translations.json
and shared/portuguese.json
. Or just remove mozambique/translations.json
for now
Yep or move |
I deleted the local Mozambique translation file for now. If another Portuguese-speaking country comes along, we might need some level of localization for Moz vs a second country but for now will just keep a single shared Portuguese translation file. |
Description
This fixes #358 by adding:
@wadhwamatic the configs are deeply merged, by default you have access to any layers in the shared layers and can just call them by
id
from your prism.json file as usual. If you need to tweak the name or the legends or else specifically for a country, you can do so by creating a layer with the same id with only the updated elements.@wadhwamatic for now I simply created one
shared/layers.json
file but we can defiitely split it by products maybe for ease of use (no need to decide now).How to test the feature:
Checklist - did you ...
Test your changes with
REACT_APP_COUNTRY=rbd yarn start
REACT_APP_COUNTRY=cambodia yarn start
REACT_APP_COUNTRY=mozambique yarn start
Screenshot/video of feature: