mirror of
https://github.com/apache/superset.git
synced 2026-04-26 03:24:53 +00:00
[explore view] fix long query issue from Run in SQL LAB Button (#9345)
* [explore view] fix long query issue from Run in SQL LAB Button * SQL Lab page needs to take the post form data, too * fix variable names * updated payload dict, rename hidden form Co-authored-by: Jesse Yang <jesse.yang@airbnb.com>
This commit is contained in:
@@ -39,6 +39,7 @@ const propTypes = {
|
||||
databases: PropTypes.object.isRequired,
|
||||
queries: PropTypes.object.isRequired,
|
||||
queryEditors: PropTypes.array,
|
||||
requestedQuery: PropTypes.object,
|
||||
tabHistory: PropTypes.array.isRequired,
|
||||
tables: PropTypes.array.isRequired,
|
||||
offline: PropTypes.bool,
|
||||
@@ -48,6 +49,7 @@ const propTypes = {
|
||||
const defaultProps = {
|
||||
queryEditors: [],
|
||||
offline: false,
|
||||
requestedQuery: null,
|
||||
saveQueryWarning: null,
|
||||
scheduleQueryWarning: null,
|
||||
};
|
||||
@@ -99,7 +101,12 @@ class TabbedSqlEditors extends React.PureComponent {
|
||||
});
|
||||
}
|
||||
|
||||
const query = URI(window.location).search(true);
|
||||
// merge post form data with GET search params
|
||||
const query = {
|
||||
...this.props.requestedQuery,
|
||||
...URI(window.location).search(true),
|
||||
};
|
||||
|
||||
// Popping a new tab based on the querystring
|
||||
if (query.id || query.sql || query.savedQueryId || query.datasourceKey) {
|
||||
if (query.id) {
|
||||
@@ -374,7 +381,7 @@ class TabbedSqlEditors extends React.PureComponent {
|
||||
TabbedSqlEditors.propTypes = propTypes;
|
||||
TabbedSqlEditors.defaultProps = defaultProps;
|
||||
|
||||
function mapStateToProps({ sqlLab, common }) {
|
||||
function mapStateToProps({ sqlLab, common, requestedQuery }) {
|
||||
return {
|
||||
databases: sqlLab.databases,
|
||||
queryEditors: sqlLab.queryEditors,
|
||||
@@ -388,6 +395,7 @@ function mapStateToProps({ sqlLab, common }) {
|
||||
maxRow: common.conf.SQL_MAX_ROW,
|
||||
saveQueryWarning: common.conf.SQLLAB_SAVE_WARNING_MESSAGE,
|
||||
scheduleQueryWarning: common.conf.SQLLAB_SCHEDULE_WARNING_MESSAGE,
|
||||
requestedQuery,
|
||||
};
|
||||
}
|
||||
function mapDispatchToProps(dispatch) {
|
||||
|
||||
Reference in New Issue
Block a user