From 5ccefed7d70c1047acdee2ceddc31b3ff89513d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sat, 4 Apr 2020 15:44:55 +0200 Subject: [PATCH] NewPanelEditor: Tab rename and minor fix --- public/app/core/services/keybindingSrv.ts | 1 + .../dashboard/components/PanelEditor/PanelEditor.tsx | 4 ++-- .../components/PanelEditor/PanelEditorTabs.tsx | 4 ++-- .../components/PanelEditor/state/selectors.ts | 12 ++++++------ .../dashboard/components/PanelEditor/types.ts | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/public/app/core/services/keybindingSrv.ts b/public/app/core/services/keybindingSrv.ts index f9276560746..0b8bead18e7 100644 --- a/public/app/core/services/keybindingSrv.ts +++ b/public/app/core/services/keybindingSrv.ts @@ -128,6 +128,7 @@ export class KeybindingSrv { if (search.editPanel) { delete search.editPanel; + delete search.tab; this.$location.search(search); return; } diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx index 402514bd69e..7705979b6c0 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx @@ -77,7 +77,7 @@ export class PanelEditorUnconnected extends PureComponent { onPanelExit = () => { this.props.updateLocation({ - query: { editPanel: null }, + query: { editPanel: null, tab: null }, partial: true, }); }; @@ -85,7 +85,7 @@ export class PanelEditorUnconnected extends PureComponent { onDiscard = () => { this.props.setDiscardChanges(true); this.props.updateLocation({ - query: { editPanel: null }, + query: { editPanel: null, tab: null }, partial: true, }); }; diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx index e09ee3eb784..2ee41c2e21c 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx @@ -46,9 +46,9 @@ export const PanelEditorTabs: React.FC = ({ panel, dashboa })} - {activeTab.id === PanelEditorTabId.Queries && } + {activeTab.id === PanelEditorTabId.Query && } {activeTab.id === PanelEditorTabId.Alert && } - {activeTab.id === PanelEditorTabId.Visualization && } + {activeTab.id === PanelEditorTabId.Visualize && } {activeTab.id === PanelEditorTabId.Transform && data.state !== LoadingState.NotStarted && (