-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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: Columns not passing properly from SQL Lab to Explore #20975
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,9 +26,10 @@ import { Form, FormItem } from 'src/components/Form'; | |
import Modal from 'src/components/Modal'; | ||
import SaveDatasetActionButton from 'src/SqlLab/components/SaveDatasetActionButton'; | ||
import { SaveDatasetModal } from 'src/SqlLab/components/SaveDatasetModal'; | ||
import { getDatasourceAsSaveableDataset } from 'src/utils/datasourceUtils'; | ||
|
||
interface SaveQueryProps { | ||
query: any; | ||
query: QueryPayload; | ||
defaultLabel: string; | ||
onSave: (arg0: QueryPayload) => void; | ||
onUpdate: (arg0: QueryPayload) => void; | ||
|
@@ -166,6 +167,7 @@ export default function SaveQuery({ | |
</Form> | ||
); | ||
|
||
console.log('FINDME SaveQuery', query, queryPayload()); | ||
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. remove this 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. This was just debugging, it wasn't ready for review yet. I pushed up a "clean up" commit |
||
return ( | ||
<Styles className="SaveQuery"> | ||
<SaveDatasetActionButton | ||
|
@@ -177,7 +179,7 @@ export default function SaveQuery({ | |
onHide={() => setShowSaveDatasetModal(false)} | ||
buttonTextOnSave={t('Save & Explore')} | ||
buttonTextOnOverwrite={t('Overwrite & Explore')} | ||
datasource={query} | ||
datasource={getDatasourceAsSaveableDataset(query)} | ||
/> | ||
<Modal | ||
className="save-query-modal" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -663,6 +663,11 @@ class SqlEditor extends React.PureComponent { | |
</Menu> | ||
); | ||
|
||
const queryWithColumns = () => ({ | ||
...qe, | ||
columns: this.props.latestQuery?.results?.columns || [], | ||
}); | ||
console.log('findme SqlEditor', qe, queryWithColumns()); | ||
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. remove this 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. This was just debugging, it wasn't ready for review yet. I pushed up a "clean up" commit |
||
return ( | ||
<StyledToolbar className="sql-toolbar" id="js-sql-toolbar"> | ||
<div className="leftItems"> | ||
|
@@ -721,7 +726,7 @@ class SqlEditor extends React.PureComponent { | |
<div className="rightItems"> | ||
<span> | ||
<SaveQuery | ||
query={qe} | ||
query={queryWithColumns()} | ||
defaultLabel={qe.name || qe.description} | ||
onSave={this.saveQuery} | ||
onUpdate={this.props.actions.updateSavedQuery} | ||
|
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.
remove this
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.
This was just debugging, it wasn't ready for review yet. I pushed up a "clean up" commit
here
.