Commit 5ccefed7 by Torkel Ödegaard

NewPanelEditor: Tab rename and minor fix

parent c4ba425d
...@@ -128,6 +128,7 @@ export class KeybindingSrv { ...@@ -128,6 +128,7 @@ export class KeybindingSrv {
if (search.editPanel) { if (search.editPanel) {
delete search.editPanel; delete search.editPanel;
delete search.tab;
this.$location.search(search); this.$location.search(search);
return; return;
} }
......
...@@ -77,7 +77,7 @@ export class PanelEditorUnconnected extends PureComponent<Props> { ...@@ -77,7 +77,7 @@ export class PanelEditorUnconnected extends PureComponent<Props> {
onPanelExit = () => { onPanelExit = () => {
this.props.updateLocation({ this.props.updateLocation({
query: { editPanel: null }, query: { editPanel: null, tab: null },
partial: true, partial: true,
}); });
}; };
...@@ -85,7 +85,7 @@ export class PanelEditorUnconnected extends PureComponent<Props> { ...@@ -85,7 +85,7 @@ export class PanelEditorUnconnected extends PureComponent<Props> {
onDiscard = () => { onDiscard = () => {
this.props.setDiscardChanges(true); this.props.setDiscardChanges(true);
this.props.updateLocation({ this.props.updateLocation({
query: { editPanel: null }, query: { editPanel: null, tab: null },
partial: true, partial: true,
}); });
}; };
......
...@@ -46,9 +46,9 @@ export const PanelEditorTabs: React.FC<PanelEditorTabsProps> = ({ panel, dashboa ...@@ -46,9 +46,9 @@ export const PanelEditorTabs: React.FC<PanelEditorTabsProps> = ({ panel, dashboa
})} })}
</TabsBar> </TabsBar>
<TabContent className={styles.tabContent}> <TabContent className={styles.tabContent}>
{activeTab.id === PanelEditorTabId.Queries && <QueriesTab panel={panel} dashboard={dashboard} />} {activeTab.id === PanelEditorTabId.Query && <QueriesTab panel={panel} dashboard={dashboard} />}
{activeTab.id === PanelEditorTabId.Alert && <AlertTab panel={panel} dashboard={dashboard} />} {activeTab.id === PanelEditorTabId.Alert && <AlertTab panel={panel} dashboard={dashboard} />}
{activeTab.id === PanelEditorTabId.Visualization && <VisualizationTab panel={panel} />} {activeTab.id === PanelEditorTabId.Visualize && <VisualizationTab panel={panel} />}
{activeTab.id === PanelEditorTabId.Transform && data.state !== LoadingState.NotStarted && ( {activeTab.id === PanelEditorTabId.Transform && data.state !== LoadingState.NotStarted && (
<TransformationsEditor <TransformationsEditor
transformations={panel.transformations || []} transformations={panel.transformations || []}
......
...@@ -10,14 +10,14 @@ export const getPanelEditorTabs = memoizeOne((location: LocationState, plugin?: ...@@ -10,14 +10,14 @@ export const getPanelEditorTabs = memoizeOne((location: LocationState, plugin?:
return tabs; return tabs;
} }
let defaultTab = PanelEditorTabId.Visualization; let defaultTab = PanelEditorTabId.Visualize;
if (!plugin.meta.skipDataQuery) { if (!plugin.meta.skipDataQuery) {
defaultTab = PanelEditorTabId.Queries; defaultTab = PanelEditorTabId.Query;
tabs.push({ tabs.push({
id: PanelEditorTabId.Queries, id: PanelEditorTabId.Query,
text: 'Queries', text: 'Query',
icon: 'gicon gicon-datasources', icon: 'gicon gicon-datasources',
active: false, active: false,
}); });
...@@ -31,8 +31,8 @@ export const getPanelEditorTabs = memoizeOne((location: LocationState, plugin?: ...@@ -31,8 +31,8 @@ export const getPanelEditorTabs = memoizeOne((location: LocationState, plugin?:
} }
tabs.push({ tabs.push({
id: PanelEditorTabId.Visualization, id: PanelEditorTabId.Visualize,
text: 'Visualization', text: 'Visualize',
icon: 'fa fa-bar-chart', icon: 'fa fa-bar-chart',
active: false, active: false,
}); });
......
...@@ -6,9 +6,9 @@ export interface PanelEditorTab { ...@@ -6,9 +6,9 @@ export interface PanelEditorTab {
} }
export enum PanelEditorTabId { export enum PanelEditorTabId {
Queries = 'queries', Query = 'Query',
Transform = 'transform', Transform = 'transform',
Visualization = 'visualization', Visualize = 'visualize',
Alert = 'alert', Alert = 'alert',
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment