This is an automated email from the ASF dual-hosted git repository.
graceguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 879c553 [fix] JS error out when rename a new chart (#6752)
879c553 is described below
commit 879c553b0ad499fd7d47ceeda67364e884c47878
Author: Grace Guo <[email protected]>
AuthorDate: Thu Jan 24 21:31:21 2019 -0800
[fix] JS error out when rename a new chart (#6752)
---
.../src/explore/components/controls/AnnotationLayerControl.jsx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git
a/superset/assets/src/explore/components/controls/AnnotationLayerControl.jsx
b/superset/assets/src/explore/components/controls/AnnotationLayerControl.jsx
index d0b7017..6f71c22 100644
--- a/superset/assets/src/explore/components/controls/AnnotationLayerControl.jsx
+++ b/superset/assets/src/explore/components/controls/AnnotationLayerControl.jsx
@@ -176,10 +176,12 @@ AnnotationLayerControl.defaultProps = defaultProps;
// directly, could not figure out how to get access to the color_scheme
function mapStateToProps({ charts, explore }) {
const chartKey = getChartKey(explore);
+ const chart = charts[chartKey] || charts[0] || {};
+
return {
colorScheme: (explore.controls || {}).color_scheme.value,
- annotationError: charts[chartKey].annotationError,
- annotationQuery: charts[chartKey].annotationQuery,
+ annotationError: chart.annotationError,
+ annotationQuery: chart.annotationQuery,
vizType: explore.controls.viz_type.value,
};
}