Skip to content

Commit

Permalink
Merge pull request #82 from lyft/merge_apache_20191114b
Browse files Browse the repository at this point in the history
Merge apache 20191114b
  • Loading branch information
Beto Dealmeida authored Nov 15, 2019
2 parents dd42e68 + 1a883c9 commit 420602b
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 45 deletions.
72 changes: 36 additions & 36 deletions superset/assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion superset/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"@superset-ui/legacy-preset-chart-kepler": "^0.1.1",
"@superset-ui/legacy-preset-chart-nvd3": "^0.11.5",
"@superset-ui/number-format": "^0.12.1",
"@superset-ui/plugin-chart-table": "^0.11.6",
"@superset-ui/plugin-chart-table": "^0.11.7",
"@superset-ui/preset-chart-xy": "^0.11.0",
"@superset-ui/query": "^0.12.2",
"@superset-ui/time-format": "^0.12.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ describe('async actions', () => {
id: 'abcd',
},
}];
return store.dispatch(actions.cloneQueryToNewTab(query)).then(() => {
return store.dispatch(actions.cloneQueryToNewTab(query, true)).then(() => {
expect(store.getActions()).toEqual(expectedActions);
});
});
Expand Down
7 changes: 4 additions & 3 deletions superset/assets/src/SqlLab/actions/sqlLab.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export function estimateQueryCost(query) {
dispatch({ type: COST_ESTIMATE_STARTED, query }),
SupersetClient.post({
endpoint,
postPayload: { sql, templateParams: JSON.parse(templateParams) },
postPayload: { sql, templateParams: JSON.parse(templateParams || '{}') },
})
.then(({ json }) => dispatch({ type: COST_ESTIMATE_RETURNED, query, json }))
.catch(response =>
Expand Down Expand Up @@ -445,7 +445,7 @@ export function addQueryEditor(queryEditor) {
};
}

export function cloneQueryToNewTab(query) {
export function cloneQueryToNewTab(query, autorun) {
return function (dispatch, getState) {
const state = getState();
const { queryEditors, tabHistory } = state.sqlLab;
Expand All @@ -454,10 +454,11 @@ export function cloneQueryToNewTab(query) {
title: t('Copy of %s', sourceQueryEditor.title),
dbId: query.dbId ? query.dbId : null,
schema: query.schema ? query.schema : null,
autorun: true,
autorun,
sql: query.sql,
queryLimit: sourceQueryEditor.queryLimit,
maxRow: sourceQueryEditor.maxRow,
templateParams: sourceQueryEditor.templateParams,
};
return dispatch(addQueryEditor(queryEditor));
};
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/src/SqlLab/components/QueryTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class QueryTable extends React.PureComponent {
}

openQueryInNewTab(query) {
this.props.actions.cloneQueryToNewTab(query);
this.props.actions.cloneQueryToNewTab(query, true);
}
openAsyncResults(query, displayLimit) {
this.props.actions.fetchQueryResults(query, displayLimit);
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/src/SqlLab/components/TabbedSqlEditors.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class TabbedSqlEditors extends React.PureComponent {
.forEach(qe => qe !== cqe && this.removeQueryEditor(qe));
}
duplicateQueryEditor(qe) {
this.props.actions.cloneQueryToNewTab(qe);
this.props.actions.cloneQueryToNewTab(qe, false);
}
toggleLeftBar() {
this.setState({ hideLeftBar: !this.state.hideLeftBar });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,13 @@ export default class FilterableTable extends PureComponent {
).map(dimension => dimension.width);

this.props.orderedColumnKeys.forEach((key, index) => {
widthsByColumnKey[key] = Math.max(...colWidths.slice(
// we can't use Math.max(...colWidths.slice(...)) here since the number
// of elements might be bigger than the number of allowed arguments in a
// Javascript function
widthsByColumnKey[key] = colWidths.slice(
index * (this.list.size + 1),
(index + 1) * (this.list.size + 1),
)) + PADDING;
).reduce((a, b) => Math.max(a, b)) + PADDING;
});

return widthsByColumnKey;
Expand Down

0 comments on commit 420602b

Please sign in to comment.