mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
prepping go to visualization
This commit is contained in:
@@ -62,20 +62,21 @@ export class AddPanelWidget extends React.Component<Props, State> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
moveToEdit(panel) {
|
moveToEdit(panel, tab) {
|
||||||
reduxStore.dispatch(
|
reduxStore.dispatch(
|
||||||
updateLocation({
|
updateLocation({
|
||||||
query: {
|
query: {
|
||||||
panelId: panel.id,
|
panelId: panel.id,
|
||||||
edit: true,
|
edit: true,
|
||||||
fullscreen: true,
|
fullscreen: true,
|
||||||
|
tab: tab,
|
||||||
},
|
},
|
||||||
partial: true,
|
partial: true,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onCreateNewPanel = () => {
|
onCreateNewPanel = (tab = 'queries') => {
|
||||||
const dashboard = this.props.dashboard;
|
const dashboard = this.props.dashboard;
|
||||||
const { gridPos } = this.props.panel;
|
const { gridPos } = this.props.panel;
|
||||||
|
|
||||||
@@ -88,7 +89,7 @@ export class AddPanelWidget extends React.Component<Props, State> {
|
|||||||
dashboard.addPanel(newPanel);
|
dashboard.addPanel(newPanel);
|
||||||
dashboard.removePanel(this.props.panel);
|
dashboard.removePanel(this.props.panel);
|
||||||
|
|
||||||
this.moveToEdit(newPanel);
|
this.moveToEdit(newPanel, tab);
|
||||||
};
|
};
|
||||||
|
|
||||||
onPasteCopiedPanel = panelPluginInfo => {
|
onPasteCopiedPanel = panelPluginInfo => {
|
||||||
@@ -150,7 +151,7 @@ export class AddPanelWidget extends React.Component<Props, State> {
|
|||||||
</div>
|
</div>
|
||||||
<div className="add-panel-widget__btn-container">
|
<div className="add-panel-widget__btn-container">
|
||||||
{this.renderOptionLink('queries', 'Add query', this.onCreateNewPanel)}
|
{this.renderOptionLink('queries', 'Add query', this.onCreateNewPanel)}
|
||||||
{this.renderOptionLink('visualization', 'Choose Panel type', this.onCreateNewPanel)}
|
{this.renderOptionLink('visualization', 'Choose Panel type', () => this.onCreateNewPanel('visualization'))}
|
||||||
{this.renderOptionLink('queries', 'Convert to row', this.onCreateNewRow)}
|
{this.renderOptionLink('queries', 'Convert to row', this.onCreateNewRow)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import React, { PureComponent } from 'react';
|
|||||||
|
|
||||||
// Utils & Services
|
// Utils & Services
|
||||||
import { AngularComponent, getAngularLoader } from 'app/core/services/AngularLoader';
|
import { AngularComponent, getAngularLoader } from 'app/core/services/AngularLoader';
|
||||||
|
//TODO: See PanelEdit
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import { EditorTabBody, EditorToolbarView } from './EditorTabBody';
|
import { EditorTabBody, EditorToolbarView } from './EditorTabBody';
|
||||||
|
|||||||
Reference in New Issue
Block a user