mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -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) {
|
||||
delete search.editPanel;
|
||||
delete search.tab;
|
||||
this.$location.search(search);
|
||||
return;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ export class PanelEditorUnconnected extends PureComponent<Props> {
|
||||
|
||||
onPanelExit = () => {
|
||||
this.props.updateLocation({
|
||||
query: { editPanel: null },
|
||||
query: { editPanel: null, tab: null },
|
||||
partial: true,
|
||||
});
|
||||
};
|
||||
@ -85,7 +85,7 @@ export class PanelEditorUnconnected extends PureComponent<Props> {
|
||||
onDiscard = () => {
|
||||
this.props.setDiscardChanges(true);
|
||||
this.props.updateLocation({
|
||||
query: { editPanel: null },
|
||||
query: { editPanel: null, tab: null },
|
||||
partial: true,
|
||||
});
|
||||
};
|
||||
|
@ -46,9 +46,9 @@ export const PanelEditorTabs: React.FC<PanelEditorTabsProps> = ({ panel, dashboa
|
||||
})}
|
||||
</TabsBar>
|
||||
<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.Visualization && <VisualizationTab panel={panel} />}
|
||||
{activeTab.id === PanelEditorTabId.Visualize && <VisualizationTab panel={panel} />}
|
||||
{activeTab.id === PanelEditorTabId.Transform && data.state !== LoadingState.NotStarted && (
|
||||
<TransformationsEditor
|
||||
transformations={panel.transformations || []}
|
||||
|
@ -10,14 +10,14 @@ export const getPanelEditorTabs = memoizeOne((location: LocationState, plugin?:
|
||||
return tabs;
|
||||
}
|
||||
|
||||
let defaultTab = PanelEditorTabId.Visualization;
|
||||
let defaultTab = PanelEditorTabId.Visualize;
|
||||
|
||||
if (!plugin.meta.skipDataQuery) {
|
||||
defaultTab = PanelEditorTabId.Queries;
|
||||
defaultTab = PanelEditorTabId.Query;
|
||||
|
||||
tabs.push({
|
||||
id: PanelEditorTabId.Queries,
|
||||
text: 'Queries',
|
||||
id: PanelEditorTabId.Query,
|
||||
text: 'Query',
|
||||
icon: 'gicon gicon-datasources',
|
||||
active: false,
|
||||
});
|
||||
@ -31,8 +31,8 @@ export const getPanelEditorTabs = memoizeOne((location: LocationState, plugin?:
|
||||
}
|
||||
|
||||
tabs.push({
|
||||
id: PanelEditorTabId.Visualization,
|
||||
text: 'Visualization',
|
||||
id: PanelEditorTabId.Visualize,
|
||||
text: 'Visualize',
|
||||
icon: 'fa fa-bar-chart',
|
||||
active: false,
|
||||
});
|
||||
|
@ -6,9 +6,9 @@ export interface PanelEditorTab {
|
||||
}
|
||||
|
||||
export enum PanelEditorTabId {
|
||||
Queries = 'queries',
|
||||
Query = 'Query',
|
||||
Transform = 'transform',
|
||||
Visualization = 'visualization',
|
||||
Visualize = 'visualize',
|
||||
Alert = 'alert',
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user