Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #13246 - Add checks for empty annotations #13422

Merged
merged 3 commits into from
Aug 10, 2017

Conversation

simianhacker
Copy link
Member

This PR fixes #13246 by adding a check to make sure there are actual annotations in the annotations array. It also returns a promise for getAnnotations() instead of just an object when request is empty due to the lack of any valid annotations.

@simianhacker simianhacker added v6.0.0 v6.0.0-beta2 Feature:TSVB TSVB (Time Series Visual Builder) review Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:fix v7.0.0 labels Aug 9, 2017
@@ -30,7 +30,7 @@ export default (req, panel) => {
return bodies;
});

if (!bodies.length) return { responses: [] };
if (!bodies.length) return Promise.resolve({ responses: [] });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while we're in here anyway, consider flagging the get_annotations function as async instead. it avoids boilerplate like this and babel will give us some more compile-time safety. not sure how far this will cascade though....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored this file to use async/await

@simianhacker simianhacker merged commit 17fcaf1 into elastic:master Aug 10, 2017
simianhacker added a commit that referenced this pull request Aug 10, 2017
* Fixes #13246 - Add checkes for empty annotations

* Refactoring get_annotations to use async/await
simianhacker added a commit that referenced this pull request Aug 10, 2017
* Fixes #13246 - Add checkes for empty annotations

* Refactoring get_annotations to use async/await
@simianhacker
Copy link
Member Author

Back ported to 6.0 with b80e970
Back ported to 6.x with 7cc9d5d

@simianhacker simianhacker deleted the fix-13246 branch April 17, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:TSVB TSVB (Time Series Visual Builder) Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:fix review v6.0.0-beta2 v6.0.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removing all annotations from a TSVB vis breaks the vis
2 participants