mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
Fix annotation cache (#18788)
This commit is contained in:
parent
c491829e99
commit
535634310b
@ -244,14 +244,14 @@ export async function getChartDataRequest({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function runAnnotationQuery(
|
export function runAnnotationQuery({
|
||||||
annotation,
|
annotation,
|
||||||
timeout = 60,
|
timeout = 60,
|
||||||
formData = null,
|
formData = null,
|
||||||
key,
|
key,
|
||||||
isDashboardRequest = false,
|
isDashboardRequest = false,
|
||||||
force = false,
|
force = false,
|
||||||
) {
|
}) {
|
||||||
return function (dispatch, getState) {
|
return function (dispatch, getState) {
|
||||||
const sliceKey = key || Object.keys(getState().charts)[0];
|
const sliceKey = key || Object.keys(getState().charts)[0];
|
||||||
// make a copy of formData, not modifying original formData
|
// make a copy of formData, not modifying original formData
|
||||||
@ -482,16 +482,16 @@ export function exploreJSON(
|
|||||||
chartDataRequestCaught,
|
chartDataRequestCaught,
|
||||||
dispatch(triggerQuery(false, key)),
|
dispatch(triggerQuery(false, key)),
|
||||||
dispatch(updateQueryFormData(formData, key)),
|
dispatch(updateQueryFormData(formData, key)),
|
||||||
...annotationLayers.map(x =>
|
...annotationLayers.map(annotation =>
|
||||||
dispatch(
|
dispatch(
|
||||||
runAnnotationQuery(
|
runAnnotationQuery({
|
||||||
x,
|
annotation,
|
||||||
timeout,
|
timeout,
|
||||||
formData,
|
formData,
|
||||||
key,
|
key,
|
||||||
isDashboardRequest,
|
isDashboardRequest,
|
||||||
force,
|
force,
|
||||||
),
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
|
@ -98,7 +98,11 @@ class AnnotationLayerControl extends React.PureComponent {
|
|||||||
this.setState({ addedAnnotationIndex: annotations.length - 1 });
|
this.setState({ addedAnnotationIndex: annotations.length - 1 });
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.refreshAnnotationData(newAnnotation);
|
this.props.refreshAnnotationData({
|
||||||
|
annotation: newAnnotation,
|
||||||
|
force: true,
|
||||||
|
});
|
||||||
|
|
||||||
this.props.onChange(annotations);
|
this.props.onChange(annotations);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,8 +243,8 @@ function mapStateToProps({ charts, explore }) {
|
|||||||
|
|
||||||
function mapDispatchToProps(dispatch) {
|
function mapDispatchToProps(dispatch) {
|
||||||
return {
|
return {
|
||||||
refreshAnnotationData: annotationLayer =>
|
refreshAnnotationData: annotationObj =>
|
||||||
dispatch(runAnnotationQuery(annotationLayer)),
|
dispatch(runAnnotationQuery(annotationObj)),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user