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:
Lyndsi Kay Williams
2022-08-01 14:36:34 -05:00
committed by GitHub
parent 3a11856ecb
commit 8a04536f9d
25 changed files with 515 additions and 196 deletions

View File

@@ -36,8 +36,8 @@ describe('newQueryTabName', () => {
it('should return next available number if there are unsaved editors', () => {
const untitledQueryText = 'Untitled Query';
const unsavedEditors = [
{ ...emptyEditor, title: `${untitledQueryText} 1` },
{ ...emptyEditor, title: `${untitledQueryText} 2` },
{ ...emptyEditor, name: `${untitledQueryText} 1` },
{ ...emptyEditor, name: `${untitledQueryText} 2` },
];
const nextTitle = newQueryTabName(unsavedEditors);

View File

@@ -31,10 +31,10 @@ export const newQueryTabName = (
if (queryEditors.length > 0) {
const mappedUntitled = queryEditors.filter(qe =>
qe.title.match(untitledQueryRegex),
qe.name.match(untitledQueryRegex),
);
const untitledQueryNumbers = mappedUntitled.map(
qe => +qe.title.replace(untitledQuery, ''),
qe => +qe.name.replace(untitledQuery, ''),
);
if (untitledQueryNumbers.length > 0) {
// When there are query tabs open, and at least one is called "Untitled Query #"