Commit 70c80813 by Torkel Ödegaard

react panels wip

parent 682c792d
......@@ -19,8 +19,15 @@ interface PanelEditorTab {
@observer
export class PanelEditor extends React.Component<PanelEditorProps, any> {
tabs: PanelEditorTab[];
constructor(props) {
super(props);
this.tabs = [
{ id: 'queries', text: 'Queries', icon: 'fa fa-database' },
{ id: 'viz', text: 'Visualization', icon: 'fa fa-line-chart' },
];
}
renderQueriesTab() {
......@@ -37,16 +44,12 @@ export class PanelEditor extends React.Component<PanelEditorProps, any> {
render() {
const activeTab: string = store.view.query.get('tab') || 'queries';
const tabs: PanelEditorTab[] = [
{ id: 'queries', text: 'Queries', icon: 'fa fa-database' },
{ id: 'viz', text: 'Visualization', icon: 'fa fa-line-chart' },
];
return (
<div className="tabbed-view tabbed-view--panel-edit-new">
<div className="tabbed-view-header">
<ul className="gf-tabs">
{tabs.map(tab => {
{this.tabs.map(tab => {
return <TabItem tab={tab} activeTab={activeTab} onClick={this.onChangeTab} key={tab.id} />;
})}
</ul>
......
import React, { Component, ComponentClass } from 'react';
import _ from 'lodash';
export interface Props {
type: string;
queries: Query[];
}
interface State {
isLoading: boolean;
timeSeries: TimeSeriesServerResponse[];
}
export interface OriginalProps {
data: TimeSeriesServerResponse[];
isLoading: boolean;
}
const DataPanel = (ComposedComponent: ComponentClass<OriginalProps & Props>) => {
class Wrapper extends Component<Props, State> {}
return Wrapper;
};
......@@ -110,7 +110,6 @@ function pluginDirectiveLoader($compile, datasourceSrv, $rootScope, $q, $http, $
let datasource = scope.target.datasource || scope.ctrl.panel.datasource;
return datasourceSrv.get(datasource).then(ds => {
scope.datasource = ds;
console.log('scope', scope);
return importPluginModule(ds.meta.module).then(dsModule => {
return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment