mirror of
https://github.com/apache/superset.git
synced 2026-04-24 10:35:01 +00:00
feat(SqlLab): Change Save Dataset Button to Split Save Query Button IV (#20852)
* Moving entire split save btn PR * Addressed review comments * Remove arbitrary div from ErrorBoundary in Chart * Added accidentally removed comment * Fix act errors in SaveQuery tests * Fix SaveDatasetActionButton test * SaveDatasetModal test almost working * SaveDatasetModal tests all passing * Clean SaveDatasetModal test * Fix create chart button and SaveDatasetModal text in SQL Lab * Fix untitled dataset name on SaveDatasetModal in explore * Fix styling on split save button
This commit is contained in:
committed by
GitHub
parent
3a11856ecb
commit
8a04536f9d
@@ -186,6 +186,11 @@ export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
|
||||
...(formData || {}),
|
||||
};
|
||||
const handleOverwriteDataset = async () => {
|
||||
// if user wants to overwrite a dataset we need to prompt them
|
||||
if (!shouldOverwriteDataset) {
|
||||
setShouldOverwriteDataset(true);
|
||||
return;
|
||||
}
|
||||
const [, key] = await Promise.all([
|
||||
updateDataset(
|
||||
datasource?.dbId,
|
||||
@@ -258,12 +263,6 @@ export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
|
||||
);
|
||||
|
||||
const handleSaveInDataset = () => {
|
||||
// if user wants to overwrite a dataset we need to prompt them
|
||||
if (newOrOverwrite === DatasetRadioState.OVERWRITE_DATASET) {
|
||||
setShouldOverwriteDataset(true);
|
||||
return;
|
||||
}
|
||||
|
||||
const selectedColumns = datasource?.columns ?? [];
|
||||
|
||||
// The filters param is only used to test jinja templates.
|
||||
@@ -347,7 +346,7 @@ export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
|
||||
onHide={onHide}
|
||||
footer={
|
||||
<>
|
||||
{!shouldOverwriteDataset && (
|
||||
{newOrOverwrite === DatasetRadioState.SAVE_NEW && (
|
||||
<Button
|
||||
disabled={disableSaveAndExploreBtn}
|
||||
buttonStyle="primary"
|
||||
@@ -356,7 +355,7 @@ export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
|
||||
{buttonTextOnSave}
|
||||
</Button>
|
||||
)}
|
||||
{shouldOverwriteDataset && (
|
||||
{newOrOverwrite === DatasetRadioState.OVERWRITE_DATASET && (
|
||||
<>
|
||||
<Button onClick={handleOverwriteCancel}>Back</Button>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user