-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
[sqllab] Fixed js error when results are not available #1715
Conversation
<div className="VisualizeModal"> | ||
<Modal show={this.props.show} onHide={this.props.onHide}> | ||
<Modal.Body> | ||
No results available for this query |
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.
s/No results available for this query, please rerun
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.
it would be nice to have actionable feedback for the user here, but if there are no results for a query, re-running it won't likely return new results. i think we could save figuring out what actionable feedback we could show here for another PR.
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.
ah, i see what's happening now, i missed reading about how we flush the query results except for the latest query.
const q = Object.assign({}, state.queries[qe.latestQueryId], { results: null }); | ||
const newResults = Object.assign( | ||
{}, state.queries[qe.latestQueryId].results, { data: [], query: null }); | ||
const q = Object.assign({}, state.queries[qe.latestQueryId], { results: newResults }); |
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.
would be great to have the unit test for it, optional
thanks for taking this on @vera-liu. i'm not sure showing this modal is the best solution. like bogdan suggested, we could add text to tell the user to re-run the query but i don't think this is a very good user experience. comments on your other ideas:
we could remove the visualize button from the query history list items altogether. if it's only present for the latest query, that seems confusing/looks like a bug if it's not displayed for the other queries. for the latest query, users will be able to use the visualize button in the results tab.
this could be a good solution but would definitely be more time consuming to get it right. i think in this case we would want to show an icon/tooltip that says re-run query to visualize. once clicked we would switch back to the results tab, update the query in the editor, and automatically start running the query. we would want to do this so the user can see that the query is running. however we also have an icon/tooltip that says i think the best solution here, balancing impact and effort, would be to remove the visualize icon from the query history list, and only have access to it from the results tab. |
8af4f58
to
8c62da4
Compare
Done:
|
dbf3d8e
to
1566f9f
Compare
@vera-liu - LGTM, please test on staging |
Issue:
Problem:
Solution:
Before:
![bug](https://cloud.githubusercontent.com/assets/20978302/20805594/3442cb94-b7ac-11e6-8b23-965a3ea03b13.png)
After:
![screen shot 2016-12-01 at 9 55 01 am](https://cloud.githubusercontent.com/assets/20978302/20805611/40a5505a-b7ac-11e6-8a69-9e21a175061d.png)
@ascott @bkyryliuk @mistercrunch