From 474185c977b8721710becb468ab26feb12fbf368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 31 Jan 2019 08:37:15 +0100 Subject: [PATCH] Moved a few things around --- .../DashboardRow}/DashboardRow.test.tsx | 4 ++-- .../DashboardRow}/DashboardRow.tsx | 4 ++-- .../dashboard/components/DashboardRow/index.ts | 1 + .../{dashboard_ctrl.ts => containers/DashboardCtrl.ts} | 4 ++-- .../app/features/dashboard/dashgrid/DashboardPanel.tsx | 2 +- public/app/features/dashboard/index.ts | 2 +- public/app/routes/ReactContainer.tsx | 10 +--------- public/sass/components/_view_states.scss | 1 + 8 files changed, 11 insertions(+), 17 deletions(-) rename public/app/features/dashboard/{specs => components/DashboardRow}/DashboardRow.test.tsx (93%) rename public/app/features/dashboard/{dashgrid => components/DashboardRow}/DashboardRow.tsx (96%) create mode 100644 public/app/features/dashboard/components/DashboardRow/index.ts rename public/app/features/dashboard/{dashboard_ctrl.ts => containers/DashboardCtrl.ts} (97%) diff --git a/public/app/features/dashboard/specs/DashboardRow.test.tsx b/public/app/features/dashboard/components/DashboardRow/DashboardRow.test.tsx similarity index 93% rename from public/app/features/dashboard/specs/DashboardRow.test.tsx rename to public/app/features/dashboard/components/DashboardRow/DashboardRow.test.tsx index 77c6cb39d9d..3e8c9b11159 100644 --- a/public/app/features/dashboard/specs/DashboardRow.test.tsx +++ b/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; diff --git a/public/app/features/dashboard/dashgrid/DashboardRow.tsx b/public/app/features/dashboard/components/DashboardRow/DashboardRow.tsx similarity index 96% rename from public/app/features/dashboard/dashgrid/DashboardRow.tsx rename to public/app/features/dashboard/components/DashboardRow/DashboardRow.tsx index 5b8ced9b2b1..22feac4f99c 100644 --- a/public/app/features/dashboard/dashgrid/DashboardRow.tsx +++ b/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'; diff --git a/public/app/features/dashboard/components/DashboardRow/index.ts b/public/app/features/dashboard/components/DashboardRow/index.ts new file mode 100644 index 00000000000..3f71e03c80c --- /dev/null +++ b/public/app/features/dashboard/components/DashboardRow/index.ts @@ -0,0 +1 @@ +export { DashboardRow } from './DashboardRow'; diff --git a/public/app/features/dashboard/dashboard_ctrl.ts b/public/app/features/dashboard/containers/DashboardCtrl.ts similarity index 97% rename from public/app/features/dashboard/dashboard_ctrl.ts rename to public/app/features/dashboard/containers/DashboardCtrl.ts index 5c4480dbad5..d28c8acd830 100644 --- a/public/app/features/dashboard/dashboard_ctrl.ts +++ b/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; diff --git a/public/app/features/dashboard/dashgrid/DashboardPanel.tsx b/public/app/features/dashboard/dashgrid/DashboardPanel.tsx index cfff64cb042..4838405e91b 100644 --- a/public/app/features/dashboard/dashgrid/DashboardPanel.tsx +++ b/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'; diff --git a/public/app/features/dashboard/index.ts b/public/app/features/dashboard/index.ts index efa54f0ee07..750fdc25247 100644 --- a/public/app/features/dashboard/index.ts +++ b/public/app/features/dashboard/index.ts @@ -1,4 +1,4 @@ -import './dashboard_ctrl'; +import './containers/DashboardCtrl'; import './time_srv'; import './dashgrid/DashboardGridDirective'; diff --git a/public/app/routes/ReactContainer.tsx b/public/app/routes/ReactContainer.tsx index 807608e6960..19cdff03b69 100644 --- a/public/app/routes/ReactContainer.tsx +++ b/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]); diff --git a/public/sass/components/_view_states.scss b/public/sass/components/_view_states.scss index b92bd596193..518d5d0f446 100644 --- a/public/sass/components/_view_states.scss +++ b/public/sass/components/_view_states.scss @@ -50,3 +50,4 @@ display: none; } } +