You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/09/05 00:35:21 UTC

(superset) branch master updated: fix(sqllab): correct Run dropdown crash and caret color regression (#43849)

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

rusackas 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 0820a0ac141 fix(sqllab): correct Run dropdown crash and caret color regression (#43849)
0820a0ac141 is described below

commit 0820a0ac141caa0d969b8c21abc111f1983d1af0
Author: Joe Li <jo...@preset.io>
AuthorDate: Fri Sep 4 17:35:15 2026 -0700

    fix(sqllab): correct Run dropdown crash and caret color regression (#43849)
    
    Co-authored-by: Claude Sonnet 5 <no...@anthropic.com>
---
 .../DropdownButton/DropdownButton.test.tsx         | 14 +++++++++++++
 .../RunQueryActionButton.test.tsx                  | 24 ++++++++++++++++++++++
 .../components/RunQueryActionButton/index.tsx      |  6 ++++--
 3 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/DropdownButton.test.tsx b/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/DropdownButton.test.tsx
index e0d3719b803..a4ea9fe9f8c 100644
--- a/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/DropdownButton.test.tsx
+++ b/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/DropdownButton.test.tsx
@@ -74,3 +74,17 @@ test('passes button type to underlying Dropdown.Button', () => {
   );
   expect(container.querySelector('.ant-btn-primary')).toBeInTheDocument();
 });
+
+test('opens the popupRender content without crashing on click trigger', async () => {
+  const { getAllByRole, findByText } = render(
+    <DropdownButton
+      popupRender={() => <div>Custom Menu</div>}
+      trigger={['click']}
+    >
+      Click
+    </DropdownButton>,
+  );
+  const buttons = getAllByRole('button');
+  fireEvent.click(buttons[buttons.length - 1]);
+  expect(await findByText('Custom Menu')).toBeInTheDocument();
+});
diff --git a/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.tsx b/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.tsx
index 61b56137929..a89324e8952 100644
--- a/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.tsx
+++ b/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.tsx
@@ -19,6 +19,8 @@
 import configureStore from 'redux-mock-store';
 import thunk from 'redux-thunk';
 import { Store } from 'redux';
+import { supersetTheme } from '@apache-superset/core/theme';
+import { Menu } from '@superset-ui/core/components/Menu';
 
 import { render, fireEvent, waitFor } from 'spec/helpers/testing-library';
 import { initialState, defaultQueryEditor } from 'src/SqlLab/fixtures';
@@ -153,3 +155,25 @@ test('dispatch stopQuery on click while running state', async () => {
   fireEvent.click(button);
   await waitFor(() => expect(stopQuery).toHaveBeenCalledTimes(1));
 });
+
+const ctasMenu = <Menu items={[{ key: 'table', label: 'CREATE TABLE AS' }]} />;
+
+test('opening the CTAS/CVAS dropdown menu does not crash and shows the menu', async () => {
+  const { getAllByRole, findByText } = setup(
+    { overlayCreateAsMenu: ctasMenu },
+    mockStore(initialState),
+  );
+  const buttons = getAllByRole('button');
+  const caretButton = buttons[buttons.length - 1];
+  fireEvent.click(caretButton);
+  expect(await findByText('CREATE TABLE AS')).toBeInTheDocument();
+});
+
+test('renders the caret icon with a color that contrasts with the primary button background', () => {
+  const { container } = setup(
+    { overlayCreateAsMenu: ctasMenu },
+    mockStore(initialState),
+  );
+  const caretIcon = container.querySelector('[data-test="down"]');
+  expect(caretIcon).toHaveStyle({ color: supersetTheme.colorTextLightSolid });
+});
diff --git a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx
index 9999c884487..3c8f7d87db4 100644
--- a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx
+++ b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx
@@ -149,11 +149,13 @@ const RunQueryActionButton = ({
         cta
         {...(overlayCreateAsMenu
           ? {
-              overlay: overlayCreateAsMenu,
+              popupRender: () => overlayCreateAsMenu,
               icon: (
                 <Icons.DownOutlined
                   iconColor={
-                    isDisabled ? theme.colorTextDisabled : theme.colorIcon
+                    isDisabled
+                      ? theme.colorTextDisabled
+                      : theme.colorTextLightSolid
                   }
                 />
               ),