micronutrientsupport / micronutrient-support-tool

Web front-end for the MAPS Micronutrient Support Tool
MIT License
2 stars 0 forks source link

Projection summary card updates #484

Closed bgsandan closed 3 years ago

bgsandan commented 3 years ago

jon571 commented 3 years ago

This is in the "Baseline Estimate" component and shows on the baseline page when the micronutrient is "isInImpact". Just thought I'd point this out as the issue specifically mentions "projections"., in case it shouldn't show on the baseline page.

bgsandan commented 3 years ago

Ah good spot.  To clarify the comments above should apply to this card on both the baseline estimate card on /diet/baseline and the projections page /diet/projection.  The visibility of the cards is correct.  Haven't looked at the code recently to know if they are the same or two very similar components :smile:

jon571 commented 3 years ago

@bgsandan Will the projection summary endpoint always return a single result? Just trying to simplify some of the code.

bgsandan commented 3 years ago

The tool will only display a single result.

The endpoint (in the updated v2 API) is likely to look something like:

GET /diet/projection/summary?countryId=XXX&micronutrientId=YYY&scenarioId=ZZZ where the query params are technically optional 

So another consumer of the API could request multiple summaries, but as the tool will be able to specify all 3 query params it will always return a single result.  

Does that answer the question?

jon571 commented 3 years ago

Actually there are two components here (one for projection one for baseline), that look exactly the same, apart from the link at the bottom baseline one taking you to projection. Any reason to think that they will ever be different apart from the link @bgsandan ?

bgsandan commented 3 years ago

I won't say "never" but certainly in the current plans/designs I see no reason for them not to be the same component (with an optional link at the bottom)