You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by kg...@apache.org on 2022/09/21 20:56:57 UTC

[superset] branch master updated: fix: Reset dataset name after saving a new dataset in SQL Lab (#21529)

This is an automated email from the ASF dual-hosted git repository.

kgabryje pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new cbadb8773f fix: Reset dataset name after saving a new dataset in SQL Lab (#21529)
cbadb8773f is described below

commit cbadb8773f06ca62ad4d9ebf04df211af3de9853
Author: EugeneTorap <ev...@gmail.com>
AuthorDate: Wed Sep 21 23:56:45 2022 +0300

    fix: Reset dataset name after saving a new dataset in SQL Lab (#21529)
---
 .../src/SqlLab/components/SaveDatasetModal/index.tsx             | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx
index 31facf4401..0bc9f574f0 100644
--- a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx
+++ b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-import React, { FunctionComponent, useCallback, useState } from 'react';
+import React, { useCallback, useState } from 'react';
 import { Radio } from 'src/components/Radio';
 import { RadioChangeEvent, AsyncSelect } from 'src/components';
 import { Input } from 'src/components/Input';
@@ -140,8 +140,7 @@ const updateDataset = async (
 
 const UNTITLED = t('Untitled Dataset');
 
-// eslint-disable-next-line no-empty-pattern
-export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
+export const SaveDatasetModal = ({
   visible,
   onHide,
   buttonTextOnSave,
@@ -150,7 +149,7 @@ export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
   datasource,
   openWindow = true,
   formData = {},
-}) => {
+}: SaveDatasetModalProps) => {
   const defaultVizType = useSelector<SqlLabRootState, string>(
     state => state.common?.conf?.DEFAULT_VIZ_TYPE || 'table',
   );
@@ -388,7 +387,7 @@ export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
                 {t('Save as new')}
                 <Input
                   className="sdm-input"
-                  defaultValue={datasetName}
+                  value={datasetName}
                   onChange={handleDatasetNameChange}
                   disabled={newOrOverwrite !== 1}
                 />