You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jl...@apache.org on 2025/08/21 16:43:12 UTC
(superset) branch 6.0 updated (c199213e8e -> e10b6e8ae9)
This is an automated email from the ASF dual-hosted git repository.
jli pushed a change to branch 6.0
in repository https://gitbox.apache.org/repos/asf/superset.git
from c199213e8e fix(translations): Fix translation of time-related strings like "7 seconds ago", "a minute ago", etc (#34051)
new 18d4acdee9 fix(sqllab): Fix save query modal closing prematurely on new tabs (#34765)
new e10b6e8ae9 fix(webpack): Bump webpack dev-server to handle Errors on Firefox where error object is not defined (#34791)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
superset-frontend/package-lock.json | 10 +--
superset-frontend/package.json | 2 +-
.../SqlLab/components/SaveQuery/SaveQuery.test.tsx | 100 +++++++++++++++++++++
.../src/SqlLab/components/SaveQuery/index.tsx | 10 +--
4 files changed, 110 insertions(+), 12 deletions(-)
(superset) 01/02: fix(sqllab): Fix save query modal closing prematurely on new tabs (#34765)
Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jli pushed a commit to branch 6.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 18d4acdee9774e5044d248e4d3a01c73ff6e390d
Author: Evan Rusackas <ev...@preset.io>
AuthorDate: Thu Aug 21 04:39:47 2025 -0700
fix(sqllab): Fix save query modal closing prematurely on new tabs (#34765)
Co-authored-by: Claude <no...@anthropic.com>
(cherry picked from commit 48699a71946fd5981dba1f6d2cfabd0315137889)
---
.../SqlLab/components/SaveQuery/SaveQuery.test.tsx | 100 +++++++++++++++++++++
.../src/SqlLab/components/SaveQuery/index.tsx | 10 +--
2 files changed, 104 insertions(+), 6 deletions(-)
diff --git a/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx b/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx
index 893f8afd71..cf4cdcca43 100644
--- a/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx
+++ b/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx
@@ -245,4 +245,104 @@ describe('SavedQuery', () => {
expect(overwriteCombobox).toBeInTheDocument();
expect(overwritePlaceholderText).toBeInTheDocument();
});
+
+ it('modal stays open while save is in progress and closes after completion', async () => {
+ let resolveSave: () => void;
+ const savePromise = new Promise<void>(resolve => {
+ resolveSave = resolve;
+ });
+
+ const mockOnSave = jest.fn().mockImplementation(() => savePromise);
+
+ render(<SaveQuery {...mockedProps} onSave={mockOnSave} />, {
+ useRedux: true,
+ store: mockStore(mockState),
+ });
+
+ // Open the modal
+ const saveBtn = screen.getByRole('button', { name: /save/i });
+ userEvent.click(saveBtn);
+
+ // Verify modal is open
+ expect(
+ screen.getByRole('heading', { name: /save query/i }),
+ ).toBeInTheDocument();
+
+ // Click save button in the modal
+ const modalSaveBtn = screen.getAllByRole('button', { name: /save/i })[1];
+ userEvent.click(modalSaveBtn);
+
+ // Modal should still be open while save is in progress
+ expect(
+ screen.getByRole('heading', { name: /save query/i }),
+ ).toBeInTheDocument();
+
+ // Resolve the save promise
+ resolveSave!();
+
+ // Wait for modal to close after save completes
+ await waitFor(() => {
+ expect(
+ screen.queryByRole('heading', { name: /save query/i }),
+ ).not.toBeInTheDocument();
+ });
+
+ expect(mockOnSave).toHaveBeenCalledTimes(1);
+ });
+
+ it('handles save with a new tab that has no changes', async () => {
+ const mockOnSave = jest.fn().mockResolvedValue(undefined);
+
+ // Mock state for a new tab with default SQL
+ const newTabState = {
+ ...mockState,
+ sqlLab: {
+ ...mockState.sqlLab,
+ queryEditors: [
+ {
+ id: mockedProps.queryEditorId,
+ dbId: 1,
+ catalog: null,
+ schema: 'main',
+ sql: 'SELECT ...', // Default SQL for new tabs
+ name: undefined,
+ description: undefined,
+ },
+ ],
+ },
+ };
+
+ render(<SaveQuery {...mockedProps} onSave={mockOnSave} />, {
+ useRedux: true,
+ store: mockStore(newTabState),
+ });
+
+ // Open the modal
+ const saveBtn = screen.getByRole('button', { name: /save/i });
+ userEvent.click(saveBtn);
+
+ // Modal should open
+ expect(
+ screen.getByRole('heading', { name: /save query/i }),
+ ).toBeInTheDocument();
+
+ // The name field should have "Undefined" as default
+ const nameInput = screen.getAllByRole('textbox')[0] as HTMLInputElement;
+ expect(nameInput).toHaveValue('Undefined');
+
+ // Click save button
+ const modalSaveBtn = screen.getAllByRole('button', { name: /save/i })[1];
+ userEvent.click(modalSaveBtn);
+
+ // Wait for save to complete and modal to close
+ await waitFor(() => {
+ expect(mockOnSave).toHaveBeenCalled();
+ });
+
+ await waitFor(() => {
+ expect(
+ screen.queryByRole('heading', { name: /save query/i }),
+ ).not.toBeInTheDocument();
+ });
+ });
});
diff --git a/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx b/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx
index 82782e59f5..7d45bd351e 100644
--- a/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx
+++ b/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx
@@ -147,14 +147,14 @@ const SaveQuery = ({
const close = () => setShowSave(false);
- const onSaveWrapper = () => {
+ const onSaveWrapper = async () => {
logAction(LOG_ACTIONS_SQLLAB_SAVE_QUERY, {});
- onSave(queryPayload(), query.id);
+ await onSave(queryPayload(), query.id);
close();
};
- const onUpdateWrapper = () => {
- onUpdate(queryPayload(), query.id);
+ const onUpdateWrapper = async () => {
+ await onUpdate(queryPayload(), query.id);
close();
};
@@ -220,9 +220,7 @@ const SaveQuery = ({
/>
<Modal
className="save-query-modal"
- onHandledPrimaryAction={onSaveWrapper}
onHide={close}
- primaryButtonName={isSaved ? t('Save') : t('Save as')}
width="620px"
show={showSave}
name={t('Save query')}
(superset) 02/02: fix(webpack): Bump webpack dev-server to handle Errors on Firefox where error object is not defined (#34791)
Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jli pushed a commit to branch 6.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit e10b6e8ae963b01ae392a59b62fa0252cc8e3937
Author: amaannawab923 <am...@gmail.com>
AuthorDate: Thu Aug 21 18:29:28 2025 +0530
fix(webpack): Bump webpack dev-server to handle Errors on Firefox where error object is not defined (#34791)
(cherry picked from commit 277f03c2075a74fbafb55531054fb5083debe5cc)
---
superset-frontend/package-lock.json | 10 +++++-----
superset-frontend/package.json | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json
index 0bd3a157ab..774217fadf 100644
--- a/superset-frontend/package-lock.json
+++ b/superset-frontend/package-lock.json
@@ -265,7 +265,7 @@
"webpack": "^5.99.9",
"webpack-bundle-analyzer": "^4.10.1",
"webpack-cli": "^6.0.1",
- "webpack-dev-server": "^5.2.1",
+ "webpack-dev-server": "^5.2.2",
"webpack-manifest-plugin": "^5.0.1",
"webpack-sources": "^3.3.3",
"webpack-visualizer-plugin2": "^1.2.0"
@@ -57102,9 +57102,9 @@
}
},
"node_modules/webpack-dev-server": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.2.1.tgz",
- "integrity": "sha512-ml/0HIj9NLpVKOMq+SuBPLHcmbG+TGIjXRHsYfZwocUBIqEvws8NnS/V9AFQ5FKP+tgn5adwVwRrTEpGL33QFQ==",
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.2.2.tgz",
+ "integrity": "sha512-QcQ72gh8a+7JO63TAx/6XZf/CWhgMzu5m0QirvPfGvptOusAxG12w2+aua1Jkjr7hzaWDnJ2n6JFeexMHI+Zjg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -57124,7 +57124,7 @@
"connect-history-api-fallback": "^2.0.0",
"express": "^4.21.2",
"graceful-fs": "^4.2.6",
- "http-proxy-middleware": "^2.0.7",
+ "http-proxy-middleware": "^2.0.9",
"ipaddr.js": "^2.1.0",
"launch-editor": "^2.6.1",
"open": "^10.0.3",
diff --git a/superset-frontend/package.json b/superset-frontend/package.json
index d78daff92a..5975fc5205 100644
--- a/superset-frontend/package.json
+++ b/superset-frontend/package.json
@@ -333,7 +333,7 @@
"webpack": "^5.99.9",
"webpack-bundle-analyzer": "^4.10.1",
"webpack-cli": "^6.0.1",
- "webpack-dev-server": "^5.2.1",
+ "webpack-dev-server": "^5.2.2",
"webpack-manifest-plugin": "^5.0.1",
"webpack-sources": "^3.3.3",
"webpack-visualizer-plugin2": "^1.2.0"