Ver código fonte

Moved a few things around

Torkel Ödegaard 6 anos atrás
pai
commit
474185c977

+ 2 - 2
public/app/features/dashboard/specs/DashboardRow.test.tsx → public/app/features/dashboard/components/DashboardRow/DashboardRow.test.tsx

@@ -1,7 +1,7 @@
 import React from 'react';
 import { shallow } from 'enzyme';
-import { DashboardRow } from '../dashgrid/DashboardRow';
-import { PanelModel } from '../panel_model';
+import { DashboardRow } from './DashboardRow';
+import { PanelModel } from '../../panel_model';
 
 describe('DashboardRow', () => {
   let wrapper, panel, dashboardMock;

+ 2 - 2
public/app/features/dashboard/dashgrid/DashboardRow.tsx → public/app/features/dashboard/components/DashboardRow/DashboardRow.tsx

@@ -1,7 +1,7 @@
 import React from 'react';
 import classNames from 'classnames';
-import { PanelModel } from '../panel_model';
-import { DashboardModel } from '../dashboard_model';
+import { PanelModel } from '../../panel_model';
+import { DashboardModel } from '../../dashboard_model';
 import templateSrv from 'app/features/templating/template_srv';
 import appEvents from 'app/core/app_events';
 

+ 1 - 0
public/app/features/dashboard/components/DashboardRow/index.ts

@@ -0,0 +1 @@
+export { DashboardRow } from './DashboardRow';

+ 2 - 2
public/app/features/dashboard/dashboard_ctrl.ts → public/app/features/dashboard/containers/DashboardCtrl.ts

@@ -5,10 +5,10 @@ import coreModule from 'app/core/core_module';
 import { removePanel } from 'app/features/dashboard/utils/panel';
 
 // Services
-import { AnnotationsSrv } from '../annotations/annotations_srv';
+import { AnnotationsSrv } from '../../annotations/annotations_srv';
 
 // Types
-import { DashboardModel } from './dashboard_model';
+import { DashboardModel } from '../dashboard_model';
 
 export class DashboardCtrl {
   dashboard: DashboardModel;

+ 1 - 1
public/app/features/dashboard/dashgrid/DashboardPanel.tsx

@@ -7,7 +7,7 @@ import { importPluginModule } from 'app/features/plugins/plugin_loader';
 
 import { AddPanelWidget } from '../components/AddPanelWidget';
 import { getPanelPluginNotFound } from './PanelPluginNotFound';
-import { DashboardRow } from './DashboardRow';
+import { DashboardRow } from '../components/DashboardRow';
 import { PanelChrome } from './PanelChrome';
 import { PanelEditor } from '../panel_editor/PanelEditor';
 

+ 1 - 1
public/app/features/dashboard/index.ts

@@ -1,4 +1,4 @@
-import './dashboard_ctrl';
+import './containers/DashboardCtrl';
 import './time_srv';
 import './dashgrid/DashboardGridDirective';
 

+ 1 - 9
public/app/routes/ReactContainer.tsx

@@ -4,8 +4,6 @@ import { Provider } from 'react-redux';
 
 import coreModule from 'app/core/core_module';
 import { store } from 'app/store/store';
-import { BackendSrv } from 'app/core/services/backend_srv';
-import { DatasourceSrv } from 'app/features/plugins/datasource_srv';
 import { ContextSrv } from 'app/core/services/context_srv';
 
 function WrapInProvider(store, Component, props) {
@@ -20,8 +18,6 @@ function WrapInProvider(store, Component, props) {
 export function reactContainer(
   $route,
   $location,
-  backendSrv: BackendSrv,
-  datasourceSrv: DatasourceSrv,
   contextSrv: ContextSrv
 ) {
   return {
@@ -42,11 +38,7 @@ export function reactContainer(
         component = component.default;
       }
 
-      const props = {
-        backendSrv: backendSrv,
-        datasourceSrv: datasourceSrv,
-        routeParams: $route.current.params,
-      };
+      const props = { };
 
       ReactDOM.render(WrapInProvider(store, component, props), elem[0]);
 

+ 1 - 0
public/sass/components/_view_states.scss

@@ -50,3 +50,4 @@
     display: none;
   }
 }
+