Skip to content
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: Reset dataset name after saving a new dataset in SQL Lab #21529

Merged
merged 1 commit into from
Sep 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand All @@ -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',
);
Expand Down Expand Up @@ -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}
/>
Expand Down