-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: No results message not showing #5
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,6 +91,17 @@ looker.plugins.visualizations.add({ | |
// Clear any errors from previous updates | ||
this.clearErrors(); | ||
|
||
// Issue identified where viz would not change with table calc filters | ||
// need to supply the container with something new if we fail early and | ||
// don't make it to the inteded render function. | ||
// https://looker.atlassian.net/browse/DX-5779 | ||
if (data.length < 1) { | ||
this.addError({ | ||
title: "No Results", | ||
}); | ||
return; | ||
} | ||
|
||
const dimensions = [].concat( | ||
queryResponse.fields.dimensions, | ||
queryResponse.fields.table_calculations.filter( | ||
|
@@ -120,13 +131,6 @@ looker.plugins.visualizations.add({ | |
}); | ||
return; | ||
} | ||
if (data.length === 0) { | ||
this.addError({ | ||
title: "No Results", | ||
}); | ||
done(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does "done()?" do. It appears to have been removed from the above code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Calling done() after adding the error is what caused the bug. Visualization would return but it would never add the error message so it wouldn't update or show. |
||
return; | ||
} | ||
|
||
// const secondDimension = dimensions[1] | ||
const firstMeasure = measures[0]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between data.length === 0 and data.length < 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not much difference, I took some code from other vis that had a similar issue, so that stayed. But no difference at all in this case.