You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ms...@apache.org on 2026/07/22 08:14:16 UTC
(superset) branch master updated: fix(explore): render stopped state when a chart query is cancelled (#42270)
This is an automated email from the ASF dual-hosted git repository.
msyavuz 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 b71b58e8214 fix(explore): render stopped state when a chart query is cancelled (#42270)
b71b58e8214 is described below
commit b71b58e82142540c2094e5e6dfcf0f839ff82ea0
Author: Mehmet Salih Yavuz <sa...@proton.me>
AuthorDate: Wed Jul 22 11:14:08 2026 +0300
fix(explore): render stopped state when a chart query is cancelled (#42270)
---
.../src/components/Chart/Chart.test.tsx | 21 ++++++++++++++++++-
superset-frontend/src/components/Chart/Chart.tsx | 24 ++++++++++++++++++++++
2 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/superset-frontend/src/components/Chart/Chart.test.tsx b/superset-frontend/src/components/Chart/Chart.test.tsx
index 53028d2d1e9..0c27b328fbb 100644
--- a/superset-frontend/src/components/Chart/Chart.test.tsx
+++ b/superset-frontend/src/components/Chart/Chart.test.tsx
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { render, screen } from 'spec/helpers/testing-library';
+import { render, screen, fireEvent } from 'spec/helpers/testing-library';
import '@testing-library/jest-dom';
import { PLACEHOLDER_DATASOURCE } from 'src/dashboard/constants';
import { ResourceStatus } from 'src/hooks/apiResources/apiResources';
@@ -86,3 +86,22 @@ test('shows loading spinner for client-side errors without errors array when dat
expect(screen.getByRole('status')).toBeInTheDocument();
expect(screen.queryByText(/Some client-side error/)).not.toBeInTheDocument();
});
+
+test('shows the stop message and a re-run affordance when the query was stopped', () => {
+ const onQuery = jest.fn();
+ render(
+ <Chart
+ {...baseProps}
+ chartStatus="stopped"
+ chartAlert="Updating chart was stopped"
+ onQuery={onQuery}
+ />,
+ );
+
+ expect(screen.getByText('Updating chart was stopped')).toBeInTheDocument();
+
+ const rerun = screen.getByText('click here');
+ fireEvent.click(rerun);
+ fireEvent.keyDown(rerun, { key: 'Enter' });
+ expect(onQuery).toHaveBeenCalledTimes(2);
+});
diff --git a/superset-frontend/src/components/Chart/Chart.tsx b/superset-frontend/src/components/Chart/Chart.tsx
index 2fcdeb6c7f4..4ae58a9d635 100644
--- a/superset-frontend/src/components/Chart/Chart.tsx
+++ b/superset-frontend/src/components/Chart/Chart.tsx
@@ -440,6 +440,30 @@ function Chart({
);
}
+ if (chartStatus === 'stopped') {
+ return (
+ <EmptyState
+ size="large"
+ title={chartAlert || t('Updating chart was stopped')}
+ description={
+ <span>
+ {t('Run a new query using the "Update chart" button or')}{' '}
+ <span
+ role="button"
+ tabIndex={0}
+ onClick={onQuery}
+ onKeyDown={handleKeyboardActivation(() => onQuery?.())}
+ >
+ {t('click here')}
+ </span>
+ .
+ </span>
+ }
+ image="chart.svg"
+ />
+ );
+ }
+
if (errorMessage && ensureIsArray(queriesResponse).length === 0) {
return (
<EmptyState