NewPanelEditor: Tab rename and minor fix

This commit is contained in:
Torkel Ödegaard 2020-04-04 15:44:55 +02:00
parent c4ba425d16
commit 5ccefed7d7
5 changed files with 13 additions and 12 deletions

View File

@ -128,6 +128,7 @@ export class KeybindingSrv {
if (search.editPanel) {
delete search.editPanel;
delete search.tab;
this.$location.search(search);
return;
}

View File

@ -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,
});
};

View File

@ -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 || []}

View File

@ -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,
});

View File

@ -6,9 +6,9 @@ export interface PanelEditorTab {
}
export enum PanelEditorTabId {
Queries = 'queries',
Query = 'Query',
Transform = 'transform',
Visualization = 'visualization',
Visualize = 'visualize',
Alert = 'alert',
}