There are three main locations where the VAP set values are displayed in the UI:
location 1: in the node view (value_and_prediction_summary) the "present" VAP set is shown (based on sim and created datetimes)
location 2: on the component form under the component title the "present" VAP set is shown (based on sim and created datetimes)
location 3: in the component form under "Value Predictions" a summary of each VAP set is shown
It is inefficient and harder to develop the code as there are multiple routes to achieve similar end results.
Description (acceptance criteria)
[ ] Having one test file that tests how a state wcomponent's VAP sets are prepared for presentation in the different locations of the UI.
[ ] The tests should include when a counterfactual is applied and when a state_value is in effect.
[ ] Refactor to the underlying code to use a DRYer set of functions to prepare this state.
[ ] Fix the current linting errors
Why (hypothesis)
It will make easier to extend this work to implement #241 and #242
Alternatives you've considered
None.
Additional context
Whilst trying to implement #241 it became apparent that invalid numbers where not being presented in an intelligible or consistent way #242 and that to implement #241 and #242 it would be easier if there was one function to extract state values from wcomponents or a specific VAP set, with or without counterfactuals already applied to it.
Currently
value_and_prediction_summary
) the "present" VAP set is shown (based on sim and created datetimes)Description (acceptance criteria)
Why (hypothesis)
Alternatives you've considered
None.
Additional context
Whilst trying to implement #241 it became apparent that invalid numbers where not being presented in an intelligible or consistent way #242 and that to implement #241 and #242 it would be easier if there was one function to extract state values from wcomponents or a specific VAP set, with or without counterfactuals already applied to it.