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

fix: No results message not showing #5

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packed_bubble.js

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions src/bubble_chart/bubble_chart_container.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 === 0) {
this.addError({
title: "No Results",
});
return;
}

const dimensions = [].concat(
queryResponse.fields.dimensions,
queryResponse.fields.table_calculations.filter(
Expand Down Expand Up @@ -120,13 +131,6 @@ looker.plugins.visualizations.add({
});
return;
}
if (data.length === 0) {
this.addError({
title: "No Results",
});
done();
Copy link

Choose a reason for hiding this comment

The 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.

Copy link
Author

@andres-rubio-go andres-rubio-go Oct 5, 2023

Choose a reason for hiding this comment

The 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];
Expand Down