diff --git a/.betterer.results b/.betterer.results index c754b1a4c5e..42911e6ae35 100644 --- a/.betterer.results +++ b/.betterer.results @@ -2712,10 +2712,6 @@ exports[`better eslint`] = { "public/app/features/dashboard/state/getPanelPluginToMigrateTo.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], - "public/app/features/dashboard/state/index.ts:5381": [ - [0, 0, 0, "Do not re-export imported variable (\`./DashboardModel\`)", "0"], - [0, 0, 0, "Do not re-export imported variable (\`./PanelModel\`)", "1"] - ], "public/app/features/dashboard/state/initDashboard.test.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], diff --git a/public/app/angular/panel/metrics_panel_ctrl.ts b/public/app/angular/panel/metrics_panel_ctrl.ts index c969a6c70aa..2c3fa1de896 100644 --- a/public/app/angular/panel/metrics_panel_ctrl.ts +++ b/public/app/angular/panel/metrics_panel_ctrl.ts @@ -15,7 +15,7 @@ import { } from '@grafana/data'; import { PanelCtrl } from 'app/angular/panel/panel_ctrl'; import { ContextSrv } from 'app/core/services/context_srv'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { applyPanelTimeOverrides } from 'app/features/dashboard/utils/panel'; import { PanelQueryRunner } from '../../features/query/state/PanelQueryRunner'; diff --git a/public/app/angular/panel/panel_ctrl.ts b/public/app/angular/panel/panel_ctrl.ts index 249bb84c41b..3a5a13e0288 100644 --- a/public/app/angular/panel/panel_ctrl.ts +++ b/public/app/angular/panel/panel_ctrl.ts @@ -13,7 +13,7 @@ import { AngularLocationWrapper } from 'app/angular/AngularLocationWrapper'; import config from 'app/core/config'; import { profiler } from 'app/core/core'; -import { DashboardModel } from '../../features/dashboard/state'; +import { DashboardModel } from '../../features/dashboard/state/DashboardModel'; export class PanelCtrl { panel: any; diff --git a/public/app/angular/panel/panel_directive.ts b/public/app/angular/panel/panel_directive.ts index 954114b4f94..a6ae94e15dc 100644 --- a/public/app/angular/panel/panel_directive.ts +++ b/public/app/angular/panel/panel_directive.ts @@ -7,7 +7,7 @@ import { RefreshEvent } from '@grafana/runtime'; import { coreModule } from 'app/angular/core_module'; import { PanelDirectiveReadyEvent, RenderEvent } from 'app/types/events'; -import { PanelModel } from '../../features/dashboard/state'; +import { PanelModel } from '../../features/dashboard/state/PanelModel'; import { PanelCtrl } from './panel_ctrl'; diff --git a/public/app/core/services/backend_srv.ts b/public/app/core/services/backend_srv.ts index 72be4f2ff4d..472f0fe221e 100644 --- a/public/app/core/services/backend_srv.ts +++ b/public/app/core/services/backend_srv.ts @@ -22,7 +22,7 @@ import { getConfig } from 'app/core/config'; import { getSessionExpiry, hasSessionExpiry } from 'app/core/utils/auth'; import { loadUrlToken } from 'app/core/utils/urlToken'; import { getDashboardAPI } from 'app/features/dashboard/api/dashboard_api'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { DashboardSearchItem } from 'app/features/search/types'; import { TokenRevokedModal } from 'app/features/users/TokenRevokedModal'; import { DashboardDTO, FolderDTO } from 'app/types'; diff --git a/public/app/core/services/keybindingSrv.ts b/public/app/core/services/keybindingSrv.ts index b1a8e81a70c..789515e47cd 100644 --- a/public/app/core/services/keybindingSrv.ts +++ b/public/app/core/services/keybindingSrv.ts @@ -4,7 +4,7 @@ import appEvents from 'app/core/app_events'; import { getExploreUrl } from 'app/core/utils/explore'; import { SaveDashboardDrawer } from 'app/features/dashboard/components/SaveDashboard/SaveDashboardDrawer'; import { ShareModal } from 'app/features/dashboard/components/ShareModal'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { getTimeSrv } from '../../features/dashboard/services/TimeSrv'; import { diff --git a/public/app/features/alerting/state/ThresholdMapper.test.ts b/public/app/features/alerting/state/ThresholdMapper.test.ts index 7df5c6c9e2a..ab6806f1242 100644 --- a/public/app/features/alerting/state/ThresholdMapper.test.ts +++ b/public/app/features/alerting/state/ThresholdMapper.test.ts @@ -1,4 +1,4 @@ -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { hiddenReducerTypes, ThresholdMapper } from './ThresholdMapper'; import alertDef from './alertDef'; diff --git a/public/app/features/alerting/state/ThresholdMapper.ts b/public/app/features/alerting/state/ThresholdMapper.ts index 5e089484b40..265934a61fd 100644 --- a/public/app/features/alerting/state/ThresholdMapper.ts +++ b/public/app/features/alerting/state/ThresholdMapper.ts @@ -1,5 +1,5 @@ import { config } from 'app/core/config'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; export const hiddenReducerTypes = ['percent_diff', 'percent_diff_abs']; export class ThresholdMapper { diff --git a/public/app/features/alerting/unified/PanelAlertTab.tsx b/public/app/features/alerting/unified/PanelAlertTab.tsx index 95329e892dc..5b5ac81849b 100644 --- a/public/app/features/alerting/unified/PanelAlertTab.tsx +++ b/public/app/features/alerting/unified/PanelAlertTab.tsx @@ -1,5 +1,6 @@ import { Tab, TabProps } from '@grafana/ui'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { usePanelCombinedRules } from './hooks/usePanelCombinedRules'; diff --git a/public/app/features/alerting/unified/PanelAlertTabContent.test.tsx b/public/app/features/alerting/unified/PanelAlertTabContent.test.tsx index 016e70e87b0..4d87a26183b 100644 --- a/public/app/features/alerting/unified/PanelAlertTabContent.test.tsx +++ b/public/app/features/alerting/unified/PanelAlertTabContent.test.tsx @@ -5,7 +5,8 @@ import { DataSourceApi } from '@grafana/data'; import { PromOptions, PrometheusDatasource } from '@grafana/prometheus'; import { setDataSourceSrv, setPluginLinksHook } from '@grafana/runtime'; import * as ruleActionButtons from 'app/features/alerting/unified/components/rules/RuleActionsButtons'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; import { AccessControlAction } from 'app/types'; import { AlertQuery, PromRulesResponse } from 'app/types/unified-alerting-dto'; diff --git a/public/app/features/alerting/unified/PanelAlertTabContent.tsx b/public/app/features/alerting/unified/PanelAlertTabContent.tsx index 412f82e3db4..0bd2a1e7def 100644 --- a/public/app/features/alerting/unified/PanelAlertTabContent.tsx +++ b/public/app/features/alerting/unified/PanelAlertTabContent.tsx @@ -4,7 +4,8 @@ import { GrafanaTheme2 } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; import { Alert, LoadingPlaceholder, ScrollContainer, useStyles2 } from '@grafana/ui'; import { contextSrv } from 'app/core/services/context_srv'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { NewRuleFromPanelButton } from './components/panel-alerts-tab/NewRuleFromPanelButton'; import { RulesTable } from './components/rules/RulesTable'; diff --git a/public/app/features/alerting/unified/components/panel-alerts-tab/NewRuleFromPanelButton.test.tsx b/public/app/features/alerting/unified/components/panel-alerts-tab/NewRuleFromPanelButton.test.tsx index f48f54461c3..08fb0f52c8e 100644 --- a/public/app/features/alerting/unified/components/panel-alerts-tab/NewRuleFromPanelButton.test.tsx +++ b/public/app/features/alerting/unified/components/panel-alerts-tab/NewRuleFromPanelButton.test.tsx @@ -2,7 +2,7 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { render } from 'test/test-utils'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { createDashboardModelFixture } from 'app/features/dashboard/state/__fixtures__/dashboardFixtures'; import * as analytics from '../../Analytics'; diff --git a/public/app/features/alerting/unified/components/panel-alerts-tab/NewRuleFromPanelButton.tsx b/public/app/features/alerting/unified/components/panel-alerts-tab/NewRuleFromPanelButton.tsx index f868376e67d..b909736e619 100644 --- a/public/app/features/alerting/unified/components/panel-alerts-tab/NewRuleFromPanelButton.tsx +++ b/public/app/features/alerting/unified/components/panel-alerts-tab/NewRuleFromPanelButton.tsx @@ -3,7 +3,8 @@ import { useAsync } from 'react-use'; import { urlUtil } from '@grafana/data'; import { Alert, Button, LinkButton } from '@grafana/ui'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { useSelector } from 'app/types'; import { logInfo, LogMessages } from '../../Analytics'; diff --git a/public/app/features/alerting/unified/components/rule-editor/AnnotationsStep.tsx b/public/app/features/alerting/unified/components/rule-editor/AnnotationsStep.tsx index 52039ffc562..eea28d29d7c 100644 --- a/public/app/features/alerting/unified/components/rule-editor/AnnotationsStep.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/AnnotationsStep.tsx @@ -8,7 +8,7 @@ import { GrafanaTheme2 } from '@grafana/data'; import { Button, Field, Input, Stack, Text, TextArea, useStyles2 } from '@grafana/ui'; import { t, Trans } from 'app/core/internationalization'; -import { DashboardModel } from '../../../../dashboard/state'; +import { DashboardModel } from '../../../../dashboard/state/DashboardModel'; import { RuleFormValues } from '../../types/rule-form'; import { Annotation, annotationLabels } from '../../utils/constants'; import { isGrafanaManagedRuleByType } from '../../utils/rules'; diff --git a/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx b/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx index becc633ca1d..8a56f7dccf3 100644 --- a/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx @@ -18,7 +18,7 @@ import { useStyles2, } from '@grafana/ui'; -import { DashboardModel } from '../../../../dashboard/state'; +import { DashboardModel } from '../../../../dashboard/state/DashboardModel'; import { dashboardApi } from '../../api/dashboardApi'; import { useDashboardQuery } from './useDashboardQuery'; diff --git a/public/app/features/alerting/unified/components/rule-editor/useDashboardQuery.ts b/public/app/features/alerting/unified/components/rule-editor/useDashboardQuery.ts index 56db0ce526f..27bfb98c6a8 100644 --- a/public/app/features/alerting/unified/components/rule-editor/useDashboardQuery.ts +++ b/public/app/features/alerting/unified/components/rule-editor/useDashboardQuery.ts @@ -1,7 +1,7 @@ import memoizeOne from 'memoize-one'; import { DashboardDTO } from '../../../../../types'; -import { DashboardModel } from '../../../../dashboard/state'; +import { DashboardModel } from '../../../../dashboard/state/DashboardModel'; import { dashboardApi } from '../../api/dashboardApi'; const convertToDashboardModel = memoizeOne((dashboardDTO: DashboardDTO) => { diff --git a/public/app/features/alerting/unified/utils/rule-form.ts b/public/app/features/alerting/unified/utils/rule-form.ts index 5a9deaa0106..175bc8dac05 100644 --- a/public/app/features/alerting/unified/utils/rule-form.ts +++ b/public/app/features/alerting/unified/utils/rule-form.ts @@ -17,7 +17,8 @@ import { config, getDataSourceSrv } from '@grafana/runtime'; import { ExpressionDatasourceRef } from '@grafana/runtime/src/utils/DataSourceWithBackend'; import { sceneGraph, VizPanel } from '@grafana/scenes'; import { DataSourceJsonData } from '@grafana/schema'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { getDashboardSceneFor, getPanelIdForVizPanel, diff --git a/public/app/features/annotations/components/StandardAnnotationQueryEditor.tsx b/public/app/features/annotations/components/StandardAnnotationQueryEditor.tsx index dd9ba29a735..b584023eda0 100644 --- a/public/app/features/annotations/components/StandardAnnotationQueryEditor.tsx +++ b/public/app/features/annotations/components/StandardAnnotationQueryEditor.tsx @@ -14,7 +14,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { Alert, AlertVariant, Button, Space, Spinner } from '@grafana/ui'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { executeAnnotationQuery } from '../executeAnnotationQuery'; import { shouldUseLegacyRunner, shouldUseMappingUI, standardAnnotationSupport } from '../standardAnnotationSupport'; diff --git a/public/app/features/annotations/executeAnnotationQuery.test.ts b/public/app/features/annotations/executeAnnotationQuery.test.ts index b59188bf063..65526e1d549 100644 --- a/public/app/features/annotations/executeAnnotationQuery.test.ts +++ b/public/app/features/annotations/executeAnnotationQuery.test.ts @@ -1,6 +1,6 @@ import { DataSourceApi, dateTime, DataQuery } from '@grafana/data'; -import { PanelModel } from '../dashboard/state'; +import { PanelModel } from '../dashboard/state/PanelModel'; import { createDashboardModelFixture } from '../dashboard/state/__fixtures__/dashboardFixtures'; import { TestQuery, getMockDataSource } from '../query/state/__mocks__/mockDataSource'; diff --git a/public/app/features/annotations/types.ts b/public/app/features/annotations/types.ts index c3ee8e6d359..99fbcbdb1d8 100644 --- a/public/app/features/annotations/types.ts +++ b/public/app/features/annotations/types.ts @@ -1,6 +1,7 @@ import { AnnotationEvent, PanelData, TimeRange } from '@grafana/data'; -import { DashboardModel, PanelModel } from '../dashboard/state'; +import { DashboardModel } from '../dashboard/state/DashboardModel'; +import { PanelModel } from '../dashboard/state/PanelModel'; export interface AnnotationQueryOptions { dashboard: DashboardModel; diff --git a/public/app/features/dashboard-scene/addToDashboard/addPanelsOnLoadBehavior.ts b/public/app/features/dashboard-scene/addToDashboard/addPanelsOnLoadBehavior.ts index 3847a027e11..7cad2fc7c3d 100644 --- a/public/app/features/dashboard-scene/addToDashboard/addPanelsOnLoadBehavior.ts +++ b/public/app/features/dashboard-scene/addToDashboard/addPanelsOnLoadBehavior.ts @@ -1,6 +1,6 @@ import { SceneTimeRange } from '@grafana/scenes'; import store from 'app/core/store'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { DASHBOARD_FROM_LS_KEY, DashboardDTO } from 'app/types'; import { DashboardScene } from '../scene/DashboardScene'; diff --git a/public/app/features/dashboard-scene/inspect/InspectJsonTab.tsx b/public/app/features/dashboard-scene/inspect/InspectJsonTab.tsx index 4663f5f6fce..ff7798b2c7c 100644 --- a/public/app/features/dashboard-scene/inspect/InspectJsonTab.tsx +++ b/public/app/features/dashboard-scene/inspect/InspectJsonTab.tsx @@ -19,7 +19,7 @@ import { LibraryPanel } from '@grafana/schema/'; import { Button, CodeEditor, Field, Select, useStyles2 } from '@grafana/ui'; import { t } from 'app/core/internationalization'; import { getPanelDataFrames } from 'app/features/dashboard/components/HelpWizard/utils'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { getPanelInspectorStyles2 } from 'app/features/inspector/styles'; import { InspectTab } from 'app/features/inspector/types'; import { getPrettyJSON } from 'app/features/inspector/utils/utils'; diff --git a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataAlertingTab.test.tsx b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataAlertingTab.test.tsx index 8d8bebbfc39..40aa3cd0926 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataAlertingTab.test.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataAlertingTab.test.tsx @@ -24,7 +24,8 @@ import { RuleFormValues } from 'app/features/alerting/unified/types/rule-form'; import * as config from 'app/features/alerting/unified/utils/config'; import { Annotation } from 'app/features/alerting/unified/utils/constants'; import { DataSourceType, GRAFANA_RULES_SOURCE_NAME } from 'app/features/alerting/unified/utils/datasource'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; import { configureStore } from 'app/store/configureStore'; import { AccessControlAction, DashboardDataDTO } from 'app/types'; diff --git a/public/app/features/dashboard-scene/scene/DashboardScene.tsx b/public/app/features/dashboard-scene/scene/DashboardScene.tsx index 3799db54798..e839cea20ba 100644 --- a/public/app/features/dashboard-scene/scene/DashboardScene.tsx +++ b/public/app/features/dashboard-scene/scene/DashboardScene.tsx @@ -31,7 +31,8 @@ import { LS_PANEL_COPY_KEY } from 'app/core/constants'; import { getNavModel } from 'app/core/selectors/navModel'; import store from 'app/core/store'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { dashboardWatcher } from 'app/features/live/dashboard/dashboardWatcher'; import { getClosestScopesFacade, ScopesFacade } from 'app/features/scopes'; import { VariablesChanged } from 'app/features/variables/types'; diff --git a/public/app/features/dashboard-scene/scene/LibraryPanelBehavior.tsx b/public/app/features/dashboard-scene/scene/LibraryPanelBehavior.tsx index e831ac4bb04..7ec6e5403aa 100644 --- a/public/app/features/dashboard-scene/scene/LibraryPanelBehavior.tsx +++ b/public/app/features/dashboard-scene/scene/LibraryPanelBehavior.tsx @@ -3,7 +3,7 @@ import { SceneObjectBase, SceneObjectState, sceneUtils, VizPanel, VizPanelState import { LibraryPanel } from '@grafana/schema'; import { Stack } from '@grafana/ui'; import { Trans } from 'app/core/internationalization'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { getLibraryPanel } from 'app/features/library-panels/state/api'; import { createPanelDataProvider } from '../utils/createPanelDataProvider'; diff --git a/public/app/features/dashboard-scene/serialization/angularMigration.test.ts b/public/app/features/dashboard-scene/serialization/angularMigration.test.ts index 5f5ec560a9d..cda96b97e9c 100644 --- a/public/app/features/dashboard-scene/serialization/angularMigration.test.ts +++ b/public/app/features/dashboard-scene/serialization/angularMigration.test.ts @@ -1,6 +1,6 @@ import { PanelTypeChangedHandler } from '@grafana/data'; import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { getAngularPanelMigrationHandler } from './angularMigration'; diff --git a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts index ad063c17fb1..a500132569d 100644 --- a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts +++ b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts @@ -20,7 +20,8 @@ import { RowPanel, VariableType, } from '@grafana/schema'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { createPanelSaveModel } from 'app/features/dashboard/state/__fixtures__/dashboardFixtures'; import { SHARED_DASHBOARD_QUERY } from 'app/plugins/datasource/dashboard'; import { DASHBOARD_DATASOURCE_PLUGIN_ID } from 'app/plugins/datasource/dashboard/types'; diff --git a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts index ba05dff82c9..8c421b83e34 100644 --- a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts +++ b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts @@ -20,7 +20,8 @@ import { SceneDataLayerControls, UserActionEvent, } from '@grafana/scenes'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { DashboardDTO, DashboardDataDTO } from 'app/types'; import { addPanelsOnLoadBehavior } from '../addToDashboard/addPanelsOnLoadBehavior'; diff --git a/public/app/features/dashboard-scene/serialization/transformSceneToSaveModel.test.ts b/public/app/features/dashboard-scene/serialization/transformSceneToSaveModel.test.ts index c06c01f6de5..d10842bcced 100644 --- a/public/app/features/dashboard-scene/serialization/transformSceneToSaveModel.test.ts +++ b/public/app/features/dashboard-scene/serialization/transformSceneToSaveModel.test.ts @@ -17,7 +17,7 @@ import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; import { getPluginLinkExtensions, setPluginImportUtils } from '@grafana/runtime'; import { MultiValueVariable, sceneGraph, SceneGridRow, VizPanel } from '@grafana/scenes'; import { Dashboard, LoadingState, Panel, RowPanel, VariableRefresh } from '@grafana/schema'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { getTimeRange } from 'app/features/dashboard/utils/timeRange'; import { reduceTransformRegistryItem } from 'app/features/transformers/editors/ReduceTransformerEditor'; import { SHARED_DASHBOARD_QUERY } from 'app/plugins/datasource/dashboard'; diff --git a/public/app/features/dashboard-scene/sharing/ShareExportTab.tsx b/public/app/features/dashboard-scene/sharing/ShareExportTab.tsx index eca7426b9ff..909c4e031b6 100644 --- a/public/app/features/dashboard-scene/sharing/ShareExportTab.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareExportTab.tsx @@ -7,7 +7,7 @@ import { Button, ClipboardButton, CodeEditor, Field, Modal, Stack, Switch } from import { t, Trans } from 'app/core/internationalization'; import { DashboardExporter } from 'app/features/dashboard/components/DashExportModal'; import { shareDashboardType } from 'app/features/dashboard/components/ShareModal/utils'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { transformSceneToSaveModel } from '../serialization/transformSceneToSaveModel'; import { getVariablesCompatibility } from '../utils/getVariablesCompatibility'; diff --git a/public/app/features/dashboard-scene/sharing/ShareLibraryPanelTab.tsx b/public/app/features/dashboard-scene/sharing/ShareLibraryPanelTab.tsx index 8a6d9931f77..75569cdd49f 100644 --- a/public/app/features/dashboard-scene/sharing/ShareLibraryPanelTab.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareLibraryPanelTab.tsx @@ -4,7 +4,8 @@ import { LibraryPanel } from '@grafana/schema/dist/esm/index.gen'; import { t } from 'app/core/internationalization'; import { ShareLibraryPanel } from 'app/features/dashboard/components/ShareModal/ShareLibraryPanel'; import { shareDashboardType } from 'app/features/dashboard/components/ShareModal/utils'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { DashboardGridItem } from '../scene/layout-default/DashboardGridItem'; import { gridItemToPanel, transformSceneToSaveModel } from '../serialization/transformSceneToSaveModel'; diff --git a/public/app/features/dashboard-scene/utils/createPanelDataProvider.ts b/public/app/features/dashboard-scene/utils/createPanelDataProvider.ts index 758d60be473..94bfc7912fa 100644 --- a/public/app/features/dashboard-scene/utils/createPanelDataProvider.ts +++ b/public/app/features/dashboard-scene/utils/createPanelDataProvider.ts @@ -1,6 +1,6 @@ import { config } from '@grafana/runtime'; import { SceneDataProvider, SceneDataTransformer, SceneQueryRunner } from '@grafana/scenes'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { DashboardDatasourceBehaviour } from '../scene/DashboardDatasourceBehaviour'; diff --git a/public/app/features/dashboard-scene/utils/registerDynamicDashNavAction.ts b/public/app/features/dashboard-scene/utils/registerDynamicDashNavAction.ts index fb610ca237a..513c5ff66ef 100644 --- a/public/app/features/dashboard-scene/utils/registerDynamicDashNavAction.ts +++ b/public/app/features/dashboard-scene/utils/registerDynamicDashNavAction.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -import { DashboardModel } from '../../dashboard/state'; +import { DashboardModel } from '../../dashboard/state/DashboardModel'; interface ComponentProps { dashboard: DashboardModel; diff --git a/public/app/features/dashboard-scene/utils/variables.test.ts b/public/app/features/dashboard-scene/utils/variables.test.ts index 75052189c54..205363651ae 100644 --- a/public/app/features/dashboard-scene/utils/variables.test.ts +++ b/public/app/features/dashboard-scene/utils/variables.test.ts @@ -19,7 +19,7 @@ import { SceneVariableSet, } from '@grafana/scenes'; import { defaultDashboard, defaultTimePickerConfig, VariableType } from '@grafana/schema'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { SnapshotVariable } from '../serialization/custom-variables/SnapshotVariable'; import { NEW_LINK } from '../settings/links/utils'; diff --git a/public/app/features/dashboard-scene/utils/variables.ts b/public/app/features/dashboard-scene/utils/variables.ts index 3392aa6dfbf..bfc41a49233 100644 --- a/public/app/features/dashboard-scene/utils/variables.ts +++ b/public/app/features/dashboard-scene/utils/variables.ts @@ -12,7 +12,7 @@ import { SceneVariableSet, TextBoxVariable, } from '@grafana/scenes'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { SnapshotVariable } from '../serialization/custom-variables/SnapshotVariable'; diff --git a/public/app/features/dashboard/api/publicDashboardApi.ts b/public/app/features/dashboard/api/publicDashboardApi.ts index 3a94b0670c4..063b55e4d79 100644 --- a/public/app/features/dashboard/api/publicDashboardApi.ts +++ b/public/app/features/dashboard/api/publicDashboardApi.ts @@ -12,7 +12,7 @@ import { SessionDashboard, SessionUser, } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { DashboardScene } from 'app/features/dashboard-scene/scene/DashboardScene'; import { PublicDashboardListWithPagination, diff --git a/public/app/features/dashboard/components/AddLibraryPanelWidget/AddLibraryPanelWidget.tsx b/public/app/features/dashboard/components/AddLibraryPanelWidget/AddLibraryPanelWidget.tsx index bd2543e2269..22dbeca1de3 100644 --- a/public/app/features/dashboard/components/AddLibraryPanelWidget/AddLibraryPanelWidget.tsx +++ b/public/app/features/dashboard/components/AddLibraryPanelWidget/AddLibraryPanelWidget.tsx @@ -11,7 +11,8 @@ import { LibraryPanelsSearch, LibraryPanelsSearchVariant, } from '../../../library-panels/components/LibraryPanelsSearch/LibraryPanelsSearch'; -import { DashboardModel, PanelModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; +import { PanelModel } from '../../state/PanelModel'; interface Props { panel: PanelModel; diff --git a/public/app/features/dashboard/components/AddPanelButton/AddPanelButton.tsx b/public/app/features/dashboard/components/AddPanelButton/AddPanelButton.tsx index e76b3769ad0..14daeec9734 100644 --- a/public/app/features/dashboard/components/AddPanelButton/AddPanelButton.tsx +++ b/public/app/features/dashboard/components/AddPanelButton/AddPanelButton.tsx @@ -3,7 +3,7 @@ import { useState, useEffect } from 'react'; import { selectors } from '@grafana/e2e-selectors'; import { Dropdown, Button, Icon } from '@grafana/ui'; import { Trans } from 'app/core/internationalization'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import AddPanelMenu from './AddPanelMenu'; diff --git a/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.tsx b/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.tsx index 8f066a7034c..ae603f2ce60 100644 --- a/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.tsx +++ b/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.tsx @@ -4,7 +4,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { locationService } from '@grafana/runtime'; import { Menu } from '@grafana/ui'; import { t } from 'app/core/internationalization'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { getCopiedPanelPlugin, onAddLibraryPanel, diff --git a/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts b/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts index 165c7742a30..45f3a8dcfdc 100644 --- a/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts +++ b/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts @@ -3,7 +3,7 @@ import { defaults, each, sortBy } from 'lodash'; import { DataSourceRef, PanelPluginMeta, VariableOption, VariableRefresh } from '@grafana/data'; import { getDataSourceSrv } from '@grafana/runtime'; import config from 'app/core/config'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { getLibraryPanel } from 'app/features/library-panels/state/api'; import { variableRegex } from 'app/features/variables/utils'; diff --git a/public/app/features/dashboard/components/DashNav/DashNav.tsx b/public/app/features/dashboard/components/DashNav/DashNav.tsx index 86a3986be31..b9c0dec0e9b 100644 --- a/public/app/features/dashboard/components/DashNav/DashNav.tsx +++ b/public/app/features/dashboard/components/DashNav/DashNav.tsx @@ -28,7 +28,7 @@ import { removeNavIndex } from 'app/core/reducers/navModel'; import AddPanelButton from 'app/features/dashboard/components/AddPanelButton/AddPanelButton'; import { SaveDashboardDrawer } from 'app/features/dashboard/components/SaveDashboard/SaveDashboardDrawer'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; import { playlistSrv } from 'app/features/playlist/PlaylistSrv'; import { updateTimeZoneForSession } from 'app/features/profile/state/reducers'; diff --git a/public/app/features/dashboard/components/DashNav/DashNavTimeControls.tsx b/public/app/features/dashboard/components/DashNav/DashNavTimeControls.tsx index c32d8c774f6..ae1ced14a10 100644 --- a/public/app/features/dashboard/components/DashNav/DashNavTimeControls.tsx +++ b/public/app/features/dashboard/components/DashNav/DashNavTimeControls.tsx @@ -11,7 +11,7 @@ import { AutoRefreshInterval } from 'app/core/services/context_srv'; import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv'; import { ShiftTimeEvent, ShiftTimeEventDirection, ZoomOutEvent } from '../../../../types/events'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; export interface Props { dashboard: DashboardModel; diff --git a/public/app/features/dashboard/components/DashNav/ShareButton.tsx b/public/app/features/dashboard/components/DashNav/ShareButton.tsx index 2e794b97c8c..32d8a87aa5d 100644 --- a/public/app/features/dashboard/components/DashNav/ShareButton.tsx +++ b/public/app/features/dashboard/components/DashNav/ShareButton.tsx @@ -2,7 +2,7 @@ import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src'; import { locationService } from '@grafana/runtime'; import { Button } from '@grafana/ui'; import { Trans } from 'app/core/internationalization'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; import { shareDashboardType } from '../ShareModal/utils'; diff --git a/public/app/features/dashboard/components/DashboardSettings/AnnotationsSettings.tsx b/public/app/features/dashboard/components/DashboardSettings/AnnotationsSettings.tsx index 158d80b9dcc..ffcf53a4085 100644 --- a/public/app/features/dashboard/components/DashboardSettings/AnnotationsSettings.tsx +++ b/public/app/features/dashboard/components/DashboardSettings/AnnotationsSettings.tsx @@ -2,7 +2,7 @@ import { AnnotationQuery, getDataSourceRef, NavModelItem } from '@grafana/data'; import { getDataSourceSrv, locationService } from '@grafana/runtime'; import { Page } from 'app/core/components/Page/Page'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; import { AnnotationSettingsEdit, AnnotationSettingsList, newAnnotationName } from '../AnnotationSettings'; import { SettingsPageProps } from './types'; diff --git a/public/app/features/dashboard/components/DashboardSettings/LinksSettings.test.tsx b/public/app/features/dashboard/components/DashboardSettings/LinksSettings.test.tsx index 21e7144ba45..2920339bd2c 100644 --- a/public/app/features/dashboard/components/DashboardSettings/LinksSettings.test.tsx +++ b/public/app/features/dashboard/components/DashboardSettings/LinksSettings.test.tsx @@ -2,7 +2,7 @@ import { screen, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { render } from 'test/test-utils'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; import { createDashboardModelFixture } from '../../state/__fixtures__/dashboardFixtures'; import { DashboardSettings } from './DashboardSettings'; diff --git a/public/app/features/dashboard/components/DashboardSettings/types.ts b/public/app/features/dashboard/components/DashboardSettings/types.ts index 1ab89418756..e93ffa918e5 100644 --- a/public/app/features/dashboard/components/DashboardSettings/types.ts +++ b/public/app/features/dashboard/components/DashboardSettings/types.ts @@ -3,7 +3,7 @@ import { ComponentType } from 'react'; import { NavModel } from '@grafana/data'; import { IconName } from '@grafana/ui'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; export interface SettingsPage { id: string; diff --git a/public/app/features/dashboard/components/DeleteDashboard/DeleteDashboardModal.tsx b/public/app/features/dashboard/components/DeleteDashboard/DeleteDashboardModal.tsx index 51b0e49ff92..314bad916ac 100644 --- a/public/app/features/dashboard/components/DeleteDashboard/DeleteDashboardModal.tsx +++ b/public/app/features/dashboard/components/DeleteDashboard/DeleteDashboardModal.tsx @@ -4,7 +4,7 @@ import useAsyncFn from 'react-use/lib/useAsyncFn'; import { locationService, config, reportInteraction } from '@grafana/runtime'; import { Modal, Button, Text, Space, TextLink } from '@grafana/ui'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { cleanUpDashboardAndVariables } from 'app/features/dashboard/state/actions'; import { Trans, t } from '../../../../core/internationalization'; diff --git a/public/app/features/dashboard/components/GenAI/GenAIDashDescriptionButton.tsx b/public/app/features/dashboard/components/GenAI/GenAIDashDescriptionButton.tsx index 6ba4f378266..b0058c0346f 100644 --- a/public/app/features/dashboard/components/GenAI/GenAIDashDescriptionButton.tsx +++ b/public/app/features/dashboard/components/GenAI/GenAIDashDescriptionButton.tsx @@ -1,5 +1,5 @@ import { getDashboardSrv } from '../../services/DashboardSrv'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; import { GenAIButton } from './GenAIButton'; import { EventTrackingSrc } from './tracking'; diff --git a/public/app/features/dashboard/components/GenAI/GenAIDashTitleButton.tsx b/public/app/features/dashboard/components/GenAI/GenAIDashTitleButton.tsx index 6e5f0b49842..fe77e35c12d 100644 --- a/public/app/features/dashboard/components/GenAI/GenAIDashTitleButton.tsx +++ b/public/app/features/dashboard/components/GenAI/GenAIDashTitleButton.tsx @@ -1,5 +1,5 @@ import { getDashboardSrv } from '../../services/DashboardSrv'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; import { GenAIButton } from './GenAIButton'; import { EventTrackingSrc } from './tracking'; diff --git a/public/app/features/dashboard/components/GenAI/GenAIDashboardChangesButton.tsx b/public/app/features/dashboard/components/GenAI/GenAIDashboardChangesButton.tsx index ac636d16d77..73be188f57e 100644 --- a/public/app/features/dashboard/components/GenAI/GenAIDashboardChangesButton.tsx +++ b/public/app/features/dashboard/components/GenAI/GenAIDashboardChangesButton.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; import { GenAIButton } from './GenAIButton'; import { EventTrackingSrc } from './tracking'; diff --git a/public/app/features/dashboard/components/GenAI/jsonDiffText.ts b/public/app/features/dashboard/components/GenAI/jsonDiffText.ts index 41faf84c232..efc70042e3f 100644 --- a/public/app/features/dashboard/components/GenAI/jsonDiffText.ts +++ b/public/app/features/dashboard/components/GenAI/jsonDiffText.ts @@ -2,7 +2,7 @@ import { createTwoFilesPatch } from 'diff'; import { Dashboard } from '@grafana/schema'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; export type JSONValue = null | boolean | number | string | JSONArray | JSONObject; diff --git a/public/app/features/dashboard/components/GenAI/utils.ts b/public/app/features/dashboard/components/GenAI/utils.ts index 4f641d2c614..bad69a59e44 100644 --- a/public/app/features/dashboard/components/GenAI/utils.ts +++ b/public/app/features/dashboard/components/GenAI/utils.ts @@ -4,7 +4,8 @@ import { llms } from '@grafana/experimental'; import { config } from '@grafana/runtime'; import { Panel } from '@grafana/schema'; -import { DashboardModel, PanelModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; +import { PanelModel } from '../../state/PanelModel'; import { NEW_PANEL_TITLE } from '../../utils/dashboard'; import { getDashboardStringDiff } from './jsonDiffText'; diff --git a/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx b/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx index bc8987ff813..69234f1b9b2 100644 --- a/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx +++ b/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx @@ -22,7 +22,7 @@ import { } from '@grafana/ui'; import { Trans } from 'app/core/internationalization'; import { contextSrv } from 'app/core/services/context_srv'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { AccessControlAction } from 'app/types'; import { ShowMessage, SnapshotTab, SupportSnapshotService } from './SupportSnapshotService'; diff --git a/public/app/features/dashboard/components/HelpWizard/SupportSnapshotService.ts b/public/app/features/dashboard/components/HelpWizard/SupportSnapshotService.ts index 145cec475ca..52a11dd96a6 100644 --- a/public/app/features/dashboard/components/HelpWizard/SupportSnapshotService.ts +++ b/public/app/features/dashboard/components/HelpWizard/SupportSnapshotService.ts @@ -7,7 +7,8 @@ import { Randomize } from 'app/features/dashboard-scene/inspect/HelpWizard/rando import { createDashboardSceneFromDashboardModel } from 'app/features/dashboard-scene/serialization/transformSaveModelToScene'; import { getTimeSrv } from '../../services/TimeSrv'; -import { DashboardModel, PanelModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; +import { PanelModel } from '../../state/PanelModel'; import { getDebugDashboard, getGithubMarkdown } from './utils'; diff --git a/public/app/features/dashboard/components/HelpWizard/utils.ts b/public/app/features/dashboard/components/HelpWizard/utils.ts index 2260a4b0315..d33520b3047 100644 --- a/public/app/features/dashboard/components/HelpWizard/utils.ts +++ b/public/app/features/dashboard/components/HelpWizard/utils.ts @@ -13,7 +13,7 @@ import { DataTopic, } from '@grafana/data'; import { config } from '@grafana/runtime'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { Randomize, randomizeData } from 'app/features/dashboard-scene/inspect/HelpWizard/randomizer'; import { GrafanaQueryType } from 'app/plugins/datasource/grafana/types'; diff --git a/public/app/features/dashboard/components/Inspector/InspectContent.tsx b/public/app/features/dashboard/components/Inspector/InspectContent.tsx index edfdb35bab5..7dfc6c7d54e 100644 --- a/public/app/features/dashboard/components/Inspector/InspectContent.tsx +++ b/public/app/features/dashboard/components/Inspector/InspectContent.tsx @@ -23,7 +23,8 @@ import { QueryInspector } from 'app/features/inspector/QueryInspector'; import { InspectTab } from 'app/features/inspector/types'; import { GetDataOptions } from '../../../query/state/PanelQueryRunner'; -import { DashboardModel, PanelModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; +import { PanelModel } from '../../state/PanelModel'; interface Props { dashboard: DashboardModel; diff --git a/public/app/features/dashboard/components/Inspector/PanelInspector.tsx b/public/app/features/dashboard/components/Inspector/PanelInspector.tsx index 719664fca24..cbd6b6c4e3f 100644 --- a/public/app/features/dashboard/components/Inspector/PanelInspector.tsx +++ b/public/app/features/dashboard/components/Inspector/PanelInspector.tsx @@ -4,7 +4,8 @@ import { useLocation } from 'react-router-dom-v5-compat'; import { PanelPlugin } from '@grafana/data'; import { locationService } from '@grafana/runtime'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { InspectTab } from 'app/features/inspector/types'; import { getPanelStateForModel } from 'app/features/panel/state/selectors'; import { StoreState } from 'app/types'; diff --git a/public/app/features/dashboard/components/Inspector/hooks.ts b/public/app/features/dashboard/components/Inspector/hooks.ts index 59cc4a2284e..49477f9e257 100644 --- a/public/app/features/dashboard/components/Inspector/hooks.ts +++ b/public/app/features/dashboard/components/Inspector/hooks.ts @@ -4,7 +4,8 @@ import useAsync from 'react-use/lib/useAsync'; import { DataSourceApi, PanelData, PanelPlugin } from '@grafana/data'; import { getDataSourceSrv } from '@grafana/runtime'; import { t } from 'app/core/internationalization'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { InspectTab } from 'app/features/inspector/types'; import { supportsDataQuery } from '../PanelEditor/utils'; diff --git a/public/app/features/dashboard/components/PanelEditor/AngularPanelOptions.tsx b/public/app/features/dashboard/components/PanelEditor/AngularPanelOptions.tsx index 7d33350ac6c..612055d32d5 100644 --- a/public/app/features/dashboard/components/PanelEditor/AngularPanelOptions.tsx +++ b/public/app/features/dashboard/components/PanelEditor/AngularPanelOptions.tsx @@ -8,7 +8,8 @@ import { changePanelPlugin } from 'app/features/panel/state/actions'; import { getPanelStateForModel } from 'app/features/panel/state/selectors'; import { StoreState } from 'app/types'; -import { PanelModel, DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; +import { PanelModel } from '../../state/PanelModel'; import { getSectionOpenState, saveSectionOpenState } from './state/utils'; diff --git a/public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.test.tsx b/public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.test.tsx index 2a04e5aa045..ad8c19ee30b 100644 --- a/public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.test.tsx +++ b/public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.test.tsx @@ -17,7 +17,7 @@ import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; import { selectors } from '@grafana/e2e-selectors'; import { getAllOptionEditors, getAllStandardFieldConfigs } from 'app/core/components/OptionsUI/registry'; -import { PanelModel } from '../../state'; +import { PanelModel } from '../../state/PanelModel'; import { createDashboardModelFixture } from '../../state/__fixtures__/dashboardFixtures'; import { OptionsPaneOptions } from './OptionsPaneOptions'; diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx index a77c269d0ca..429e74a6eaa 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx @@ -37,7 +37,8 @@ import { UnlinkModal } from '../../../dashboard-scene/scene/UnlinkModal'; import { isPanelModelLibraryPanel } from '../../../library-panels/guard'; import { getVariablesByKey } from '../../../variables/state/selectors'; import { DashboardPanel } from '../../dashgrid/DashboardPanel'; -import { DashboardModel, PanelModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; +import { PanelModel } from '../../state/PanelModel'; import { DashNavTimeControls } from '../DashNav/DashNavTimeControls'; import { SaveDashboardDrawer } from '../SaveDashboard/SaveDashboardDrawer'; diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditorQueries.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditorQueries.tsx index 0c81aafeea8..020eea8d8e8 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditorQueries.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditorQueries.tsx @@ -8,7 +8,7 @@ import { QueryGroup } from 'app/features/query/components/QueryGroup'; import { QueryGroupDataSource, QueryGroupOptions } from 'app/types'; import { getDashboardSrv } from '../../services/DashboardSrv'; -import { PanelModel } from '../../state'; +import { PanelModel } from '../../state/PanelModel'; import { getLastUsedDatasourceFromStorage } from '../../utils/dashboard'; interface Props { diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditorTableView.test.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditorTableView.test.tsx index 6a7703dec7f..a8cc437dd5c 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditorTableView.test.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditorTableView.test.tsx @@ -17,7 +17,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { getTimeSrv, TimeSrv, setTimeSrv } from 'app/features/dashboard/services/TimeSrv'; import { PanelQueryRunner } from '../../../query/state/PanelQueryRunner'; -import { PanelModel } from '../../state'; +import { PanelModel } from '../../state/PanelModel'; import { createDashboardModelFixture } from '../../state/__fixtures__/dashboardFixtures'; import { PanelEditorTableView, Props } from './PanelEditorTableView'; diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditorTableView.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditorTableView.tsx index 74e66a0ed07..31aa452e6ab 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditorTableView.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditorTableView.tsx @@ -7,7 +7,8 @@ import { PanelRenderer } from 'app/features/panel/components/PanelRenderer'; import { Options } from 'app/plugins/panel/table/panelcfg.gen'; import { getTimeSrv } from '../../services/TimeSrv'; -import { DashboardModel, PanelModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; +import { PanelModel } from '../../state/PanelModel'; import PanelHeaderCorner from './PanelHeaderCorner'; import { usePanelLatestData } from './usePanelLatestData'; diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx index cad04df45f3..8f3a9488b58 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx @@ -9,7 +9,8 @@ import { PanelAlertTab } from 'app/features/alerting/unified/PanelAlertTab'; import { PanelAlertTabContent } from 'app/features/alerting/unified/PanelAlertTabContent'; import { PanelQueriesChangedEvent, PanelTransformationsChangedEvent } from 'app/types/events'; -import { DashboardModel, PanelModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; +import { PanelModel } from '../../state/PanelModel'; import { TransformationsEditor } from '../TransformationsEditor/TransformationsEditor'; import { PanelEditorQueries } from './PanelEditorQueries'; diff --git a/public/app/features/dashboard/components/PanelEditor/PanelHeaderCorner.test.tsx b/public/app/features/dashboard/components/PanelEditor/PanelHeaderCorner.test.tsx index fd46e18b065..0f17156edb0 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelHeaderCorner.test.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelHeaderCorner.test.tsx @@ -3,7 +3,7 @@ import { render, screen } from '@testing-library/react'; import { createTheme } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; -import { PanelModel } from '../../state'; +import { PanelModel } from '../../state/PanelModel'; import { PanelHeaderCorner, Props } from './PanelHeaderCorner'; diff --git a/public/app/features/dashboard/components/PanelEditor/VisualizationButton.tsx b/public/app/features/dashboard/components/PanelEditor/VisualizationButton.tsx index 17acd43a090..a24f7de019e 100644 --- a/public/app/features/dashboard/components/PanelEditor/VisualizationButton.tsx +++ b/public/app/features/dashboard/components/PanelEditor/VisualizationButton.tsx @@ -4,7 +4,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { ToolbarButton, ButtonGroup } from '@grafana/ui'; import { useDispatch, useSelector } from 'app/types'; -import { PanelModel } from '../../state'; +import { PanelModel } from '../../state/PanelModel'; import { getPanelPluginWithFallback } from '../../state/selectors'; import { updatePanelEditorUIState } from './state/actions'; diff --git a/public/app/features/dashboard/components/PanelEditor/state/actions.test.ts b/public/app/features/dashboard/components/PanelEditor/state/actions.test.ts index ac7c255d8a6..b661ef017b8 100644 --- a/public/app/features/dashboard/components/PanelEditor/state/actions.test.ts +++ b/public/app/features/dashboard/components/PanelEditor/state/actions.test.ts @@ -5,7 +5,7 @@ import { createDashboardModelFixture } from 'app/features/dashboard/state/__fixt import { panelModelAndPluginReady, removePanel } from 'app/features/panel/state/reducers'; import { thunkTester } from '../../../../../../test/core/thunk/thunkTester'; -import { PanelModel } from '../../../state'; +import { PanelModel } from '../../../state/PanelModel'; import { exitPanelEditor, initPanelEditor, skipPanelUpdate } from './actions'; import { closeEditor, initialState, PanelEditorState } from './reducers'; diff --git a/public/app/features/dashboard/components/PanelEditor/state/actions.ts b/public/app/features/dashboard/components/PanelEditor/state/actions.ts index e01fda2c028..00a96421aea 100644 --- a/public/app/features/dashboard/components/PanelEditor/state/actions.ts +++ b/public/app/features/dashboard/components/PanelEditor/state/actions.ts @@ -6,7 +6,8 @@ import { cleanUpPanelState } from 'app/features/panel/state/actions'; import { panelModelAndPluginReady } from 'app/features/panel/state/reducers'; import { ThunkResult } from 'app/types'; -import { DashboardModel, PanelModel } from '../../../state'; +import { DashboardModel } from '../../../state/DashboardModel'; +import { PanelModel } from '../../../state/PanelModel'; import { closeEditor, diff --git a/public/app/features/dashboard/components/PanelEditor/types.ts b/public/app/features/dashboard/components/PanelEditor/types.ts index c74a0800795..2de187e28e1 100644 --- a/public/app/features/dashboard/components/PanelEditor/types.ts +++ b/public/app/features/dashboard/components/PanelEditor/types.ts @@ -1,6 +1,7 @@ import { DataFrame, FieldConfigSource, PanelData, PanelPlugin } from '@grafana/data'; -import { DashboardModel, PanelModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; +import { PanelModel } from '../../state/PanelModel'; export interface PanelEditorTab { id: string; diff --git a/public/app/features/dashboard/components/PanelEditor/usePanelLatestData.ts b/public/app/features/dashboard/components/PanelEditor/usePanelLatestData.ts index 360b00c1a8a..2a5a47e574e 100644 --- a/public/app/features/dashboard/components/PanelEditor/usePanelLatestData.ts +++ b/public/app/features/dashboard/components/PanelEditor/usePanelLatestData.ts @@ -4,7 +4,7 @@ import { Unsubscribable } from 'rxjs'; import { LoadingState, PanelData } from '@grafana/data'; import { GetDataOptions } from '../../../query/state/PanelQueryRunner'; -import { PanelModel } from '../../state'; +import { PanelModel } from '../../state/PanelModel'; interface UsePanelLatestData { data?: PanelData; diff --git a/public/app/features/dashboard/components/SaveDashboard/DashboardValidation.tsx b/public/app/features/dashboard/components/SaveDashboard/DashboardValidation.tsx index 1dd48ce9555..bfe729fd47e 100644 --- a/public/app/features/dashboard/components/SaveDashboard/DashboardValidation.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/DashboardValidation.tsx @@ -7,7 +7,7 @@ import { FetchError } from '@grafana/runtime'; import { Alert, useStyles2 } from '@grafana/ui'; import { backendSrv } from 'app/core/services/backend_srv'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; interface DashboardValidationProps { dashboard: DashboardModel; diff --git a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardButton.tsx b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardButton.tsx index c4c718bda4d..baf405f7381 100644 --- a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardButton.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardButton.tsx @@ -1,7 +1,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { reportInteraction } from '@grafana/runtime'; import { Button, ButtonVariant, ComponentSize, ModalsController } from '@grafana/ui'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { SaveDashboardDrawer } from './SaveDashboardDrawer'; diff --git a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardDrawer.test.tsx b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardDrawer.test.tsx index 7d1c0af7c55..5f51e2094d5 100644 --- a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardDrawer.test.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardDrawer.test.tsx @@ -4,7 +4,7 @@ import { Provider } from 'react-redux'; import { configureStore } from 'app/store/configureStore'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; import { createDashboardModelFixture } from '../../state/__fixtures__/dashboardFixtures'; import { SaveDashboardDrawer } from './SaveDashboardDrawer'; diff --git a/public/app/features/dashboard/components/SaveDashboard/UnsavedChangesModal.tsx b/public/app/features/dashboard/components/SaveDashboard/UnsavedChangesModal.tsx index 4c6030d0556..298869f0c76 100644 --- a/public/app/features/dashboard/components/SaveDashboard/UnsavedChangesModal.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/UnsavedChangesModal.tsx @@ -2,7 +2,7 @@ import { css } from '@emotion/css'; import { Button, Modal } from '@grafana/ui'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; import { SaveDashboardButton } from './SaveDashboardButton'; diff --git a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.test.tsx b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.test.tsx index da11ebdf177..4000dc6d54a 100644 --- a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.test.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.test.tsx @@ -1,7 +1,7 @@ import { screen, render } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import * as api from 'app/features/manage-dashboards/state/actions'; import { SaveDashboardResponseDTO } from 'app/types'; diff --git a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx index e11482af296..5d8cdfc0755 100644 --- a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx @@ -3,7 +3,7 @@ import { ChangeEvent } from 'react'; import { config } from '@grafana/runtime'; import { Button, Input, Switch, Form, Field, InputControl, Label, TextArea, Stack } from '@grafana/ui'; import { FolderPicker } from 'app/core/components/Select/FolderPicker'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { validationSrv } from 'app/features/manage-dashboards/services/ValidationSrv'; import { GenAIDashDescriptionButton } from '../../GenAI/GenAIDashDescriptionButton'; diff --git a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.test.tsx b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.test.tsx index 4afa44f1b75..1a3942acb9c 100644 --- a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.test.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.test.tsx @@ -2,7 +2,7 @@ import { screen, render } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { Dashboard } from '@grafana/schema'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { createDashboardModelFixture } from 'app/features/dashboard/state/__fixtures__/dashboardFixtures'; import { SaveDashboardResponseDTO } from 'app/types'; diff --git a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx index 9093d92ee81..6799e9a2e16 100644 --- a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx @@ -6,7 +6,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { config } from '@grafana/runtime'; import { Dashboard } from '@grafana/schema'; import { Button, Checkbox, TextArea, useStyles2, Stack } from '@grafana/ui'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { SaveDashboardResponseDTO } from 'app/types'; import { GenAIDashboardChangesButton } from '../../GenAI/GenAIDashboardChangesButton'; diff --git a/public/app/features/dashboard/components/SaveDashboard/useDashboardSave.tsx b/public/app/features/dashboard/components/SaveDashboard/useDashboardSave.tsx index 08de75d36c0..f91865f78d6 100644 --- a/public/app/features/dashboard/components/SaveDashboard/useDashboardSave.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/useDashboardSave.tsx @@ -7,7 +7,7 @@ import appEvents from 'app/core/app_events'; import { useAppNotification } from 'app/core/copy/appNotification'; import { updateDashboardName } from 'app/core/reducers/navBarTree'; import { useSaveDashboardMutation } from 'app/features/browse-dashboards/api/browseDashboardsAPI'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { useDispatch } from 'app/types'; import { DashboardSavedEvent } from 'app/types/events'; diff --git a/public/app/features/dashboard/components/ShareModal/ShareEmbed.test.tsx b/public/app/features/dashboard/components/ShareModal/ShareEmbed.test.tsx index 7707d15a419..dc0699ab6e6 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareEmbed.test.tsx +++ b/public/app/features/dashboard/components/ShareModal/ShareEmbed.test.tsx @@ -5,7 +5,7 @@ import { setEchoSrv } from '@grafana/runtime/src'; import config from 'app/core/config'; import { Echo } from '../../../../core/services/echo/Echo'; -import { PanelModel } from '../../state'; +import { PanelModel } from '../../state/PanelModel'; import { createDashboardModelFixture } from '../../state/__fixtures__/dashboardFixtures'; import { ShareEmbed } from './ShareEmbed'; diff --git a/public/app/features/dashboard/components/ShareModal/ShareLink.test.tsx b/public/app/features/dashboard/components/ShareModal/ShareLink.test.tsx index a862b20b43e..03647498a00 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareLink.test.tsx +++ b/public/app/features/dashboard/components/ShareModal/ShareLink.test.tsx @@ -10,7 +10,7 @@ import { initTemplateSrv } from '../../../../../test/helpers/initTemplateSrv'; import { Echo } from '../../../../core/services/echo/Echo'; import { variableAdapters } from '../../../variables/adapters'; import { createQueryVariableAdapter } from '../../../variables/query/adapter'; -import { PanelModel } from '../../state'; +import { PanelModel } from '../../state/PanelModel'; import { createDashboardModelFixture } from '../../state/__fixtures__/dashboardFixtures'; import { Props, ShareLink } from './ShareLink'; diff --git a/public/app/features/dashboard/components/ShareModal/ShareModal.tsx b/public/app/features/dashboard/components/ShareModal/ShareModal.tsx index dc96e943357..9e360f02627 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareModal.tsx +++ b/public/app/features/dashboard/components/ShareModal/ShareModal.tsx @@ -6,7 +6,8 @@ import { contextSrv } from 'app/core/core'; import { t } from 'app/core/internationalization'; import { SharePublicDashboard } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard'; import { isPublicDashboardsEnabled } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; import { isPanelModelLibraryPanel } from 'app/features/library-panels/guard'; import { AccessControlAction } from 'app/types'; diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/ConfigPublicDashboard.tsx b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/ConfigPublicDashboard.tsx index 662a0b29999..f32b8d0a262 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/ConfigPublicDashboard.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/ConfigPublicDashboard.tsx @@ -21,7 +21,7 @@ import { usePauseOrResumePublicDashboardMutation, useUpdatePublicDashboardMutation, } from 'app/features/dashboard/api/publicDashboardApi'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { getTimeRange } from 'app/features/dashboard/utils/timeRange'; import { DashboardScene } from 'app/features/dashboard-scene/scene/DashboardScene'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/CreatePublicDashboard/CreatePublicDashboard.tsx b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/CreatePublicDashboard/CreatePublicDashboard.tsx index 2287fef08d4..135bdc1e793 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/CreatePublicDashboard/CreatePublicDashboard.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/CreatePublicDashboard/CreatePublicDashboard.tsx @@ -7,7 +7,7 @@ import { Button, Spinner, useStyles2 } from '@grafana/ui'; import { Trans } from 'app/core/internationalization'; import { contextSrv } from 'app/core/services/context_srv'; import { useCreatePublicDashboardMutation } from 'app/features/dashboard/api/publicDashboardApi'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { DashboardScene } from 'app/features/dashboard-scene/scene/DashboardScene'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; import { AccessControlAction, useSelector } from 'app/types'; diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils.ts b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils.ts index 34de4860b99..5c3b7e1f862 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils.ts +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils.ts @@ -3,7 +3,7 @@ import { config, DataSourceWithBackend, featureEnabled } from '@grafana/runtime' import { getConfig } from 'app/core/config'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; -import { PanelModel } from '../../../state'; +import { PanelModel } from '../../../state/PanelModel'; import { shareDashboardType } from '../utils'; import { supportedDatasources } from './SupportedPubdashDatasources'; diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/useGetUnsupportedDataSources.ts b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/useGetUnsupportedDataSources.ts index 0ccbc99dbfd..e9ed4c902af 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/useGetUnsupportedDataSources.ts +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/useGetUnsupportedDataSources.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { getUnsupportedDashboardDatasources } from './SharePublicDashboardUtils'; diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/utilsTest.tsx b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/utilsTest.tsx index 6ef2e1bec2b..f1a2eb97686 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/utilsTest.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/utilsTest.tsx @@ -5,7 +5,8 @@ import { Provider } from 'react-redux'; import { configureStore } from '../../../../../store/configureStore'; import { DashboardInitPhase } from '../../../../../types'; -import { DashboardModel, PanelModel } from '../../../state'; +import { DashboardModel } from '../../../state/DashboardModel'; +import { PanelModel } from '../../../state/PanelModel'; import { createDashboardModelFixture } from '../../../state/__fixtures__/dashboardFixtures'; import { ShareModal } from '../ShareModal'; diff --git a/public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx b/public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx index d300289fe74..232562451b3 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx +++ b/public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx @@ -6,7 +6,8 @@ import { getBackendSrv } from '@grafana/runtime'; import { Button, ClipboardButton, Field, Input, LinkButton, Modal, Select, Spinner, Stack } from '@grafana/ui'; import { t, Trans } from 'app/core/internationalization'; import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; import { getDashboardSnapshotSrv } from '../../services/SnapshotSrv'; diff --git a/public/app/features/dashboard/components/ShareModal/types.ts b/public/app/features/dashboard/components/ShareModal/types.ts index cabf30ebed2..54992ec1657 100644 --- a/public/app/features/dashboard/components/ShareModal/types.ts +++ b/public/app/features/dashboard/components/ShareModal/types.ts @@ -2,7 +2,8 @@ import * as React from 'react'; import { NavModelItem } from '@grafana/data'; import { LibraryPanel } from '@grafana/schema/dist/esm/index.gen'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; export interface ShareModalTabProps { dashboard: DashboardModel; diff --git a/public/app/features/dashboard/components/ShareModal/utils.ts b/public/app/features/dashboard/components/ShareModal/utils.ts index 12518e52eeb..ce8c5f5b168 100644 --- a/public/app/features/dashboard/components/ShareModal/utils.ts +++ b/public/app/features/dashboard/components/ShareModal/utils.ts @@ -4,7 +4,7 @@ import { SceneObjectRef, VizPanel } from '@grafana/scenes'; import { createShortLink } from 'app/core/utils/shortLinks'; import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv'; -import { PanelModel } from '../../state'; +import { PanelModel } from '../../state/PanelModel'; export interface BuildParamsArgs { useCurrentTimeRange: boolean; diff --git a/public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx b/public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx index b442b1ad768..1fa176900eb 100644 --- a/public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx +++ b/public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx @@ -8,7 +8,7 @@ import { Tooltip, useForceUpdate } from '@grafana/ui'; import { LINK_ICON_MAP } from 'app/features/dashboard-scene/settings/links/utils'; import { getLinkSrv } from '../../../panel/panellinks/link_srv'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; import { DashboardLinkButton, DashboardLinksDashboard } from './DashboardLinksDashboard'; diff --git a/public/app/features/dashboard/components/SubMenu/SubMenu.tsx b/public/app/features/dashboard/components/SubMenu/SubMenu.tsx index 3fdc08ad079..605c19dc0af 100644 --- a/public/app/features/dashboard/components/SubMenu/SubMenu.tsx +++ b/public/app/features/dashboard/components/SubMenu/SubMenu.tsx @@ -9,7 +9,7 @@ import { stylesFactory, Themeable2, withTheme2 } from '@grafana/ui'; import { StoreState } from '../../../../types'; import { getSubMenuVariables, getVariablesState } from '../../../variables/state/selectors'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; import { Annotations } from './Annotations'; import { DashboardLinks } from './DashboardLinks'; diff --git a/public/app/features/dashboard/components/TransformationsEditor/TransformationsEditor.test.tsx b/public/app/features/dashboard/components/TransformationsEditor/TransformationsEditor.test.tsx index 958bed2991b..80ff9f45e1e 100644 --- a/public/app/features/dashboard/components/TransformationsEditor/TransformationsEditor.test.tsx +++ b/public/app/features/dashboard/components/TransformationsEditor/TransformationsEditor.test.tsx @@ -6,7 +6,7 @@ import { selectors } from '@grafana/e2e-selectors'; import config from 'app/core/config'; import { getStandardTransformers } from 'app/features/transformers/standardTransformers'; -import { PanelModel } from '../../state'; +import { PanelModel } from '../../state/PanelModel'; import { TransformationsEditor } from './TransformationsEditor'; diff --git a/public/app/features/dashboard/components/TransformationsEditor/TransformationsEditor.tsx b/public/app/features/dashboard/components/TransformationsEditor/TransformationsEditor.tsx index 96bd51cc5f9..577206d37af 100644 --- a/public/app/features/dashboard/components/TransformationsEditor/TransformationsEditor.tsx +++ b/public/app/features/dashboard/components/TransformationsEditor/TransformationsEditor.tsx @@ -26,7 +26,7 @@ import { import config from 'app/core/config'; import { EmptyTransformationsMessage } from 'app/features/dashboard-scene/panel-edit/PanelDataPane/EmptyTransformationsMessage'; -import { PanelModel } from '../../state'; +import { PanelModel } from '../../state/PanelModel'; import { PanelNotSupported } from '../PanelEditor/PanelNotSupported'; import { TransformationOperationRows } from './TransformationOperationRows'; diff --git a/public/app/features/dashboard/components/VersionHistory/useDashboardRestore.tsx b/public/app/features/dashboard/components/VersionHistory/useDashboardRestore.tsx index af1f894d3f2..4ee340a8110 100644 --- a/public/app/features/dashboard/components/VersionHistory/useDashboardRestore.tsx +++ b/public/app/features/dashboard/components/VersionHistory/useDashboardRestore.tsx @@ -8,7 +8,7 @@ import { historySrv } from 'app/features/dashboard-scene/settings/version-histor import { useSelector } from 'app/types'; import { dashboardWatcher } from '../../../live/dashboard/dashboardWatcher'; -import { DashboardModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; const restoreDashboard = async (version: number, dashboard: DashboardModel) => { // Skip the watcher logic for this save since it's handled by the hook diff --git a/public/app/features/dashboard/containers/DashboardPage.test.tsx b/public/app/features/dashboard/containers/DashboardPage.test.tsx index a773197e7b1..1baa0231d4b 100644 --- a/public/app/features/dashboard/containers/DashboardPage.test.tsx +++ b/public/app/features/dashboard/containers/DashboardPage.test.tsx @@ -18,7 +18,7 @@ import { DashboardInitPhase, DashboardMeta, DashboardRoutes } from 'app/types'; import { Props as LazyLoaderProps } from '../dashgrid/LazyLoader'; import { DashboardSrv, setDashboardSrv } from '../services/DashboardSrv'; -import { DashboardModel } from '../state'; +import { DashboardModel } from '../state/DashboardModel'; import { createDashboardModelFixture } from '../state/__fixtures__/dashboardFixtures'; import { Props, UnthemedDashboardPage } from './DashboardPage'; diff --git a/public/app/features/dashboard/containers/DashboardPage.tsx b/public/app/features/dashboard/containers/DashboardPage.tsx index fffdf296dd0..03f32764a77 100644 --- a/public/app/features/dashboard/containers/DashboardPage.tsx +++ b/public/app/features/dashboard/containers/DashboardPage.tsx @@ -16,7 +16,7 @@ import { getKioskMode } from 'app/core/navigation/kiosk'; import { GrafanaRouteComponentProps } from 'app/core/navigation/types'; import { ID_PREFIX } from 'app/core/reducers/navBarTree'; import { getNavModel } from 'app/core/selectors/navModel'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { dashboardWatcher } from 'app/features/live/dashboard/dashboardWatcher'; import { AngularDeprecationNotice } from 'app/features/plugins/angularDeprecation/AngularDeprecationNotice'; import { AngularMigrationNotice } from 'app/features/plugins/angularDeprecation/AngularMigrationNotice'; diff --git a/public/app/features/dashboard/containers/PublicDashboardPage.test.tsx b/public/app/features/dashboard/containers/PublicDashboardPage.test.tsx index b5b96868e02..0de0da4426b 100644 --- a/public/app/features/dashboard/containers/PublicDashboardPage.test.tsx +++ b/public/app/features/dashboard/containers/PublicDashboardPage.test.tsx @@ -13,7 +13,7 @@ import { DashboardInitPhase, DashboardMeta, DashboardRoutes } from 'app/types'; import { configureStore } from '../../../store/configureStore'; import { Props as LazyLoaderProps } from '../dashgrid/LazyLoader'; -import { DashboardModel } from '../state'; +import { DashboardModel } from '../state/DashboardModel'; import { initDashboard } from '../state/initDashboard'; import PublicDashboardPage, { Props } from './PublicDashboardPage'; diff --git a/public/app/features/dashboard/containers/PublicDashboardPage.tsx b/public/app/features/dashboard/containers/PublicDashboardPage.tsx index 51a231f1fef..1588d464e1c 100644 --- a/public/app/features/dashboard/containers/PublicDashboardPage.tsx +++ b/public/app/features/dashboard/containers/PublicDashboardPage.tsx @@ -24,7 +24,7 @@ import { useGetPublicDashboardConfig } from '../components/PublicDashboard/usePu import { PublicDashboardNotAvailable } from '../components/PublicDashboardNotAvailable/PublicDashboardNotAvailable'; import { DashboardGrid } from '../dashgrid/DashboardGrid'; import { getTimeSrv } from '../services/TimeSrv'; -import { DashboardModel } from '../state'; +import { DashboardModel } from '../state/DashboardModel'; import { initDashboard } from '../state/initDashboard'; export type Props = Omit< diff --git a/public/app/features/dashboard/containers/SoloPanelPage.test.tsx b/public/app/features/dashboard/containers/SoloPanelPage.test.tsx index 0d4d7840f38..a1dfe58b99d 100644 --- a/public/app/features/dashboard/containers/SoloPanelPage.test.tsx +++ b/public/app/features/dashboard/containers/SoloPanelPage.test.tsx @@ -9,7 +9,7 @@ import { DashboardMeta, DashboardRoutes } from 'app/types'; import { getRouteComponentProps } from '../../../core/navigation/__mocks__/routeProps'; import { Props as DashboardPanelProps } from '../dashgrid/DashboardPanel'; -import { DashboardModel } from '../state'; +import { DashboardModel } from '../state/DashboardModel'; import { createDashboardModelFixture } from '../state/__fixtures__/dashboardFixtures'; import { Props, SoloPanelPage } from './SoloPanelPage'; diff --git a/public/app/features/dashboard/containers/SoloPanelPage.tsx b/public/app/features/dashboard/containers/SoloPanelPage.tsx index 48dc90beba1..db0064ec0ab 100644 --- a/public/app/features/dashboard/containers/SoloPanelPage.tsx +++ b/public/app/features/dashboard/containers/SoloPanelPage.tsx @@ -7,7 +7,8 @@ import AutoSizer from 'react-virtualized-auto-sizer'; import { GrafanaTheme2 } from '@grafana/data'; import { Alert, useStyles2 } from '@grafana/ui'; import { GrafanaRouteComponentProps } from 'app/core/navigation/types'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { StoreState } from 'app/types'; import { useGrafana } from '../../../core/context/GrafanaContext'; diff --git a/public/app/features/dashboard/dashgrid/DashboardEmpty.tsx b/public/app/features/dashboard/dashgrid/DashboardEmpty.tsx index de9a7d13070..220952a435c 100644 --- a/public/app/features/dashboard/dashgrid/DashboardEmpty.tsx +++ b/public/app/features/dashboard/dashgrid/DashboardEmpty.tsx @@ -5,7 +5,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { locationService } from '@grafana/runtime'; import { Button, useStyles2, Text, Box, Stack } from '@grafana/ui'; import { Trans } from 'app/core/internationalization'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { onAddLibraryPanel as onAddLibraryPanelImpl, onCreateNewPanel, diff --git a/public/app/features/dashboard/dashgrid/DashboardGrid.test.tsx b/public/app/features/dashboard/dashgrid/DashboardGrid.test.tsx index 052044af9b4..164d49ba4b8 100644 --- a/public/app/features/dashboard/dashgrid/DashboardGrid.test.tsx +++ b/public/app/features/dashboard/dashgrid/DashboardGrid.test.tsx @@ -9,7 +9,7 @@ import { GetVariables } from 'app/features/variables/state/selectors'; import { VariablesChanged } from 'app/features/variables/types'; import { DashboardMeta } from 'app/types'; -import { DashboardModel } from '../state'; +import { DashboardModel } from '../state/DashboardModel'; import { createDashboardModelFixture } from '../state/__fixtures__/dashboardFixtures'; import { DashboardGrid, PANEL_FILTER_VARIABLE, Props } from './DashboardGrid'; diff --git a/public/app/features/dashboard/dashgrid/DashboardGrid.tsx b/public/app/features/dashboard/dashgrid/DashboardGrid.tsx index cb09e66048a..397dfc30c33 100644 --- a/public/app/features/dashboard/dashgrid/DashboardGrid.tsx +++ b/public/app/features/dashboard/dashgrid/DashboardGrid.tsx @@ -13,8 +13,8 @@ import { DashboardPanelsChangedEvent } from 'app/types/events'; import { AddLibraryPanelWidget } from '../components/AddLibraryPanelWidget'; import { DashboardRow } from '../components/DashboardRow'; -import { DashboardModel, PanelModel } from '../state'; -import { GridPos } from '../state/PanelModel'; +import { DashboardModel } from '../state/DashboardModel'; +import { GridPos, PanelModel } from '../state/PanelModel'; import DashboardEmpty from './DashboardEmpty'; import { DashboardPanel } from './DashboardPanel'; diff --git a/public/app/features/dashboard/dashgrid/DashboardPanel.tsx b/public/app/features/dashboard/dashgrid/DashboardPanel.tsx index b0873eabb07..383cab5d8f9 100644 --- a/public/app/features/dashboard/dashgrid/DashboardPanel.tsx +++ b/public/app/features/dashboard/dashgrid/DashboardPanel.tsx @@ -5,7 +5,8 @@ import { StoreState } from 'app/types'; import { initPanelState } from '../../panel/state/actions'; import { setPanelInstanceState } from '../../panel/state/reducers'; -import { DashboardModel, PanelModel } from '../state'; +import { DashboardModel } from '../state/DashboardModel'; +import { PanelModel } from '../state/PanelModel'; import { LazyLoader } from './LazyLoader'; import { PanelChromeAngular } from './PanelChromeAngular'; diff --git a/public/app/features/dashboard/dashgrid/PanelChromeAngular.tsx b/public/app/features/dashboard/dashgrid/PanelChromeAngular.tsx index 4a0eb485f1e..bc32598a5b5 100644 --- a/public/app/features/dashboard/dashgrid/PanelChromeAngular.tsx +++ b/public/app/features/dashboard/dashgrid/PanelChromeAngular.tsx @@ -12,7 +12,8 @@ import { getPanelStateForModel } from 'app/features/panel/state/selectors'; import { StoreState } from 'app/types'; import { getTimeSrv, TimeSrv } from '../services/TimeSrv'; -import { DashboardModel, PanelModel } from '../state'; +import { DashboardModel } from '../state/DashboardModel'; +import { PanelModel } from '../state/PanelModel'; import { getPanelChromeProps } from '../utils/getPanelChromeProps'; import { PanelHeaderMenuWrapper } from './PanelHeader/PanelHeaderMenuWrapper'; diff --git a/public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuProvider.tsx b/public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuProvider.tsx index 1ff72d01a27..88057645e16 100644 --- a/public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuProvider.tsx +++ b/public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuProvider.tsx @@ -11,7 +11,8 @@ import { usePluginLinks } from '@grafana/runtime'; import { getPanelStateForModel } from 'app/features/panel/state/selectors'; import { useSelector } from 'app/types'; -import { DashboardModel, PanelModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; +import { PanelModel } from '../../state/PanelModel'; import { getPanelMenu } from '../../utils/getPanelMenu'; interface PanelHeaderMenuProviderApi { diff --git a/public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuWrapper.tsx b/public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuWrapper.tsx index 338573bb23a..fa17a134ffd 100644 --- a/public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuWrapper.tsx +++ b/public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuWrapper.tsx @@ -2,7 +2,8 @@ import * as React from 'react'; import { LoadingState } from '@grafana/data'; -import { DashboardModel, PanelModel } from '../../state'; +import { DashboardModel } from '../../state/DashboardModel'; +import { PanelModel } from '../../state/PanelModel'; import { PanelHeaderMenu } from './PanelHeaderMenu'; import { PanelHeaderMenuProvider } from './PanelHeaderMenuProvider'; diff --git a/public/app/features/dashboard/dashgrid/PanelStateWrapper.test.tsx b/public/app/features/dashboard/dashgrid/PanelStateWrapper.test.tsx index d37ebdc1af7..906bbde5a71 100644 --- a/public/app/features/dashboard/dashgrid/PanelStateWrapper.test.tsx +++ b/public/app/features/dashboard/dashgrid/PanelStateWrapper.test.tsx @@ -8,7 +8,8 @@ import { selectors } from '@grafana/e2e-selectors'; import { PanelQueryRunner } from '../../query/state/PanelQueryRunner'; import { setTimeSrv, TimeSrv } from '../services/TimeSrv'; -import { DashboardModel, PanelModel } from '../state'; +import { DashboardModel } from '../state/DashboardModel'; +import { PanelModel } from '../state/PanelModel'; import { PanelStateWrapper, Props } from './PanelStateWrapper'; diff --git a/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx b/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx index a0158c55aee..4f3d12cd7d6 100644 --- a/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx +++ b/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx @@ -46,7 +46,8 @@ import { RenderEvent } from 'app/types/events'; import { deleteAnnotation, saveAnnotation, updateAnnotation } from '../../annotations/api'; import { getDashboardQueryRunner } from '../../query/state/DashboardQueryRunner/DashboardQueryRunner'; import { getTimeSrv, TimeSrv } from '../services/TimeSrv'; -import { DashboardModel, PanelModel } from '../state'; +import { DashboardModel } from '../state/DashboardModel'; +import { PanelModel } from '../state/PanelModel'; import { getPanelChromeProps } from '../utils/getPanelChromeProps'; import { loadSnapshotData } from '../utils/loadSnapshotData'; diff --git a/public/app/features/dashboard/state/index.ts b/public/app/features/dashboard/state/index.ts deleted file mode 100644 index 253d4aa7ac3..00000000000 --- a/public/app/features/dashboard/state/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { DashboardModel } from './DashboardModel'; -export { PanelModel } from './PanelModel'; diff --git a/public/app/features/dashboard/utils/dashboard.ts b/public/app/features/dashboard/utils/dashboard.ts index d11a154feca..4c6c2864ef5 100644 --- a/public/app/features/dashboard/utils/dashboard.ts +++ b/public/app/features/dashboard/utils/dashboard.ts @@ -5,7 +5,8 @@ import { locationService } from '@grafana/runtime'; import config from 'app/core/config'; import { LS_PANEL_COPY_KEY } from 'app/core/constants'; import store from 'app/core/store'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { calculateNewPanelGridPos } from 'app/features/dashboard/utils/panel'; export const NEW_PANEL_TITLE = 'Panel Title'; diff --git a/public/app/features/dashboard/utils/getPanelChromeProps.tsx b/public/app/features/dashboard/utils/getPanelChromeProps.tsx index 52a0e96ec79..a4814ee9040 100644 --- a/public/app/features/dashboard/utils/getPanelChromeProps.tsx +++ b/public/app/features/dashboard/utils/getPanelChromeProps.tsx @@ -9,7 +9,8 @@ import { getPanelLinksSupplier } from 'app/features/panel/panellinks/linkSupplie import { isAngularDatasourcePluginAndNotHidden } from 'app/features/plugins/angularDeprecation/utils'; import { PanelHeaderTitleItems } from '../dashgrid/PanelHeader/PanelHeaderTitleItems'; -import { DashboardModel, PanelModel } from '../state'; +import { DashboardModel } from '../state/DashboardModel'; +import { PanelModel } from '../state/PanelModel'; interface CommonProps { panel: PanelModel; diff --git a/public/app/features/dashboard/utils/getPanelMenu.test.ts b/public/app/features/dashboard/utils/getPanelMenu.test.ts index 7827f341781..dad84aa00c5 100644 --- a/public/app/features/dashboard/utils/getPanelMenu.test.ts +++ b/public/app/features/dashboard/utils/getPanelMenu.test.ts @@ -8,7 +8,7 @@ import * as actions from 'app/features/explore/state/main'; import { setStore } from 'app/store/store'; import { AccessControlAction } from 'app/types'; -import { PanelModel } from '../state'; +import { PanelModel } from '../state/PanelModel'; import { createDashboardModelFixture } from '../state/__fixtures__/dashboardFixtures'; import { getPanelMenu } from './getPanelMenu'; diff --git a/public/app/features/dashboard/utils/loadSnapshotData.ts b/public/app/features/dashboard/utils/loadSnapshotData.ts index ccd169140ea..2be1206ec12 100644 --- a/public/app/features/dashboard/utils/loadSnapshotData.ts +++ b/public/app/features/dashboard/utils/loadSnapshotData.ts @@ -10,7 +10,8 @@ import { config } from 'app/core/config'; import { SnapshotWorker } from '../../query/state/DashboardQueryRunner/SnapshotWorker'; import { getTimeSrv } from '../services/TimeSrv'; -import { DashboardModel, PanelModel } from '../state'; +import { DashboardModel } from '../state/DashboardModel'; +import { PanelModel } from '../state/PanelModel'; import { applyPanelTimeOverrides } from './panel'; diff --git a/public/app/features/dashboard/utils/panel.test.ts b/public/app/features/dashboard/utils/panel.test.ts index 0d82380b489..a739dcedab4 100644 --- a/public/app/features/dashboard/utils/panel.test.ts +++ b/public/app/features/dashboard/utils/panel.test.ts @@ -5,7 +5,7 @@ import { dateTime, DateTime, PanelProps, TimeRange } from '@grafana/data'; import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; import { applyPanelTimeOverrides, calculateInnerPanelHeight } from 'app/features/dashboard/utils/panel'; -import { PanelModel } from '../state'; +import { PanelModel } from '../state/PanelModel'; const dashboardTimeRange: TimeRange = { from: dateTime([2019, 1, 11, 12, 0]), diff --git a/public/app/features/dashboard/utils/panelMerge.ts b/public/app/features/dashboard/utils/panelMerge.ts index 309b7fddea7..fa0216fa3a6 100644 --- a/public/app/features/dashboard/utils/panelMerge.ts +++ b/public/app/features/dashboard/utils/panelMerge.ts @@ -2,7 +2,7 @@ import { isEqualWith } from 'lodash'; import { PanelModel as IPanelModel } from '@grafana/data'; -import { PanelModel } from '../state'; +import { PanelModel } from '../state/PanelModel'; export interface PanelMergeInfo { changed: boolean; diff --git a/public/app/features/dashboard/utils/tracking.ts b/public/app/features/dashboard/utils/tracking.ts index a70c8b84ab4..a9cca265776 100644 --- a/public/app/features/dashboard/utils/tracking.ts +++ b/public/app/features/dashboard/utils/tracking.ts @@ -2,7 +2,8 @@ import { Panel, VariableModel } from '@grafana/schema/dist/esm/index'; import { DashboardScene } from 'app/features/dashboard-scene/scene/DashboardScene'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; -import { DashboardModel, PanelModel } from '../state'; +import { DashboardModel } from '../state/DashboardModel'; +import { PanelModel } from '../state/PanelModel'; export function trackDashboardLoaded(dashboard: DashboardModel, duration?: number, versionBeforeMigration?: number) { // Count the different types of variables diff --git a/public/app/features/explore/state/main.test.ts b/public/app/features/explore/state/main.test.ts index 7174bf4e5f4..28fe5009234 100644 --- a/public/app/features/explore/state/main.test.ts +++ b/public/app/features/explore/state/main.test.ts @@ -3,7 +3,7 @@ import { thunkTester } from 'test/core/thunk/thunkTester'; import { dateTime, ExploreUrlState } from '@grafana/data'; import { serializeStateToUrlParam } from '@grafana/data/src/utils/url'; import { locationService } from '@grafana/runtime'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { reducerTester } from '../../../../test/core/redux/reducerTester'; import { MockDataSourceApi } from '../../../../test/mocks/datasource_srv'; diff --git a/public/app/features/explore/state/main.ts b/public/app/features/explore/state/main.ts index 306fc6ed3f1..3e1375434c9 100644 --- a/public/app/features/explore/state/main.ts +++ b/public/app/features/explore/state/main.ts @@ -5,7 +5,7 @@ import { AnyAction } from 'redux'; import { SplitOpenOptions, TimeRange, EventBusSrv } from '@grafana/data'; import { locationService } from '@grafana/runtime'; import { generateExploreId, GetExploreUrlArguments } from 'app/core/utils/explore'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { getTemplateSrv } from 'app/features/templating/template_srv'; import { CorrelationEditorDetailsUpdate, ExploreItemState, ExploreState } from 'app/types/explore'; diff --git a/public/app/features/inspector/InspectJSONTab.tsx b/public/app/features/inspector/InspectJSONTab.tsx index 1874a3e0b48..b8f7cda7197 100644 --- a/public/app/features/inspector/InspectJSONTab.tsx +++ b/public/app/features/inspector/InspectJSONTab.tsx @@ -10,7 +10,8 @@ import { locationService } from '@grafana/runtime'; import { Button, CodeEditor, Field, Select, useStyles2 } from '@grafana/ui'; import { appEvents } from 'app/core/core'; import { t } from 'app/core/internationalization'; -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { getPanelDataFrames } from '../dashboard/components/HelpWizard/utils'; import { getPanelInspectorStyles2 } from '../inspector/styles'; diff --git a/public/app/features/library-panels/components/AddLibraryPanelModal/AddLibraryPanelModal.tsx b/public/app/features/library-panels/components/AddLibraryPanelModal/AddLibraryPanelModal.tsx index afa39633756..c04bc81e9cd 100644 --- a/public/app/features/library-panels/components/AddLibraryPanelModal/AddLibraryPanelModal.tsx +++ b/public/app/features/library-panels/components/AddLibraryPanelModal/AddLibraryPanelModal.tsx @@ -7,7 +7,7 @@ import { Button, Field, Input, Modal, Stack } from '@grafana/ui'; import { FolderPicker } from 'app/core/components/Select/FolderPicker'; import { t, Trans } from 'app/core/internationalization'; -import { PanelModel } from '../../../dashboard/state'; +import { PanelModel } from '../../../dashboard/state/PanelModel'; import { getLibraryPanelByName } from '../../state/api'; import { usePanelSave } from '../../utils/usePanelSave'; diff --git a/public/app/features/library-panels/components/ChangeLibraryPanelModal/ChangeLibraryPanelModal.tsx b/public/app/features/library-panels/components/ChangeLibraryPanelModal/ChangeLibraryPanelModal.tsx index 76623045536..3e48d672a3f 100644 --- a/public/app/features/library-panels/components/ChangeLibraryPanelModal/ChangeLibraryPanelModal.tsx +++ b/public/app/features/library-panels/components/ChangeLibraryPanelModal/ChangeLibraryPanelModal.tsx @@ -1,6 +1,6 @@ import { ConfirmModal } from '@grafana/ui'; -import { PanelModel } from '../../../dashboard/state'; +import { PanelModel } from '../../../dashboard/state/PanelModel'; import { isPanelModelLibraryPanel } from '../../guard'; export interface ChangeLibraryPanelModalProps { diff --git a/public/app/features/library-panels/components/PanelLibraryOptionsGroup/PanelLibraryOptionsGroup.tsx b/public/app/features/library-panels/components/PanelLibraryOptionsGroup/PanelLibraryOptionsGroup.tsx index c84406b9d70..5d928460e20 100644 --- a/public/app/features/library-panels/components/PanelLibraryOptionsGroup/PanelLibraryOptionsGroup.tsx +++ b/public/app/features/library-panels/components/PanelLibraryOptionsGroup/PanelLibraryOptionsGroup.tsx @@ -4,7 +4,7 @@ import { useCallback, useState } from 'react'; import { PanelPluginMeta } from '@grafana/data'; import { Button, VerticalGroup } from '@grafana/ui'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { changeToLibraryPanel } from 'app/features/panel/state/actions'; import { useDispatch } from 'app/types'; diff --git a/public/app/features/library-panels/guard.ts b/public/app/features/library-panels/guard.ts index 739fe7bd2e3..3a68bfbc69e 100644 --- a/public/app/features/library-panels/guard.ts +++ b/public/app/features/library-panels/guard.ts @@ -1,4 +1,4 @@ -import { PanelModel } from '../dashboard/state'; +import { PanelModel } from '../dashboard/state/PanelModel'; import { PanelModelWithLibraryPanel } from './types'; diff --git a/public/app/features/library-panels/state/api.ts b/public/app/features/library-panels/state/api.ts index 18ee2b204d7..5466f0e79f6 100644 --- a/public/app/features/library-panels/state/api.ts +++ b/public/app/features/library-panels/state/api.ts @@ -2,7 +2,7 @@ import { lastValueFrom } from 'rxjs'; import { VizPanel } from '@grafana/scenes'; import { LibraryPanel, defaultDashboard } from '@grafana/schema'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { DashboardGridItem } from 'app/features/dashboard-scene/scene/layout-default/DashboardGridItem'; import { vizPanelToPanel } from 'app/features/dashboard-scene/serialization/transformSceneToSaveModel'; import { getLibraryPanelBehavior } from 'app/features/dashboard-scene/utils/utils'; diff --git a/public/app/features/library-panels/types.ts b/public/app/features/library-panels/types.ts index 0d4356ff7ba..5ce33b72620 100644 --- a/public/app/features/library-panels/types.ts +++ b/public/app/features/library-panels/types.ts @@ -4,7 +4,7 @@ import { Dispatch } from 'react'; import { LibraryPanel } from '@grafana/schema'; import { LibraryElementDTOMetaUser } from '@grafana/schema/src/raw/librarypanel/x/librarypanel_types.gen'; -import { PanelModel } from '../dashboard/state'; +import { PanelModel } from '../dashboard/state/PanelModel'; export enum LibraryElementKind { Panel = 1, diff --git a/public/app/features/library-panels/utils.ts b/public/app/features/library-panels/utils.ts index 874bcb8aa54..8974f6f0c30 100644 --- a/public/app/features/library-panels/utils.ts +++ b/public/app/features/library-panels/utils.ts @@ -1,4 +1,4 @@ -import { PanelModel } from '../dashboard/state'; +import { PanelModel } from '../dashboard/state/PanelModel'; import { addLibraryPanel, updateLibraryPanel } from './state/api'; import { LibraryElementDTO, PanelModelWithLibraryPanel } from './types'; diff --git a/public/app/features/library-panels/utils/usePanelSave.ts b/public/app/features/library-panels/utils/usePanelSave.ts index 85ac7ba1bfd..2d72cbe73d0 100644 --- a/public/app/features/library-panels/utils/usePanelSave.ts +++ b/public/app/features/library-panels/utils/usePanelSave.ts @@ -3,7 +3,7 @@ import useAsyncFn from 'react-use/lib/useAsyncFn'; import { isFetchError } from '@grafana/runtime'; import { useAppNotification } from 'app/core/copy/appNotification'; import { t } from 'app/core/internationalization'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { saveAndRefreshLibraryPanel } from '../utils'; diff --git a/public/app/features/manage-dashboards/state/actions.test.ts b/public/app/features/manage-dashboards/state/actions.test.ts index 209bae2ec9e..8581d113c26 100644 --- a/public/app/features/manage-dashboards/state/actions.test.ts +++ b/public/app/features/manage-dashboards/state/actions.test.ts @@ -5,7 +5,7 @@ import { defaultDashboard, FieldColorModeId } from '@grafana/schema'; import { browseDashboardsAPI } from 'app/features/browse-dashboards/api/browseDashboardsAPI'; import { getLibraryPanel } from 'app/features/library-panels/state/api'; -import { PanelModel } from '../../dashboard/state'; +import { PanelModel } from '../../dashboard/state/PanelModel'; import { LibraryElementDTO } from '../../library-panels/types'; import { DashboardJson } from '../types'; import { validateDashboardJson } from '../utils/validation'; diff --git a/public/app/features/panel/state/actions.test.ts b/public/app/features/panel/state/actions.test.ts index 2574f92c27c..0f6dc41284d 100644 --- a/public/app/features/panel/state/actions.test.ts +++ b/public/app/features/panel/state/actions.test.ts @@ -1,7 +1,7 @@ import { standardEditorsRegistry, standardFieldConfigEditorRegistry } from '@grafana/data'; import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; import { mockStandardFieldConfigOptions } from '@grafana/data/test/helpers/fieldConfig'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { panelPluginLoaded } from 'app/features/plugins/admin/state/actions'; import { thunkTester } from '../../../../test/core/thunk/thunkTester'; diff --git a/public/app/features/panel/state/selectors.ts b/public/app/features/panel/state/selectors.ts index 5bfaccfe5f7..6851c061940 100644 --- a/public/app/features/panel/state/selectors.ts +++ b/public/app/features/panel/state/selectors.ts @@ -1,4 +1,4 @@ -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { StoreState } from 'app/types'; import { PanelState } from './reducers'; diff --git a/public/app/features/query/state/DashboardQueryRunner/AnnotationsQueryRunner.ts b/public/app/features/query/state/DashboardQueryRunner/AnnotationsQueryRunner.ts index 6c656d4d8b3..3ececb5efc2 100644 --- a/public/app/features/query/state/DashboardQueryRunner/AnnotationsQueryRunner.ts +++ b/public/app/features/query/state/DashboardQueryRunner/AnnotationsQueryRunner.ts @@ -4,7 +4,7 @@ import { catchError, map } from 'rxjs/operators'; import { AnnotationEvent, DataSourceApi } from '@grafana/data'; import { executeAnnotationQuery } from '../../../annotations/executeAnnotationQuery'; -import { PanelModel } from '../../../dashboard/state'; +import { PanelModel } from '../../../dashboard/state/PanelModel'; import { AnnotationQueryRunner, AnnotationQueryRunnerOptions } from './types'; import { handleAnnotationQueryRunnerError } from './utils'; diff --git a/public/app/features/query/state/DashboardQueryRunner/AnnotationsWorker.test.ts b/public/app/features/query/state/DashboardQueryRunner/AnnotationsWorker.test.ts index c71989ffac4..360a5f1837f 100644 --- a/public/app/features/query/state/DashboardQueryRunner/AnnotationsWorker.test.ts +++ b/public/app/features/query/state/DashboardQueryRunner/AnnotationsWorker.test.ts @@ -3,7 +3,7 @@ import { delay } from 'rxjs/operators'; import { AnnotationQuery } from '@grafana/data'; import { DataSourceSrv, setDataSourceSrv, config } from '@grafana/runtime'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { silenceConsoleOutput } from '../../../../../test/core/utils/silenceConsoleOutput'; import * as annotationsSrv from '../../../annotations/executeAnnotationQuery'; diff --git a/public/app/features/query/state/DashboardQueryRunner/DashboardQueryRunner.ts b/public/app/features/query/state/DashboardQueryRunner/DashboardQueryRunner.ts index ddd605865e7..3c6e8fb25f9 100644 --- a/public/app/features/query/state/DashboardQueryRunner/DashboardQueryRunner.ts +++ b/public/app/features/query/state/DashboardQueryRunner/DashboardQueryRunner.ts @@ -6,7 +6,7 @@ import { RefreshEvent } from '@grafana/runtime'; import { dedupAnnotations } from 'app/features/annotations/events_processing'; import { getTimeSrv, TimeSrv } from '../../../dashboard/services/TimeSrv'; -import { DashboardModel } from '../../../dashboard/state'; +import { DashboardModel } from '../../../dashboard/state/DashboardModel'; import { AnnotationsWorker } from './AnnotationsWorker'; import { SnapshotWorker } from './SnapshotWorker'; diff --git a/public/app/features/query/state/DashboardQueryRunner/SnapshotWorker.test.ts b/public/app/features/query/state/DashboardQueryRunner/SnapshotWorker.test.ts index fa1770780c3..4140dd5f529 100644 --- a/public/app/features/query/state/DashboardQueryRunner/SnapshotWorker.test.ts +++ b/public/app/features/query/state/DashboardQueryRunner/SnapshotWorker.test.ts @@ -1,6 +1,6 @@ import { AnnotationEvent, AnnotationQuery, getDefaultTimeRange } from '@grafana/data'; import { Dashboard } from '@grafana/schema'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { SnapshotWorker } from './SnapshotWorker'; import { DashboardQueryRunnerOptions } from './types'; diff --git a/public/app/features/query/state/DashboardQueryRunner/SnapshotWorker.ts b/public/app/features/query/state/DashboardQueryRunner/SnapshotWorker.ts index 43f187c2cff..1bb4cf285ce 100644 --- a/public/app/features/query/state/DashboardQueryRunner/SnapshotWorker.ts +++ b/public/app/features/query/state/DashboardQueryRunner/SnapshotWorker.ts @@ -2,7 +2,7 @@ import { Observable, of } from 'rxjs'; import { AnnotationEvent } from '@grafana/data'; -import { DashboardModel } from '../../../dashboard/state'; +import { DashboardModel } from '../../../dashboard/state/DashboardModel'; import { DashboardQueryRunnerOptions, DashboardQueryRunnerWorker, DashboardQueryRunnerWorkerResult } from './types'; import { emptyResult, getAnnotationsByPanelId, translateQueryResult } from './utils'; diff --git a/public/app/features/query/state/DashboardQueryRunner/types.ts b/public/app/features/query/state/DashboardQueryRunner/types.ts index ff19d443506..73ba8961d6d 100644 --- a/public/app/features/query/state/DashboardQueryRunner/types.ts +++ b/public/app/features/query/state/DashboardQueryRunner/types.ts @@ -2,7 +2,7 @@ import { Observable } from 'rxjs'; import { AlertStateInfo, AnnotationEvent, AnnotationQuery, DataSourceApi, TimeRange } from '@grafana/data'; -import { DashboardModel } from '../../../dashboard/state'; +import { DashboardModel } from '../../../dashboard/state/DashboardModel'; export interface DashboardQueryRunnerOptions { dashboard: DashboardModel; diff --git a/public/app/features/query/state/PanelQueryRunner.ts b/public/app/features/query/state/PanelQueryRunner.ts index 8853a9945a2..329d4186a8e 100644 --- a/public/app/features/query/state/PanelQueryRunner.ts +++ b/public/app/features/query/state/PanelQueryRunner.ts @@ -37,7 +37,7 @@ import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; import { getTemplateSrv } from 'app/features/templating/template_srv'; import { isSharedDashboardQuery, runSharedRequest } from '../../../plugins/datasource/dashboard'; -import { PanelModel } from '../../dashboard/state'; +import { PanelModel } from '../../dashboard/state/PanelModel'; import { getDashboardQueryRunner } from './DashboardQueryRunner/DashboardQueryRunner'; import { mergePanelAndDashData } from './mergePanelAndDashData'; diff --git a/public/app/features/runtime/init.ts b/public/app/features/runtime/init.ts index 1f71bf55154..6960d0183d9 100644 --- a/public/app/features/runtime/init.ts +++ b/public/app/features/runtime/init.ts @@ -2,7 +2,7 @@ import { PanelData, RawTimeRange } from '@grafana/data'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv'; -import { DashboardModel } from '../dashboard/state'; +import { DashboardModel } from '../dashboard/state/DashboardModel'; declare global { interface Window { diff --git a/public/app/features/variables/inspect/VariablesUnknownTable.tsx b/public/app/features/variables/inspect/VariablesUnknownTable.tsx index cd7196118bf..f197b584267 100644 --- a/public/app/features/variables/inspect/VariablesUnknownTable.tsx +++ b/public/app/features/variables/inspect/VariablesUnknownTable.tsx @@ -6,7 +6,7 @@ import { GrafanaTheme2 } from '@grafana/data'; import { reportInteraction } from '@grafana/runtime'; import { CollapsableSection, HorizontalGroup, Icon, Spinner, Tooltip, useStyles2, VerticalGroup } from '@grafana/ui'; -import { DashboardModel } from '../../dashboard/state'; +import { DashboardModel } from '../../dashboard/state/DashboardModel'; import { VariableModel } from '../types'; import { VariablesUnknownButton } from './VariablesUnknownButton'; diff --git a/public/app/features/variables/inspect/utils.test.ts b/public/app/features/variables/inspect/utils.test.ts index bd14a965373..a8533bf1c41 100644 --- a/public/app/features/variables/inspect/utils.test.ts +++ b/public/app/features/variables/inspect/utils.test.ts @@ -1,4 +1,5 @@ -import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { variableAdapters } from '../adapters'; import { createCustomVariableAdapter } from '../custom/adapter'; diff --git a/public/app/features/variables/inspect/utils.ts b/public/app/features/variables/inspect/utils.ts index 5858d10952e..a8632eca193 100644 --- a/public/app/features/variables/inspect/utils.ts +++ b/public/app/features/variables/inspect/utils.ts @@ -4,7 +4,8 @@ import { mapSet } from 'app/core/utils/set'; import { stringifyPanelModel } from 'app/features/dashboard/state/PanelModel'; import { safeStringifyValue } from '../../../core/utils/explore'; -import { DashboardModel, PanelModel } from '../../dashboard/state'; +import { DashboardModel } from '../../dashboard/state/DashboardModel'; +import { PanelModel } from '../../dashboard/state/PanelModel'; import { variableAdapters } from '../adapters'; import { isAdHoc } from '../guard'; import { VariableModel } from '../types'; diff --git a/public/app/features/variables/state/actions.test.ts b/public/app/features/variables/state/actions.test.ts index e324fe15059..5248711ae03 100644 --- a/public/app/features/variables/state/actions.test.ts +++ b/public/app/features/variables/state/actions.test.ts @@ -4,7 +4,7 @@ import { ConstantVariableModel, LoadingState, VariableRefresh } from '@grafana/d import * as runtime from '@grafana/runtime'; import { DataSourceSrv, LocationService } from '@grafana/runtime'; import { BackendSrv } from 'app/core/services/backend_srv'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { reduxTester } from '../../../../test/core/redux/reduxTester'; import { toAsyncOfResult } from '../../query/state/DashboardQueryRunner/testHelpers'; diff --git a/public/app/features/variables/state/actions.ts b/public/app/features/variables/state/actions.ts index 2e1ea5ba255..fdbc54bbbba 100644 --- a/public/app/features/variables/state/actions.ts +++ b/public/app/features/variables/state/actions.ts @@ -24,7 +24,7 @@ import { config, locationService, logWarning } from '@grafana/runtime'; import { notifyApp } from 'app/core/actions'; import { contextSrv } from 'app/core/services/context_srv'; import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { store } from 'app/store/store'; import { createErrorNotification } from '../../../core/copy/appNotification'; diff --git a/public/app/features/variables/state/initVariableTransaction.test.ts b/public/app/features/variables/state/initVariableTransaction.test.ts index c0556092892..c540f14c188 100644 --- a/public/app/features/variables/state/initVariableTransaction.test.ts +++ b/public/app/features/variables/state/initVariableTransaction.test.ts @@ -1,6 +1,6 @@ import { DataSourceRef, LoadingState } from '@grafana/data/src'; import { setDataSourceSrv } from '@grafana/runtime/src'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { reduxTester } from '../../../../test/core/redux/reduxTester'; import { toAsyncOfResult } from '../../query/state/DashboardQueryRunner/testHelpers'; diff --git a/public/app/features/variables/state/onTimeRangeUpdated.test.ts b/public/app/features/variables/state/onTimeRangeUpdated.test.ts index 911630949ec..528db0045ec 100644 --- a/public/app/features/variables/state/onTimeRangeUpdated.test.ts +++ b/public/app/features/variables/state/onTimeRangeUpdated.test.ts @@ -7,7 +7,7 @@ import { silenceConsoleOutput } from '../../../../test/core/utils/silenceConsole import { appEvents } from '../../../core/core'; import { notifyApp } from '../../../core/reducers/appNotification'; import { DashboardState } from '../../../types'; -import { DashboardModel } from '../../dashboard/state'; +import { DashboardModel } from '../../dashboard/state/DashboardModel'; import { createDashboardModelFixture } from '../../dashboard/state/__fixtures__/dashboardFixtures'; import { TemplateSrv } from '../../templating/template_srv'; import { variableAdapters } from '../adapters'; diff --git a/public/app/features/variables/state/processVariable.test.ts b/public/app/features/variables/state/processVariable.test.ts index 4a7e4bed185..7973229b125 100644 --- a/public/app/features/variables/state/processVariable.test.ts +++ b/public/app/features/variables/state/processVariable.test.ts @@ -1,6 +1,6 @@ import { UrlQueryMap, VariableRefresh } from '@grafana/data'; import { setDataSourceSrv } from '@grafana/runtime'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { DatasourceSrv } from 'app/features/plugins/datasource_srv'; import { reduxTester } from '../../../../test/core/redux/reduxTester'; diff --git a/public/app/features/variables/state/templateVarsChangedInUrl.test.ts b/public/app/features/variables/state/templateVarsChangedInUrl.test.ts index 036a4eaa4c7..8e6f6432599 100644 --- a/public/app/features/variables/state/templateVarsChangedInUrl.test.ts +++ b/public/app/features/variables/state/templateVarsChangedInUrl.test.ts @@ -1,7 +1,7 @@ import { TypedVariableModel } from '@grafana/data'; import { DashboardState, StoreState } from '../../../types'; -import { PanelModel } from '../../dashboard/state'; +import { PanelModel } from '../../dashboard/state/PanelModel'; import { createDashboardModelFixture } from '../../dashboard/state/__fixtures__/dashboardFixtures'; import { initialState } from '../../dashboard/state/reducers'; import { variableAdapters } from '../adapters'; diff --git a/public/app/plugins/datasource/dashboard/DashboardQueryEditor.test.tsx b/public/app/plugins/datasource/dashboard/DashboardQueryEditor.test.tsx index 1798a6c1ae4..790b70a3c31 100644 --- a/public/app/plugins/datasource/dashboard/DashboardQueryEditor.test.tsx +++ b/public/app/plugins/datasource/dashboard/DashboardQueryEditor.test.tsx @@ -5,7 +5,7 @@ import { getDefaultTimeRange, LoadingState } from '@grafana/data'; import { setDataSourceSrv } from '@grafana/runtime'; import { mockDataSource, MockDataSourceSrv } from 'app/features/alerting/unified/mocks'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { createDashboardModelFixture, diff --git a/public/app/plugins/datasource/dashboard/DashboardQueryEditor.tsx b/public/app/plugins/datasource/dashboard/DashboardQueryEditor.tsx index 47f70640b07..9c151018d60 100644 --- a/public/app/plugins/datasource/dashboard/DashboardQueryEditor.tsx +++ b/public/app/plugins/datasource/dashboard/DashboardQueryEditor.tsx @@ -9,7 +9,7 @@ import { OperationsEditorRow } from '@grafana/experimental'; import { Field, Select, useStyles2, Spinner, RadioButtonGroup, Stack, InlineSwitch } from '@grafana/ui'; import config from 'app/core/config'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { DashboardScene } from 'app/features/dashboard-scene/scene/DashboardScene'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; import { filterPanelDataToQuery } from 'app/features/query/components/QueryEditorRow'; diff --git a/public/app/plugins/datasource/dashboard/runSharedRequest.ts b/public/app/plugins/datasource/dashboard/runSharedRequest.ts index d4b73dd4cc3..e895c839425 100644 --- a/public/app/plugins/datasource/dashboard/runSharedRequest.ts +++ b/public/app/plugins/datasource/dashboard/runSharedRequest.ts @@ -11,7 +11,7 @@ import { DataTopic, } from '@grafana/data'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { QueryRunnerOptions } from 'app/features/query/state/PanelQueryRunner'; import { DashboardQuery, SHARED_DASHBOARD_QUERY } from './types'; diff --git a/public/app/plugins/datasource/grafana/utils.ts b/public/app/plugins/datasource/grafana/utils.ts index 7e4d0585beb..3b89cab87bd 100644 --- a/public/app/plugins/datasource/grafana/utils.ts +++ b/public/app/plugins/datasource/grafana/utils.ts @@ -3,7 +3,7 @@ import { DropEvent, FileRejection } from 'react-dropzone'; import { DataFrame, DataFrameJSON, dataFrameToJSON } from '@grafana/data'; import appEvents from 'app/core/app_events'; import { GRAFANA_DATASOURCE_NAME } from 'app/features/alerting/unified/utils/datasource'; -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import * as DFImport from 'app/features/dataframe-import'; import { ShowConfirmModalEvent } from 'app/types/events'; diff --git a/public/app/plugins/panel/alertlist/UnifiedAlertList.tsx b/public/app/plugins/panel/alertlist/UnifiedAlertList.tsx index 09028327b35..3408ecf7078 100644 --- a/public/app/plugins/panel/alertlist/UnifiedAlertList.tsx +++ b/public/app/plugins/panel/alertlist/UnifiedAlertList.tsx @@ -35,7 +35,7 @@ import { } from 'app/features/alerting/unified/utils/redux'; import { flattenCombinedRules, getFirstActiveAt } from 'app/features/alerting/unified/utils/rules'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { Matcher } from 'app/plugins/datasource/alertmanager/types'; import { ThunkDispatch, useDispatch } from 'app/types'; import { PromAlertingRuleState } from 'app/types/unified-alerting-dto'; diff --git a/public/app/plugins/panel/graph/graph.ts b/public/app/plugins/panel/graph/graph.ts index 5ebc2fe8c52..bffde64875e 100644 --- a/public/app/plugins/panel/graph/graph.ts +++ b/public/app/plugins/panel/graph/graph.ts @@ -44,7 +44,7 @@ import { ContextSrv } from 'app/core/services/context_srv'; import { provideTheme } from 'app/core/utils/ConfigProvider'; import { tickStep } from 'app/core/utils/ticks'; import { TimeSrv } from 'app/features/dashboard/services/TimeSrv'; -import { DashboardModel } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { getFieldLinksSupplier } from 'app/features/panel/panellinks/linkSuppliers'; import { GraphContextMenuCtrl } from './GraphContextMenuCtrl'; diff --git a/public/app/plugins/panel/state-timeline/migrations.test.ts b/public/app/plugins/panel/state-timeline/migrations.test.ts index f849be085c0..98b10d22a5a 100644 --- a/public/app/plugins/panel/state-timeline/migrations.test.ts +++ b/public/app/plugins/panel/state-timeline/migrations.test.ts @@ -1,4 +1,4 @@ -import { PanelModel } from 'app/features/dashboard/state'; +import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { timelinePanelChangedHandler } from './migrations'; diff --git a/public/app/plugins/panel/timeseries/migrations.test.ts b/public/app/plugins/panel/timeseries/migrations.test.ts index 2b86f89ba7f..f38303384be 100644 --- a/public/app/plugins/panel/timeseries/migrations.test.ts +++ b/public/app/plugins/panel/timeseries/migrations.test.ts @@ -3,7 +3,8 @@ import { cloneDeep } from 'lodash'; import { PanelModel, FieldConfigSource, FieldMatcherID, ReducerID } from '@grafana/data'; import { TooltipDisplayMode, SortOrder } from '@grafana/schema'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; -import { DashboardModel, PanelModel as PanelModelState } from 'app/features/dashboard/state'; +import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; +import { PanelModel as PanelModelState } from 'app/features/dashboard/state/PanelModel'; import { createDashboardModelFixture } from 'app/features/dashboard/state/__fixtures__/dashboardFixtures'; import { dataLayersToAnnotations } from 'app/features/dashboard-scene/serialization/dataLayersToAnnotations'; import { transformSaveModelToScene } from 'app/features/dashboard-scene/serialization/transformSaveModelToScene'; diff --git a/public/test/helpers/getDashboardModel.ts b/public/test/helpers/getDashboardModel.ts index 2ad11a3e6e0..95c8b12162d 100644 --- a/public/test/helpers/getDashboardModel.ts +++ b/public/test/helpers/getDashboardModel.ts @@ -1,4 +1,4 @@ -import { DashboardModel } from '../../app/features/dashboard/state'; +import { DashboardModel } from '../../app/features/dashboard/state/DashboardModel'; import { DashboardMeta } from '../../app/types/dashboard'; export const getDashboardModel = (json: any, meta: DashboardMeta = {}) => {