mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
NewPanelEditor: Tab rename and minor fix
This commit is contained in:
parent
c4ba425d16
commit
5ccefed7d7
@ -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> {
|
|||||||
|
|
||||||
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> {
|
|||||||
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
|
|||||||
})}
|
})}
|
||||||
</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?:
|
|||||||
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?:
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export enum PanelEditorTabId {
|
export enum PanelEditorTabId {
|
||||||
Queries = 'queries',
|
Query = 'Query',
|
||||||
Transform = 'transform',
|
Transform = 'transform',
|
||||||
Visualization = 'visualization',
|
Visualize = 'visualize',
|
||||||
Alert = 'alert',
|
Alert = 'alert',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user