-
Notifications
You must be signed in to change notification settings - Fork 14k
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
[sql-lab] only show the reset state button if location param present #1075
Conversation
@@ -117,6 +117,7 @@ class SqlEditorTopToolbar extends React.Component { | |||
} | |||
render() { | |||
const tables = this.props.tables.filter((t) => (t.queryEditorId === this.props.queryEditor.id)); | |||
const shouldShowReset = window.location.search === '?reset=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.
what if you have here other args?
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.
I think we have a querystring parser function in the caravel module.
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.
sql-lab isn't using url params for anything else currently. i think this will probably be a short term thing, so it can be toggled for a demo tomorrow. we should remove it once most of the dev work is done.
I am just curious, @ascott , do you know if there is a way in js to distinguish between dev and prod modes? |
@bkyryliuk here's the way to distinguish between prod/dev |
thanks @mistercrunch great to know, looks like a simple check. |
@mistercrunch do you want this for the demo today? is it useful for you if it's only available in dev? |
It's good to have this button hidden somewhere if the state ever gets corrupt or incompatible with new code. We should do all we can to prevent any situation where clearing the state would fix issues, but it's good to have. While developing I've gotten to situations where the state was incompatible and the "Reset State" button would not even render :( . |
* only show the reset state button if location param (#1075) * cherry pick commits from master
/caravel/sqllab?reset=1
plz review @mistercrunch @bkyryliuk @vera-liu