mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
updated
This commit is contained in:
parent
be3b684140
commit
3c7e54461f
@ -2,11 +2,11 @@ import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { PanelModel } from '../panel_model';
|
||||
import { DashboardModel } from '../dashboard_model';
|
||||
import { store } from 'app/stores/store';
|
||||
import { observer } from 'mobx-react';
|
||||
import { store } from 'app/store/configureStore';
|
||||
import { QueriesTab } from './QueriesTab';
|
||||
import { PanelPlugin, PluginExports } from 'app/types/plugins';
|
||||
import { VizTypePicker } from './VizTypePicker';
|
||||
import { updateLocation } from 'app/core/actions';
|
||||
|
||||
interface PanelEditorProps {
|
||||
panel: PanelModel;
|
||||
@ -22,7 +22,6 @@ interface PanelEditorTab {
|
||||
icon: string;
|
||||
}
|
||||
|
||||
@observer
|
||||
export class PanelEditor extends React.Component<PanelEditorProps, any> {
|
||||
tabs: PanelEditorTab[];
|
||||
|
||||
@ -65,7 +64,11 @@ export class PanelEditor extends React.Component<PanelEditorProps, any> {
|
||||
}
|
||||
|
||||
onChangeTab = (tab: PanelEditorTab) => {
|
||||
store.view.updateQuery({ tab: tab.id }, false);
|
||||
store.dispatch(
|
||||
updateLocation({
|
||||
query: { tab: tab.id },
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
|
@ -2,7 +2,8 @@ import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { PanelModel } from '../panel_model';
|
||||
import { DashboardModel } from '../dashboard_model';
|
||||
import { store } from 'app/stores/store';
|
||||
import { store } from 'app/store/configureStore';
|
||||
import { updateLocation } from 'app/core/actions';
|
||||
|
||||
interface PanelHeaderProps {
|
||||
panel: PanelModel;
|
||||
@ -11,24 +12,26 @@ interface PanelHeaderProps {
|
||||
|
||||
export class PanelHeader extends React.Component<PanelHeaderProps, any> {
|
||||
onEditPanel = () => {
|
||||
store.view.updateQuery(
|
||||
{
|
||||
panelId: this.props.panel.id,
|
||||
edit: true,
|
||||
fullscreen: true,
|
||||
},
|
||||
false
|
||||
store.dispatch(
|
||||
updateLocation({
|
||||
query: {
|
||||
panelId: this.props.panel.id,
|
||||
edit: true,
|
||||
fullscreen: true,
|
||||
},
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
onViewPanel = () => {
|
||||
store.view.updateQuery(
|
||||
{
|
||||
panelId: this.props.panel.id,
|
||||
fullscreen: true,
|
||||
edit: false,
|
||||
},
|
||||
false
|
||||
store.dispatch(
|
||||
updateLocation({
|
||||
query: {
|
||||
panelId: this.props.panel.id,
|
||||
edit: false,
|
||||
fullscreen: true,
|
||||
},
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user