From 96ba44c802db3195d4594901effe2bc747d2cb31 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 09:42:58 +0200 Subject: [PATCH] [v11.1.x] DashboardScene: Fixes issue removing override rule (#89136) --- .../dashboard-scene/panel-edit/PanelOptions.test.tsx | 8 ++++++++ .../features/dashboard-scene/panel-edit/PanelOptions.tsx | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard-scene/panel-edit/PanelOptions.test.tsx b/public/app/features/dashboard-scene/panel-edit/PanelOptions.test.tsx index 4e319506fa2..7376cd14568 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelOptions.test.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelOptions.test.tsx @@ -152,6 +152,14 @@ describe('PanelOptions', () => { expect(screen.queryByLabelText(overrideRuleTooltipDescription)).not.toBeInTheDocument(); }); + + it('Can delete rule', async () => { + const {} = setup(); + + await userEvent.click(screen.getByLabelText('Remove override')); + + expect(screen.queryByLabelText(overrideRuleTooltipDescription)).not.toBeInTheDocument(); + }); }); it('gets library panel options when the editing a library panel', async () => { diff --git a/public/app/features/dashboard-scene/panel-edit/PanelOptions.tsx b/public/app/features/dashboard-scene/panel-edit/PanelOptions.tsx index 590715a653a..11fae6fbb83 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelOptions.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelOptions.tsx @@ -62,7 +62,7 @@ export const PanelOptions = React.memo(({ vizManager, searchQuery, listMo data?.series ?? [], searchQuery, (newConfig) => { - panel.onFieldConfigChange(newConfig); + panel.onFieldConfigChange(newConfig, true); } ), // eslint-disable-next-line react-hooks/exhaustive-deps