Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Remove the 'models' Input from ModelModalComponent #28

Open
CloudNiner opened this issue Dec 19, 2017 · 2 comments · Fixed by #32
Open

Remove the 'models' Input from ModelModalComponent #28

CloudNiner opened this issue Dec 19, 2017 · 2 comments · Fixed by #32

Comments

@CloudNiner
Copy link
Contributor

The ModelModalComponent queries for the models available based on the input dataset. It shouldn't be necessary to also Input a list of models.

Additionally, keeping this input around causes issues with downstream projects that shouldn't need to pass an initial list of models, but also can't pass a null initial value due to #27. As a result, defaulting models to an empty array when initializing a ModelModalComponent causes this error querying the Climate API:

error: ['Dataset LOCA has no data for model(s) ']
@CloudNiner
Copy link
Contributor Author

This would also likely fix the occasional:

ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: ''. Current value: '[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]'.

issue in downstream projects.

CloudNiner pushed a commit to azavea/temperate that referenced this issue Dec 19, 2017
Likely exposed by ClimateModel list being returned immediately
from the cache, causing the following steps to occur:
1. Dataset changes in ModelModalComponent
2. Triggers model list API request
3. ModelModalComponent.onModelsChanged fired
4. IndicatorChart.models is set from change event
5. Triggers onChanges for ModelModalComponent.models

Before, the model list API request happening asynchronously
was enough to break this chain of events.

We can fix the error by wrapping the update to IndicatorChart.models
in a setTimeout, which delays checking until next cycle.

This is a temporary fix, when:

azavea/climate-change-components#28

is addressed, this fix should be removed as well.
@CloudNiner CloudNiner self-assigned this Jan 2, 2018
@CloudNiner
Copy link
Contributor Author

It was decided that this actually cannot be removed, since its used to power the user projects settings in Lab. It's likely if we revisit Lab interactions that we'll want to improve the handling of how we pass the list of models to/from this component.

@CloudNiner CloudNiner reopened this Jan 8, 2018
@CloudNiner CloudNiner removed their assignment Jan 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants