This PR addresses the scenario when a dataset version changes and cohorts no longer work. For example, AMP PD may release a new dataset quarterly.
AMP PD v1 data is stored in BigQuery dataset 2019_v1_0101.
Data Explorer url contains filter=amppd.2019_v1_0101.demographics.sex=female which is valid. User saves a cohort with this filter.
A new version of AMP PD is released. (Data Explorer URL remains the same.) Elasticsearch index is recreated with the new BigQuery dataset 2019_v2_0401.
User won't be able to open saved cohort in DE; amppd.2019_v1_0101.demographics.sex is no longer is Elasticsearch index.
Before this PR, if filter or extraFacets url params contained invalid facet names, DE UI is blank.
After this PR:
DE renders, ignoring the invalid facets
A snackbar is shown so user knows some of their filters/extra facets are missing
Invalid facets are removed from url, so if user tries to saves cohort, cohort won't contain invalid params
Invalid filter param:
Multiple invalid filter params:
For invalid extra facets param, we show slightly different text:
Multiple invalid extra facets params:
Also tested:
Invalid filter and extra facet. You see the invalid extra facet snackbar first. After you dismiss that, then you see the invalid filter snackbar.
Invalid filter, valid extra facet
Invalid extra facet, valid filter
Invalid and valid filters. Only invalid filters are removed from url.
Invalid and valid extra facets. Only invalid extra facets are removed from url.
Embedded and standalone. When embedded, invalid params are removed from parent url in addition to iframe url
Time series
Invalid filter in "all time periods" facet - filter correctly removed from url
Invalid filter in "single time period" facet - filter correctly removed from url
Invalid extra facet that is "all time periods" facet - extra facet correctly removed from url
Invalid extra facet that is "single time period" facet - extra facet correctly removed from url
Invalid filter in "single time period" facet and invalid extra facet that is "single time period" facet
"How to use Data Explorer" snackbar still goes away second time
This PR addresses the scenario when a dataset version changes and cohorts no longer work. For example, AMP PD may release a new dataset quarterly.
2019_v1_0101
.filter=amppd.2019_v1_0101.demographics.sex=female
which is valid. User saves a cohort with this filter.2019_v2_0401
.amppd.2019_v1_0101.demographics.sex
is no longer is Elasticsearch index.Before this PR, if filter or extraFacets url params contained invalid facet names, DE UI is blank.
After this PR:
Invalid filter param:
Multiple invalid filter params:
For invalid extra facets param, we show slightly different text:
Multiple invalid extra facets params:
Also tested: