Parcourir la source

Moved dashboard state components to state folder

Torkel Ödegaard il y a 6 ans
Parent
commit
aafd4a339a
50 fichiers modifiés avec 66 ajouts et 66 suppressions
  1. 1 1
      public/app/core/services/backend_srv.ts
  2. 2 2
      public/app/features/alerting/AlertTab.tsx
  3. 1 1
      public/app/features/alerting/StateHistory.tsx
  4. 1 1
      public/app/features/alerting/TestRuleResult.test.tsx
  5. 1 1
      public/app/features/alerting/TestRuleResult.tsx
  6. 1 1
      public/app/features/annotations/annotations_srv.ts
  7. 2 2
      public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx
  8. 1 1
      public/app/features/dashboard/components/DashExportModal/DashboardExporter.test.ts
  9. 1 1
      public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts
  10. 1 1
      public/app/features/dashboard/components/DashNav/DashNavCtrl.ts
  11. 1 1
      public/app/features/dashboard/components/DashboardRow/DashboardRow.test.tsx
  12. 2 2
      public/app/features/dashboard/components/DashboardRow/DashboardRow.tsx
  13. 1 1
      public/app/features/dashboard/components/DashboardSettings/SettingsCtrl.ts
  14. 1 1
      public/app/features/dashboard/components/VersionHistory/HistoryListCtrl.ts
  15. 1 1
      public/app/features/dashboard/components/VersionHistory/HistorySrv.test.ts
  16. 1 1
      public/app/features/dashboard/components/VersionHistory/HistorySrv.ts
  17. 1 1
      public/app/features/dashboard/containers/DashboardCtrl.ts
  18. 1 2
      public/app/features/dashboard/dashgrid/DashboardGrid.tsx
  19. 1 2
      public/app/features/dashboard/dashgrid/DashboardPanel.tsx
  20. 2 2
      public/app/features/dashboard/dashgrid/PanelChrome.tsx
  21. 2 2
      public/app/features/dashboard/dashgrid/PanelHeader/PanelHeader.tsx
  22. 1 1
      public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderCorner.tsx
  23. 2 2
      public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenu.tsx
  24. 1 1
      public/app/features/dashboard/dashgrid/PanelResizer.tsx
  25. 1 1
      public/app/features/dashboard/panel_editor/GeneralTab.tsx
  26. 2 2
      public/app/features/dashboard/panel_editor/PanelEditor.tsx
  27. 2 2
      public/app/features/dashboard/panel_editor/QueriesTab.tsx
  28. 1 1
      public/app/features/dashboard/panel_editor/QueryEditorRow.tsx
  29. 1 1
      public/app/features/dashboard/panel_editor/QueryOptions.tsx
  30. 2 2
      public/app/features/dashboard/panel_editor/VisualizationTab.tsx
  31. 2 2
      public/app/features/dashboard/services/ChangeTracker.test.ts
  32. 1 1
      public/app/features/dashboard/services/ChangeTracker.ts
  33. 1 1
      public/app/features/dashboard/services/DashboardSrv.ts
  34. 1 1
      public/app/features/dashboard/services/DashboardViewStateSrv.test.ts
  35. 1 1
      public/app/features/dashboard/services/DashboardViewStateSrv.ts
  36. 2 2
      public/app/features/dashboard/state/DashboardMigrator.test.ts
  37. 2 2
      public/app/features/dashboard/state/DashboardMigrator.ts
  38. 1 1
      public/app/features/dashboard/state/DashboardModel.repeat.test.ts
  39. 2 2
      public/app/features/dashboard/state/DashboardModel.test.ts
  40. 2 2
      public/app/features/dashboard/state/DashboardModel.ts
  41. 1 1
      public/app/features/dashboard/state/PanelModel.test.ts
  42. 0 0
      public/app/features/dashboard/state/PanelModel.ts
  43. 2 0
      public/app/features/dashboard/state/index.ts
  44. 2 2
      public/app/features/dashboard/utils/getPanelMenu.ts
  45. 2 2
      public/app/features/dashboard/utils/panel.ts
  46. 1 1
      public/app/features/panel/specs/metrics_panel_ctrl.test.ts
  47. 1 1
      public/app/features/templating/specs/variable_srv.test.ts
  48. 1 1
      public/app/features/templating/specs/variable_srv_init.test.ts
  49. 1 1
      public/app/features/templating/variable_srv.ts
  50. 1 1
      public/test/specs/helpers.ts

+ 1 - 1
public/app/core/services/backend_srv.ts

@@ -1,7 +1,7 @@
 import _ from 'lodash';
 import coreModule from 'app/core/core_module';
 import appEvents from 'app/core/app_events';
-import { DashboardModel } from 'app/features/dashboard/dashboard_model';
+import { DashboardModel } from 'app/features/dashboard/state/DashboardModel';
 
 export class BackendSrv {
   private inFlightRequests = {};

+ 2 - 2
public/app/features/alerting/AlertTab.tsx

@@ -12,8 +12,8 @@ import StateHistory from './StateHistory';
 import 'app/features/alerting/AlertTabCtrl';
 
 // Types
-import { DashboardModel } from '../dashboard/dashboard_model';
-import { PanelModel } from '../dashboard/panel_model';
+import { DashboardModel } from '../dashboard/state/DashboardModel';
+import { PanelModel } from '../dashboard/state/PanelModel';
 import { TestRuleResult } from './TestRuleResult';
 
 interface Props {

+ 1 - 1
public/app/features/alerting/StateHistory.tsx

@@ -1,7 +1,7 @@
 import React, { PureComponent } from 'react';
 import alertDef from './state/alertDef';
 import { getBackendSrv } from 'app/core/services/backend_srv';
-import { DashboardModel } from '../dashboard/dashboard_model';
+import { DashboardModel } from '../dashboard/state/DashboardModel';
 import appEvents from '../../core/app_events';
 
 interface Props {

+ 1 - 1
public/app/features/alerting/TestRuleResult.test.tsx

@@ -1,6 +1,6 @@
 import React from 'react';
 import { shallow } from 'enzyme';
-import { DashboardModel } from '../dashboard/dashboard_model';
+import { DashboardModel } from '../dashboard/state/DashboardModel';
 import { Props, TestRuleResult } from './TestRuleResult';
 
 jest.mock('app/core/services/backend_srv', () => ({

+ 1 - 1
public/app/features/alerting/TestRuleResult.tsx

@@ -1,7 +1,7 @@
 import React, { PureComponent } from 'react';
 import { JSONFormatter } from 'app/core/components/JSONFormatter/JSONFormatter';
 import { getBackendSrv } from 'app/core/services/backend_srv';
-import { DashboardModel } from '../dashboard/dashboard_model';
+import { DashboardModel } from '../dashboard/state/DashboardModel';
 import { LoadingPlaceholder } from '@grafana/ui/src';
 
 export interface Props {

+ 1 - 1
public/app/features/annotations/annotations_srv.ts

@@ -10,7 +10,7 @@ import coreModule from 'app/core/core_module';
 import { makeRegions, dedupAnnotations } from './events_processing';
 
 // Types
-import { DashboardModel } from '../dashboard/dashboard_model';
+import { DashboardModel } from '../dashboard/state/DashboardModel';
 
 export class AnnotationsSrv {
   globalAnnotationsPromise: any;

+ 2 - 2
public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx

@@ -1,8 +1,8 @@
 import React from 'react';
 import _ from 'lodash';
 import config from 'app/core/config';
-import { PanelModel } from '../../panel_model';
-import { DashboardModel } from '../../dashboard_model';
+import { PanelModel } from '../../state/PanelModel';
+import { DashboardModel } from '../../state/DashboardModel';
 import store from 'app/core/store';
 import { LS_PANEL_COPY_KEY } from 'app/core/constants';
 import { updateLocation } from 'app/core/actions';

+ 1 - 1
public/app/features/dashboard/components/DashExportModal/DashboardExporter.test.ts

@@ -7,7 +7,7 @@ jest.mock('app/core/store', () => {
 import _ from 'lodash';
 import config from 'app/core/config';
 import { DashboardExporter } from './DashboardExporter';
-import { DashboardModel } from '../../dashboard_model';
+import { DashboardModel } from '../../state/DashboardModel';
 
 describe('given dashboard with repeated panels', () => {
   let dash, exported;

+ 1 - 1
public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts

@@ -1,6 +1,6 @@
 import config from 'app/core/config';
 import _ from 'lodash';
-import { DashboardModel } from '../../dashboard_model';
+import { DashboardModel } from '../../state/DashboardModel';
 
 export class DashboardExporter {
   constructor(private datasourceSrv) {}

+ 1 - 1
public/app/features/dashboard/components/DashNav/DashNavCtrl.ts

@@ -1,7 +1,7 @@
 import moment from 'moment';
 import angular from 'angular';
 import { appEvents, NavModel } from 'app/core/core';
-import { DashboardModel } from '../../dashboard_model';
+import { DashboardModel } from '../../state/DashboardModel';
 
 export class DashNavCtrl {
   dashboard: DashboardModel;

+ 1 - 1
public/app/features/dashboard/components/DashboardRow/DashboardRow.test.tsx

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

+ 2 - 2
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 '../../state/PanelModel';
+import { DashboardModel } from '../../state/DashboardModel';
 import templateSrv from 'app/features/templating/template_srv';
 import appEvents from 'app/core/app_events';
 

+ 1 - 1
public/app/features/dashboard/components/DashboardSettings/SettingsCtrl.ts

@@ -1,5 +1,5 @@
 import { coreModule, appEvents, contextSrv } from 'app/core/core';
-import { DashboardModel } from '../../dashboard_model';
+import { DashboardModel } from '../../state/DashboardModel';
 import $ from 'jquery';
 import _ from 'lodash';
 import angular from 'angular';

+ 1 - 1
public/app/features/dashboard/components/VersionHistory/HistoryListCtrl.ts

@@ -3,7 +3,7 @@ import angular from 'angular';
 import moment from 'moment';
 
 import locationUtil from 'app/core/utils/location_util';
-import { DashboardModel } from '../../dashboard_model';
+import { DashboardModel } from '../../state/DashboardModel';
 import { HistoryListOpts, RevisionsModel, CalculateDiffOptions, HistorySrv } from './HistorySrv';
 
 export class HistoryListCtrl {

+ 1 - 1
public/app/features/dashboard/components/VersionHistory/HistorySrv.test.ts

@@ -1,6 +1,6 @@
 import { versions, restore } from './__mocks__/history';
 import { HistorySrv } from './HistorySrv';
-import { DashboardModel } from '../../dashboard_model';
+import { DashboardModel } from '../../state/DashboardModel';
 jest.mock('app/core/store');
 
 describe('historySrv', () => {

+ 1 - 1
public/app/features/dashboard/components/VersionHistory/HistorySrv.ts

@@ -1,6 +1,6 @@
 import _ from 'lodash';
 import coreModule from 'app/core/core_module';
-import { DashboardModel } from '../../dashboard_model';
+import { DashboardModel } from '../../state/DashboardModel';
 
 export interface HistoryListOpts {
   limit: number;

+ 1 - 1
public/app/features/dashboard/containers/DashboardCtrl.ts

@@ -8,7 +8,7 @@ import { removePanel } from 'app/features/dashboard/utils/panel';
 import { AnnotationsSrv } from '../../annotations/annotations_srv';
 
 // Types
-import { DashboardModel } from '../dashboard_model';
+import { DashboardModel } from '../state/DashboardModel';
 
 export class DashboardCtrl {
   dashboard: DashboardModel;

+ 1 - 2
public/app/features/dashboard/dashgrid/DashboardGrid.tsx

@@ -3,8 +3,7 @@ import { hot } from 'react-hot-loader';
 import ReactGridLayout, { ItemCallback } from 'react-grid-layout';
 import { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN, GRID_COLUMN_COUNT } from 'app/core/constants';
 import { DashboardPanel } from './DashboardPanel';
-import { DashboardModel } from '../dashboard_model';
-import { PanelModel } from '../panel_model';
+import { DashboardModel, PanelModel } from '../state';
 import classNames from 'classnames';
 import sizeMe from 'react-sizeme';
 

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

@@ -11,8 +11,7 @@ import { DashboardRow } from '../components/DashboardRow';
 import { PanelChrome } from './PanelChrome';
 import { PanelEditor } from '../panel_editor/PanelEditor';
 
-import { PanelModel } from '../panel_model';
-import { DashboardModel } from '../dashboard_model';
+import { PanelModel, DashboardModel } from '../state';
 import { PanelPlugin } from 'app/types';
 import { PanelResizer } from './PanelResizer';
 

+ 2 - 2
public/app/features/dashboard/dashgrid/PanelChrome.tsx

@@ -14,8 +14,8 @@ import { applyPanelTimeOverrides } from 'app/features/dashboard/utils/panel';
 import { PANEL_HEADER_HEIGHT } from 'app/core/constants';
 
 // Types
-import { PanelModel } from '../panel_model';
-import { DashboardModel } from '../dashboard_model';
+import { PanelModel } from '../state/PanelModel';
+import { DashboardModel } from '../state/DashboardModel';
 import { PanelPlugin } from 'app/types';
 import { TimeRange } from '@grafana/ui';
 

+ 2 - 2
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeader.tsx

@@ -6,8 +6,8 @@ import PanelHeaderCorner from './PanelHeaderCorner';
 import { PanelHeaderMenu } from './PanelHeaderMenu';
 import templateSrv from 'app/features/templating/template_srv';
 
-import { DashboardModel } from 'app/features/dashboard/dashboard_model';
-import { PanelModel } from 'app/features/dashboard/panel_model';
+import { DashboardModel } from 'app/features/dashboard/state/DashboardModel';
+import { PanelModel } from 'app/features/dashboard/state/PanelModel';
 import { ClickOutsideWrapper } from 'app/core/components/ClickOutsideWrapper/ClickOutsideWrapper';
 
 export interface Props {

+ 1 - 1
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderCorner.tsx

@@ -1,7 +1,7 @@
 import React, { Component } from 'react';
 import Remarkable from 'remarkable';
 import { Tooltip } from '@grafana/ui';
-import { PanelModel } from 'app/features/dashboard/panel_model';
+import { PanelModel } from 'app/features/dashboard/state/PanelModel';
 import templateSrv from 'app/features/templating/template_srv';
 import { LinkSrv } from 'app/features/panel/panellinks/link_srv';
 import { getTimeSrv, TimeSrv } from 'app/features/dashboard/services/TimeSrv';

+ 2 - 2
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenu.tsx

@@ -1,6 +1,6 @@
 import React, { PureComponent } from 'react';
-import { DashboardModel } from 'app/features/dashboard/dashboard_model';
-import { PanelModel } from 'app/features/dashboard/panel_model';
+import { DashboardModel } from 'app/features/dashboard/state/DashboardModel';
+import { PanelModel } from 'app/features/dashboard/state/PanelModel';
 import { PanelHeaderMenuItem } from './PanelHeaderMenuItem';
 import { getPanelMenu } from 'app/features/dashboard/utils/getPanelMenu';
 import { PanelMenuItem } from '@grafana/ui';

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

@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
 import { throttle } from 'lodash';
 import Draggable, { DraggableEventHandler } from 'react-draggable';
 
-import { PanelModel } from '../panel_model';
+import { PanelModel } from '../state/PanelModel';
 
 interface Props {
   isEditing: boolean;

+ 1 - 1
public/app/features/dashboard/panel_editor/GeneralTab.tsx

@@ -3,7 +3,7 @@ import React, { PureComponent } from 'react';
 import { getAngularLoader, AngularComponent } from 'app/core/services/AngularLoader';
 import { EditorTabBody } from './EditorTabBody';
 
-import { PanelModel } from '../panel_model';
+import { PanelModel } from '../state/PanelModel';
 import './../../panel/GeneralTabCtrl';
 
 interface Props {

+ 2 - 2
public/app/features/dashboard/panel_editor/PanelEditor.tsx

@@ -11,8 +11,8 @@ import { store } from 'app/store/store';
 import { updateLocation } from 'app/core/actions';
 import { AngularComponent } from 'app/core/services/AngularLoader';
 
-import { PanelModel } from '../panel_model';
-import { DashboardModel } from '../dashboard_model';
+import { PanelModel } from '../state/PanelModel';
+import { DashboardModel } from '../state/DashboardModel';
 import { PanelPlugin } from 'app/types/plugins';
 
 import { Tooltip } from '@grafana/ui';

+ 2 - 2
public/app/features/dashboard/panel_editor/QueriesTab.tsx

@@ -16,8 +16,8 @@ import { BackendSrv, getBackendSrv } from 'app/core/services/backend_srv';
 import config from 'app/core/config';
 
 // Types
-import { PanelModel } from '../panel_model';
-import { DashboardModel } from '../dashboard_model';
+import { PanelModel } from '../state/PanelModel';
+import { DashboardModel } from '../state/DashboardModel';
 import { DataQuery, DataSourceSelectItem } from '@grafana/ui/src/types';
 import { PluginHelp } from 'app/core/components/PluginHelp/PluginHelp';
 

+ 1 - 1
public/app/features/dashboard/panel_editor/QueryEditorRow.tsx

@@ -9,7 +9,7 @@ import { AngularComponent, getAngularLoader } from 'app/core/services/AngularLoa
 import { Emitter } from 'app/core/utils/emitter';
 
 // Types
-import { PanelModel } from '../panel_model';
+import { PanelModel } from '../state/PanelModel';
 import { DataQuery, DataSourceApi } from '@grafana/ui';
 
 interface Props {

+ 1 - 1
public/app/features/dashboard/panel_editor/QueryOptions.tsx

@@ -13,7 +13,7 @@ import DataSourceOption from './DataSourceOption';
 import { FormLabel } from '@grafana/ui';
 
 // Types
-import { PanelModel } from '../panel_model';
+import { PanelModel } from '../state/PanelModel';
 import { DataSourceSelectItem } from '@grafana/ui/src/types';
 import { ValidationEvents } from 'app/types';
 

+ 2 - 2
public/app/features/dashboard/panel_editor/VisualizationTab.tsx

@@ -11,8 +11,8 @@ import { PluginHelp } from 'app/core/components/PluginHelp/PluginHelp';
 import { FadeIn } from 'app/core/components/Animations/FadeIn';
 
 // Types
-import { PanelModel } from '../panel_model';
-import { DashboardModel } from '../dashboard_model';
+import { PanelModel } from '../state/PanelModel';
+import { DashboardModel } from '../state/DashboardModel';
 import { PanelPlugin } from 'app/types/plugins';
 
 interface Props {

+ 2 - 2
public/app/features/dashboard/services/ChangeTracker.test.ts

@@ -1,7 +1,7 @@
 import { ChangeTracker } from './ChangeTracker';
 import { contextSrv } from 'app/core/services/context_srv';
-import { DashboardModel } from '../dashboard_model';
-import { PanelModel } from '../panel_model';
+import { DashboardModel } from '../state/DashboardModel';
+import { PanelModel } from '../state/PanelModel';
 
 jest.mock('app/core/services/context_srv', () => ({
   contextSrv: {

+ 1 - 1
public/app/features/dashboard/services/ChangeTracker.ts

@@ -1,6 +1,6 @@
 import angular from 'angular';
 import _ from 'lodash';
-import { DashboardModel } from '../dashboard_model';
+import { DashboardModel } from '../state/DashboardModel';
 
 export class ChangeTracker {
   current: any;

+ 1 - 1
public/app/features/dashboard/services/DashboardSrv.ts

@@ -1,5 +1,5 @@
 import coreModule from 'app/core/core_module';
-import { DashboardModel } from '../dashboard_model';
+import { DashboardModel } from '../state/DashboardModel';
 import locationUtil from 'app/core/utils/location_util';
 
 export class DashboardSrv {

+ 1 - 1
public/app/features/dashboard/services/DashboardViewStateSrv.test.ts

@@ -1,6 +1,6 @@
 import config from 'app/core/config';
 import { DashboardViewStateSrv } from './DashboardViewStateSrv';
-import { DashboardModel } from '../dashboard_model';
+import { DashboardModel } from '../state/DashboardModel';
 
 describe('when updating view state', () => {
   const location = {

+ 1 - 1
public/app/features/dashboard/services/DashboardViewStateSrv.ts

@@ -2,7 +2,7 @@ import angular from 'angular';
 import _ from 'lodash';
 import config from 'app/core/config';
 import appEvents from 'app/core/app_events';
-import { DashboardModel } from '../dashboard_model';
+import { DashboardModel } from '../state/DashboardModel';
 
 // represents the transient view state
 // like fullscreen panel & edit

+ 2 - 2
public/app/features/dashboard/specs/dashboard_migration.test.ts → public/app/features/dashboard/state/DashboardMigrator.test.ts

@@ -1,6 +1,6 @@
 import _ from 'lodash';
-import { DashboardModel } from '../dashboard_model';
-import { PanelModel } from '../panel_model';
+import { DashboardModel } from '../state/DashboardModel';
+import { PanelModel } from '../state/PanelModel';
 import { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN } from 'app/core/constants';
 import { expect } from 'test/lib/common';
 

+ 2 - 2
public/app/features/dashboard/dashboard_migration.ts → public/app/features/dashboard/state/DashboardMigrator.ts

@@ -7,8 +7,8 @@ import {
   MIN_PANEL_HEIGHT,
   DEFAULT_PANEL_SPAN,
 } from 'app/core/constants';
-import { PanelModel } from './panel_model';
-import { DashboardModel } from './dashboard_model';
+import { PanelModel } from './PanelModel';
+import { DashboardModel } from './DashboardModel';
 import getFactors from 'app/core/utils/factors';
 
 export class DashboardMigrator {

+ 1 - 1
public/app/features/dashboard/specs/repeat.test.ts → public/app/features/dashboard/state/DashboardModel.repeat.test.ts

@@ -1,5 +1,5 @@
 import _ from 'lodash';
-import { DashboardModel } from '../dashboard_model';
+import { DashboardModel } from '../state/DashboardModel';
 import { expect } from 'test/lib/common';
 
 jest.mock('app/core/services/context_srv', () => ({}));

+ 2 - 2
public/app/features/dashboard/specs/dashboard_model.test.ts → public/app/features/dashboard/state/DashboardModel.test.ts

@@ -1,6 +1,6 @@
 import _ from 'lodash';
-import { DashboardModel } from '../dashboard_model';
-import { PanelModel } from '../panel_model';
+import { DashboardModel } from '../state/DashboardModel';
+import { PanelModel } from '../state/PanelModel';
 
 jest.mock('app/core/services/context_srv', () => ({}));
 

+ 2 - 2
public/app/features/dashboard/dashboard_model.ts → public/app/features/dashboard/state/DashboardModel.ts

@@ -7,8 +7,8 @@ import { Emitter } from 'app/core/utils/emitter';
 import { contextSrv } from 'app/core/services/context_srv';
 import sortByKeys from 'app/core/utils/sort_by_keys';
 
-import { PanelModel } from './panel_model';
-import { DashboardMigrator } from './dashboard_migration';
+import { PanelModel } from './PanelModel';
+import { DashboardMigrator } from './DashboardMigrator';
 import { TimeRange } from '@grafana/ui/src';
 
 export class DashboardModel {

+ 1 - 1
public/app/features/dashboard/specs/panel_model.test.ts → public/app/features/dashboard/state/PanelModel.test.ts

@@ -1,5 +1,5 @@
 import _ from 'lodash';
-import { PanelModel } from '../panel_model';
+import { PanelModel } from '../state/PanelModel';
 
 describe('PanelModel', () => {
   describe('when creating new panel model', () => {

+ 0 - 0
public/app/features/dashboard/panel_model.ts → public/app/features/dashboard/state/PanelModel.ts


+ 2 - 0
public/app/features/dashboard/state/index.ts

@@ -0,0 +1,2 @@
+export { DashboardModel } from './DashboardModel';
+export { PanelModel } from './PanelModel';

+ 2 - 2
public/app/features/dashboard/utils/getPanelMenu.ts

@@ -2,8 +2,8 @@ import { updateLocation } from 'app/core/actions';
 import { store } from 'app/store/store';
 
 import { removePanel, duplicatePanel, copyPanel, editPanelJson, sharePanel } from 'app/features/dashboard/utils/panel';
-import { PanelModel } from 'app/features/dashboard/panel_model';
-import { DashboardModel } from 'app/features/dashboard/dashboard_model';
+import { PanelModel } from 'app/features/dashboard/state/PanelModel';
+import { DashboardModel } from 'app/features/dashboard/state/DashboardModel';
 import { PanelMenuItem } from '@grafana/ui';
 
 export const getPanelMenu = (dashboard: DashboardModel, panel: PanelModel) => {

+ 2 - 2
public/app/features/dashboard/utils/panel.ts

@@ -2,8 +2,8 @@
 import store from 'app/core/store';
 
 // Models
-import { DashboardModel } from 'app/features/dashboard/dashboard_model';
-import { PanelModel } from 'app/features/dashboard/panel_model';
+import { DashboardModel } from 'app/features/dashboard/state/DashboardModel';
+import { PanelModel } from 'app/features/dashboard/state/PanelModel';
 import { TimeRange } from '@grafana/ui';
 
 // Utils

+ 1 - 1
public/app/features/panel/specs/metrics_panel_ctrl.test.ts

@@ -11,7 +11,7 @@ jest.mock('app/core/config', () => {
 });
 
 import q from 'q';
-import { PanelModel } from 'app/features/dashboard/panel_model';
+import { PanelModel } from 'app/features/dashboard/state/PanelModel';
 import { MetricsPanelCtrl } from '../metrics_panel_ctrl';
 
 describe('MetricsPanelCtrl', () => {

+ 1 - 1
public/app/features/templating/specs/variable_srv.test.ts

@@ -1,6 +1,6 @@
 import '../all';
 import { VariableSrv } from '../variable_srv';
-import { DashboardModel } from '../../dashboard/dashboard_model';
+import { DashboardModel } from '../../dashboard/state/DashboardModel';
 import moment from 'moment';
 import $q from 'q';
 

+ 1 - 1
public/app/features/templating/specs/variable_srv_init.test.ts

@@ -2,7 +2,7 @@ import '../all';
 
 import _ from 'lodash';
 import { VariableSrv } from '../variable_srv';
-import { DashboardModel } from '../../dashboard/dashboard_model';
+import { DashboardModel } from '../../dashboard/state/DashboardModel';
 import $q from 'q';
 
 describe('VariableSrv init', function(this: any) {

+ 1 - 1
public/app/features/templating/variable_srv.ts

@@ -8,7 +8,7 @@ import { variableTypes } from './variable';
 import { Graph } from 'app/core/utils/dag';
 import { TemplateSrv } from 'app/features/templating/template_srv';
 import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
-import { DashboardModel } from 'app/features/dashboard/dashboard_model';
+import { DashboardModel } from 'app/features/dashboard/state/DashboardModel';
 
 // Types
 import { TimeRange } from '@grafana/ui/src';

+ 1 - 1
public/test/specs/helpers.ts

@@ -2,7 +2,7 @@ import _ from 'lodash';
 import config from 'app/core/config';
 import * as dateMath from 'app/core/utils/datemath';
 import { angularMocks, sinon } from '../lib/common';
-import { PanelModel } from 'app/features/dashboard/panel_model';
+import { PanelModel } from 'app/features/dashboard/state/PanelModel';
 
 export function ControllerTestContext(this: any) {
   const self = this;