You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/12/08 07:55:15 UTC
[GitHub] [incubator-superset] zhaoyongjie commented on a change in pull request #11755: feat: Sqllab to Explore UX improvements
zhaoyongjie commented on a change in pull request #11755:
URL: https://github.com/apache/incubator-superset/pull/11755#discussion_r538112686
##########
File path: superset-frontend/src/SqlLab/components/ResultSet.tsx
##########
@@ -124,6 +205,145 @@ export default class ResultSet extends React.PureComponent<
}
}
+ handleOnChangeAutoComplete = () => {
+ this.setState({ datasetToOverwrite: {} });
+ };
+
+ handleOverwriteDataset = async () => {
+ const { sql, results, dbId } = this.props.query;
+ const { datasetToOverwrite } = this.state;
+
+ updateDatset(
+ datasetToOverwrite.datasetId,
+ dbId,
+ sql,
+ results.selected_columns.map(d => ({ column_name: d.name })),
+ true,
+ )
+ .then(() => {
+ exploreChart({
+ ...EXPLORE_CHART_DEFAULT,
+ datasource: `${datasetToOverwrite.datasetId}__table`,
+ all_columns: results.selected_columns.map(d => d.name),
+ });
+ })
+ .catch(() => {
+ this.props.actions.addDangerToast(
+ t('An error occurred overwriting dataset'),
+ );
+ });
+
+ this.setState({
+ showSaveDatasetModal: false,
+ shouldOverwriteDataSet: false,
+ datasetToOverwrite: {},
+ newSaveDatasetName: `${this.props.query.tab} ${moment().format(
+ 'MM/DD/YYYY HH:mm:ss',
Review comment:
"YYYY-MM-DD HH:mm:ss" It's a more common way for i18n.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org