From 20c700dd52373c7b4e6f9560d0c2e35985308cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Wed, 9 Jul 2025 06:15:33 +0200 Subject: [PATCH] Chore: reduces barrel files part II (#107688) * Chore: reduce barrel files * chore: fixes unit test * Chore: reduces barrel files part II * chore: fix import sorting --- .betterer.results | 26 ------------------- .../pkg/apis/alerting_manifest.go | 2 -- apps/dashboard/pkg/apis/dashboard_manifest.go | 2 -- apps/folder/pkg/apis/folder_manifest.go | 2 -- public/app/api/utils.ts | 2 +- public/app/core/actions/cleanUp.ts | 2 +- .../AccessControl/AddPermission.tsx | 2 +- .../core/components/AccessControl/types.ts | 2 +- .../components/AppChrome/AppChromeService.tsx | 2 +- .../AppChrome/MegaMenu/MegaMenu.tsx | 2 +- .../OrganizationSelect.tsx | 2 +- .../OrganizationSwitcher.test.tsx | 8 +++--- .../OrganizationSwitcher.tsx | 3 ++- .../AppChrome/OrganizationSwitcher/types.ts | 2 +- .../AppChrome/QuickAdd/QuickAdd.tsx | 2 +- .../AppChrome/TopBar/SingleTopBar.tsx | 2 +- .../AppNotifications/AppNotificationItem.tsx | 2 +- .../AppNotifications/AppNotificationList.tsx | 2 +- .../components/FolderFilter/FolderFilter.tsx | 3 ++- .../core/components/InviteUserButton/utils.ts | 2 +- .../NestedFolderPicker/FolderRepo.tsx | 2 +- .../NestedFolderPicker/NestedFolderList.tsx | 2 +- .../NestedFolderPicker/NestedFolderPicker.tsx | 2 +- .../NestedFolderPicker/useFoldersQuery.ts | 3 +-- .../useFoldersQueryLegacy.ts | 3 ++- public/app/core/components/Page/usePageNav.ts | 2 +- .../app/core/components/Page/usePageTitle.ts | 2 +- .../RolePicker/BuiltinRoleSelector.tsx | 3 +-- .../RolePicker/RoleMenuGroupsSection.tsx | 2 +- .../components/RolePicker/RoleMenuOption.tsx | 2 +- .../core/components/RolePicker/RolePicker.tsx | 3 ++- .../components/RolePicker/RolePickerInput.tsx | 3 +-- .../components/RolePicker/RolePickerMenu.tsx | 3 ++- .../RolePicker/RolePickerSubMenu.tsx | 2 +- .../components/RolePicker/TeamRolePicker.tsx | 2 +- .../components/RolePicker/UserRolePicker.tsx | 3 ++- public/app/core/components/RolePicker/api.ts | 2 +- .../app/core/components/RolePicker/hooks.ts | 2 +- .../app/core/components/RolePicker/utils.ts | 2 +- .../RolePickerDrawer/RolePickerBadges.tsx | 2 +- .../RolePickerDrawer/RolePickerDrawer.tsx | 3 +-- .../Select/DashboardPicker.test.tsx | 2 +- .../components/Select/DashboardPicker.tsx | 2 +- .../components/Select/OldFolderPicker.tsx | 3 ++- .../app/core/components/Select/OrgPicker.tsx | 3 ++- .../Select/ServiceAccountPicker.tsx | 2 +- .../app/core/components/Select/TeamPicker.tsx | 2 +- .../app/core/components/Select/UserPicker.tsx | 2 +- public/app/core/copy/appNotification.ts | 3 ++- .../history/RichHistoryLocalStorage.test.ts | 2 +- .../core/history/RichHistoryLocalStorage.ts | 2 +- .../history/RichHistoryRemoteStorage.test.ts | 2 +- public/app/core/history/RichHistoryStorage.ts | 3 +-- .../history/localStorageConverter.test.ts | 2 +- .../app/core/history/localStorageConverter.ts | 3 +-- .../history/remoteStorageConverter.test.ts | 3 ++- .../core/history/remoteStorageConverter.ts | 3 +-- .../richHistoryLocalStorageUtils.test.ts | 3 +-- .../history/richHistoryLocalStorageUtils.ts | 2 +- public/app/core/hooks/useCleanup.ts | 2 +- public/app/core/hooks/useNavModel.ts | 2 +- public/app/core/navigation/kiosk.ts | 3 +-- .../app/core/reducers/appNotification.test.ts | 2 +- public/app/core/reducers/appNotification.ts | 2 +- public/app/core/reducers/root.test.ts | 3 ++- public/app/core/services/backend_srv.ts | 3 ++- public/app/core/services/context_srv.ts | 2 +- public/app/core/utils/richHistory.test.ts | 2 +- public/app/dev-utils.ts | 2 +- .../app/features/admin/AdminEditOrgPage.tsx | 5 ++-- .../app/features/admin/AdminListOrgsPage.tsx | 3 ++- public/app/features/admin/AdminOrgsTable.tsx | 3 ++- public/app/features/admin/ServerStats.tsx | 2 +- public/app/features/admin/UpgradePage.tsx | 2 +- public/app/features/admin/UserAdminPage.tsx | 5 +++- .../app/features/admin/UserLdapSyncInfo.tsx | 4 ++- .../app/features/admin/UserListAdminPage.tsx | 5 ++-- .../features/admin/UserListAnonymousPage.tsx | 3 +-- public/app/features/admin/UserListPage.tsx | 2 +- public/app/features/admin/UserOrgs.tsx | 6 +++-- public/app/features/admin/UserPermissions.tsx | 2 +- public/app/features/admin/UserProfile.tsx | 3 ++- public/app/features/admin/UserSessions.tsx | 3 ++- .../features/admin/Users/AnonUsersTable.tsx | 2 +- public/app/features/admin/Users/OrgUnits.tsx | 2 +- .../admin/Users/OrgUsersTable.test.tsx | 3 ++- .../features/admin/Users/OrgUsersTable.tsx | 3 ++- .../features/admin/Users/UsersTable.test.tsx | 2 +- .../app/features/admin/Users/UsersTable.tsx | 2 +- public/app/features/admin/api.ts | 3 ++- .../admin/ldap/LdapConnectionStatus.tsx | 3 ++- public/app/features/admin/ldap/LdapDrawer.tsx | 2 +- .../features/admin/ldap/LdapGroupMapping.tsx | 4 +-- public/app/features/admin/ldap/LdapPage.tsx | 13 +++------- .../features/admin/ldap/LdapSettingsPage.tsx | 3 ++- .../app/features/admin/ldap/LdapSyncInfo.tsx | 2 +- .../features/admin/ldap/LdapUserGroups.tsx | 2 +- .../app/features/admin/ldap/LdapUserInfo.tsx | 2 +- .../admin/ldap/LdapUserMappingInfo.tsx | 2 +- .../admin/ldap/LdapUserPermissions.tsx | 2 +- .../app/features/admin/ldap/LdapUserTeams.tsx | 2 +- public/app/features/admin/state/actions.ts | 13 +++------- .../app/features/admin/state/reducers.test.ts | 3 ++- public/app/features/admin/state/reducers.ts | 10 +++---- public/app/features/alerting/routes.tsx | 2 +- .../features/alerting/state/reducers.test.ts | 2 +- .../app/features/alerting/state/reducers.ts | 2 +- .../features/alerting/state/selectors.test.ts | 3 ++- .../app/features/alerting/state/selectors.ts | 3 ++- .../alerting/unified/AlertGroups.test.tsx | 2 +- .../features/alerting/unified/AlertGroups.tsx | 2 +- .../alerting/unified/AlertsFolderView.tsx | 2 +- .../alerting/unified/MuteTimings.test.tsx | 2 +- .../unified/NotificationPoliciesPage.test.tsx | 2 +- .../unified/PanelAlertTabContent.test.tsx | 2 +- .../alerting/unified/Receivers.test.tsx | 2 +- .../RuleEditorGrafanaRecordingRules.test.tsx | 2 +- .../alerting/unified/RuleList.test.tsx | 2 +- .../alerting/unified/Silences.test.tsx | 2 +- .../alerting/unified/Templates.test.tsx | 2 +- .../alerting/unified/api/alertmanagerApi.ts | 3 +-- .../alerting/unified/api/dashboardApi.ts | 3 ++- .../alerting/unified/api/grafana.test.ts | 2 +- .../features/alerting/unified/api/grafana.ts | 2 +- .../alerting/unified/api/prometheusApi.ts | 2 +- .../alerting/unified/api/receiversApi.ts | 2 +- .../components/alert-groups/AlertDetails.tsx | 2 +- .../contact-points/ContactPoints.test.tsx | 2 +- .../contact-points/ContactPoints.tsx | 2 +- .../contact-points/EditContactPoint.test.tsx | 2 +- .../NotificationTemplates.test.tsx | 2 +- .../components/contact-points/permissions.ts | 2 +- .../contact-points/useContactPoints.test.tsx | 2 +- .../components/contact-points/utils.ts | 2 +- .../create-folder/CreateNewFolder.tsx | 2 +- .../export/GrafanaRuleFolderExporter.tsx | 2 +- .../folder-actions/FolderActionsButton.tsx | 2 +- .../import-to-gma/ImportToGMARules.test.tsx | 2 +- .../unified/components/import-to-gma/hooks.ts | 2 +- .../mute-timings/MuteTimingsTable.test.tsx | 2 +- .../components/mute-timings/permissions.ts | 2 +- .../EditDefaultPolicyForm.test.tsx | 2 +- .../EditNotificationPolicyForm.test.tsx | 2 +- .../notification-policies/Policy.tsx | 2 +- .../notification-policies/permissions.ts | 2 +- .../NewRuleFromPanelButton.test.tsx | 4 +-- .../NewRuleFromPanelButton.tsx | 2 +- .../components/receivers/GlobalConfigForm.tsx | 2 +- .../receivers/NewReceiverView.test.tsx | 2 +- .../receivers/form/ChannelOptions.tsx | 2 +- .../receivers/form/ChannelSubForm.tsx | 2 +- .../form/GrafanaReceiverForm.test.tsx | 2 +- .../receivers/form/GrafanaReceiverForm.tsx | 2 +- .../receivers/form/fields/OptionField.tsx | 2 +- .../form/fields/SubformArrayField.tsx | 2 +- .../receivers/form/fields/SubformField.tsx | 2 +- .../form/fields/TemplateSelector.test.tsx | 3 ++- .../form/fields/TemplateSelector.tsx | 2 +- .../components/receivers/form/notifiers.ts | 2 +- .../onCall/useOnCallIntegration.tsx | 2 +- .../rule-editor/DashboardAnnotationField.tsx | 2 +- .../SimplifiedRuleEditor.test.tsx | 2 +- .../query-and-alert-condition/utils.ts | 2 +- .../rule-editor/useDashboardQuery.ts | 3 ++- .../rule-viewer/RuleViewer.test.tsx | 2 +- .../rules/Filter/RulesFilter.v1.tsx | 2 +- .../rules/RuleActionsButtons.test.tsx | 2 +- .../components/rules/RuleActionsButtons.tsx | 2 +- .../rules/RuleListGroupView.test.tsx | 2 +- .../components/rules/RulesGroup.test.tsx | 2 +- .../settings/AlertmanagerConfig.test.tsx | 2 +- .../components/templates/permissions.ts | 2 +- .../group-details/GroupDetailsPage.test.tsx | 2 +- .../group-details/GroupDetailsPage.tsx | 2 +- .../group-details/GroupEditPage.test.tsx | 2 +- .../unified/group-details/GroupEditPage.tsx | 2 +- .../ruleGroup/useDeleteRuleFromGroup.test.tsx | 2 +- .../ruleGroup/usePauseAlertRule.test.tsx | 2 +- .../ruleGroup/useUpdateRuleGroup.test.tsx | 2 +- .../unified/hooks/useAbilities.test.tsx | 2 +- .../alerting/unified/hooks/useAbilities.ts | 2 +- .../alerting/unified/hooks/useFolder.ts | 2 +- .../unified/hooks/useIsRuleEditable.test.tsx | 3 ++- .../hooks/useManagedAlertStateHistory.ts | 2 +- .../hooks/useUnifiedAlertingSelector.ts | 2 +- .../app/features/alerting/unified/mockApi.ts | 3 ++- .../alerting/unified/mockGrafanaNotifiers.ts | 2 +- public/app/features/alerting/unified/mocks.ts | 6 ++++- .../unified/mocks/server/configure.ts | 2 +- .../alerting/unified/mocks/server/db.ts | 2 +- .../mocks/server/handlers/accessControl.ts | 2 +- .../unified/mocks/server/handlers/folders.ts | 2 +- .../rule-editor/CloneRuleEditor.test.tsx | 2 +- .../RuleEditorCloudOnlyAllowed.test.tsx | 2 +- .../rule-editor/RuleEditorCloudRules.test.tsx | 2 +- .../rule-editor/RuleEditorExisting.test.tsx | 2 +- .../RuleEditorGrafanaRules.test.tsx | 2 +- .../RuleEditorRecordingRule.test.tsx | 2 +- .../rule-list/DataSourceGroupLoader.test.tsx | 2 +- .../unified/rule-list/FilterView.test.tsx | 2 +- .../rule-list/GrafanaGroupLoader.test.tsx | 2 +- .../unified/rule-list/GroupedView.test.tsx | 2 +- .../unified/rule-list/RuleList.v1.tsx | 2 +- .../unified/rule-list/RuleList.v2.test.tsx | 2 +- .../alerting/unified/state/actions.ts | 2 +- .../alerting/unified/test/test-utils.ts | 2 +- .../alerting/unified/types/receiver-form.ts | 2 +- .../alerting/unified/utils/access-control.ts | 2 +- .../cloud-alertmanager-notifier-types.ts | 2 +- .../alerting/unified/utils/datasource.ts | 2 +- .../alerting/unified/utils/notifier-types.ts | 2 +- .../alerting/unified/utils/receiver-form.ts | 2 +- .../app/features/auth-config/AuthDrawer.tsx | 2 +- .../auth-config/AuthProvidersListPage.tsx | 2 +- .../features/auth-config/ErrorContainer.tsx | 2 +- .../auth-config/ProviderConfigPage.tsx | 2 +- public/app/features/auth-config/index.ts | 3 ++- .../app/features/auth-config/state/actions.ts | 4 ++- .../features/auth-config/state/reducers.ts | 2 +- public/app/features/auth-config/types.ts | 2 +- .../app/features/bookmarks/BookmarksPage.tsx | 2 +- .../BrowseDashboardsPage.tsx | 2 +- .../browse-dashboards/RecentlyDeletedPage.tsx | 3 +-- .../api/browseDashboardsAPI.ts | 12 +++------ .../browse-dashboards/api/isProvisioned.ts | 2 +- .../browse-dashboards/api/services.ts | 2 +- .../BrowseActions/BrowseActions.tsx | 2 +- .../components/BrowseView.tsx | 2 +- .../components/CreateNewButton.test.tsx | 2 +- .../components/CreateNewButton.tsx | 2 +- .../DeleteProvisionedFolderForm.test.tsx | 2 +- .../DeleteProvisionedFolderForm.tsx | 2 +- .../components/FolderActionsButton.tsx | 2 +- .../NewProvisionedFolderForm.test.tsx | 2 +- .../components/NewProvisionedFolderForm.tsx | 2 +- .../components/RecentlyDeletedActions.tsx | 2 +- .../components/SearchView.tsx | 2 +- .../fixtures/folder.fixture.ts | 2 +- .../features/browse-dashboards/permissions.ts | 3 ++- .../browse-dashboards/state/actions.ts | 2 +- .../browse-dashboards/state/hooks.test.ts | 6 ++--- .../features/browse-dashboards/state/hooks.ts | 2 +- .../commandPalette/actions/staticActions.ts | 2 +- .../app/features/connections/Connections.tsx | 2 +- .../ConnectionsRedirectNotice.tsx | 2 +- .../hooks/useDataSourceSettingsNav.ts | 2 +- .../pages/DataSourceDetailsPage.tsx | 3 ++- .../connections/pages/DataSourcesListPage.tsx | 2 +- .../tabs/ConnectData/ConnectData.test.tsx | 2 +- .../tabs/ConnectData/ConnectData.tsx | 2 +- .../correlations/CorrelationsPage.tsx | 2 +- public/app/features/correlations/utils.ts | 2 +- .../addToDashboard/AddToDashboardForm.tsx | 2 +- .../addToDashboard/addPanelsOnLoadBehavior.ts | 2 +- .../addToDashboard/addToDashboard.ts | 2 +- .../embedding/EmbeddedDashboard.tsx | 2 +- .../inspect/HelpWizard/HelpWizard.tsx | 2 +- .../pages/DashboardScenePage.test.tsx | 2 +- .../pages/DashboardScenePage.tsx | 2 +- .../DashboardScenePageStateManager.test.ts | 2 +- .../pages/DashboardScenePageStateManager.ts | 2 +- .../pages/PublicDashboardScenePage.tsx | 2 +- .../PanelDataAlertingTab.test.tsx | 3 ++- .../PanelDataQueriesTab.test.tsx | 2 +- .../PanelDataPane/PanelDataQueriesTab.tsx | 2 +- .../PanelDataTransformationsTab.test.tsx | 2 +- .../saving/SaveDashboardDrawer.test.tsx | 2 +- .../saving/getDashboardChanges.ts | 2 +- .../provisioned/DashboardPreviewBanner.tsx | 2 +- .../saving/provisioned/hooks.ts | 2 +- .../saving/useSaveDashboard.ts | 2 +- .../scene/AlertStatesDataLayer.ts | 2 +- .../dashboard-scene/scene/DashboardScene.tsx | 2 +- .../scene/DashboardSceneRenderer.tsx | 2 +- .../scene/DashboardSceneUrlSync.test.ts | 2 +- .../scene/DashboardSceneUrlSync.ts | 2 +- .../scene/ManagedDashboardNavBarBadge.tsx | 2 +- .../scene/NavToolbarActions.test.tsx | 2 +- .../scene/NavToolbarActions.tsx | 2 +- .../scene/PanelMenuBehavior.test.tsx | 2 +- .../scene/PanelMenuBehavior.tsx | 2 +- .../scene/keyboardShortcuts.ts | 2 +- .../serialization/DashboardSceneSerializer.ts | 2 +- .../buildNewDashboardSaveModel.ts | 2 +- .../transformSaveModelSchemaV2ToScene.ts | 2 +- .../transformSaveModelToScene.test.ts | 2 +- .../transformSaveModelToScene.ts | 2 +- .../transformSceneToSaveModel.test.ts | 2 +- .../settings/JsonModelEditView.tsx | 2 +- .../settings/PermissionsEditView.tsx | 2 +- .../dashboard-scene/settings/utils.ts | 3 ++- .../sharing/ShareButton/ShareMenu.test.tsx | 2 +- .../sharing/ShareButton/ShareMenu.tsx | 2 +- .../ConfigEmailSharing/ConfigEmailSharing.tsx | 2 +- .../EmailShare/CreateEmailSharing.tsx | 2 +- .../PublicShare/CreatePublicSharing.tsx | 2 +- .../share-externally/ShareAlerts.tsx | 2 +- .../share-externally/ShareConfiguration.tsx | 2 +- .../share-externally/ShareExternally.tsx | 2 +- .../share-externally/ShareTypeSelect.tsx | 2 +- .../share-snapshot/ShareSnapshot.tsx | 2 +- .../dashboard-scene/sharing/ShareModal.tsx | 2 +- .../ConfigPublicDashboard.tsx | 2 +- .../dashboard-scene/solo/SoloPanelPage.tsx | 2 +- .../utils/dashboardSessionState.test.ts | 2 +- .../dashboard-scene/utils/test-utils.ts | 2 +- .../v2schema/ImportDashboardOverviewV2.tsx | 2 +- .../api/ResponseTransformers.test.ts | 2 +- .../dashboard/api/ResponseTransformers.ts | 2 +- .../dashboard/api/UnifiedDashboardAPI.test.ts | 2 +- .../dashboard/api/UnifiedDashboardAPI.ts | 2 +- .../features/dashboard/api/dashboard_api.ts | 2 +- .../app/features/dashboard/api/legacy.test.ts | 2 +- public/app/features/dashboard/api/legacy.ts | 2 +- public/app/features/dashboard/api/types.ts | 2 +- public/app/features/dashboard/api/utils.ts | 2 +- public/app/features/dashboard/api/v1.test.ts | 2 +- public/app/features/dashboard/api/v1.ts | 2 +- public/app/features/dashboard/api/v2.ts | 2 +- .../AddPanelButton/AddPanelMenu.test.tsx | 4 +-- .../AddPanelButton/AddPanelMenu.tsx | 2 +- .../dashboard/components/DashNav/DashNav.tsx | 3 ++- .../DashboardLoading/DashboardFailed.tsx | 3 ++- .../DashboardLoading/DashboardLoading.tsx | 2 +- .../AccessControlDashboardPermissions.tsx | 2 +- .../DashboardPrompt/DashboardPrompt.tsx | 2 +- .../DashboardSettings/DashboardSettings.tsx | 2 +- .../components/HelpWizard/HelpWizard.tsx | 2 +- .../components/Inspector/PanelInspector.tsx | 2 +- .../components/PanelEditor/OptionsPane.tsx | 2 +- .../components/PanelEditor/PanelEditor.tsx | 2 +- .../PanelEditor/PanelEditorQueries.tsx | 2 +- .../PanelEditor/VisualizationButton.tsx | 2 +- .../PanelEditor/VisualizationSelectPane.tsx | 2 +- .../components/PanelEditor/state/actions.ts | 2 +- .../RepeatRowSelect/RepeatRowSelect.tsx | 2 +- .../forms/SaveDashboardAsForm.test.tsx | 2 +- .../forms/SaveDashboardForm.test.tsx | 2 +- .../SaveDashboard/forms/SaveDashboardForm.tsx | 2 +- .../components/SaveDashboard/types.ts | 2 +- .../SaveDashboard/useDashboardSave.tsx | 2 +- .../components/ShareModal/ShareModal.tsx | 2 +- .../ConfigPublicDashboard.tsx | 3 ++- .../EmailSharingConfiguration.tsx | 2 +- .../CreatePublicDashboard.tsx | 3 ++- .../SharePublicDashboard.tsx | 2 +- .../SharePublicDashboard/utilsTest.tsx | 3 ++- .../dashboard/components/SubMenu/SubMenu.tsx | 2 +- .../VersionHistory/useDashboardRestore.tsx | 2 +- .../containers/DashboardPage.test.tsx | 2 +- .../dashboard/containers/DashboardPage.tsx | 3 ++- .../containers/DashboardPageProxy.test.tsx | 2 +- .../containers/DashboardPageProxy.tsx | 2 +- .../containers/NewDashboardWithDS.tsx | 2 +- .../containers/PublicDashboardPage.test.tsx | 10 +++---- .../containers/PublicDashboardPage.tsx | 3 ++- .../PublicDashboardPageProxy.test.tsx | 3 +-- .../containers/SoloPanelPage.test.tsx | 2 +- .../dashboard/containers/SoloPanelPage.tsx | 2 +- .../dashgrid/DashboardEmpty.test.tsx | 4 +-- .../dashboard/dashgrid/DashboardEmpty.tsx | 2 +- .../dashboard/dashgrid/DashboardGrid.test.tsx | 2 +- .../dashboard/dashgrid/DashboardPanel.tsx | 2 +- public/app/features/dashboard/routes.ts | 3 ++- .../dashboard/services/DashboardLoaderSrv.ts | 2 +- .../dashboard/services/DashboardSrv.ts | 2 +- .../dashboard/services/SnapshotSrv.ts | 2 +- .../dashboard/state/DashboardModel.ts | 11 +++++--- .../features/dashboard/state/PanelModel.ts | 2 +- .../state/__fixtures__/dashboardFixtures.ts | 2 +- .../app/features/dashboard/state/actions.ts | 2 +- .../dashboard/state/initDashboard.test.ts | 2 +- .../features/dashboard/state/initDashboard.ts | 6 ++--- .../features/dashboard/state/reducers.test.ts | 2 +- .../app/features/dashboard/state/reducers.ts | 2 +- .../app/features/dashboard/state/selectors.ts | 2 +- .../dashboard/utils/getPanelMenu.test.ts | 2 +- .../components/DashboardsTable.test.tsx | 2 +- .../components/DashboardsTable.tsx | 2 +- .../components/DataSourceAddButton.tsx | 2 +- .../components/DataSourceCategories.tsx | 2 +- .../components/DataSourceDashboards.tsx | 3 ++- .../components/DataSourcesList.tsx | 3 ++- .../components/DataSourcesListHeader.tsx | 2 +- .../datasources/components/EditDataSource.tsx | 3 ++- .../datasources/components/NewDataSource.tsx | 3 ++- .../picker/AddNewDataSourceButton.tsx | 2 +- .../datasources/components/picker/utils.ts | 2 +- .../datasources/mocks/dataSourcesMocks.ts | 3 ++- .../datasources/state/actions.test.ts | 2 +- .../app/features/datasources/state/actions.ts | 4 ++- .../datasources/state/buildCategories.ts | 2 +- .../app/features/datasources/state/hooks.ts | 3 ++- .../features/datasources/state/navModel.ts | 2 +- .../datasources/state/reducers.test.ts | 2 +- .../features/datasources/state/reducers.ts | 2 +- .../explore/CorrelationEditorModeBar.tsx | 3 ++- .../features/explore/CorrelationHelper.tsx | 2 +- public/app/features/explore/Explore.tsx | 2 +- .../app/features/explore/ExploreActions.tsx | 3 ++- public/app/features/explore/ExplorePage.tsx | 2 +- .../features/explore/ExplorePaneContainer.tsx | 2 +- .../explore/ExploreQueryInspector.tsx | 3 ++- .../explore/ExploreRunQueryButton.test.tsx | 2 +- .../explore/ExploreRunQueryButton.tsx | 2 +- .../features/explore/Graph/ExploreGraph.tsx | 2 +- .../explore/Graph/ExploreGraphLabel.tsx | 2 +- .../features/explore/Graph/GraphContainer.tsx | 2 +- .../explore/Graph/exploreGraphStyleUtils.ts | 2 +- public/app/features/explore/Graph/utils.ts | 2 +- public/app/features/explore/Logs/Logs.tsx | 3 ++- .../features/explore/Logs/LogsContainer.tsx | 2 +- .../explore/NoDataSourceCallToAction.tsx | 2 +- .../explore/NodeGraph/NodeGraphContainer.tsx | 2 +- .../QueriesDrawer/QueriesDrawerContext.tsx | 2 +- .../app/features/explore/QueryRows.test.tsx | 2 +- public/app/features/explore/QueryRows.tsx | 2 +- .../RawPrometheusContainer.test.tsx | 2 +- .../RawPrometheus/RawPrometheusContainer.tsx | 4 +-- .../explore/ResponseErrorContainer.tsx | 2 +- .../explore/RichHistory/RichHistory.tsx | 2 +- .../RichHistory/RichHistoryCard.test.tsx | 2 +- .../RichHistory/RichHistoryContainer.tsx | 2 +- .../RichHistory/RichHistoryStarredTab.tsx | 2 +- .../app/features/explore/SecondaryActions.tsx | 2 +- .../features/explore/ShortLinkButtonMenu.tsx | 2 +- .../features/explore/Table/TableContainer.tsx | 2 +- .../features/explore/TraceView/TraceView.tsx | 2 +- .../explore/TraceView/TraceViewContainer.tsx | 2 +- .../explore/correlationEditLogic.test.ts | 2 +- .../features/explore/correlationEditLogic.ts | 2 +- .../ExploreToDashboardPanel.tsx | 2 +- .../AddToDashboard/addToDashboard.test.ts | 2 +- .../AddToDashboard/addToDashboard.ts | 2 +- .../AddToDashboard/getAddToDashboardTitle.ts | 2 +- .../extensions/AddToDashboard/index.test.tsx | 2 +- .../extensions/AddToDashboard/index.tsx | 2 +- .../extensions/ToolbarExtensionPoint.test.tsx | 2 +- .../extensions/ToolbarExtensionPoint.tsx | 4 ++- .../extensions/getExploreExtensionConfigs.tsx | 2 +- .../explore/hooks/useExplorePageTitle.ts | 2 +- .../explore/hooks/useKeyboardShortcuts.ts | 2 +- .../explore/hooks/useSplitSizeUpdater.ts | 2 +- .../hooks/useStateSync/external.utils.ts | 2 +- .../explore/hooks/useStateSync/index.ts | 3 ++- .../explore/hooks/useStateSync/parseURL.ts | 2 +- .../useStateSync/synchronizer/fromURL.ts | 3 ++- .../hooks/useStateSync/synchronizer/init.ts | 2 +- .../hooks/useStateSync/synchronizer/toURL.ts | 2 +- public/app/features/explore/mocks/data.ts | 3 +-- .../features/explore/spec/helper/setup.tsx | 2 +- .../features/explore/state/correlations.ts | 2 +- .../features/explore/state/datasource.test.ts | 2 +- .../app/features/explore/state/datasource.ts | 3 ++- .../app/features/explore/state/explorePane.ts | 2 +- public/app/features/explore/state/history.ts | 3 ++- .../app/features/explore/state/main.test.ts | 3 ++- public/app/features/explore/state/main.ts | 2 +- .../app/features/explore/state/query.test.ts | 3 ++- public/app/features/explore/state/query.ts | 11 ++++---- .../features/explore/state/selectors.test.ts | 2 +- .../app/features/explore/state/selectors.ts | 3 ++- .../app/features/explore/state/time.test.ts | 2 +- public/app/features/explore/state/time.ts | 3 ++- public/app/features/explore/state/utils.ts | 4 +-- .../features/explore/useLiveTailControls.ts | 2 +- .../features/explore/utils/decorators.test.ts | 2 +- .../app/features/explore/utils/decorators.ts | 2 +- .../utils/supplementaryQueries.test.ts | 2 +- .../explore/utils/supplementaryQueries.ts | 2 +- .../utils/supplementaryQueries_legacy.test.ts | 2 +- public/app/features/folders/state/actions.ts | 3 ++- public/app/features/folders/state/navModel.ts | 3 ++- .../features/folders/state/reducers.test.ts | 2 +- public/app/features/folders/state/reducers.ts | 2 +- public/app/features/invites/InviteeRow.tsx | 2 +- public/app/features/invites/InviteesTable.tsx | 2 +- public/app/features/invites/state/actions.ts | 4 ++- public/app/features/invites/state/reducers.ts | 2 +- .../app/features/invites/state/selectors.ts | 2 +- .../LibraryPanelsSearch.tsx | 2 +- .../PanelLibraryOptionsGroup.tsx | 2 +- .../log-context/LogRowContextModal.test.tsx | 4 +-- .../log-context/LogRowContextModal.tsx | 2 +- .../manage-dashboards/DashboardImportPage.tsx | 2 +- .../components/ImportDashboardOverview.tsx | 2 +- .../PublicDashboardListTable.tsx | 2 +- .../components/SnapshotListTableRow.test.tsx | 2 +- .../components/SnapshotListTableRow.tsx | 2 +- .../manage-dashboards/state/actions.ts | 3 ++- .../utils/validation.test.ts | 2 +- .../notifications/StoredNotifications.tsx | 2 +- .../app/features/org/OrgDetailsPage.test.tsx | 2 +- public/app/features/org/OrgDetailsPage.tsx | 3 ++- public/app/features/org/OrgProfile.tsx | 2 +- public/app/features/org/SelectOrgPage.tsx | 3 ++- public/app/features/org/UserInviteForm.tsx | 4 +-- public/app/features/org/state/actions.test.ts | 2 +- public/app/features/org/state/actions.ts | 3 ++- .../app/features/org/state/reducers.test.ts | 4 ++- public/app/features/org/state/reducers.ts | 3 ++- .../panel/components/PanelDataErrorView.tsx | 2 +- .../panel/components/PanelPluginError.tsx | 2 +- public/app/features/panel/state/actions.ts | 2 +- public/app/features/panel/state/selectors.ts | 2 +- .../admin/components/ConnectionsTab.test.tsx | 2 +- .../admin/components/ConnectionsTab.tsx | 3 ++- .../GetStartedWithApp.tsx | 2 +- .../GetStartedWithDataSource.test.tsx | 2 +- .../GetStartedWithDataSource.tsx | 2 +- .../InstallControls/InstallControlsButton.tsx | 2 +- .../InstallControlsWarning.tsx | 2 +- .../admin/components/PluginDashboards.tsx | 2 +- .../admin/components/PluginDetailsPage.tsx | 2 +- public/app/features/plugins/admin/helpers.ts | 2 +- .../admin/hooks/usePluginDetailsTabs.tsx | 2 +- .../features/plugins/admin/pages/Browse.tsx | 2 +- .../app/features/plugins/admin/permissions.ts | 2 +- public/app/features/plugins/admin/routes.tsx | 2 +- .../features/plugins/admin/state/actions.ts | 2 +- .../app/features/plugins/admin/state/hooks.ts | 2 +- public/app/features/plugins/admin/types.ts | 3 ++- .../features/profile/ChangePasswordForm.tsx | 2 +- .../features/profile/ChangePasswordPage.tsx | 2 +- .../features/profile/UserOrganizations.tsx | 2 +- .../features/profile/UserProfileEditForm.tsx | 2 +- .../features/profile/UserProfileEditPage.tsx | 2 +- public/app/features/profile/UserSessions.tsx | 2 +- public/app/features/profile/UserTeams.tsx | 2 +- public/app/features/profile/api.ts | 4 +-- public/app/features/profile/state/actions.ts | 3 ++- .../features/profile/state/reducers.test.ts | 3 ++- public/app/features/profile/state/reducers.ts | 4 ++- .../app/features/provisioning/utils/routes.ts | 2 +- .../features/query/components/QueryGroup.tsx | 2 +- .../query/components/QueryGroupOptions.tsx | 2 +- .../DashboardQueryRunner.test.ts | 2 +- .../UnifiedAlertStatesWorker.ts | 2 +- .../features/scopes/tests/utils/render.tsx | 2 +- .../search/service/deletedDashboardsCache.ts | 3 +-- public/app/features/search/service/sql.ts | 2 +- public/app/features/search/service/types.ts | 2 +- public/app/features/search/service/utils.ts | 2 +- .../ServiceAccountCreatePage.tsx | 4 ++- .../ServiceAccountPage.test.tsx | 4 ++- .../serviceaccounts/ServiceAccountPage.tsx | 5 +++- .../ServiceAccountPermissions.tsx | 4 +-- .../serviceaccounts/ServiceAccountTable.tsx | 4 ++- .../ServiceAccountsListPage.test.tsx | 3 ++- .../ServiceAccountsListPage.tsx | 4 ++- .../components/ServiceAccountProfile.tsx | 3 ++- .../components/ServiceAccountRoleRow.tsx | 4 ++- .../components/ServiceAccountTokensTable.tsx | 2 +- .../components/ServiceAccountsListItem.tsx | 3 ++- .../features/serviceaccounts/state/actions.ts | 4 ++- .../state/actionsServiceAccountPage.ts | 3 ++- .../serviceaccounts/state/reducers.ts | 8 +++--- .../support-bundles/SupportBundles.tsx | 3 ++- .../support-bundles/SupportBundlesCreate.tsx | 2 +- .../features/support-bundles/state/actions.ts | 3 ++- .../support-bundles/state/reducers.ts | 2 +- public/app/features/teams/CreateTeam.tsx | 3 ++- .../app/features/teams/TeamGroupSync.test.tsx | 2 +- public/app/features/teams/TeamGroupSync.tsx | 4 +-- public/app/features/teams/TeamList.test.tsx | 3 +-- public/app/features/teams/TeamList.tsx | 4 ++- public/app/features/teams/TeamPages.tsx | 3 ++- public/app/features/teams/TeamPermissions.tsx | 4 +-- public/app/features/teams/TeamSettings.tsx | 3 ++- public/app/features/teams/mocks/teamMocks.ts | 3 ++- public/app/features/teams/state/actions.ts | 4 ++- public/app/features/teams/state/navModel.ts | 4 ++- .../app/features/teams/state/reducers.test.ts | 3 ++- public/app/features/teams/state/reducers.ts | 2 +- .../features/teams/state/selectors.test.ts | 3 ++- public/app/features/teams/state/selectors.ts | 2 +- public/app/features/users/UsersActionBar.tsx | 3 ++- .../app/features/users/UsersListPage.test.tsx | 2 +- public/app/features/users/UsersListPage.tsx | 5 ++-- public/app/features/users/mocks/userMocks.ts | 3 ++- public/app/features/users/state/actions.ts | 6 ++--- .../app/features/users/state/reducers.test.ts | 3 ++- public/app/features/users/state/reducers.ts | 2 +- public/app/features/users/state/selectors.ts | 2 +- .../variables/adhoc/AdHocVariableEditor.tsx | 2 +- .../app/features/variables/adhoc/actions.ts | 2 +- .../features/variables/constant/actions.ts | 2 +- .../variables/custom/CustomVariableEditor.tsx | 2 +- .../app/features/variables/custom/actions.ts | 2 +- .../datasource/DataSourceVariableEditor.tsx | 2 +- .../features/variables/datasource/actions.ts | 2 +- .../editor/VariableEditorContainer.tsx | 2 +- .../variables/editor/VariableEditorEditor.tsx | 2 +- .../app/features/variables/editor/actions.ts | 2 +- .../features/variables/interval/actions.ts | 2 +- .../pickers/OptionsPicker/OptionsPicker.tsx | 2 +- .../pickers/OptionsPicker/actions.ts | 2 +- .../variables/query/QueryVariableEditor.tsx | 2 +- .../variables/query/VariableQueryRunner.ts | 2 +- .../app/features/variables/query/actions.ts | 2 +- .../app/features/variables/query/operators.ts | 2 +- .../app/features/variables/state/actions.ts | 3 ++- .../app/features/variables/state/helpers.ts | 3 ++- .../state/onTimeRangeUpdated.test.ts | 2 +- .../app/features/variables/state/selectors.ts | 2 +- .../state/templateVarsChangedInUrl.test.ts | 3 ++- .../textbox/TextBoxVariablePicker.tsx | 2 +- .../app/features/variables/textbox/actions.ts | 2 +- public/app/features/variables/utils.ts | 2 +- .../elasticsearch/components/reducerTester.ts | 2 +- .../panel/alertlist/GroupByWithLoading.tsx | 2 +- .../panel/alertlist/UnifiedAlertList.tsx | 2 +- .../app/plugins/panel/dashlist/DashList.tsx | 2 +- .../app/plugins/panel/dashlist/migrations.ts | 2 +- public/app/routes/routes.tsx | 3 ++- public/app/store/store.ts | 2 +- public/app/types/acl.ts | 4 --- public/app/types/apiKeys.ts | 4 +-- public/app/types/index.ts | 23 ---------------- public/app/types/organization.ts | 2 +- public/app/types/serviceaccount.ts | 5 ++-- public/app/types/user.ts | 5 ++-- public/test/core/redux/reducerTester.ts | 2 +- public/test/core/redux/reduxTester.ts | 2 +- public/test/helpers/convertToStoreState.ts | 2 +- .../helpers/getTemplateSrvDependencies.ts | 2 +- 626 files changed, 812 insertions(+), 770 deletions(-) delete mode 100644 public/app/types/index.ts diff --git a/.betterer.results b/.betterer.results index 01a8e96aa9f..ffd8cc3c5b4 100644 --- a/.betterer.results +++ b/.betterer.results @@ -4012,9 +4012,6 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], - "public/app/types/acl.ts:5381": [ - [0, 0, 0, "Do not re-export imported variable (\`OrgRole\`)", "0"] - ], "public/app/types/alerting.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], @@ -4036,29 +4033,6 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "7"], [0, 0, 0, "Unexpected any. Specify a different type.", "8"] ], - "public/app/types/index.ts:5381": [ - [0, 0, 0, "Do not re-export imported variable (\`CoreEvents\`)", "0"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "1"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "2"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "3"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "4"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "5"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "6"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "7"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "8"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "9"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "10"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "11"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "12"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "13"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "14"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "15"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "16"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "17"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "18"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "19"], - [0, 0, 0, "Do not use export all (\`export * from ...\`)", "20"] - ], "public/app/types/jquery/jquery.d.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], diff --git a/apps/alerting/notifications/pkg/apis/alerting_manifest.go b/apps/alerting/notifications/pkg/apis/alerting_manifest.go index 4ea6c3da1c7..9b1e424d463 100644 --- a/apps/alerting/notifications/pkg/apis/alerting_manifest.go +++ b/apps/alerting/notifications/pkg/apis/alerting_manifest.go @@ -14,8 +14,6 @@ import ( v0alpha1 "github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/alerting/v0alpha1" ) -var () - var appManifestData = app.ManifestData{ AppName: "alerting", Group: "notifications.alerting.grafana.app", diff --git a/apps/dashboard/pkg/apis/dashboard_manifest.go b/apps/dashboard/pkg/apis/dashboard_manifest.go index 7a4552f5e0a..568e229d09d 100644 --- a/apps/dashboard/pkg/apis/dashboard_manifest.go +++ b/apps/dashboard/pkg/apis/dashboard_manifest.go @@ -16,8 +16,6 @@ import ( v2alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1" ) -var () - var appManifestData = app.ManifestData{ AppName: "dashboard", Group: "dashboard.grafana.app", diff --git a/apps/folder/pkg/apis/folder_manifest.go b/apps/folder/pkg/apis/folder_manifest.go index 8525663fea8..8491ddc6083 100644 --- a/apps/folder/pkg/apis/folder_manifest.go +++ b/apps/folder/pkg/apis/folder_manifest.go @@ -14,8 +14,6 @@ import ( v1beta1 "github.com/grafana/grafana/apps/folder/pkg/apis/folder/v1beta1" ) -var () - var appManifestData = app.ManifestData{ AppName: "folder", Group: "folder.grafana.app", diff --git a/public/app/api/utils.ts b/public/app/api/utils.ts index 0815c34d288..1ad0ff690e5 100644 --- a/public/app/api/utils.ts +++ b/public/app/api/utils.ts @@ -1,8 +1,8 @@ import { config, isFetchError } from '@grafana/runtime'; +import { ThunkDispatch } from 'app/types/store'; import { notifyApp } from '../core/actions'; import { createErrorNotification } from '../core/copy/appNotification'; -import { ThunkDispatch } from '../types'; export const getAPINamespace = () => config.namespace; diff --git a/public/app/core/actions/cleanUp.ts b/public/app/core/actions/cleanUp.ts index 4322612bda0..854b10ec5c3 100644 --- a/public/app/core/actions/cleanUp.ts +++ b/public/app/core/actions/cleanUp.ts @@ -1,6 +1,6 @@ import { createAction } from '@reduxjs/toolkit'; -import { StoreState } from '../../types'; +import { StoreState } from 'app/types/store'; export type CleanUpAction = (state: StoreState) => void; diff --git a/public/app/core/components/AccessControl/AddPermission.tsx b/public/app/core/components/AccessControl/AddPermission.tsx index c7569ff09f6..f49988dcc1a 100644 --- a/public/app/core/components/AccessControl/AddPermission.tsx +++ b/public/app/core/components/AccessControl/AddPermission.tsx @@ -1,12 +1,12 @@ import { useEffect, useMemo, useState } from 'react'; +import { OrgRole } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { Button, Select, Stack } from '@grafana/ui'; import { CloseButton } from 'app/core/components/CloseButton/CloseButton'; import { ServiceAccountPicker } from 'app/core/components/Select/ServiceAccountPicker'; import { TeamPicker } from 'app/core/components/Select/TeamPicker'; import { UserPicker } from 'app/core/components/Select/UserPicker'; -import { OrgRole } from 'app/types/acl'; import { Assignments, PermissionTarget, SetPermission } from './types'; diff --git a/public/app/core/components/AccessControl/types.ts b/public/app/core/components/AccessControl/types.ts index c061bc77138..dcc69b58df4 100644 --- a/public/app/core/components/AccessControl/types.ts +++ b/public/app/core/components/AccessControl/types.ts @@ -1,4 +1,4 @@ -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; export type ResourcePermission = { id: number; diff --git a/public/app/core/components/AppChrome/AppChromeService.tsx b/public/app/core/components/AppChrome/AppChromeService.tsx index 8c91066066b..fc6c062b782 100644 --- a/public/app/core/components/AppChrome/AppChromeService.tsx +++ b/public/app/core/components/AppChrome/AppChromeService.tsx @@ -7,7 +7,7 @@ import { config, locationService, reportInteraction } from '@grafana/runtime'; import appEvents from 'app/core/app_events'; import store from 'app/core/store'; import { isShallowEqual } from 'app/core/utils/isShallowEqual'; -import { KioskMode } from 'app/types'; +import { KioskMode } from 'app/types/dashboard'; import { RouteDescriptor } from '../../navigation/types'; import { buildBreadcrumbs } from '../Breadcrumbs/utils'; diff --git a/public/app/core/components/AppChrome/MegaMenu/MegaMenu.tsx b/public/app/core/components/AppChrome/MegaMenu/MegaMenu.tsx index 9f85383b4d8..1c8b3959230 100644 --- a/public/app/core/components/AppChrome/MegaMenu/MegaMenu.tsx +++ b/public/app/core/components/AppChrome/MegaMenu/MegaMenu.tsx @@ -11,7 +11,7 @@ import { ScrollContainer, useStyles2 } from '@grafana/ui'; import { useGrafana } from 'app/core/context/GrafanaContext'; import { setBookmark } from 'app/core/reducers/navBarTree'; import { usePatchUserPreferencesMutation } from 'app/features/preferences/api/index'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; import { InviteUserButton } from '../../InviteUserButton/InviteUserButton'; import { shouldRenderInviteUserButton } from '../../InviteUserButton/utils'; diff --git a/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSelect.tsx b/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSelect.tsx index 2a33cf03123..e2e1d35a962 100644 --- a/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSelect.tsx +++ b/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSelect.tsx @@ -5,7 +5,7 @@ import { SelectableValue, GrafanaTheme2 } from '@grafana/data'; import { t } from '@grafana/i18n'; import { Icon, Select, useStyles2 } from '@grafana/ui'; import { contextSrv } from 'app/core/services/context_srv'; -import { UserOrg } from 'app/types'; +import { UserOrg } from 'app/types/user'; import { OrganizationBaseProps } from './types'; diff --git a/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSwitcher.test.tsx b/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSwitcher.test.tsx index d7897786e3e..79b9ab19f02 100644 --- a/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSwitcher.test.tsx +++ b/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSwitcher.test.tsx @@ -4,7 +4,7 @@ import { TestProvider } from 'test/helpers/TestProvider'; import { OrgRole } from '@grafana/data'; import { ContextSrv, setContextSrv } from 'app/core/services/context_srv'; import { getUserOrganizations } from 'app/features/org/state/actions'; -import * as appTypes from 'app/types'; +import { StoreState } from 'app/types/store'; import { OrganizationSwitcher } from './OrganizationSwitcher'; @@ -14,12 +14,12 @@ jest.mock('app/features/org/state/actions', () => ({ setUserOrganization: jest.fn(), })); -jest.mock('app/types', () => ({ - ...jest.requireActual('app/types'), +jest.mock('app/types/store', () => ({ + ...jest.requireActual('app/types/store'), useDispatch: () => jest.fn(), })); -const renderWithProvider = ({ initialState }: { initialState?: Partial }) => { +const renderWithProvider = ({ initialState }: { initialState?: Partial }) => { render( diff --git a/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSwitcher.tsx b/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSwitcher.tsx index 4138e69733b..67ad47cded0 100644 --- a/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSwitcher.tsx +++ b/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSwitcher.tsx @@ -5,7 +5,8 @@ import { locationService } from '@grafana/runtime'; import { Space, Text } from '@grafana/ui'; import { contextSrv } from 'app/core/services/context_srv'; import { getUserOrganizations, setUserOrganization } from 'app/features/org/state/actions'; -import { useDispatch, useSelector, UserOrg } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; +import { UserOrg } from 'app/types/user'; import { Branding } from '../../Branding/Branding'; diff --git a/public/app/core/components/AppChrome/OrganizationSwitcher/types.ts b/public/app/core/components/AppChrome/OrganizationSwitcher/types.ts index 3b2afef009b..0687bf2ca6c 100644 --- a/public/app/core/components/AppChrome/OrganizationSwitcher/types.ts +++ b/public/app/core/components/AppChrome/OrganizationSwitcher/types.ts @@ -1,5 +1,5 @@ import { SelectableValue } from '@grafana/data'; -import { UserOrg } from 'app/types'; +import { UserOrg } from 'app/types/user'; export interface OrganizationBaseProps { orgs: UserOrg[]; diff --git a/public/app/core/components/AppChrome/QuickAdd/QuickAdd.tsx b/public/app/core/components/AppChrome/QuickAdd/QuickAdd.tsx index a528a0c8341..0a9a48ac6ed 100644 --- a/public/app/core/components/AppChrome/QuickAdd/QuickAdd.tsx +++ b/public/app/core/components/AppChrome/QuickAdd/QuickAdd.tsx @@ -4,7 +4,7 @@ import { t } from '@grafana/i18n'; import { reportInteraction } from '@grafana/runtime'; import { Menu, Dropdown, ToolbarButton } from '@grafana/ui'; import { getExternalUserMngLinkUrl } from 'app/features/users/utils'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { performInviteUserClick, shouldRenderInviteUserButton } from '../../InviteUserButton/utils'; import { NavToolbarSeparator } from '../NavToolbar/NavToolbarSeparator'; diff --git a/public/app/core/components/AppChrome/TopBar/SingleTopBar.tsx b/public/app/core/components/AppChrome/TopBar/SingleTopBar.tsx index 0f26fdeeba1..6766d757b49 100644 --- a/public/app/core/components/AppChrome/TopBar/SingleTopBar.tsx +++ b/public/app/core/components/AppChrome/TopBar/SingleTopBar.tsx @@ -13,7 +13,7 @@ import { useGrafana } from 'app/core/context/GrafanaContext'; import { contextSrv } from 'app/core/core'; import { useMediaQueryMinWidth } from 'app/core/hooks/useMediaQueryMinWidth'; import { HOME_NAV_ID } from 'app/core/reducers/navModel'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { Branding } from '../../Branding/Branding'; import { Breadcrumbs } from '../../Breadcrumbs/Breadcrumbs'; diff --git a/public/app/core/components/AppNotifications/AppNotificationItem.tsx b/public/app/core/components/AppNotifications/AppNotificationItem.tsx index 2d3ad8ea0f7..13575340b6a 100644 --- a/public/app/core/components/AppNotifications/AppNotificationItem.tsx +++ b/public/app/core/components/AppNotifications/AppNotificationItem.tsx @@ -4,7 +4,7 @@ import { useEffectOnce } from 'react-use'; import { GrafanaTheme2 } from '@grafana/data'; import { Trans } from '@grafana/i18n'; import { Alert, useStyles2 } from '@grafana/ui'; -import { AppNotification, timeoutMap } from 'app/types'; +import { AppNotification, timeoutMap } from 'app/types/appNotifications'; interface Props { appNotification: AppNotification; diff --git a/public/app/core/components/AppNotifications/AppNotificationList.tsx b/public/app/core/components/AppNotifications/AppNotificationList.tsx index edb686f0d55..bb473dd0905 100644 --- a/public/app/core/components/AppNotifications/AppNotificationList.tsx +++ b/public/app/core/components/AppNotifications/AppNotificationList.tsx @@ -6,7 +6,7 @@ import { useStyles2, Stack } from '@grafana/ui'; import { notifyApp, hideAppNotification } from 'app/core/actions'; import appEvents from 'app/core/app_events'; import { selectVisible } from 'app/core/reducers/appNotification'; -import { useSelector, useDispatch } from 'app/types'; +import { useSelector, useDispatch } from 'app/types/store'; import { createErrorNotification, diff --git a/public/app/core/components/FolderFilter/FolderFilter.tsx b/public/app/core/components/FolderFilter/FolderFilter.tsx index b427eed4569..2d310a6609b 100644 --- a/public/app/core/components/FolderFilter/FolderFilter.tsx +++ b/public/app/core/components/FolderFilter/FolderFilter.tsx @@ -9,7 +9,8 @@ import { config } from 'app/core/config'; import { getBackendSrv } from 'app/core/services/backend_srv'; import { getGrafanaSearcher } from 'app/features/search/service/searcher'; import { DashboardSearchItemType } from 'app/features/search/types'; -import { FolderInfo, PermissionLevelString } from 'app/types'; +import { PermissionLevelString } from 'app/types/acl'; +import { FolderInfo } from 'app/types/folders'; export interface FolderFilterProps { onChange: (folder: FolderInfo[]) => void; diff --git a/public/app/core/components/InviteUserButton/utils.ts b/public/app/core/components/InviteUserButton/utils.ts index 708e5ff88d5..6fb774a059b 100644 --- a/public/app/core/components/InviteUserButton/utils.ts +++ b/public/app/core/components/InviteUserButton/utils.ts @@ -2,7 +2,7 @@ import { reportInteraction } from '@grafana/runtime'; import { config } from 'app/core/config'; import { contextSrv } from 'app/core/services/context_srv'; import { getExternalUserMngLinkUrl } from 'app/features/users/utils'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; export const shouldRenderInviteUserButton = config.featureToggles.inviteUserExperimental && diff --git a/public/app/core/components/NestedFolderPicker/FolderRepo.tsx b/public/app/core/components/NestedFolderPicker/FolderRepo.tsx index 02f2f108e30..e149f84c75d 100644 --- a/public/app/core/components/NestedFolderPicker/FolderRepo.tsx +++ b/public/app/core/components/NestedFolderPicker/FolderRepo.tsx @@ -2,7 +2,7 @@ import { t } from '@grafana/i18n'; import { Badge } from '@grafana/ui'; import { useIsProvisionedInstance } from 'app/features/provisioning/hooks/useIsProvisionedInstance'; import { NestedFolderDTO } from 'app/features/search/service/types'; -import { FolderDTO, FolderListItemDTO } from 'app/types'; +import { FolderDTO, FolderListItemDTO } from 'app/types/folders'; export interface Props { folder?: FolderListItemDTO | NestedFolderDTO | FolderDTO; diff --git a/public/app/core/components/NestedFolderPicker/NestedFolderList.tsx b/public/app/core/components/NestedFolderPicker/NestedFolderList.tsx index 4a322b6ee27..46ef137c53f 100644 --- a/public/app/core/components/NestedFolderPicker/NestedFolderList.tsx +++ b/public/app/core/components/NestedFolderPicker/NestedFolderList.tsx @@ -12,7 +12,7 @@ import { Indent } from 'app/core/components/Indent/Indent'; import { childrenByParentUIDSelector, rootItemsSelector } from 'app/features/browse-dashboards/state/hooks'; import { DashboardsTreeItem } from 'app/features/browse-dashboards/types'; import { DashboardViewItem } from 'app/features/search/types'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { FolderRepo } from './FolderRepo'; diff --git a/public/app/core/components/NestedFolderPicker/NestedFolderPicker.tsx b/public/app/core/components/NestedFolderPicker/NestedFolderPicker.tsx index 28305640a2a..38d241c61e2 100644 --- a/public/app/core/components/NestedFolderPicker/NestedFolderPicker.tsx +++ b/public/app/core/components/NestedFolderPicker/NestedFolderPicker.tsx @@ -15,7 +15,7 @@ import { getGrafanaSearcher } from 'app/features/search/service/searcher'; import { QueryResponse } from 'app/features/search/service/types'; import { queryResultToViewItem } from 'app/features/search/service/utils'; import { DashboardViewItem } from 'app/features/search/types'; -import { PermissionLevelString } from 'app/types'; +import { PermissionLevelString } from 'app/types/acl'; import { FolderRepo } from './FolderRepo'; import { getDOMId, NestedFolderList } from './NestedFolderList'; diff --git a/public/app/core/components/NestedFolderPicker/useFoldersQuery.ts b/public/app/core/components/NestedFolderPicker/useFoldersQuery.ts index bd3b6ba9098..6fe4c0ef440 100644 --- a/public/app/core/components/NestedFolderPicker/useFoldersQuery.ts +++ b/public/app/core/components/NestedFolderPicker/useFoldersQuery.ts @@ -1,6 +1,5 @@ import { config } from '@grafana/runtime'; - -import { PermissionLevelString } from '../../../types'; +import { PermissionLevelString } from 'app/types/acl'; import { useFoldersQueryAppPlatform } from './useFoldersQueryAppPlatform'; import { useFoldersQueryLegacy } from './useFoldersQueryLegacy'; diff --git a/public/app/core/components/NestedFolderPicker/useFoldersQueryLegacy.ts b/public/app/core/components/NestedFolderPicker/useFoldersQueryLegacy.ts index 6b1286895bd..8381c61d1f2 100644 --- a/public/app/core/components/NestedFolderPicker/useFoldersQueryLegacy.ts +++ b/public/app/core/components/NestedFolderPicker/useFoldersQueryLegacy.ts @@ -7,7 +7,8 @@ import { ListFolderQueryArgs, browseDashboardsAPI } from 'app/features/browse-da import { PAGE_SIZE } from 'app/features/browse-dashboards/api/services'; import { getPaginationPlaceholders } from 'app/features/browse-dashboards/state/utils'; import { DashboardViewItemWithUIItems, DashboardsTreeItem } from 'app/features/browse-dashboards/types'; -import { FolderListItemDTO, PermissionLevelString } from 'app/types'; +import { PermissionLevelString } from 'app/types/acl'; +import { FolderListItemDTO } from 'app/types/folders'; import { useDispatch, useSelector } from 'app/types/store'; import { ROOT_FOLDER_ITEM } from './utils'; diff --git a/public/app/core/components/Page/usePageNav.ts b/public/app/core/components/Page/usePageNav.ts index da6bd0da218..66899e442da 100644 --- a/public/app/core/components/Page/usePageNav.ts +++ b/public/app/core/components/Page/usePageNav.ts @@ -3,7 +3,7 @@ import { createSelector } from 'reselect'; import { NavModel } from '@grafana/data'; import { getNavModel } from 'app/core/selectors/navModel'; import { store } from 'app/store/store'; -import { StoreState, useSelector } from 'app/types'; +import { StoreState, useSelector } from 'app/types/store'; export function usePageNav(navId?: string, oldProp?: NavModel): NavModel | undefined { if (oldProp) { diff --git a/public/app/core/components/Page/usePageTitle.ts b/public/app/core/components/Page/usePageTitle.ts index c2e53b23251..4c338a77ef0 100644 --- a/public/app/core/components/Page/usePageTitle.ts +++ b/public/app/core/components/Page/usePageTitle.ts @@ -2,7 +2,7 @@ import { useEffect } from 'react'; import { NavModel, NavModelItem } from '@grafana/data'; import { HOME_NAV_ID } from 'app/core/reducers/navModel'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { Branding } from '../Branding/Branding'; import { buildBreadcrumbs } from '../Breadcrumbs/utils'; diff --git a/public/app/core/components/RolePicker/BuiltinRoleSelector.tsx b/public/app/core/components/RolePicker/BuiltinRoleSelector.tsx index c0fa457d8c2..70e18b2a9c8 100644 --- a/public/app/core/components/RolePicker/BuiltinRoleSelector.tsx +++ b/public/app/core/components/RolePicker/BuiltinRoleSelector.tsx @@ -1,8 +1,7 @@ -import { SelectableValue } from '@grafana/data'; +import { OrgRole, SelectableValue } from '@grafana/data'; import { Trans } from '@grafana/i18n'; import { Icon, RadioButtonList, Tooltip, useStyles2, useTheme2, PopoverContent } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; -import { OrgRole } from 'app/types'; import { getStyles } from './styles'; diff --git a/public/app/core/components/RolePicker/RoleMenuGroupsSection.tsx b/public/app/core/components/RolePicker/RoleMenuGroupsSection.tsx index 79e44be57e6..b4b3e30d738 100644 --- a/public/app/core/components/RolePicker/RoleMenuGroupsSection.tsx +++ b/public/app/core/components/RolePicker/RoleMenuGroupsSection.tsx @@ -1,7 +1,7 @@ import { forwardRef, useCallback, useState } from 'react'; import { useStyles2, getSelectStyles, useTheme2 } from '@grafana/ui'; -import { Role } from 'app/types'; +import { Role } from 'app/types/accessControl'; import { RoleMenuGroupOption } from './RoleMenuGroupOption'; import { RoleMenuOption } from './RoleMenuOption'; diff --git a/public/app/core/components/RolePicker/RoleMenuOption.tsx b/public/app/core/components/RolePicker/RoleMenuOption.tsx index 7700b00bdae..6e020ad6018 100644 --- a/public/app/core/components/RolePicker/RoleMenuOption.tsx +++ b/public/app/core/components/RolePicker/RoleMenuOption.tsx @@ -4,7 +4,7 @@ import { forwardRef, FormEvent } from 'react'; import { t } from '@grafana/i18n'; import { Checkbox, Icon, Tooltip, useStyles2, useTheme2 } from '@grafana/ui'; import { getSelectStyles } from '@grafana/ui/internal'; -import { Role } from 'app/types'; +import { Role } from 'app/types/accessControl'; import { getStyles } from './styles'; diff --git a/public/app/core/components/RolePicker/RolePicker.tsx b/public/app/core/components/RolePicker/RolePicker.tsx index 6cbf2e0450d..25cff0889a1 100644 --- a/public/app/core/components/RolePicker/RolePicker.tsx +++ b/public/app/core/components/RolePicker/RolePicker.tsx @@ -1,7 +1,8 @@ import { FormEvent, useCallback, useEffect, useState, useRef } from 'react'; +import { OrgRole } from '@grafana/data'; import { ClickOutsideWrapper, Portal, useTheme2 } from '@grafana/ui'; -import { Role, OrgRole } from 'app/types'; +import { Role } from 'app/types/accessControl'; import { RolePickerInput } from './RolePickerInput'; import { RolePickerMenu } from './RolePickerMenu'; diff --git a/public/app/core/components/RolePicker/RolePickerInput.tsx b/public/app/core/components/RolePicker/RolePickerInput.tsx index 9acb2630745..9aaa4b447f5 100644 --- a/public/app/core/components/RolePicker/RolePickerInput.tsx +++ b/public/app/core/components/RolePicker/RolePickerInput.tsx @@ -6,8 +6,7 @@ import { GrafanaTheme2 } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { useStyles2, getInputStyles, sharedInputStyle, Tooltip, Icon, Spinner } from '@grafana/ui'; import { getFocusStyles } from '@grafana/ui/internal'; - -import { Role } from '../../../types'; +import { Role } from 'app/types/accessControl'; import { ValueContainer } from './ValueContainer'; import { ROLE_PICKER_WIDTH } from './constants'; diff --git a/public/app/core/components/RolePicker/RolePickerMenu.tsx b/public/app/core/components/RolePicker/RolePickerMenu.tsx index 23cf52de471..81c38519ae6 100644 --- a/public/app/core/components/RolePicker/RolePickerMenu.tsx +++ b/public/app/core/components/RolePicker/RolePickerMenu.tsx @@ -1,10 +1,11 @@ import { css, cx } from '@emotion/css'; import { useEffect, useRef, useState } from 'react'; +import { OrgRole } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { Button, ScrollContainer, Stack, TextLink, useStyles2, useTheme2 } from '@grafana/ui'; import { getSelectStyles } from '@grafana/ui/internal'; -import { OrgRole, Role } from 'app/types'; +import { Role } from 'app/types/accessControl'; import { BuiltinRoleSelector } from './BuiltinRoleSelector'; import { RoleMenuGroupsSection } from './RoleMenuGroupsSection'; diff --git a/public/app/core/components/RolePicker/RolePickerSubMenu.tsx b/public/app/core/components/RolePicker/RolePickerSubMenu.tsx index fdcd22224b9..3dff3fc88be 100644 --- a/public/app/core/components/RolePicker/RolePickerSubMenu.tsx +++ b/public/app/core/components/RolePicker/RolePickerSubMenu.tsx @@ -3,7 +3,7 @@ import { cx } from '@emotion/css'; import { Trans, t } from '@grafana/i18n'; import { Button, ScrollContainer, Stack, useStyles2, useTheme2 } from '@grafana/ui'; import { getSelectStyles } from '@grafana/ui/internal'; -import { Role } from 'app/types'; +import { Role } from 'app/types/accessControl'; import { RoleMenuOption } from './RoleMenuOption'; import { MENU_MAX_HEIGHT } from './constants'; diff --git a/public/app/core/components/RolePicker/TeamRolePicker.tsx b/public/app/core/components/RolePicker/TeamRolePicker.tsx index 83552236334..78e3b0f2c82 100644 --- a/public/app/core/components/RolePicker/TeamRolePicker.tsx +++ b/public/app/core/components/RolePicker/TeamRolePicker.tsx @@ -2,7 +2,7 @@ import { useEffect } from 'react'; import { useAsyncFn } from 'react-use'; import { contextSrv } from 'app/core/core'; -import { Role, AccessControlAction } from 'app/types'; +import { Role, AccessControlAction } from 'app/types/accessControl'; import { RolePicker } from './RolePicker'; import { fetchTeamRoles, updateTeamRoles } from './api'; diff --git a/public/app/core/components/RolePicker/UserRolePicker.tsx b/public/app/core/components/RolePicker/UserRolePicker.tsx index 5fa3c94286f..a4232f4b61a 100644 --- a/public/app/core/components/RolePicker/UserRolePicker.tsx +++ b/public/app/core/components/RolePicker/UserRolePicker.tsx @@ -1,8 +1,9 @@ import { useEffect } from 'react'; import { useAsyncFn } from 'react-use'; +import { OrgRole } from '@grafana/data'; import { contextSrv } from 'app/core/core'; -import { Role, OrgRole, AccessControlAction } from 'app/types'; +import { Role, AccessControlAction } from 'app/types/accessControl'; import { RolePicker } from './RolePicker'; import { fetchUserRoles, updateUserRoles } from './api'; diff --git a/public/app/core/components/RolePicker/api.ts b/public/app/core/components/RolePicker/api.ts index 00e1926eea5..596463b4a9d 100644 --- a/public/app/core/components/RolePicker/api.ts +++ b/public/app/core/components/RolePicker/api.ts @@ -1,5 +1,5 @@ import { getBackendSrv, isFetchError } from '@grafana/runtime'; -import { Role } from 'app/types'; +import { Role } from 'app/types/accessControl'; import { addDisplayNameForFixedRole, addFilteredDisplayName } from './utils'; diff --git a/public/app/core/components/RolePicker/hooks.ts b/public/app/core/components/RolePicker/hooks.ts index 071f31eddaa..0b66a36c94f 100644 --- a/public/app/core/components/RolePicker/hooks.ts +++ b/public/app/core/components/RolePicker/hooks.ts @@ -4,7 +4,7 @@ import { useDeepCompareEffect } from 'react-use'; import useAsync from 'react-use/lib/useAsync'; import { contextSrv } from 'app/core/core'; -import { Role, AccessControlAction } from 'app/types'; +import { Role, AccessControlAction } from 'app/types/accessControl'; import { fetchRoleOptions } from './api'; diff --git a/public/app/core/components/RolePicker/utils.ts b/public/app/core/components/RolePicker/utils.ts index ed1021f2d8c..413671f0090 100644 --- a/public/app/core/components/RolePicker/utils.ts +++ b/public/app/core/components/RolePicker/utils.ts @@ -1,4 +1,4 @@ -import { Role } from 'app/types'; +import { Role } from 'app/types/accessControl'; export const isNotDelegatable = (role: Role) => { return role.delegatable !== undefined && !role.delegatable; diff --git a/public/app/core/components/RolePickerDrawer/RolePickerBadges.tsx b/public/app/core/components/RolePickerDrawer/RolePickerBadges.tsx index 57789ebb518..522f752b9a6 100644 --- a/public/app/core/components/RolePickerDrawer/RolePickerBadges.tsx +++ b/public/app/core/components/RolePickerDrawer/RolePickerBadges.tsx @@ -5,7 +5,7 @@ import { FormProvider, useForm } from 'react-hook-form'; import { GrafanaTheme2 } from '@grafana/data'; import { t } from '@grafana/i18n'; import { useStyles2, Badge, Stack } from '@grafana/ui'; -import { OrgUser } from 'app/types'; +import { OrgUser } from 'app/types/user'; import { RolePickerDrawer } from './RolePickerDrawer'; diff --git a/public/app/core/components/RolePickerDrawer/RolePickerDrawer.tsx b/public/app/core/components/RolePickerDrawer/RolePickerDrawer.tsx index 9b327449519..75afc684eab 100644 --- a/public/app/core/components/RolePickerDrawer/RolePickerDrawer.tsx +++ b/public/app/core/components/RolePickerDrawer/RolePickerDrawer.tsx @@ -1,9 +1,8 @@ import { Controller, useFormContext } from 'react-hook-form'; -import { toOption } from '@grafana/data'; +import { OrgRole, toOption } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { Drawer, Field, RadioButtonGroup, TextLink } from '@grafana/ui'; -import { OrgRole } from 'app/types'; const roleOptions = Object.keys(OrgRole).map(toOption); diff --git a/public/app/core/components/Select/DashboardPicker.test.tsx b/public/app/core/components/Select/DashboardPicker.test.tsx index 2f662fe586b..b46c1f9d2df 100644 --- a/public/app/core/components/Select/DashboardPicker.test.tsx +++ b/public/app/core/components/Select/DashboardPicker.test.tsx @@ -10,7 +10,7 @@ import { import { backendSrv } from 'app/core/services/backend_srv'; import { DashboardWithAccessInfo } from 'app/features/dashboard/api/types'; import { DashboardSearchItemType } from 'app/features/search/types'; -import { DashboardDTO } from 'app/types'; +import { DashboardDTO } from 'app/types/dashboard'; import { DashboardPicker } from './DashboardPicker'; diff --git a/public/app/core/components/Select/DashboardPicker.tsx b/public/app/core/components/Select/DashboardPicker.tsx index dfbb2458ade..bfb965a73bd 100644 --- a/public/app/core/components/Select/DashboardPicker.tsx +++ b/public/app/core/components/Select/DashboardPicker.tsx @@ -8,7 +8,7 @@ import { AnnoKeyFolder, AnnoKeyFolderTitle } from 'app/features/apiserver/types' import { getDashboardAPI } from 'app/features/dashboard/api/dashboard_api'; import { isDashboardV2Resource } from 'app/features/dashboard/api/utils'; import { DashboardSearchItem } from 'app/features/search/types'; -import { DashboardDTO } from 'app/types'; +import { DashboardDTO } from 'app/types/dashboard'; interface Props extends Omit, 'value' | 'onChange' | 'loadOptions' | ''> { value?: DashboardPickerDTO['uid']; diff --git a/public/app/core/components/Select/OldFolderPicker.tsx b/public/app/core/components/Select/OldFolderPicker.tsx index e5e684b7713..13ddca85986 100644 --- a/public/app/core/components/Select/OldFolderPicker.tsx +++ b/public/app/core/components/Select/OldFolderPicker.tsx @@ -13,7 +13,8 @@ import appEvents from 'app/core/app_events'; import { contextSrv } from 'app/core/services/context_srv'; import { createFolder, getFolderByUid, searchFolders } from 'app/features/manage-dashboards/state/actions'; import { DashboardSearchHit } from 'app/features/search/types'; -import { AccessControlAction, PermissionLevelString, SearchQueryType } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { PermissionLevelString, SearchQueryType } from 'app/types/acl'; export type FolderPickerFilter = (hits: DashboardSearchHit[]) => DashboardSearchHit[]; diff --git a/public/app/core/components/Select/OrgPicker.tsx b/public/app/core/components/Select/OrgPicker.tsx index bc064c83d98..81ed7132d02 100644 --- a/public/app/core/components/Select/OrgPicker.tsx +++ b/public/app/core/components/Select/OrgPicker.tsx @@ -5,7 +5,8 @@ import { SelectableValue } from '@grafana/data'; import { t } from '@grafana/i18n'; import { getBackendSrv } from '@grafana/runtime'; import { AsyncSelect } from '@grafana/ui'; -import { Organization, UserOrg } from 'app/types'; +import { Organization } from 'app/types/organization'; +import { UserOrg } from 'app/types/user'; export type OrgSelectItem = SelectableValue; diff --git a/public/app/core/components/Select/ServiceAccountPicker.tsx b/public/app/core/components/Select/ServiceAccountPicker.tsx index b86a451dea1..037404dcb2b 100644 --- a/public/app/core/components/Select/ServiceAccountPicker.tsx +++ b/public/app/core/components/Select/ServiceAccountPicker.tsx @@ -6,7 +6,7 @@ import { SelectableValue } from '@grafana/data'; import { t } from '@grafana/i18n'; import { getBackendSrv } from '@grafana/runtime'; import { AsyncSelect } from '@grafana/ui'; -import { ServiceAccountDTO, ServiceAccountsState } from 'app/types'; +import { ServiceAccountDTO, ServiceAccountsState } from 'app/types/serviceaccount'; export interface Props { onSelected: (user: SelectableValue) => void; diff --git a/public/app/core/components/Select/TeamPicker.tsx b/public/app/core/components/Select/TeamPicker.tsx index b3608b80105..3f374fc8930 100644 --- a/public/app/core/components/Select/TeamPicker.tsx +++ b/public/app/core/components/Select/TeamPicker.tsx @@ -6,7 +6,7 @@ import { SelectableValue } from '@grafana/data'; import { t } from '@grafana/i18n'; import { getBackendSrv } from '@grafana/runtime'; import { AsyncSelect } from '@grafana/ui'; -import { Team } from 'app/types'; +import { Team } from 'app/types/teams'; export interface Props { onSelected: (team: SelectableValue) => void; diff --git a/public/app/core/components/Select/UserPicker.tsx b/public/app/core/components/Select/UserPicker.tsx index 0b1b5cb129f..5284cbeca5f 100644 --- a/public/app/core/components/Select/UserPicker.tsx +++ b/public/app/core/components/Select/UserPicker.tsx @@ -6,7 +6,7 @@ import { SelectableValue } from '@grafana/data'; import { t } from '@grafana/i18n'; import { getBackendSrv } from '@grafana/runtime'; import { AsyncSelect } from '@grafana/ui'; -import { OrgUser } from 'app/types'; +import { OrgUser } from 'app/types/user'; export interface Props { onSelected: (user: SelectableValue) => void; diff --git a/public/app/core/copy/appNotification.ts b/public/app/core/copy/appNotification.ts index 9f2fff8641f..3f1dd8f484f 100644 --- a/public/app/core/copy/appNotification.ts +++ b/public/app/core/copy/appNotification.ts @@ -3,7 +3,8 @@ import { v4 as uuidv4 } from 'uuid'; import { getMessageFromError } from 'app/core/utils/errors'; import { dispatch as storeDispatch } from 'app/store/store'; -import { AppNotification, AppNotificationSeverity, useDispatch } from 'app/types'; +import { AppNotificationSeverity, AppNotification } from 'app/types/appNotifications'; +import { useDispatch } from 'app/types/store'; import { notifyApp } from '../actions'; diff --git a/public/app/core/history/RichHistoryLocalStorage.test.ts b/public/app/core/history/RichHistoryLocalStorage.test.ts index 8899a7cc509..8cf739514e2 100644 --- a/public/app/core/history/RichHistoryLocalStorage.test.ts +++ b/public/app/core/history/RichHistoryLocalStorage.test.ts @@ -1,8 +1,8 @@ import { DataQuery } from '@grafana/data'; import store from 'app/core/store'; +import { RichHistoryQuery } from 'app/types/explore'; import { DatasourceSrv } from '../../features/plugins/datasource_srv'; -import { RichHistoryQuery } from '../../types'; import { backendSrv } from '../services/backend_srv'; import { RichHistorySearchFilters, RichHistorySettings, SortOrder } from '../utils/richHistoryTypes'; diff --git a/public/app/core/history/RichHistoryLocalStorage.ts b/public/app/core/history/RichHistoryLocalStorage.ts index 4396b73a1fa..165c2f06eac 100644 --- a/public/app/core/history/RichHistoryLocalStorage.ts +++ b/public/app/core/history/RichHistoryLocalStorage.ts @@ -2,8 +2,8 @@ import { find, isEqual, omit } from 'lodash'; import { DataQuery, SelectableValue } from '@grafana/data'; import { RichHistorySearchFilters, RichHistorySettings } from 'app/core/utils/richHistory'; +import { RichHistoryQuery } from 'app/types/explore'; -import { RichHistoryQuery } from '../../types'; import store from '../store'; import RichHistoryStorage, { RichHistoryServiceError, RichHistoryStorageWarning } from './RichHistoryStorage'; diff --git a/public/app/core/history/RichHistoryRemoteStorage.test.ts b/public/app/core/history/RichHistoryRemoteStorage.test.ts index 766712d1c0a..d3d6f48f830 100644 --- a/public/app/core/history/RichHistoryRemoteStorage.test.ts +++ b/public/app/core/history/RichHistoryRemoteStorage.test.ts @@ -1,9 +1,9 @@ import { of } from 'rxjs'; import { Preferences as UserPreferencesDTO } from '@grafana/schema/src/raw/preferences/x/preferences_types.gen'; +import { RichHistoryQuery } from 'app/types/explore'; import { DatasourceSrv } from '../../features/plugins/datasource_srv'; -import { RichHistoryQuery } from '../../types'; import { SortOrder } from '../utils/richHistoryTypes'; import RichHistoryRemoteStorage, { RichHistoryRemoteStorageDTO } from './RichHistoryRemoteStorage'; diff --git a/public/app/core/history/RichHistoryStorage.ts b/public/app/core/history/RichHistoryStorage.ts index 13d89a05172..158a5e7d6cb 100644 --- a/public/app/core/history/RichHistoryStorage.ts +++ b/public/app/core/history/RichHistoryStorage.ts @@ -1,6 +1,5 @@ import { RichHistorySearchBackendFilters, RichHistorySettings } from 'app/core/utils/richHistoryTypes'; - -import { RichHistoryQuery } from '../../types'; +import { RichHistoryQuery } from 'app/types/explore'; /** * Errors are used when the operation on Rich History was not successful. diff --git a/public/app/core/history/localStorageConverter.test.ts b/public/app/core/history/localStorageConverter.test.ts index 20b8701a258..ffefb2ce8d4 100644 --- a/public/app/core/history/localStorageConverter.test.ts +++ b/public/app/core/history/localStorageConverter.test.ts @@ -1,6 +1,6 @@ import { DatasourceSrv } from 'app/features/plugins/datasource_srv'; +import { RichHistoryQuery } from 'app/types/explore'; -import { RichHistoryQuery } from '../../types'; import { backendSrv } from '../services/backend_srv'; import { RichHistoryLocalStorageDTO } from './RichHistoryLocalStorage'; diff --git a/public/app/core/history/localStorageConverter.ts b/public/app/core/history/localStorageConverter.ts index 62be110bcdd..485ebf3a1a3 100644 --- a/public/app/core/history/localStorageConverter.ts +++ b/public/app/core/history/localStorageConverter.ts @@ -1,6 +1,5 @@ import { getDataSourceSrv } from '@grafana/runtime'; - -import { RichHistoryQuery } from '../../types'; +import { RichHistoryQuery } from 'app/types/explore'; import { RichHistoryLocalStorageDTO } from './RichHistoryLocalStorage'; diff --git a/public/app/core/history/remoteStorageConverter.test.ts b/public/app/core/history/remoteStorageConverter.test.ts index 6e42cc507ac..dd8f927ec66 100644 --- a/public/app/core/history/remoteStorageConverter.test.ts +++ b/public/app/core/history/remoteStorageConverter.test.ts @@ -1,5 +1,6 @@ +import { RichHistoryQuery } from 'app/types/explore'; + import { DatasourceSrv } from '../../features/plugins/datasource_srv'; -import { RichHistoryQuery } from '../../types'; import { backendSrv } from '../services/backend_srv'; import { RichHistoryRemoteStorageDTO } from './RichHistoryRemoteStorage'; diff --git a/public/app/core/history/remoteStorageConverter.ts b/public/app/core/history/remoteStorageConverter.ts index 6a743016e64..a4d15a677c3 100644 --- a/public/app/core/history/remoteStorageConverter.ts +++ b/public/app/core/history/remoteStorageConverter.ts @@ -1,6 +1,5 @@ import { getDataSourceSrv } from '@grafana/runtime'; - -import { RichHistoryQuery } from '../../types'; +import { RichHistoryQuery } from 'app/types/explore'; import { RichHistoryRemoteStorageDTO } from './RichHistoryRemoteStorage'; diff --git a/public/app/core/history/richHistoryLocalStorageUtils.test.ts b/public/app/core/history/richHistoryLocalStorageUtils.test.ts index 7687f3f1bb5..29a4b7d79d2 100644 --- a/public/app/core/history/richHistoryLocalStorageUtils.test.ts +++ b/public/app/core/history/richHistoryLocalStorageUtils.test.ts @@ -1,7 +1,6 @@ import { DataQuery } from '@grafana/data'; import { SortOrder } from 'app/core/utils/richHistory'; - -import { RichHistoryQuery } from '../../types'; +import { RichHistoryQuery } from 'app/types/explore'; import { filterAndSortQueries } from './richHistoryLocalStorageUtils'; diff --git a/public/app/core/history/richHistoryLocalStorageUtils.ts b/public/app/core/history/richHistoryLocalStorageUtils.ts index d22b4816781..caefdd7f45d 100644 --- a/public/app/core/history/richHistoryLocalStorageUtils.ts +++ b/public/app/core/history/richHistoryLocalStorageUtils.ts @@ -1,8 +1,8 @@ import { omit } from 'lodash'; import { DateTime, dateTime, dateTimeForTimeZone } from '@grafana/data'; +import { RichHistoryQuery } from 'app/types/explore'; -import { RichHistoryQuery } from '../../types'; import { SortOrder } from '../utils/richHistoryTypes'; /** diff --git a/public/app/core/hooks/useCleanup.ts b/public/app/core/hooks/useCleanup.ts index 86696b829d2..6cec29424d1 100644 --- a/public/app/core/hooks/useCleanup.ts +++ b/public/app/core/hooks/useCleanup.ts @@ -1,6 +1,6 @@ import { useEffect, useRef } from 'react'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { cleanUpAction, CleanUpAction } from '../actions/cleanUp'; diff --git a/public/app/core/hooks/useNavModel.ts b/public/app/core/hooks/useNavModel.ts index 047654109cc..a872f1a59f1 100644 --- a/public/app/core/hooks/useNavModel.ts +++ b/public/app/core/hooks/useNavModel.ts @@ -1,5 +1,5 @@ import { NavModel } from '@grafana/data'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { getNavModel } from '../selectors/navModel'; diff --git a/public/app/core/navigation/kiosk.ts b/public/app/core/navigation/kiosk.ts index 36c66c7eeeb..0e7ddfb3f3c 100644 --- a/public/app/core/navigation/kiosk.ts +++ b/public/app/core/navigation/kiosk.ts @@ -1,6 +1,5 @@ import { UrlQueryMap } from '@grafana/data'; - -import { KioskMode } from '../../types'; +import { KioskMode } from 'app/types/dashboard'; // TODO Remove after topnav feature toggle is permanent and old NavBar is removed export function getKioskMode(queryParams: UrlQueryMap): KioskMode | null { diff --git a/public/app/core/reducers/appNotification.test.ts b/public/app/core/reducers/appNotification.test.ts index 6094e1ac7bc..f9bb79baab0 100644 --- a/public/app/core/reducers/appNotification.test.ts +++ b/public/app/core/reducers/appNotification.test.ts @@ -1,4 +1,4 @@ -import { AppNotificationSeverity, AppNotificationsState } from 'app/types/'; +import { AppNotificationSeverity, AppNotificationsState } from 'app/types/appNotifications'; import { appNotificationsReducer, clearNotification, notifyApp } from './appNotification'; diff --git a/public/app/core/reducers/appNotification.ts b/public/app/core/reducers/appNotification.ts index d9f563d364e..aedb2d0a0fc 100644 --- a/public/app/core/reducers/appNotification.ts +++ b/public/app/core/reducers/appNotification.ts @@ -1,6 +1,6 @@ import { createSelector, createSlice, PayloadAction } from '@reduxjs/toolkit'; -import { AppNotification, AppNotificationSeverity, AppNotificationsState } from 'app/types/'; +import { AppNotification, AppNotificationSeverity, AppNotificationsState } from 'app/types/appNotifications'; const MAX_STORED_NOTIFICATIONS = 25; export const STORAGE_KEY = 'notifications'; diff --git a/public/app/core/reducers/root.test.ts b/public/app/core/reducers/root.test.ts index 6b584776233..c9f5d5068bf 100644 --- a/public/app/core/reducers/root.test.ts +++ b/public/app/core/reducers/root.test.ts @@ -1,6 +1,7 @@ +import { Team } from 'app/types/teams'; + import { reducerTester } from '../../../test/core/redux/reducerTester'; import { initialTeamsState, teamsLoaded } from '../../features/teams/state/reducers'; -import { Team } from '../../types'; import { StoreState } from '../../types/store'; import { cleanUpAction } from '../actions/cleanUp'; diff --git a/public/app/core/services/backend_srv.ts b/public/app/core/services/backend_srv.ts index ac0d13d1051..f518dc83df7 100644 --- a/public/app/core/services/backend_srv.ts +++ b/public/app/core/services/backend_srv.ts @@ -25,7 +25,8 @@ import { getDashboardAPI } from 'app/features/dashboard/api/dashboard_api'; 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'; +import { DashboardDTO } from 'app/types/dashboard'; +import { FolderDTO } from 'app/types/folders'; import { ShowModalReactEvent } from '../../types/events'; import { isContentTypeJson, parseInitFromOptions, parseResponseBody, parseUrlFromOptions } from '../utils/fetch'; diff --git a/public/app/core/services/context_srv.ts b/public/app/core/services/context_srv.ts index 513b5a97699..8374d4b7bf1 100644 --- a/public/app/core/services/context_srv.ts +++ b/public/app/core/services/context_srv.ts @@ -11,7 +11,7 @@ import { } from '@grafana/data'; import { featureEnabled, getBackendSrv } from '@grafana/runtime'; import { getSessionExpiry } from 'app/core/utils/auth'; -import { AccessControlAction, UserPermission } from 'app/types'; +import { UserPermission, AccessControlAction } from 'app/types/accessControl'; import { CurrentUserInternal } from 'app/types/config'; import config from '../../core/config'; diff --git a/public/app/core/utils/richHistory.test.ts b/public/app/core/utils/richHistory.test.ts index 0c6a95b981d..0fba9ac1352 100644 --- a/public/app/core/utils/richHistory.test.ts +++ b/public/app/core/utils/richHistory.test.ts @@ -1,7 +1,7 @@ import { dateTime, DataQuery } from '@grafana/data'; import store from 'app/core/store'; +import { RichHistoryQuery } from 'app/types/explore'; -import { RichHistoryQuery } from '../../types'; import RichHistoryStorage, { RichHistoryStorageWarning } from '../history/RichHistoryStorage'; import { diff --git a/public/app/dev-utils.ts b/public/app/dev-utils.ts index 478af4f8f64..07a656735c1 100644 --- a/public/app/dev-utils.ts +++ b/public/app/dev-utils.ts @@ -3,7 +3,7 @@ import store from 'app/core/store'; import { sendAppNotification } from './core/copy/appNotification'; import { PreferencesService } from './core/services/PreferencesService'; -import { AppNotificationSeverity } from './types'; +import { AppNotificationSeverity } from './types/appNotifications'; export const STORAGE_MOCK_API_KEY = 'grafana.dev.mockApi'; diff --git a/public/app/features/admin/AdminEditOrgPage.tsx b/public/app/features/admin/AdminEditOrgPage.tsx index 34b0d477523..fb6039792dc 100644 --- a/public/app/features/admin/AdminEditOrgPage.tsx +++ b/public/app/features/admin/AdminEditOrgPage.tsx @@ -3,12 +3,13 @@ import { useForm } from 'react-hook-form'; import { useParams } from 'react-router-dom-v5-compat'; import { useAsyncFn } from 'react-use'; -import { NavModelItem } from '@grafana/data'; +import { NavModelItem, OrgRole } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { Field, Input, Button, Legend, Alert } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/core'; -import { OrgUser, AccessControlAction, OrgRole } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { OrgUser } from 'app/types/user'; import { OrgUsersTable } from './Users/OrgUsersTable'; import { getOrg, getOrgUsers, getUsersRoles, removeOrgUser, updateOrgName, updateOrgUserRole } from './api'; diff --git a/public/app/features/admin/AdminListOrgsPage.tsx b/public/app/features/admin/AdminListOrgsPage.tsx index be3ef8f2624..48da226edaf 100644 --- a/public/app/features/admin/AdminListOrgsPage.tsx +++ b/public/app/features/admin/AdminListOrgsPage.tsx @@ -6,7 +6,8 @@ import { getBackendSrv, isFetchError } from '@grafana/runtime'; import { LinkButton } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction, Organization } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { Organization } from 'app/types/organization'; import { AdminOrgsTable } from './AdminOrgsTable'; diff --git a/public/app/features/admin/AdminOrgsTable.tsx b/public/app/features/admin/AdminOrgsTable.tsx index 9feba68ae31..d85dcccfea5 100644 --- a/public/app/features/admin/AdminOrgsTable.tsx +++ b/public/app/features/admin/AdminOrgsTable.tsx @@ -7,7 +7,8 @@ import { Trans, t } from '@grafana/i18n'; import { Button, ConfirmModal, useStyles2 } from '@grafana/ui'; import { SkeletonComponent, attachSkeleton } from '@grafana/ui/unstable'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, Organization } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { Organization } from 'app/types/organization'; interface Props { orgs: Organization[]; diff --git a/public/app/features/admin/ServerStats.tsx b/public/app/features/admin/ServerStats.tsx index a7f62ec72c1..f3d8e4d0a66 100644 --- a/public/app/features/admin/ServerStats.tsx +++ b/public/app/features/admin/ServerStats.tsx @@ -5,7 +5,7 @@ import { GrafanaTheme2 } from '@grafana/data'; import { Trans } from '@grafana/i18n'; import { config, GrafanaBootConfig } from '@grafana/runtime'; import { LinkButton, Stack, useStyles2 } from '@grafana/ui'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { contextSrv } from '../../core/services/context_srv'; diff --git a/public/app/features/admin/UpgradePage.tsx b/public/app/features/admin/UpgradePage.tsx index 3a8b8ed7f02..61925407cbd 100644 --- a/public/app/features/admin/UpgradePage.tsx +++ b/public/app/features/admin/UpgradePage.tsx @@ -6,6 +6,7 @@ import { GrafanaTheme2, NavModel } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { LinkButton, useStyles2 } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; +import { StoreState } from 'app/types/store'; import checkmarkSvg from 'img/licensing/checkmark.svg'; import customerSupportSvg from 'img/licensing/customer_support.svg'; import handinhandSupportSvg from 'img/licensing/handinhand_support.svg'; @@ -13,7 +14,6 @@ import pluginEnterpriseSvg from 'img/licensing/plugin_enterprise.svg'; import slaSvg from 'img/licensing/sla.svg'; import { getNavModel } from '../../core/selectors/navModel'; -import { StoreState } from '../../types'; import { LicenseChrome } from './LicenseChrome'; import { ServerStats } from './ServerStats'; diff --git a/public/app/features/admin/UserAdminPage.tsx b/public/app/features/admin/UserAdminPage.tsx index 8a2f2c84aa8..1642c3259e8 100644 --- a/public/app/features/admin/UserAdminPage.tsx +++ b/public/app/features/admin/UserAdminPage.tsx @@ -8,7 +8,10 @@ import { featureEnabled } from '@grafana/runtime'; import { Stack } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/core'; -import { StoreState, UserDTO, UserOrg, UserSession, SyncInfo, UserAdminError, AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { SyncInfo } from 'app/types/ldap'; +import { StoreState } from 'app/types/store'; +import { UserDTO, UserOrg, UserSession, UserAdminError } from 'app/types/user'; import { UserLdapSyncInfo } from './UserLdapSyncInfo'; import { UserOrgs } from './UserOrgs'; diff --git a/public/app/features/admin/UserLdapSyncInfo.tsx b/public/app/features/admin/UserLdapSyncInfo.tsx index 387cc3eb9fa..ca1d0ec148a 100644 --- a/public/app/features/admin/UserLdapSyncInfo.tsx +++ b/public/app/features/admin/UserLdapSyncInfo.tsx @@ -4,7 +4,9 @@ import { dateTimeFormat } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { Button, LinkButton } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, SyncInfo, UserDTO } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { SyncInfo } from 'app/types/ldap'; +import { UserDTO } from 'app/types/user'; import { TagBadge } from '../../core/components/TagFilter/TagBadge'; diff --git a/public/app/features/admin/UserListAdminPage.tsx b/public/app/features/admin/UserListAdminPage.tsx index d4b485c3ada..215fd281f3e 100644 --- a/public/app/features/admin/UserListAdminPage.tsx +++ b/public/app/features/admin/UserListAdminPage.tsx @@ -8,8 +8,9 @@ import { Trans, t } from '@grafana/i18n'; import { LinkButton, RadioButtonGroup, useStyles2, FilterInput, EmptyState } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/core'; - -import { AccessControlAction, StoreState, UserFilter } from '../../types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { StoreState } from 'app/types/store'; +import { UserFilter } from 'app/types/user'; import { EnterpriseAuthFeaturesCard } from './EnterpriseAuthFeaturesCard'; import { UsersTable } from './Users/UsersTable'; diff --git a/public/app/features/admin/UserListAnonymousPage.tsx b/public/app/features/admin/UserListAnonymousPage.tsx index c2cd0404dd8..eec26483830 100644 --- a/public/app/features/admin/UserListAnonymousPage.tsx +++ b/public/app/features/admin/UserListAnonymousPage.tsx @@ -7,8 +7,7 @@ import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src'; import { t } from '@grafana/i18n'; import { RadioButtonGroup, useStyles2, FilterInput } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; - -import { StoreState } from '../../types'; +import { StoreState } from 'app/types/store'; import { AnonUsersDevicesTable } from './Users/AnonUsersTable'; import { fetchUsersAnonymousDevices, changeAnonUserSort, changeAnonPage, changeAnonQuery } from './state/actions'; diff --git a/public/app/features/admin/UserListPage.tsx b/public/app/features/admin/UserListPage.tsx index 97184596de4..a2357b4aecf 100644 --- a/public/app/features/admin/UserListPage.tsx +++ b/public/app/features/admin/UserListPage.tsx @@ -9,9 +9,9 @@ import { config } from '@grafana/runtime'; import { useStyles2, TabsBar, Tab } from '@grafana/ui'; import { contextSrv } from 'app/core/services/context_srv'; import { isEmailSharingEnabled } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; +import { AccessControlAction } from 'app/types/accessControl'; import { Page } from '../../core/components/Page/Page'; -import { AccessControlAction } from '../../types'; import { UsersListPageContent } from '../users/UsersListPage'; import { UserListAdminPageContent } from './UserListAdminPage'; diff --git a/public/app/features/admin/UserOrgs.tsx b/public/app/features/admin/UserOrgs.tsx index 6aac4d1721c..201df124ec8 100644 --- a/public/app/features/admin/UserOrgs.tsx +++ b/public/app/features/admin/UserOrgs.tsx @@ -1,7 +1,7 @@ import { css, cx } from '@emotion/css'; import { createRef, PureComponent, ReactElement } from 'react'; -import { GrafanaTheme2 } from '@grafana/data'; +import { GrafanaTheme2, OrgRole } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { Button, @@ -20,7 +20,9 @@ import { UserRolePicker } from 'app/core/components/RolePicker/UserRolePicker'; import { fetchRoleOptions, updateUserRoles } from 'app/core/components/RolePicker/api'; import { OrgPicker, OrgSelectItem } from 'app/core/components/Select/OrgPicker'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, Organization, OrgRole, Role, UserDTO, UserOrg } from 'app/types'; +import { AccessControlAction, Role } from 'app/types/accessControl'; +import { Organization } from 'app/types/organization'; +import { UserOrg, UserDTO } from 'app/types/user'; import { OrgRolePicker } from './OrgRolePicker'; diff --git a/public/app/features/admin/UserPermissions.tsx b/public/app/features/admin/UserPermissions.tsx index ea658a48e49..4d36d628768 100644 --- a/public/app/features/admin/UserPermissions.tsx +++ b/public/app/features/admin/UserPermissions.tsx @@ -6,7 +6,7 @@ import { Trans, t } from '@grafana/i18n'; import { ConfirmButton, RadioButtonGroup, Icon, useStyles2 } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; import { ExternalUserTooltip } from 'app/features/admin/UserOrgs'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; interface Props { isGrafanaAdmin: boolean; diff --git a/public/app/features/admin/UserProfile.tsx b/public/app/features/admin/UserProfile.tsx index 9b9522a084a..1fb9da50d77 100644 --- a/public/app/features/admin/UserProfile.tsx +++ b/public/app/features/admin/UserProfile.tsx @@ -5,7 +5,8 @@ import * as React from 'react'; import { Trans, t } from '@grafana/i18n'; import { Button, ConfirmButton, ConfirmModal, Input, LegacyInputStatus, Stack } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, UserDTO } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { UserDTO } from 'app/types/user'; interface Props { user: UserDTO; diff --git a/public/app/features/admin/UserSessions.tsx b/public/app/features/admin/UserSessions.tsx index 2ee811676d4..f05278d7884 100644 --- a/public/app/features/admin/UserSessions.tsx +++ b/public/app/features/admin/UserSessions.tsx @@ -5,7 +5,8 @@ import { ConfirmButton, ConfirmModal, Button, Stack } from '@grafana/ui'; import { TagBadge } from 'app/core/components/TagFilter/TagBadge'; import { contextSrv } from 'app/core/core'; import { formatDate } from 'app/core/internationalization/dates'; -import { AccessControlAction, UserSession } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { UserSession } from 'app/types/user'; interface Props { sessions: UserSession[]; diff --git a/public/app/features/admin/Users/AnonUsersTable.tsx b/public/app/features/admin/Users/AnonUsersTable.tsx index b4a4882314f..ba540e280a6 100644 --- a/public/app/features/admin/Users/AnonUsersTable.tsx +++ b/public/app/features/admin/Users/AnonUsersTable.tsx @@ -13,7 +13,7 @@ import { FetchDataFunc, } from '@grafana/ui'; import { EmptyArea } from 'app/features/alerting/unified/components/EmptyArea'; -import { UserAnonymousDeviceDTO } from 'app/types'; +import { UserAnonymousDeviceDTO } from 'app/types/user'; type Cell = CellProps< UserAnonymousDeviceDTO, diff --git a/public/app/features/admin/Users/OrgUnits.tsx b/public/app/features/admin/Users/OrgUnits.tsx index 5dc25622fed..b029df9e19e 100644 --- a/public/app/features/admin/Users/OrgUnits.tsx +++ b/public/app/features/admin/Users/OrgUnits.tsx @@ -2,7 +2,7 @@ import { forwardRef, PropsWithChildren } from 'react'; import { IconName } from '@grafana/data'; import { Icon, Tooltip, Box, Stack } from '@grafana/ui'; -import { Unit } from 'app/types'; +import { Unit } from 'app/types/user'; type OrgUnitProps = { units?: Unit[]; icon: IconName }; diff --git a/public/app/features/admin/Users/OrgUsersTable.test.tsx b/public/app/features/admin/Users/OrgUsersTable.test.tsx index ea64232081e..8fa183441db 100644 --- a/public/app/features/admin/Users/OrgUsersTable.test.tsx +++ b/public/app/features/admin/Users/OrgUsersTable.test.tsx @@ -1,7 +1,8 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { OrgUser } from '../../../types'; +import { OrgUser } from 'app/types/user'; + import { getMockUsers } from '../../users/mocks/userMocks'; import { OrgUsersTable, Props } from './OrgUsersTable'; diff --git a/public/app/features/admin/Users/OrgUsersTable.tsx b/public/app/features/admin/Users/OrgUsersTable.tsx index d83485531db..42f69b89cf2 100644 --- a/public/app/features/admin/Users/OrgUsersTable.tsx +++ b/public/app/features/admin/Users/OrgUsersTable.tsx @@ -25,7 +25,8 @@ import { fetchRoleOptions, updateUserRoles } from 'app/core/components/RolePicke import { RolePickerBadges } from 'app/core/components/RolePickerDrawer/RolePickerBadges'; import { TagBadge } from 'app/core/components/TagFilter/TagBadge'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, OrgUser, Role } from 'app/types'; +import { AccessControlAction, Role } from 'app/types/accessControl'; +import { OrgUser } from 'app/types/user'; import { OrgRolePicker } from '../OrgRolePicker'; diff --git a/public/app/features/admin/Users/UsersTable.test.tsx b/public/app/features/admin/Users/UsersTable.test.tsx index 667aca52b89..61c8210a56f 100644 --- a/public/app/features/admin/Users/UsersTable.test.tsx +++ b/public/app/features/admin/Users/UsersTable.test.tsx @@ -1,7 +1,7 @@ import { render } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom-v5-compat'; -import { UserDTO } from '../../../types'; +import { UserDTO } from 'app/types/user'; import { UsersTable, UsersTableProps } from './UsersTable'; diff --git a/public/app/features/admin/Users/UsersTable.tsx b/public/app/features/admin/Users/UsersTable.tsx index 7deb4480fd4..a3a1f6be297 100644 --- a/public/app/features/admin/Users/UsersTable.tsx +++ b/public/app/features/admin/Users/UsersTable.tsx @@ -17,7 +17,7 @@ import { Tooltip, } from '@grafana/ui'; import { TagBadge } from 'app/core/components/TagFilter/TagBadge'; -import { UserDTO } from 'app/types'; +import { UserDTO } from 'app/types/user'; import { OrgUnits } from './OrgUnits'; diff --git a/public/app/features/admin/api.ts b/public/app/features/admin/api.ts index 0db8de7ed13..f1e4f5419d4 100644 --- a/public/app/features/admin/api.ts +++ b/public/app/features/admin/api.ts @@ -2,7 +2,8 @@ import { UrlQueryValue } from '@grafana/data'; import { getBackendSrv } from '@grafana/runtime'; import { contextSrv } from 'app/core/core'; import { accessControlQueryParam } from 'app/core/utils/accessControl'; -import { OrgUser, AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { OrgUser } from 'app/types/user'; const perPage = 30; diff --git a/public/app/features/admin/ldap/LdapConnectionStatus.tsx b/public/app/features/admin/ldap/LdapConnectionStatus.tsx index 59dc679d197..268ac3ea1b5 100644 --- a/public/app/features/admin/ldap/LdapConnectionStatus.tsx +++ b/public/app/features/admin/ldap/LdapConnectionStatus.tsx @@ -2,7 +2,8 @@ import { useMemo } from 'react'; import { Trans, t } from '@grafana/i18n'; import { Alert, CellProps, Column, Icon, InteractiveTable, Stack, Text, Tooltip } from '@grafana/ui'; -import { AppNotificationSeverity, LdapConnectionInfo, LdapServerInfo } from 'app/types'; +import { AppNotificationSeverity } from 'app/types/appNotifications'; +import { LdapConnectionInfo, LdapServerInfo } from 'app/types/ldap'; interface Props { ldapConnectionInfo: LdapConnectionInfo; diff --git a/public/app/features/admin/ldap/LdapDrawer.tsx b/public/app/features/admin/ldap/LdapDrawer.tsx index cd3e0a1342c..159a66a9ea5 100644 --- a/public/app/features/admin/ldap/LdapDrawer.tsx +++ b/public/app/features/admin/ldap/LdapDrawer.tsx @@ -23,7 +23,7 @@ import { RadioButtonGroup, SecretInput, } from '@grafana/ui'; -import { LdapPayload, MapKeyCertConfigured } from 'app/types'; +import { MapKeyCertConfigured, LdapPayload } from 'app/types/ldap'; import { GroupMappingComponent } from './LdapGroupMapping'; diff --git a/public/app/features/admin/ldap/LdapGroupMapping.tsx b/public/app/features/admin/ldap/LdapGroupMapping.tsx index 6680294e578..1a7b8d9450a 100644 --- a/public/app/features/admin/ldap/LdapGroupMapping.tsx +++ b/public/app/features/admin/ldap/LdapGroupMapping.tsx @@ -1,10 +1,10 @@ import { useFormContext } from 'react-hook-form'; -import { SelectableValue } from '@grafana/data'; +import { OrgRole, SelectableValue } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { Box, Button, Field, Input, RadioButtonGroup, Switch } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; -import { LdapPayload, OrgRole } from 'app/types'; +import { LdapPayload } from 'app/types/ldap'; const roleOptions: Array> = Object.keys(OrgRole).map((key) => { return { label: key, value: key }; diff --git a/public/app/features/admin/ldap/LdapPage.tsx b/public/app/features/admin/ldap/LdapPage.tsx index ce1ba188936..4c6bc32f0e7 100644 --- a/public/app/features/admin/ldap/LdapPage.tsx +++ b/public/app/features/admin/ldap/LdapPage.tsx @@ -9,15 +9,10 @@ import { Alert, Button, Field, Input, Stack } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/core'; import { GrafanaRouteComponentProps } from 'app/core/navigation/types'; -import { - AppNotificationSeverity, - LdapError, - LdapUser, - StoreState, - SyncInfo, - LdapConnectionInfo, - AccessControlAction, -} from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { AppNotificationSeverity } from 'app/types/appNotifications'; +import { LdapConnectionInfo, LdapUser, SyncInfo, LdapError } from 'app/types/ldap'; +import { StoreState } from 'app/types/store'; import { loadLdapState, diff --git a/public/app/features/admin/ldap/LdapSettingsPage.tsx b/public/app/features/admin/ldap/LdapSettingsPage.tsx index 7ba327c1ce0..b100c9386fb 100644 --- a/public/app/features/admin/ldap/LdapSettingsPage.tsx +++ b/public/app/features/admin/ldap/LdapSettingsPage.tsx @@ -27,7 +27,8 @@ import { FormPrompt } from 'app/core/components/FormPrompt/FormPrompt'; import { Page } from 'app/core/components/Page/Page'; import config from 'app/core/config'; import { Loader } from 'app/features/plugins/admin/components/Loader'; -import { LdapPayload, MapKeyCertConfigured, StoreState } from 'app/types'; +import { LdapPayload, MapKeyCertConfigured } from 'app/types/ldap'; +import { StoreState } from 'app/types/store'; import { LdapDrawerComponent } from './LdapDrawer'; diff --git a/public/app/features/admin/ldap/LdapSyncInfo.tsx b/public/app/features/admin/ldap/LdapSyncInfo.tsx index 11a1db488b5..c4aacb5a7ad 100644 --- a/public/app/features/admin/ldap/LdapSyncInfo.tsx +++ b/public/app/features/admin/ldap/LdapSyncInfo.tsx @@ -1,7 +1,7 @@ import { dateTimeFormat } from '@grafana/data'; import { Trans } from '@grafana/i18n'; import { InteractiveTable, Text } from '@grafana/ui'; -import { SyncInfo } from 'app/types'; +import { SyncInfo } from 'app/types/ldap'; interface Props { ldapSyncInfo: SyncInfo; diff --git a/public/app/features/admin/ldap/LdapUserGroups.tsx b/public/app/features/admin/ldap/LdapUserGroups.tsx index d2e82b83e3e..7f0ff635a44 100644 --- a/public/app/features/admin/ldap/LdapUserGroups.tsx +++ b/public/app/features/admin/ldap/LdapUserGroups.tsx @@ -2,7 +2,7 @@ import { useMemo } from 'react'; import { Trans, t } from '@grafana/i18n'; import { Tooltip, Icon, InteractiveTable, type CellProps, Column, Stack } from '@grafana/ui'; -import { LdapRole } from 'app/types'; +import { LdapRole } from 'app/types/ldap'; interface Props { groups: LdapRole[]; diff --git a/public/app/features/admin/ldap/LdapUserInfo.tsx b/public/app/features/admin/ldap/LdapUserInfo.tsx index 0877216ca6f..73d6a79a87b 100644 --- a/public/app/features/admin/ldap/LdapUserInfo.tsx +++ b/public/app/features/admin/ldap/LdapUserInfo.tsx @@ -1,6 +1,6 @@ import { Trans } from '@grafana/i18n'; import { Box, Stack, Text } from '@grafana/ui'; -import { LdapUser } from 'app/types'; +import { LdapUser } from 'app/types/ldap'; import { LdapUserGroups } from './LdapUserGroups'; import { LdapUserMappingInfo } from './LdapUserMappingInfo'; diff --git a/public/app/features/admin/ldap/LdapUserMappingInfo.tsx b/public/app/features/admin/ldap/LdapUserMappingInfo.tsx index 534ea3cf0a7..e4485a9d3c2 100644 --- a/public/app/features/admin/ldap/LdapUserMappingInfo.tsx +++ b/public/app/features/admin/ldap/LdapUserMappingInfo.tsx @@ -1,7 +1,7 @@ import { useMemo } from 'react'; import { InteractiveTable } from '@grafana/ui'; -import { LdapUserInfo } from 'app/types'; +import { LdapUserInfo } from 'app/types/ldap'; interface Props { info: LdapUserInfo; diff --git a/public/app/features/admin/ldap/LdapUserPermissions.tsx b/public/app/features/admin/ldap/LdapUserPermissions.tsx index e426a4e090b..57dc65f4c96 100644 --- a/public/app/features/admin/ldap/LdapUserPermissions.tsx +++ b/public/app/features/admin/ldap/LdapUserPermissions.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import { Trans } from '@grafana/i18n'; import { Column, Icon, InteractiveTable } from '@grafana/ui'; -import { LdapPermissions } from 'app/types'; +import { LdapPermissions } from 'app/types/ldap'; interface Props { permissions: LdapPermissions; diff --git a/public/app/features/admin/ldap/LdapUserTeams.tsx b/public/app/features/admin/ldap/LdapUserTeams.tsx index 39f9f779710..b37cad73034 100644 --- a/public/app/features/admin/ldap/LdapUserTeams.tsx +++ b/public/app/features/admin/ldap/LdapUserTeams.tsx @@ -1,7 +1,7 @@ import { useMemo } from 'react'; import { Column, InteractiveTable, CellProps } from '@grafana/ui'; -import { LdapTeam } from 'app/types'; +import { LdapTeam } from 'app/types/ldap'; interface Props { teams: LdapTeam[]; diff --git a/public/app/features/admin/state/actions.ts b/public/app/features/admin/state/actions.ts index ede0ed15dd6..7dd57ea1e72 100644 --- a/public/app/features/admin/state/actions.ts +++ b/public/app/features/admin/state/actions.ts @@ -6,15 +6,10 @@ import { FetchDataArgs } from '@grafana/ui'; import config from 'app/core/config'; import { contextSrv } from 'app/core/core'; import { accessControlQueryParam } from 'app/core/utils/accessControl'; -import { - ThunkResult, - LdapUser, - UserSession, - UserDTO, - AccessControlAction, - UserFilter, - AnonUserFilter, -} from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { LdapUser } from 'app/types/ldap'; +import { ThunkResult } from 'app/types/store'; +import { UserDTO, UserSession, UserFilter, AnonUserFilter } from 'app/types/user'; import { userAdminPageLoadedAction, diff --git a/public/app/features/admin/state/reducers.test.ts b/public/app/features/admin/state/reducers.test.ts index 8b504a62935..67652835859 100644 --- a/public/app/features/admin/state/reducers.test.ts +++ b/public/app/features/admin/state/reducers.test.ts @@ -1,6 +1,7 @@ import { reducerTester } from 'test/core/redux/reducerTester'; -import { LdapState, LdapUser, UserAdminState, UserDTO, UserListAdminState } from 'app/types'; +import { LdapState, LdapUser } from 'app/types/ldap'; +import { UserAdminState, UserListAdminState, UserDTO } from 'app/types/user'; import { clearUserMappingInfoAction, diff --git a/public/app/features/admin/state/reducers.ts b/public/app/features/admin/state/reducers.ts index 550e3de57b6..67f71dec9f3 100644 --- a/public/app/features/admin/state/reducers.ts +++ b/public/app/features/admin/state/reducers.ts @@ -1,22 +1,18 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'; +import { LdapState, LdapConnectionInfo, LdapError, SyncInfo, LdapUser } from 'app/types/ldap'; import { - LdapConnectionInfo, - LdapError, - LdapState, - LdapUser, - SyncInfo, - UserAdminError, UserAdminState, UserDTO, UserOrg, UserSession, + UserAdminError, UserListAdminState, UserFilter, UserListAnonymousDevicesState, UserAnonymousDeviceDTO, AnonUserFilter, -} from 'app/types'; +} from 'app/types/user'; const initialLdapState: LdapState = { connectionInfo: [], diff --git a/public/app/features/alerting/routes.tsx b/public/app/features/alerting/routes.tsx index 12a8dbfbadf..ced0d8d394f 100644 --- a/public/app/features/alerting/routes.tsx +++ b/public/app/features/alerting/routes.tsx @@ -3,7 +3,7 @@ import { Navigate } from 'react-router-dom-v5-compat'; import { SafeDynamicImport } from 'app/core/components/DynamicImports/SafeDynamicImport'; import { config } from 'app/core/config'; import { GrafanaRouteComponent, RouteDescriptor } from 'app/core/navigation/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { PERMISSIONS_CONTACT_POINTS } from './unified/components/contact-points/permissions'; import { diff --git a/public/app/features/alerting/state/reducers.test.ts b/public/app/features/alerting/state/reducers.test.ts index ac9b9acda67..7afd5eee5e7 100644 --- a/public/app/features/alerting/state/reducers.test.ts +++ b/public/app/features/alerting/state/reducers.test.ts @@ -1,5 +1,5 @@ import { dateTime } from '@grafana/data'; -import { AlertRuleDTO, AlertRulesState, NotificationChannelState, NotifierDTO } from 'app/types'; +import { AlertRuleDTO, AlertRulesState, NotificationChannelState, NotifierDTO } from 'app/types/alerting'; import { reducerTester } from '../../../../test/core/redux/reducerTester'; diff --git a/public/app/features/alerting/state/reducers.ts b/public/app/features/alerting/state/reducers.ts index f4c9b798bc2..ffba9aa8c89 100644 --- a/public/app/features/alerting/state/reducers.ts +++ b/public/app/features/alerting/state/reducers.ts @@ -8,7 +8,7 @@ import { NotificationChannelOption, NotificationChannelState, NotifierDTO, -} from 'app/types'; +} from 'app/types/alerting'; import unifiedAlertingReducer from '../unified/state/reducers'; diff --git a/public/app/features/alerting/state/selectors.test.ts b/public/app/features/alerting/state/selectors.test.ts index b279c1ebd41..0463a99be8e 100644 --- a/public/app/features/alerting/state/selectors.test.ts +++ b/public/app/features/alerting/state/selectors.test.ts @@ -1,4 +1,5 @@ -import { AlertRulesState, StoreState } from 'app/types'; +import { AlertRulesState } from 'app/types/alerting'; +import { StoreState } from 'app/types/store'; import { getAlertRuleItems, getSearchQuery } from './selectors'; diff --git a/public/app/features/alerting/state/selectors.ts b/public/app/features/alerting/state/selectors.ts index f51e66ce8a4..0e2c897e7bb 100644 --- a/public/app/features/alerting/state/selectors.ts +++ b/public/app/features/alerting/state/selectors.ts @@ -1,4 +1,5 @@ -import { AlertRule, AlertRulesState, NotificationChannelState, StoreState } from 'app/types'; +import { AlertRule, AlertRulesState, NotificationChannelState } from 'app/types/alerting'; +import { StoreState } from 'app/types/store'; export const getSearchQuery = (state: AlertRulesState) => state.searchQuery; diff --git a/public/app/features/alerting/unified/AlertGroups.test.tsx b/public/app/features/alerting/unified/AlertGroups.test.tsx index a39b0348f15..dbf38615d33 100644 --- a/public/app/features/alerting/unified/AlertGroups.test.tsx +++ b/public/app/features/alerting/unified/AlertGroups.test.tsx @@ -3,7 +3,7 @@ import { byRole, byTestId, byText } from 'testing-library-selector'; import { selectors } from '@grafana/e2e-selectors'; import { setupDataSources } from 'app/features/alerting/unified/testSetup/datasources'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import AlertGroups from './AlertGroups'; import { fetchAlertGroups } from './api/alertmanager'; diff --git a/public/app/features/alerting/unified/AlertGroups.tsx b/public/app/features/alerting/unified/AlertGroups.tsx index a72d973645b..0ca50b2c7c9 100644 --- a/public/app/features/alerting/unified/AlertGroups.tsx +++ b/public/app/features/alerting/unified/AlertGroups.tsx @@ -3,7 +3,7 @@ import { Fragment, useEffect } from 'react'; import { Trans, t } from '@grafana/i18n'; import { Alert, Box, LoadingPlaceholder, Text } from '@grafana/ui'; import { useQueryParams } from 'app/core/hooks/useQueryParams'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { AlertmanagerChoice } from '../../../plugins/datasource/alertmanager/types'; diff --git a/public/app/features/alerting/unified/AlertsFolderView.tsx b/public/app/features/alerting/unified/AlertsFolderView.tsx index 8e13f93435a..ec39dcdde18 100644 --- a/public/app/features/alerting/unified/AlertsFolderView.tsx +++ b/public/app/features/alerting/unified/AlertsFolderView.tsx @@ -8,7 +8,7 @@ import { Trans, t } from '@grafana/i18n'; import { Card, FilterInput, Icon, Pagination, Select, Stack, TagList, useStyles2 } from '@grafana/ui'; import { DEFAULT_PER_PAGE_PAGINATION } from 'app/core/constants'; import { getQueryParamValue } from 'app/core/utils/query'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; import { GrafanaRuleDefinition, RulerGrafanaRuleDTO } from 'app/types/unified-alerting-dto'; import { usePagination } from './hooks/usePagination'; diff --git a/public/app/features/alerting/unified/MuteTimings.test.tsx b/public/app/features/alerting/unified/MuteTimings.test.tsx index 0b69e95653e..fc44b90a59f 100644 --- a/public/app/features/alerting/unified/MuteTimings.test.tsx +++ b/public/app/features/alerting/unified/MuteTimings.test.tsx @@ -14,7 +14,7 @@ import { } from 'app/features/alerting/unified/mocks/server/handlers/k8s/timeIntervals.k8s'; import { setupDataSources } from 'app/features/alerting/unified/testSetup/datasources'; import { AlertManagerCortexConfig, MuteTimeInterval } from 'app/plugins/datasource/alertmanager/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import EditMuteTimingPage from './components/mute-timings/EditMuteTiming'; import NewMuteTimingPage from './components/mute-timings/NewMuteTiming'; diff --git a/public/app/features/alerting/unified/NotificationPoliciesPage.test.tsx b/public/app/features/alerting/unified/NotificationPoliciesPage.test.tsx index f48f3eb16fe..90bfe88ad4b 100644 --- a/public/app/features/alerting/unified/NotificationPoliciesPage.test.tsx +++ b/public/app/features/alerting/unified/NotificationPoliciesPage.test.tsx @@ -29,7 +29,7 @@ import { MatcherOperator, RouteWithID, } from 'app/plugins/datasource/alertmanager/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import NotificationPolicies from './NotificationPoliciesPage'; import { findRoutesMatchingFilters } from './components/notification-policies/NotificationPoliciesList'; diff --git a/public/app/features/alerting/unified/PanelAlertTabContent.test.tsx b/public/app/features/alerting/unified/PanelAlertTabContent.test.tsx index 9e01d77d060..dfe3549eeee 100644 --- a/public/app/features/alerting/unified/PanelAlertTabContent.test.tsx +++ b/public/app/features/alerting/unified/PanelAlertTabContent.test.tsx @@ -7,7 +7,7 @@ import config from 'app/core/config'; import { setupDataSources } from 'app/features/alerting/unified/testSetup/datasources'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { AlertQuery, PromRulesResponse } from 'app/types/unified-alerting-dto'; import { PanelAlertTabContent } from './PanelAlertTabContent'; diff --git a/public/app/features/alerting/unified/Receivers.test.tsx b/public/app/features/alerting/unified/Receivers.test.tsx index 0363e772509..f831a707bb3 100644 --- a/public/app/features/alerting/unified/Receivers.test.tsx +++ b/public/app/features/alerting/unified/Receivers.test.tsx @@ -10,7 +10,7 @@ import { import { setupMswServer } from 'app/features/alerting/unified/mockApi'; import { grantUserPermissions } from 'app/features/alerting/unified/mocks'; import { setupDataSources } from 'app/features/alerting/unified/testSetup/datasources'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import ContactPoints from './components/contact-points/ContactPoints'; import EditContactPoint from './components/contact-points/EditContactPoint'; diff --git a/public/app/features/alerting/unified/RuleEditorGrafanaRecordingRules.test.tsx b/public/app/features/alerting/unified/RuleEditorGrafanaRecordingRules.test.tsx index 196ee8b0583..fcc74629ca1 100644 --- a/public/app/features/alerting/unified/RuleEditorGrafanaRecordingRules.test.tsx +++ b/public/app/features/alerting/unified/RuleEditorGrafanaRecordingRules.test.tsx @@ -9,7 +9,7 @@ import { FeatureToggles } from '@grafana/data'; import { contextSrv } from 'app/core/services/context_srv'; import { setupMswServer } from 'app/features/alerting/unified/mockApi'; import { PROMETHEUS_DATASOURCE_UID } from 'app/features/alerting/unified/mocks/server/constants'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { grantUserPermissions, mockDataSource } from './mocks'; import { grafanaRulerGroup } from './mocks/grafanaRulerApi'; diff --git a/public/app/features/alerting/unified/RuleList.test.tsx b/public/app/features/alerting/unified/RuleList.test.tsx index 5868e5b4c13..905920cbf1d 100644 --- a/public/app/features/alerting/unified/RuleList.test.tsx +++ b/public/app/features/alerting/unified/RuleList.test.tsx @@ -12,7 +12,7 @@ import { setAlertmanagerChoices } from 'app/features/alerting/unified/mocks/serv import * as actions from 'app/features/alerting/unified/state/actions'; import { setupDataSources } from 'app/features/alerting/unified/testSetup/datasources'; import { AlertmanagerChoice } from 'app/plugins/datasource/alertmanager/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { PromAlertingRuleState, PromApplication } from 'app/types/unified-alerting-dto'; import RuleList from './RuleList'; diff --git a/public/app/features/alerting/unified/Silences.test.tsx b/public/app/features/alerting/unified/Silences.test.tsx index 66fa0bc7a46..7f1deda8289 100644 --- a/public/app/features/alerting/unified/Silences.test.tsx +++ b/public/app/features/alerting/unified/Silences.test.tsx @@ -15,7 +15,7 @@ import { MOCK_GRAFANA_ALERT_RULE_TITLE } from 'app/features/alerting/unified/moc import { silenceCreateHandler } from 'app/features/alerting/unified/mocks/server/handlers/silences'; import { MATCHER_ALERT_RULE_UID } from 'app/features/alerting/unified/utils/constants'; import { MatcherOperator, SilenceState } from 'app/plugins/datasource/alertmanager/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import NewSilencePage from './NewSilencePage'; import ExistingSilenceEditorPage from './components/silences/SilencesEditor'; diff --git a/public/app/features/alerting/unified/Templates.test.tsx b/public/app/features/alerting/unified/Templates.test.tsx index b7ff2f7b3e4..219da94cab8 100644 --- a/public/app/features/alerting/unified/Templates.test.tsx +++ b/public/app/features/alerting/unified/Templates.test.tsx @@ -8,7 +8,7 @@ import { byLabelText, byRole } from 'testing-library-selector'; import { CodeEditor } from '@grafana/ui'; import { AppNotificationList } from 'app/core/components/AppNotifications/AppNotificationList'; import { setupMswServer } from 'app/features/alerting/unified/mockApi'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import Templates from './Templates'; import { grantUserPermissions } from './mocks'; diff --git a/public/app/features/alerting/unified/api/alertmanagerApi.ts b/public/app/features/alerting/unified/api/alertmanagerApi.ts index 0d579e37e53..1fefcce17ea 100644 --- a/public/app/features/alerting/unified/api/alertmanagerApi.ts +++ b/public/app/features/alerting/unified/api/alertmanagerApi.ts @@ -2,7 +2,7 @@ import { isEmpty } from 'lodash'; import { encodeMatcher } from 'app/features/alerting/unified/utils/matchers'; import { dispatch } from 'app/store/store'; -import { ReceiversStateDTO } from 'app/types/alerting'; +import { NotificationChannelOption, NotifierDTO, ReceiversStateDTO } from 'app/types/alerting'; import { AlertManagerCortexConfig, @@ -14,7 +14,6 @@ import { GrafanaAlertingConfiguration, Matcher, } from '../../../../plugins/datasource/alertmanager/types'; -import { NotificationChannelOption, NotifierDTO } from '../../../../types'; import { withPerformanceLogging } from '../Analytics'; import { matcherToMatcherField } from '../utils/alertmanager'; import { diff --git a/public/app/features/alerting/unified/api/dashboardApi.ts b/public/app/features/alerting/unified/api/dashboardApi.ts index 15c71cb7508..104826cfe22 100644 --- a/public/app/features/alerting/unified/api/dashboardApi.ts +++ b/public/app/features/alerting/unified/api/dashboardApi.ts @@ -1,4 +1,5 @@ -import { DashboardDTO } from '../../../../types'; +import { DashboardDTO } from 'app/types/dashboard'; + import { DashboardSearchItem } from '../../../search/types'; import { alertingApi } from './alertingApi'; diff --git a/public/app/features/alerting/unified/api/grafana.test.ts b/public/app/features/alerting/unified/api/grafana.test.ts index b83282258e5..3f3e8e79acc 100644 --- a/public/app/features/alerting/unified/api/grafana.test.ts +++ b/public/app/features/alerting/unified/api/grafana.test.ts @@ -1,4 +1,4 @@ -import { ReceiversStateDTO } from 'app/types'; +import { ReceiversStateDTO } from 'app/types/alerting'; import { contactPointsStateDtoToModel, getIntegrationType, parseIntegrationName } from './grafana'; diff --git a/public/app/features/alerting/unified/api/grafana.ts b/public/app/features/alerting/unified/api/grafana.ts index c6872cf2cf0..771ec80301f 100644 --- a/public/app/features/alerting/unified/api/grafana.ts +++ b/public/app/features/alerting/unified/api/grafana.ts @@ -1,7 +1,7 @@ import { lastValueFrom } from 'rxjs'; import { getBackendSrv } from '@grafana/runtime'; -import { ContactPointsState, ReceiverState, ReceiversStateDTO } from 'app/types'; +import { ContactPointsState, ReceiverState, ReceiversStateDTO } from 'app/types/alerting'; import { getDatasourceAPIUid } from '../utils/datasource'; diff --git a/public/app/features/alerting/unified/api/prometheusApi.ts b/public/app/features/alerting/unified/api/prometheusApi.ts index 69b19725bf0..8fce82f8755 100644 --- a/public/app/features/alerting/unified/api/prometheusApi.ts +++ b/public/app/features/alerting/unified/api/prometheusApi.ts @@ -1,6 +1,6 @@ import { useCallback } from 'react'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { RuleHealth } from 'app/types/unified-alerting'; import { GrafanaPromRuleGroupDTO, diff --git a/public/app/features/alerting/unified/api/receiversApi.ts b/public/app/features/alerting/unified/api/receiversApi.ts index 3f94a38f26e..7b22a1507e3 100644 --- a/public/app/features/alerting/unified/api/receiversApi.ts +++ b/public/app/features/alerting/unified/api/receiversApi.ts @@ -1,6 +1,6 @@ /** @deprecated To be deleted - use alertingApiServer API instead */ -import { ContactPointsState } from 'app/types'; +import { ContactPointsState } from 'app/types/alerting'; import { CONTACT_POINTS_STATE_INTERVAL_MS } from '../utils/constants'; diff --git a/public/app/features/alerting/unified/components/alert-groups/AlertDetails.tsx b/public/app/features/alerting/unified/components/alert-groups/AlertDetails.tsx index 3177a8aa6e7..642c47a3f9d 100644 --- a/public/app/features/alerting/unified/components/alert-groups/AlertDetails.tsx +++ b/public/app/features/alerting/unified/components/alert-groups/AlertDetails.tsx @@ -5,7 +5,7 @@ import { Trans, t } from '@grafana/i18n'; import { LinkButton, useStyles2 } from '@grafana/ui'; import { contextSrv } from 'app/core/services/context_srv'; import { AlertState, AlertmanagerAlert } from 'app/plugins/datasource/alertmanager/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { AlertmanagerAction } from '../../hooks/useAbilities'; import { isGrafanaRulesSource } from '../../utils/datasource'; diff --git a/public/app/features/alerting/unified/components/contact-points/ContactPoints.test.tsx b/public/app/features/alerting/unified/components/contact-points/ContactPoints.test.tsx index 87f1ebfff59..79cec523d69 100644 --- a/public/app/features/alerting/unified/components/contact-points/ContactPoints.test.tsx +++ b/public/app/features/alerting/unified/components/contact-points/ContactPoints.test.tsx @@ -7,7 +7,7 @@ import { MIMIR_DATASOURCE_UID } from 'app/features/alerting/unified/mocks/server import { flushMicrotasks } from 'app/features/alerting/unified/test/test-utils'; import { K8sAnnotations } from 'app/features/alerting/unified/utils/k8s/constants'; import { AlertManagerDataSourceJsonData, AlertManagerImplementation } from 'app/plugins/datasource/alertmanager/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { setupMswServer } from '../../mockApi'; import { grantUserPermissions, mockDataSource } from '../../mocks'; diff --git a/public/app/features/alerting/unified/components/contact-points/ContactPoints.tsx b/public/app/features/alerting/unified/components/contact-points/ContactPoints.tsx index a9bbbf29845..6f2423e424d 100644 --- a/public/app/features/alerting/unified/components/contact-points/ContactPoints.tsx +++ b/public/app/features/alerting/unified/components/contact-points/ContactPoints.tsx @@ -17,7 +17,7 @@ import { import { contextSrv } from 'app/core/core'; import { shouldUseK8sApi } from 'app/features/alerting/unified/utils/k8s/utils'; import { makeAMLink, stringifyErrorLike } from 'app/features/alerting/unified/utils/misc'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { AlertmanagerAction, useAlertmanagerAbility } from '../../hooks/useAbilities'; import { usePagination } from '../../hooks/usePagination'; diff --git a/public/app/features/alerting/unified/components/contact-points/EditContactPoint.test.tsx b/public/app/features/alerting/unified/components/contact-points/EditContactPoint.test.tsx index b43671ce874..04f6fcdb435 100644 --- a/public/app/features/alerting/unified/components/contact-points/EditContactPoint.test.tsx +++ b/public/app/features/alerting/unified/components/contact-points/EditContactPoint.test.tsx @@ -4,7 +4,7 @@ import { clickSelectOption } from 'test/helpers/selectOptionInTest'; import { render, screen, within } from 'test/test-utils'; import EditContactPoint from 'app/features/alerting/unified/components/contact-points/EditContactPoint'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { setupMswServer } from '../../mockApi'; import { grantUserPermissions } from '../../mocks'; diff --git a/public/app/features/alerting/unified/components/contact-points/NotificationTemplates.test.tsx b/public/app/features/alerting/unified/components/contact-points/NotificationTemplates.test.tsx index ee5cd458b8d..479d6453c26 100644 --- a/public/app/features/alerting/unified/components/contact-points/NotificationTemplates.test.tsx +++ b/public/app/features/alerting/unified/components/contact-points/NotificationTemplates.test.tsx @@ -1,7 +1,7 @@ import { render, screen, within } from 'test/test-utils'; import { AppNotificationList } from 'app/core/components/AppNotifications/AppNotificationList'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { setupMswServer } from '../../mockApi'; import { grantUserPermissions } from '../../mocks'; diff --git a/public/app/features/alerting/unified/components/contact-points/permissions.ts b/public/app/features/alerting/unified/components/contact-points/permissions.ts index 48ba46a10c5..48686fc5fb1 100644 --- a/public/app/features/alerting/unified/components/contact-points/permissions.ts +++ b/public/app/features/alerting/unified/components/contact-points/permissions.ts @@ -1,4 +1,4 @@ -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; /** * List of granular permissions that allow viewing contact points diff --git a/public/app/features/alerting/unified/components/contact-points/useContactPoints.test.tsx b/public/app/features/alerting/unified/components/contact-points/useContactPoints.test.tsx index 59f38e5a4fe..2ac9c04f981 100644 --- a/public/app/features/alerting/unified/components/contact-points/useContactPoints.test.tsx +++ b/public/app/features/alerting/unified/components/contact-points/useContactPoints.test.tsx @@ -6,7 +6,7 @@ import { disablePlugin } from 'app/features/alerting/unified/mocks/server/config import { setOnCallIntegrations } from 'app/features/alerting/unified/mocks/server/handlers/plugins/configure-plugins'; import { SupportedPlugin } from 'app/features/alerting/unified/types/pluginBridges'; import { GRAFANA_RULES_SOURCE_NAME } from 'app/features/alerting/unified/utils/datasource'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { setupMswServer } from '../../mockApi'; import { grantUserPermissions } from '../../mocks'; diff --git a/public/app/features/alerting/unified/components/contact-points/utils.ts b/public/app/features/alerting/unified/components/contact-points/utils.ts index f45535df9dc..034ee098894 100644 --- a/public/app/features/alerting/unified/components/contact-points/utils.ts +++ b/public/app/features/alerting/unified/components/contact-points/utils.ts @@ -11,7 +11,7 @@ import { Receiver, Route, } from 'app/plugins/datasource/alertmanager/types'; -import { NotifierDTO, NotifierStatus, ReceiversStateDTO } from 'app/types'; +import { NotifierDTO, NotifierStatus, ReceiversStateDTO } from 'app/types/alerting'; import { OnCallIntegrationDTO } from '../../api/onCallApi'; import { computeInheritedTree } from '../../utils/notification-policies'; diff --git a/public/app/features/alerting/unified/components/create-folder/CreateNewFolder.tsx b/public/app/features/alerting/unified/components/create-folder/CreateNewFolder.tsx index 0f61f8c7a42..a8e3d4d3fba 100644 --- a/public/app/features/alerting/unified/components/create-folder/CreateNewFolder.tsx +++ b/public/app/features/alerting/unified/components/create-folder/CreateNewFolder.tsx @@ -8,7 +8,7 @@ import { Button, Field, Input, Label, Modal, Stack, useStyles2 } from '@grafana/ import { useAppNotification } from 'app/core/copy/appNotification'; import { contextSrv } from 'app/core/core'; import { useNewFolderMutation } from 'app/features/browse-dashboards/api/browseDashboardsAPI'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { Folder } from '../../types/rule-form'; diff --git a/public/app/features/alerting/unified/components/export/GrafanaRuleFolderExporter.tsx b/public/app/features/alerting/unified/components/export/GrafanaRuleFolderExporter.tsx index cefe9fa5530..b240743f672 100644 --- a/public/app/features/alerting/unified/components/export/GrafanaRuleFolderExporter.tsx +++ b/public/app/features/alerting/unified/components/export/GrafanaRuleFolderExporter.tsx @@ -2,8 +2,8 @@ import { useState } from 'react'; import { t } from '@grafana/i18n'; import { LoadingPlaceholder } from '@grafana/ui'; +import { FolderDTO } from 'app/types/folders'; -import { FolderDTO } from '../../../../../types'; import { alertRuleApi } from '../../api/alertRuleApi'; import { FileExportPreview } from './FileExportPreview'; diff --git a/public/app/features/alerting/unified/components/folder-actions/FolderActionsButton.tsx b/public/app/features/alerting/unified/components/folder-actions/FolderActionsButton.tsx index d677309fb51..14988605dbe 100644 --- a/public/app/features/alerting/unified/components/folder-actions/FolderActionsButton.tsx +++ b/public/app/features/alerting/unified/components/folder-actions/FolderActionsButton.tsx @@ -3,7 +3,7 @@ import { useState } from 'react'; import { t } from '@grafana/i18n'; import { config, locationService } from '@grafana/runtime'; import { Dropdown, Menu } from '@grafana/ui'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { alertingFolderActionsApi } from '../../api/alertingFolderActionsApi'; import { shouldUseAlertingListViewV2, shouldUsePrometheusRulesPrimary } from '../../featureToggles'; diff --git a/public/app/features/alerting/unified/components/import-to-gma/ImportToGMARules.test.tsx b/public/app/features/alerting/unified/components/import-to-gma/ImportToGMARules.test.tsx index ad0d4feb52f..da2fbd63528 100644 --- a/public/app/features/alerting/unified/components/import-to-gma/ImportToGMARules.test.tsx +++ b/public/app/features/alerting/unified/components/import-to-gma/ImportToGMARules.test.tsx @@ -2,7 +2,7 @@ import { render, waitFor } from 'test/test-utils'; import { byLabelText, byRole } from 'testing-library-selector'; import { setPluginComponentsHook, setPluginLinksHook } from '@grafana/runtime'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { setupMswServer } from '../../mockApi'; import { grantUserPermissions } from '../../mocks'; diff --git a/public/app/features/alerting/unified/components/import-to-gma/hooks.ts b/public/app/features/alerting/unified/components/import-to-gma/hooks.ts index 0d41f413a2b..a15d6f85218 100644 --- a/public/app/features/alerting/unified/components/import-to-gma/hooks.ts +++ b/public/app/features/alerting/unified/components/import-to-gma/hooks.ts @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react'; import { lastValueFrom } from 'rxjs'; import { getBackendSrv } from '@grafana/runtime'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; import { RulerRulesConfigDTO } from 'app/types/unified-alerting-dto'; import { alertRuleApi } from '../../api/alertRuleApi'; diff --git a/public/app/features/alerting/unified/components/mute-timings/MuteTimingsTable.test.tsx b/public/app/features/alerting/unified/components/mute-timings/MuteTimingsTable.test.tsx index a60d1902d7b..d9d611d7a00 100644 --- a/public/app/features/alerting/unified/components/mute-timings/MuteTimingsTable.test.tsx +++ b/public/app/features/alerting/unified/components/mute-timings/MuteTimingsTable.test.tsx @@ -7,7 +7,7 @@ import { } from 'app/features/alerting/unified/mocks/server/configure'; import { setAlertmanagerConfig } from 'app/features/alerting/unified/mocks/server/entities/alertmanagers'; import { captureRequests } from 'app/features/alerting/unified/mocks/server/events'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { grantUserPermissions } from '../../mocks'; import { TIME_INTERVAL_UID_HAPPY_PATH } from '../../mocks/server/handlers/k8s/timeIntervals.k8s'; diff --git a/public/app/features/alerting/unified/components/mute-timings/permissions.ts b/public/app/features/alerting/unified/components/mute-timings/permissions.ts index 5cbf687c636..b2891d4b251 100644 --- a/public/app/features/alerting/unified/components/mute-timings/permissions.ts +++ b/public/app/features/alerting/unified/components/mute-timings/permissions.ts @@ -1,4 +1,4 @@ -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; /** * List of granular permissions that allow viewing contact points diff --git a/public/app/features/alerting/unified/components/notification-policies/EditDefaultPolicyForm.test.tsx b/public/app/features/alerting/unified/components/notification-policies/EditDefaultPolicyForm.test.tsx index e7ed08151a5..f426b2ad737 100644 --- a/public/app/features/alerting/unified/components/notification-policies/EditDefaultPolicyForm.test.tsx +++ b/public/app/features/alerting/unified/components/notification-policies/EditDefaultPolicyForm.test.tsx @@ -6,7 +6,7 @@ import { Button } from '@grafana/ui'; import { setupMswServer } from 'app/features/alerting/unified/mockApi'; import { grantUserPermissions } from 'app/features/alerting/unified/mocks'; import { AlertmanagerProvider } from 'app/features/alerting/unified/state/AlertmanagerContext'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { RouteWithID } from '../../../../../plugins/datasource/alertmanager/types'; import { FormAmRoute } from '../../types/amroutes'; diff --git a/public/app/features/alerting/unified/components/notification-policies/EditNotificationPolicyForm.test.tsx b/public/app/features/alerting/unified/components/notification-policies/EditNotificationPolicyForm.test.tsx index c83c0813cf1..171e4349bf3 100644 --- a/public/app/features/alerting/unified/components/notification-policies/EditNotificationPolicyForm.test.tsx +++ b/public/app/features/alerting/unified/components/notification-policies/EditNotificationPolicyForm.test.tsx @@ -6,7 +6,7 @@ import { Button } from '@grafana/ui'; import { setupMswServer } from 'app/features/alerting/unified/mockApi'; import { grantUserPermissions } from 'app/features/alerting/unified/mocks'; import { GRAFANA_RULES_SOURCE_NAME } from 'app/features/alerting/unified/utils/datasource'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { RouteWithID } from '../../../../../plugins/datasource/alertmanager/types'; import { AlertmanagerProvider } from '../../state/AlertmanagerContext'; diff --git a/public/app/features/alerting/unified/components/notification-policies/Policy.tsx b/public/app/features/alerting/unified/components/notification-policies/Policy.tsx index 346a9de008e..ff037ca21f2 100644 --- a/public/app/features/alerting/unified/components/notification-policies/Policy.tsx +++ b/public/app/features/alerting/unified/components/notification-policies/Policy.tsx @@ -32,7 +32,7 @@ import { Receiver, RouteWithID, } from 'app/plugins/datasource/alertmanager/types'; -import { ReceiversState } from 'app/types'; +import { ReceiversState } from 'app/types/alerting'; import { AlertmanagerAction, useAlertmanagerAbilities, useAlertmanagerAbility } from '../../hooks/useAbilities'; import { getAmMatcherFormatter } from '../../utils/alertmanager'; diff --git a/public/app/features/alerting/unified/components/notification-policies/permissions.ts b/public/app/features/alerting/unified/components/notification-policies/permissions.ts index c685357df3e..bcbcae681ab 100644 --- a/public/app/features/alerting/unified/components/notification-policies/permissions.ts +++ b/public/app/features/alerting/unified/components/notification-policies/permissions.ts @@ -1,4 +1,4 @@ -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; /** * List of granular permissions that allow viewing notification policies 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 08fb0f52c8e..89b8886fb4e 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 @@ -9,8 +9,8 @@ import * as analytics from '../../Analytics'; import { NewRuleFromPanelButton } from './NewRuleFromPanelButton'; -jest.mock('app/types', () => { - const original = jest.requireActual('app/types'); +jest.mock('app/types/store', () => { + const original = jest.requireActual('app/types/store'); return { ...original, useSelector: jest.fn(), 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 714f42a9a8a..ccd057e4526 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 @@ -6,7 +6,7 @@ import { Trans, t } from '@grafana/i18n'; import { Alert, Button, LinkButton } from '@grafana/ui'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { LogMessages, logInfo } from '../../Analytics'; import { panelToRuleFormValues } from '../../utils/rule-form'; diff --git a/public/app/features/alerting/unified/components/receivers/GlobalConfigForm.tsx b/public/app/features/alerting/unified/components/receivers/GlobalConfigForm.tsx index 12fefb5a4d3..9ec9d6f9b03 100644 --- a/public/app/features/alerting/unified/components/receivers/GlobalConfigForm.tsx +++ b/public/app/features/alerting/unified/components/receivers/GlobalConfigForm.tsx @@ -4,7 +4,7 @@ import { Trans, t } from '@grafana/i18n'; import { Alert, Button, LinkButton, Stack } from '@grafana/ui'; import { useCleanup } from 'app/core/hooks/useCleanup'; import { AlertManagerCortexConfig } from 'app/plugins/datasource/alertmanager/types'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { useUnifiedAlertingSelector } from '../../hooks/useUnifiedAlertingSelector'; import { updateAlertManagerConfigAction } from '../../state/actions'; diff --git a/public/app/features/alerting/unified/components/receivers/NewReceiverView.test.tsx b/public/app/features/alerting/unified/components/receivers/NewReceiverView.test.tsx index 3929c478053..e1a1aa5aeba 100644 --- a/public/app/features/alerting/unified/components/receivers/NewReceiverView.test.tsx +++ b/public/app/features/alerting/unified/components/receivers/NewReceiverView.test.tsx @@ -3,7 +3,7 @@ import { render, screen } from 'test/test-utils'; import { byLabelText, byPlaceholderText, byRole, byTestId } from 'testing-library-selector'; import { captureRequests } from 'app/features/alerting/unified/mocks/server/events'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { setupMswServer } from '../../mockApi'; import { grantUserPermissions } from '../../mocks'; diff --git a/public/app/features/alerting/unified/components/receivers/form/ChannelOptions.tsx b/public/app/features/alerting/unified/components/receivers/form/ChannelOptions.tsx index e402c4f8875..e65dd9f0f38 100644 --- a/public/app/features/alerting/unified/components/receivers/form/ChannelOptions.tsx +++ b/public/app/features/alerting/unified/components/receivers/form/ChannelOptions.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { DeepMap, FieldError, FieldErrors, useFormContext } from 'react-hook-form'; import { Field, SecretInput } from '@grafana/ui'; -import { NotificationChannelOption, NotificationChannelSecureFields, OptionMeta } from 'app/types'; +import { NotificationChannelOption, NotificationChannelSecureFields, OptionMeta } from 'app/types/alerting'; import { ChannelValues, diff --git a/public/app/features/alerting/unified/components/receivers/form/ChannelSubForm.tsx b/public/app/features/alerting/unified/components/receivers/form/ChannelSubForm.tsx index 7e47f08b5a2..93dfa812d85 100644 --- a/public/app/features/alerting/unified/components/receivers/form/ChannelSubForm.tsx +++ b/public/app/features/alerting/unified/components/receivers/form/ChannelSubForm.tsx @@ -7,7 +7,7 @@ import { Controller, FieldErrors, useFormContext } from 'react-hook-form'; import { GrafanaTheme2, SelectableValue } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { Alert, Button, Field, Select, Stack, Text, useStyles2 } from '@grafana/ui'; -import { NotificationChannelOption } from 'app/types'; +import { NotificationChannelOption } from 'app/types/alerting'; import { useUnifiedAlertingSelector } from '../../../hooks/useUnifiedAlertingSelector'; import { diff --git a/public/app/features/alerting/unified/components/receivers/form/GrafanaReceiverForm.test.tsx b/public/app/features/alerting/unified/components/receivers/form/GrafanaReceiverForm.test.tsx index 937c64f4afb..af23e5dc423 100644 --- a/public/app/features/alerting/unified/components/receivers/form/GrafanaReceiverForm.test.tsx +++ b/public/app/features/alerting/unified/components/receivers/form/GrafanaReceiverForm.test.tsx @@ -13,7 +13,7 @@ import { import { AlertmanagerProvider } from 'app/features/alerting/unified/state/AlertmanagerContext'; import { SupportedPlugin } from 'app/features/alerting/unified/types/pluginBridges'; import { AlertManagerCortexConfig } from 'app/plugins/datasource/alertmanager/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { AlertmanagerConfigBuilder, setupMswServer } from '../../../mockApi'; import { grantUserPermissions } from '../../../mocks'; diff --git a/public/app/features/alerting/unified/components/receivers/form/GrafanaReceiverForm.tsx b/public/app/features/alerting/unified/components/receivers/form/GrafanaReceiverForm.tsx index 5a7a4d72d4b..44da5c3588b 100644 --- a/public/app/features/alerting/unified/components/receivers/form/GrafanaReceiverForm.tsx +++ b/public/app/features/alerting/unified/components/receivers/form/GrafanaReceiverForm.tsx @@ -15,7 +15,7 @@ import { GrafanaManagedReceiverConfig, TestReceiversAlert, } from 'app/plugins/datasource/alertmanager/types'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { alertmanagerApi } from '../../../api/alertmanagerApi'; import { testReceiversAction } from '../../../state/actions'; diff --git a/public/app/features/alerting/unified/components/receivers/form/fields/OptionField.tsx b/public/app/features/alerting/unified/components/receivers/form/fields/OptionField.tsx index 62db9294dc3..4bad7a8639f 100644 --- a/public/app/features/alerting/unified/components/receivers/form/fields/OptionField.tsx +++ b/public/app/features/alerting/unified/components/receivers/form/fields/OptionField.tsx @@ -14,7 +14,7 @@ import { TextArea, useStyles2, } from '@grafana/ui'; -import { NotificationChannelOption, NotificationChannelSecureFields, OptionMeta } from 'app/types'; +import { NotificationChannelOption, NotificationChannelSecureFields, OptionMeta } from 'app/types/alerting'; import { KeyValueMapInput } from './KeyValueMapInput'; import { StringArrayInput } from './StringArrayInput'; diff --git a/public/app/features/alerting/unified/components/receivers/form/fields/SubformArrayField.tsx b/public/app/features/alerting/unified/components/receivers/form/fields/SubformArrayField.tsx index 00533179299..02177df1bae 100644 --- a/public/app/features/alerting/unified/components/receivers/form/fields/SubformArrayField.tsx +++ b/public/app/features/alerting/unified/components/receivers/form/fields/SubformArrayField.tsx @@ -3,7 +3,7 @@ import { DeepMap, FieldError, useFormContext } from 'react-hook-form'; import { Trans, t } from '@grafana/i18n'; import { Button, useStyles2 } from '@grafana/ui'; import { useControlledFieldArray } from 'app/features/alerting/unified/hooks/useControlledFieldArray'; -import { NotificationChannelOption, NotificationChannelSecureFields, OptionMeta } from 'app/types'; +import { NotificationChannelOption, NotificationChannelSecureFields, OptionMeta } from 'app/types/alerting'; import { ActionIcon } from '../../../rules/ActionIcon'; import { CollapsibleSection } from '../CollapsibleSection'; diff --git a/public/app/features/alerting/unified/components/receivers/form/fields/SubformField.tsx b/public/app/features/alerting/unified/components/receivers/form/fields/SubformField.tsx index e836f4522f8..32118e6bc4c 100644 --- a/public/app/features/alerting/unified/components/receivers/form/fields/SubformField.tsx +++ b/public/app/features/alerting/unified/components/receivers/form/fields/SubformField.tsx @@ -3,7 +3,7 @@ import { DeepMap, FieldError, useFormContext } from 'react-hook-form'; import { Trans, t } from '@grafana/i18n'; import { Button, useStyles2 } from '@grafana/ui'; -import { NotificationChannelOption, NotificationChannelSecureFields, OptionMeta } from 'app/types'; +import { NotificationChannelOption, NotificationChannelSecureFields, OptionMeta } from 'app/types/alerting'; import { ActionIcon } from '../../../rules/ActionIcon'; diff --git a/public/app/features/alerting/unified/components/receivers/form/fields/TemplateSelector.test.tsx b/public/app/features/alerting/unified/components/receivers/form/fields/TemplateSelector.test.tsx index e8a58495887..74f574ac549 100644 --- a/public/app/features/alerting/unified/components/receivers/form/fields/TemplateSelector.test.tsx +++ b/public/app/features/alerting/unified/components/receivers/form/fields/TemplateSelector.test.tsx @@ -9,7 +9,8 @@ import { AlertmanagerProvider } from 'app/features/alerting/unified/state/Alertm import { GRAFANA_RULES_SOURCE_NAME } from 'app/features/alerting/unified/utils/datasource'; import { PROVENANCE_NONE } from 'app/features/alerting/unified/utils/k8s/constants'; import { DEFAULT_TEMPLATES } from 'app/features/alerting/unified/utils/template-constants'; -import { AccessControlAction, NotificationChannelOption } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { NotificationChannelOption } from 'app/types/alerting'; import { TemplatesPicker, getTemplateOptions } from './TemplateSelector'; import { parseTemplates } from './utils'; diff --git a/public/app/features/alerting/unified/components/receivers/form/fields/TemplateSelector.tsx b/public/app/features/alerting/unified/components/receivers/form/fields/TemplateSelector.tsx index de3cd0e3503..6cfea24cd83 100644 --- a/public/app/features/alerting/unified/components/receivers/form/fields/TemplateSelector.tsx +++ b/public/app/features/alerting/unified/components/receivers/form/fields/TemplateSelector.tsx @@ -28,7 +28,7 @@ import { useNotificationTemplates, } from 'app/features/alerting/unified/components/contact-points/useNotificationTemplates'; import { useAlertmanager } from 'app/features/alerting/unified/state/AlertmanagerContext'; -import { NotificationChannelOption } from 'app/types'; +import { NotificationChannelOption } from 'app/types/alerting'; import { defaultPayloadString } from '../../TemplateForm'; diff --git a/public/app/features/alerting/unified/components/receivers/form/notifiers.ts b/public/app/features/alerting/unified/components/receivers/form/notifiers.ts index 15baf45aabe..d84e8bc2f9d 100644 --- a/public/app/features/alerting/unified/components/receivers/form/notifiers.ts +++ b/public/app/features/alerting/unified/components/receivers/form/notifiers.ts @@ -1,6 +1,6 @@ import { ReactElement } from 'react'; -import { NotifierDTO } from '../../../../../../types'; +import { NotifierDTO } from 'app/types/alerting'; export interface NotifierMetadata { enabled: boolean; diff --git a/public/app/features/alerting/unified/components/receivers/grafanaAppReceivers/onCall/useOnCallIntegration.tsx b/public/app/features/alerting/unified/components/receivers/grafanaAppReceivers/onCall/useOnCallIntegration.tsx index b30545e604b..2f84d394b9f 100644 --- a/public/app/features/alerting/unified/components/receivers/grafanaAppReceivers/onCall/useOnCallIntegration.tsx +++ b/public/app/features/alerting/unified/components/receivers/grafanaAppReceivers/onCall/useOnCallIntegration.tsx @@ -6,10 +6,10 @@ import { t } from '@grafana/i18n'; import { isFetchError } from '@grafana/runtime'; import { Badge } from '@grafana/ui'; import { getIrmIfPresentOrOnCallPluginId } from 'app/features/alerting/unified/utils/config'; +import { NotifierDTO } from 'app/types/alerting'; import { useAppNotification } from '../../../../../../../core/copy/appNotification'; import { Receiver } from '../../../../../../../plugins/datasource/alertmanager/types'; -import { NotifierDTO } from '../../../../../../../types'; import { ONCALL_INTEGRATION_V2_FEATURE, onCallApi } from '../../../../api/onCallApi'; import { usePluginBridge } from '../../../../hooks/usePluginBridge'; import { option } from '../../../../utils/notifier-types'; diff --git a/public/app/features/alerting/unified/components/rule-editor/DashboardAnnotationField.tsx b/public/app/features/alerting/unified/components/rule-editor/DashboardAnnotationField.tsx index ee9992d4f1b..26d32af3104 100644 --- a/public/app/features/alerting/unified/components/rule-editor/DashboardAnnotationField.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/DashboardAnnotationField.tsx @@ -3,7 +3,7 @@ import { css } from '@emotion/css'; import { GrafanaTheme2 } from '@grafana/data'; import { Trans } from '@grafana/i18n'; import { Icon, Text, useStyles2 } from '@grafana/ui'; -import { DashboardDataDTO } from 'app/types'; +import { DashboardDataDTO } from 'app/types/dashboard'; import { makeDashboardLink, makePanelLink } from '../../utils/misc'; diff --git a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/simplifiedRouting/SimplifiedRuleEditor.test.tsx b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/simplifiedRouting/SimplifiedRuleEditor.test.tsx index c2d7fd5b240..d56b5b5ea01 100644 --- a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/simplifiedRouting/SimplifiedRuleEditor.test.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/simplifiedRouting/SimplifiedRuleEditor.test.tsx @@ -17,7 +17,7 @@ import { setupDataSources } from 'app/features/alerting/unified/testSetup/dataso import { DataSourceType } from 'app/features/alerting/unified/utils/datasource'; import { MANUAL_ROUTING_KEY, SIMPLIFIED_QUERY_EDITOR_KEY } from 'app/features/alerting/unified/utils/rule-form'; import { AlertmanagerChoice } from 'app/plugins/datasource/alertmanager/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { grafanaRulerGroup } from '../../../../mocks/grafanaRulerApi'; diff --git a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/utils.ts b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/utils.ts index 6ad5dac7d73..138db1979bf 100644 --- a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/utils.ts +++ b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/utils.ts @@ -2,7 +2,7 @@ import { DataSourceInstanceSettings } from '@grafana/data'; import { DataSourceJsonData } from '@grafana/schema/dist/esm/index'; import { contextSrv } from 'app/core/core'; import { ExpressionDatasourceUID } from 'app/features/expressions/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { AlertQuery } from 'app/types/unified-alerting-dto'; import { RuleFormType } from '../../../types/rule-form'; 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 27bfb98c6a8..bf84e8eb110 100644 --- a/public/app/features/alerting/unified/components/rule-editor/useDashboardQuery.ts +++ b/public/app/features/alerting/unified/components/rule-editor/useDashboardQuery.ts @@ -1,6 +1,7 @@ import memoizeOne from 'memoize-one'; -import { DashboardDTO } from '../../../../../types'; +import { DashboardDTO } from 'app/types/dashboard'; + import { DashboardModel } from '../../../../dashboard/state/DashboardModel'; import { dashboardApi } from '../../api/dashboardApi'; diff --git a/public/app/features/alerting/unified/components/rule-viewer/RuleViewer.test.tsx b/public/app/features/alerting/unified/components/rule-viewer/RuleViewer.test.tsx index a3125ccca53..cf642620c14 100644 --- a/public/app/features/alerting/unified/components/rule-viewer/RuleViewer.test.tsx +++ b/public/app/features/alerting/unified/components/rule-viewer/RuleViewer.test.tsx @@ -5,7 +5,7 @@ import { byLabelText, byRole, byText } from 'testing-library-selector'; import { setPluginLinksHook } from '@grafana/runtime'; import { setupMswServer } from 'app/features/alerting/unified/mockApi'; import { AlertManagerDataSourceJsonData } from 'app/plugins/datasource/alertmanager/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { CombinedRule, RuleIdentifier } from 'app/types/unified-alerting'; import { diff --git a/public/app/features/alerting/unified/components/rules/Filter/RulesFilter.v1.tsx b/public/app/features/alerting/unified/components/rules/Filter/RulesFilter.v1.tsx index 61dc5f119e7..ca70ddaa984 100644 --- a/public/app/features/alerting/unified/components/rules/Filter/RulesFilter.v1.tsx +++ b/public/app/features/alerting/unified/components/rules/Filter/RulesFilter.v1.tsx @@ -8,7 +8,7 @@ import { Trans, t } from '@grafana/i18n'; import { Button, Field, Icon, Input, Label, RadioButtonGroup, Stack, Tooltip, useStyles2 } from '@grafana/ui'; import { DashboardPicker } from 'app/core/components/Select/DashboardPicker'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { PromAlertingRuleState, PromRuleType } from 'app/types/unified-alerting-dto'; import { diff --git a/public/app/features/alerting/unified/components/rules/RuleActionsButtons.test.tsx b/public/app/features/alerting/unified/components/rules/RuleActionsButtons.test.tsx index 57725b1975b..5de673ccb14 100644 --- a/public/app/features/alerting/unified/components/rules/RuleActionsButtons.test.tsx +++ b/public/app/features/alerting/unified/components/rules/RuleActionsButtons.test.tsx @@ -15,7 +15,7 @@ import { mockPromAlertingRule, } from 'app/features/alerting/unified/mocks'; import { MIMIR_DATASOURCE_UID } from 'app/features/alerting/unified/mocks/server/constants'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { PromAlertingRuleState } from 'app/types/unified-alerting-dto'; import { setupDataSources } from '../../testSetup/datasources'; diff --git a/public/app/features/alerting/unified/components/rules/RuleActionsButtons.tsx b/public/app/features/alerting/unified/components/rules/RuleActionsButtons.tsx index 9e4d8c25a46..fc1142d3656 100644 --- a/public/app/features/alerting/unified/components/rules/RuleActionsButtons.tsx +++ b/public/app/features/alerting/unified/components/rules/RuleActionsButtons.tsx @@ -7,7 +7,7 @@ import { useDeleteModal } from 'app/features/alerting/unified/components/rule-vi import { INSTANCES_DISPLAY_LIMIT } from 'app/features/alerting/unified/components/rules/RuleDetails'; import SilenceGrafanaRuleDrawer from 'app/features/alerting/unified/components/silences/SilenceGrafanaRuleDrawer'; import { useRulesFilter } from 'app/features/alerting/unified/hooks/useFilteredRules'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { CombinedRule, RuleIdentifier, RulesSource } from 'app/types/unified-alerting'; import { AlertRuleAction, useAlertRuleAbility } from '../../hooks/useAbilities'; diff --git a/public/app/features/alerting/unified/components/rules/RuleListGroupView.test.tsx b/public/app/features/alerting/unified/components/rules/RuleListGroupView.test.tsx index 2d770e93fff..19100a72600 100644 --- a/public/app/features/alerting/unified/components/rules/RuleListGroupView.test.tsx +++ b/public/app/features/alerting/unified/components/rules/RuleListGroupView.test.tsx @@ -4,7 +4,7 @@ import { byRole } from 'testing-library-selector'; import { setPluginLinksHook } from '@grafana/runtime'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { CombinedRuleNamespace } from 'app/types/unified-alerting'; import * as analytics from '../../Analytics'; diff --git a/public/app/features/alerting/unified/components/rules/RulesGroup.test.tsx b/public/app/features/alerting/unified/components/rules/RulesGroup.test.tsx index 67e5486f9f8..fca35aa7dc4 100644 --- a/public/app/features/alerting/unified/components/rules/RulesGroup.test.tsx +++ b/public/app/features/alerting/unified/components/rules/RulesGroup.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from 'test/test-utils'; import { byRole } from 'testing-library-selector'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { CombinedRuleGroup, CombinedRuleNamespace, RulerDataSourceConfig } from 'app/types/unified-alerting'; import * as analytics from '../../Analytics'; diff --git a/public/app/features/alerting/unified/components/settings/AlertmanagerConfig.test.tsx b/public/app/features/alerting/unified/components/settings/AlertmanagerConfig.test.tsx index 9a97530ac9a..d401413335e 100644 --- a/public/app/features/alerting/unified/components/settings/AlertmanagerConfig.test.tsx +++ b/public/app/features/alerting/unified/components/settings/AlertmanagerConfig.test.tsx @@ -4,7 +4,7 @@ import { render } from 'test/test-utils'; import { byRole } from 'testing-library-selector'; import { setupDataSources } from 'app/features/alerting/unified/testSetup/datasources'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { setupMswServer } from '../../mockApi'; import { grantUserPermissions } from '../../mocks'; diff --git a/public/app/features/alerting/unified/components/templates/permissions.ts b/public/app/features/alerting/unified/components/templates/permissions.ts index a92758f1a1d..82bef452e94 100644 --- a/public/app/features/alerting/unified/components/templates/permissions.ts +++ b/public/app/features/alerting/unified/components/templates/permissions.ts @@ -1,4 +1,4 @@ -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; /** * List of all permissions that allow templates read/write functionality diff --git a/public/app/features/alerting/unified/group-details/GroupDetailsPage.test.tsx b/public/app/features/alerting/unified/group-details/GroupDetailsPage.test.tsx index a1606965fd2..988f3aaaeb1 100644 --- a/public/app/features/alerting/unified/group-details/GroupDetailsPage.test.tsx +++ b/public/app/features/alerting/unified/group-details/GroupDetailsPage.test.tsx @@ -4,7 +4,7 @@ import { Props } from 'react-virtualized-auto-sizer'; import { render, screen, waitFor, within } from 'test/test-utils'; import { byRole, byTestId } from 'testing-library-selector'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { setupMswServer } from '../mockApi'; import { grantUserPermissions, mockRulerGrafanaRule, mockRulerRuleGroup } from '../mocks'; diff --git a/public/app/features/alerting/unified/group-details/GroupDetailsPage.tsx b/public/app/features/alerting/unified/group-details/GroupDetailsPage.tsx index f05e9c1a19d..0b354af9457 100644 --- a/public/app/features/alerting/unified/group-details/GroupDetailsPage.tsx +++ b/public/app/features/alerting/unified/group-details/GroupDetailsPage.tsx @@ -5,7 +5,7 @@ import { useParams } from 'react-router-dom-v5-compat'; import { Trans, t } from '@grafana/i18n'; import { Alert, Badge, Button, LinkButton, Text, TextLink, withErrorBoundary } from '@grafana/ui'; import { EntityNotFound } from 'app/core/components/PageNotFound/EntityNotFound'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; import { GrafanaRulesSourceSymbol, RuleGroup } from 'app/types/unified-alerting'; import { PromRuleType, RulerRuleGroupDTO } from 'app/types/unified-alerting-dto'; diff --git a/public/app/features/alerting/unified/group-details/GroupEditPage.test.tsx b/public/app/features/alerting/unified/group-details/GroupEditPage.test.tsx index 2240d26dc55..bafd72ddedd 100644 --- a/public/app/features/alerting/unified/group-details/GroupEditPage.test.tsx +++ b/public/app/features/alerting/unified/group-details/GroupEditPage.test.tsx @@ -5,7 +5,7 @@ import { byRole, byTestId, byText } from 'testing-library-selector'; import { locationService } from '@grafana/runtime'; import { AppNotificationList } from 'app/core/components/AppNotifications/AppNotificationList'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { RulerRuleGroupDTO } from 'app/types/unified-alerting-dto'; import { setupMswServer } from '../mockApi'; diff --git a/public/app/features/alerting/unified/group-details/GroupEditPage.tsx b/public/app/features/alerting/unified/group-details/GroupEditPage.tsx index 1a2ece20bc4..a68f230d8cb 100644 --- a/public/app/features/alerting/unified/group-details/GroupEditPage.tsx +++ b/public/app/features/alerting/unified/group-details/GroupEditPage.tsx @@ -20,7 +20,7 @@ import { } from '@grafana/ui'; import { EntityNotFound } from 'app/core/components/PageNotFound/EntityNotFound'; import { useAppNotification } from 'app/core/copy/appNotification'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { GrafanaRulesSourceSymbol, RuleGroupIdentifierV2, RulerDataSourceConfig } from 'app/types/unified-alerting'; import { RulerRuleGroupDTO } from 'app/types/unified-alerting-dto'; diff --git a/public/app/features/alerting/unified/hooks/ruleGroup/useDeleteRuleFromGroup.test.tsx b/public/app/features/alerting/unified/hooks/ruleGroup/useDeleteRuleFromGroup.test.tsx index 538d02d1a38..552c401b6d0 100644 --- a/public/app/features/alerting/unified/hooks/ruleGroup/useDeleteRuleFromGroup.test.tsx +++ b/public/app/features/alerting/unified/hooks/ruleGroup/useDeleteRuleFromGroup.test.tsx @@ -3,7 +3,7 @@ import { render } from 'test/test-utils'; import { byRole, byText } from 'testing-library-selector'; import server from '@grafana/test-utils/server'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { CombinedRule } from 'app/types/unified-alerting'; import { setupMswServer } from '../../mockApi'; diff --git a/public/app/features/alerting/unified/hooks/ruleGroup/usePauseAlertRule.test.tsx b/public/app/features/alerting/unified/hooks/ruleGroup/usePauseAlertRule.test.tsx index 1b7f1f89db3..df57efb9ac5 100644 --- a/public/app/features/alerting/unified/hooks/ruleGroup/usePauseAlertRule.test.tsx +++ b/public/app/features/alerting/unified/hooks/ruleGroup/usePauseAlertRule.test.tsx @@ -3,7 +3,7 @@ import { HttpResponse } from 'msw'; import { render } from 'test/test-utils'; import { byRole, byText } from 'testing-library-selector'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { RulerGrafanaRuleDTO } from 'app/types/unified-alerting-dto'; import { setupMswServer } from '../../mockApi'; diff --git a/public/app/features/alerting/unified/hooks/ruleGroup/useUpdateRuleGroup.test.tsx b/public/app/features/alerting/unified/hooks/ruleGroup/useUpdateRuleGroup.test.tsx index 4d5fa6d556f..e74178297fb 100644 --- a/public/app/features/alerting/unified/hooks/ruleGroup/useUpdateRuleGroup.test.tsx +++ b/public/app/features/alerting/unified/hooks/ruleGroup/useUpdateRuleGroup.test.tsx @@ -1,7 +1,7 @@ import { render } from 'test/test-utils'; import { byRole, byText } from 'testing-library-selector'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { RuleGroupIdentifier } from 'app/types/unified-alerting'; import { setupMswServer } from '../../mockApi'; diff --git a/public/app/features/alerting/unified/hooks/useAbilities.test.tsx b/public/app/features/alerting/unified/hooks/useAbilities.test.tsx index a7b550e0b68..3fdd05e6c63 100644 --- a/public/app/features/alerting/unified/hooks/useAbilities.test.tsx +++ b/public/app/features/alerting/unified/hooks/useAbilities.test.tsx @@ -5,7 +5,7 @@ import { setupMswServer } from 'app/features/alerting/unified/mockApi'; import { setFolderAccessControl } from 'app/features/alerting/unified/mocks/server/configure'; import { MIMIR_DATASOURCE_UID } from 'app/features/alerting/unified/mocks/server/constants'; import { AlertManagerDataSourceJsonData, AlertManagerImplementation } from 'app/plugins/datasource/alertmanager/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { CombinedRule } from 'app/types/unified-alerting'; import { getCloudRule, getGrafanaRule, grantUserPermissions, mockDataSource } from '../mocks'; diff --git a/public/app/features/alerting/unified/hooks/useAbilities.ts b/public/app/features/alerting/unified/hooks/useAbilities.ts index 91fbe9cc603..5dd43d6db63 100644 --- a/public/app/features/alerting/unified/hooks/useAbilities.ts +++ b/public/app/features/alerting/unified/hooks/useAbilities.ts @@ -12,7 +12,7 @@ import { } from 'app/features/alerting/unified/components/notification-policies/permissions'; import { useFolder } from 'app/features/alerting/unified/hooks/useFolder'; import { AlertmanagerChoice } from 'app/plugins/datasource/alertmanager/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { CombinedRule, RuleGroupIdentifierV2 } from 'app/types/unified-alerting'; import { GrafanaPromRuleDTO, RulerRuleDTO } from 'app/types/unified-alerting-dto'; diff --git a/public/app/features/alerting/unified/hooks/useFolder.ts b/public/app/features/alerting/unified/hooks/useFolder.ts index 7b06bf92020..804c9c12b25 100644 --- a/public/app/features/alerting/unified/hooks/useFolder.ts +++ b/public/app/features/alerting/unified/hooks/useFolder.ts @@ -1,7 +1,7 @@ import { skipToken } from '@reduxjs/toolkit/query/react'; import { useGetFolderQuery } from 'app/features/browse-dashboards/api/browseDashboardsAPI'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; interface ReturnBag { folder?: FolderDTO; diff --git a/public/app/features/alerting/unified/hooks/useIsRuleEditable.test.tsx b/public/app/features/alerting/unified/hooks/useIsRuleEditable.test.tsx index 36d2d6f06d1..ff0c9b61a1c 100644 --- a/public/app/features/alerting/unified/hooks/useIsRuleEditable.test.tsx +++ b/public/app/features/alerting/unified/hooks/useIsRuleEditable.test.tsx @@ -5,7 +5,8 @@ import { Provider } from 'react-redux'; import { contextSrv } from 'app/core/services/context_srv'; import { MIMIR_DATASOURCE_UID } from 'app/features/alerting/unified/mocks/server/constants'; import { configureStore } from 'app/store/configureStore'; -import { AccessControlAction, FolderDTO } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { FolderDTO } from 'app/types/folders'; import { setupMswServer } from '../mockApi'; import { mockDataSource, mockFolder, mockRulerAlertingRule, mockRulerGrafanaRule } from '../mocks'; diff --git a/public/app/features/alerting/unified/hooks/useManagedAlertStateHistory.ts b/public/app/features/alerting/unified/hooks/useManagedAlertStateHistory.ts index e7902fcf507..8230954063c 100644 --- a/public/app/features/alerting/unified/hooks/useManagedAlertStateHistory.ts +++ b/public/app/features/alerting/unified/hooks/useManagedAlertStateHistory.ts @@ -1,6 +1,6 @@ import { useEffect } from 'react'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { StateHistoryItem } from 'app/types/unified-alerting'; import { fetchGrafanaAnnotationsAction } from '../state/actions'; diff --git a/public/app/features/alerting/unified/hooks/useUnifiedAlertingSelector.ts b/public/app/features/alerting/unified/hooks/useUnifiedAlertingSelector.ts index 5e6daa81e8b..ed65c6ea4a9 100644 --- a/public/app/features/alerting/unified/hooks/useUnifiedAlertingSelector.ts +++ b/public/app/features/alerting/unified/hooks/useUnifiedAlertingSelector.ts @@ -1,6 +1,6 @@ import { createSelector } from 'reselect'; -import { StoreState, useSelector } from 'app/types'; +import { StoreState, useSelector } from 'app/types/store'; import { UnifiedAlertingState } from '../state/reducers'; diff --git a/public/app/features/alerting/unified/mockApi.ts b/public/app/features/alerting/unified/mockApi.ts index ae0e9c385b0..614c8235dd0 100644 --- a/public/app/features/alerting/unified/mockApi.ts +++ b/public/app/features/alerting/unified/mockApi.ts @@ -9,7 +9,8 @@ import { setupAlertmanagerStatusMapDefaultState, } from 'app/features/alerting/unified/mocks/server/entities/alertmanagers'; import { resetRoutingTreeMap } from 'app/features/alerting/unified/mocks/server/entities/k8s/routingtrees'; -import { DashboardDTO, FolderDTO } from 'app/types'; +import { DashboardDTO } from 'app/types/dashboard'; +import { FolderDTO } from 'app/types/folders'; import { PromRulesResponse, RulerGrafanaRuleDTO, diff --git a/public/app/features/alerting/unified/mockGrafanaNotifiers.ts b/public/app/features/alerting/unified/mockGrafanaNotifiers.ts index 08bc5d4d90d..fd058176867 100644 --- a/public/app/features/alerting/unified/mockGrafanaNotifiers.ts +++ b/public/app/features/alerting/unified/mockGrafanaNotifiers.ts @@ -1,4 +1,4 @@ -import { GrafanaNotifierType, NotifierDTO } from 'app/types'; +import { GrafanaNotifierType, NotifierDTO } from 'app/types/alerting'; export const grafanaAlertNotifiers: Record = { dingding: { diff --git a/public/app/features/alerting/unified/mocks.ts b/public/app/features/alerting/unified/mocks.ts index e8d3bc2e2ab..0202406bf8e 100644 --- a/public/app/features/alerting/unified/mocks.ts +++ b/public/app/features/alerting/unified/mocks.ts @@ -26,7 +26,11 @@ import { SilenceState, } from 'app/plugins/datasource/alertmanager/types'; import { configureStore } from 'app/store/configureStore'; -import { AccessControlAction, DashboardDTO, FolderDTO, NotifiersState, ReceiversState, StoreState } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { NotifiersState, ReceiversState } from 'app/types/alerting'; +import { DashboardDTO } from 'app/types/dashboard'; +import { FolderDTO } from 'app/types/folders'; +import { StoreState } from 'app/types/store'; import { Alert, AlertingRule, diff --git a/public/app/features/alerting/unified/mocks/server/configure.ts b/public/app/features/alerting/unified/mocks/server/configure.ts index f21833e4866..3e3043d9331 100644 --- a/public/app/features/alerting/unified/mocks/server/configure.ts +++ b/public/app/features/alerting/unified/mocks/server/configure.ts @@ -22,7 +22,7 @@ import { import { SupportedPlugin } from 'app/features/alerting/unified/types/pluginBridges'; import { clearPluginSettingsCache } from 'app/features/plugins/pluginSettings'; import { AlertmanagerChoice } from 'app/plugins/datasource/alertmanager/types'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; import { RulerDataSourceConfig } from 'app/types/unified-alerting'; import { GrafanaPromRuleGroupDTO, PromRuleGroupDTO, RulerRuleGroupDTO } from 'app/types/unified-alerting-dto'; diff --git a/public/app/features/alerting/unified/mocks/server/db.ts b/public/app/features/alerting/unified/mocks/server/db.ts index a100519b4b4..05cbf225981 100644 --- a/public/app/features/alerting/unified/mocks/server/db.ts +++ b/public/app/features/alerting/unified/mocks/server/db.ts @@ -4,7 +4,7 @@ import { uniqueId } from 'lodash'; import { DataSourceInstanceSettings, PluginType } from '@grafana/data'; import { config } from '@grafana/runtime'; import { GrafanaManagedContactPoint, GrafanaManagedReceiverConfig } from 'app/plugins/datasource/alertmanager/types'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; import { GrafanaAlertStateDecision, GrafanaAlertingRuleDefinition, diff --git a/public/app/features/alerting/unified/mocks/server/handlers/accessControl.ts b/public/app/features/alerting/unified/mocks/server/handlers/accessControl.ts index 9e73c77f671..3a79aa4824d 100644 --- a/public/app/features/alerting/unified/mocks/server/handlers/accessControl.ts +++ b/public/app/features/alerting/unified/mocks/server/handlers/accessControl.ts @@ -1,7 +1,7 @@ import { HttpResponse, http } from 'msw'; import { Description, ResourcePermission } from 'app/core/components/AccessControl/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; // TODO: Expand this out to more realistic use cases as we work on RBAC for contact points const resourceDescriptionsMap: Record = { diff --git a/public/app/features/alerting/unified/mocks/server/handlers/folders.ts b/public/app/features/alerting/unified/mocks/server/handlers/folders.ts index a1599b815e1..7a295222077 100644 --- a/public/app/features/alerting/unified/mocks/server/handlers/folders.ts +++ b/public/app/features/alerting/unified/mocks/server/handlers/folders.ts @@ -2,7 +2,7 @@ import { HttpResponse, http } from 'msw'; import { mockFolder } from 'app/features/alerting/unified/mocks'; import { grafanaRulerRule } from 'app/features/alerting/unified/mocks/grafanaRulerApi'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; export const DEFAULT_FOLDERS: FolderDTO[] = [ mockFolder({ diff --git a/public/app/features/alerting/unified/rule-editor/CloneRuleEditor.test.tsx b/public/app/features/alerting/unified/rule-editor/CloneRuleEditor.test.tsx index fd04f5c3b8e..8bd3b28e933 100644 --- a/public/app/features/alerting/unified/rule-editor/CloneRuleEditor.test.tsx +++ b/public/app/features/alerting/unified/rule-editor/CloneRuleEditor.test.tsx @@ -5,7 +5,7 @@ import { byRole, byTestId } from 'testing-library-selector'; import { MIMIR_DATASOURCE_UID } from 'app/features/alerting/unified/mocks/server/constants'; import { DashboardSearchItemType } from 'app/features/search/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { RuleWithLocation } from 'app/types/unified-alerting'; import { RulerAlertingRuleDTO, diff --git a/public/app/features/alerting/unified/rule-editor/RuleEditorCloudOnlyAllowed.test.tsx b/public/app/features/alerting/unified/rule-editor/RuleEditorCloudOnlyAllowed.test.tsx index 86d92dac4fe..d21d660cc66 100644 --- a/public/app/features/alerting/unified/rule-editor/RuleEditorCloudOnlyAllowed.test.tsx +++ b/public/app/features/alerting/unified/rule-editor/RuleEditorCloudOnlyAllowed.test.tsx @@ -3,7 +3,7 @@ import { screen } from 'test/test-utils'; import { byText } from 'testing-library-selector'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { PromApiFeatures, PromApplication } from 'app/types/unified-alerting-dto'; import { discoverFeaturesByUid } from '../api/buildInfo'; diff --git a/public/app/features/alerting/unified/rule-editor/RuleEditorCloudRules.test.tsx b/public/app/features/alerting/unified/rule-editor/RuleEditorCloudRules.test.tsx index ac0668721cb..7e823431f87 100644 --- a/public/app/features/alerting/unified/rule-editor/RuleEditorCloudRules.test.tsx +++ b/public/app/features/alerting/unified/rule-editor/RuleEditorCloudRules.test.tsx @@ -3,7 +3,7 @@ import { clickSelectOption } from 'test/helpers/selectOptionInTest'; import { screen } from 'test/test-utils'; import { selectors } from '@grafana/e2e-selectors'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { ExpressionEditorProps } from '../components/rule-editor/ExpressionEditor'; import { setupMswServer } from '../mockApi'; diff --git a/public/app/features/alerting/unified/rule-editor/RuleEditorExisting.test.tsx b/public/app/features/alerting/unified/rule-editor/RuleEditorExisting.test.tsx index 9a99b587bcd..eab7a703499 100644 --- a/public/app/features/alerting/unified/rule-editor/RuleEditorExisting.test.tsx +++ b/public/app/features/alerting/unified/rule-editor/RuleEditorExisting.test.tsx @@ -6,7 +6,7 @@ import { contextSrv } from 'app/core/services/context_srv'; import { setFolderResponse } from 'app/features/alerting/unified/mocks/server/configure'; import { captureRequests } from 'app/features/alerting/unified/mocks/server/events'; import { DashboardSearchItemType } from 'app/features/search/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { setupMswServer } from '../mockApi'; import { grantUserPermissions, mockDataSource, mockFolder } from '../mocks'; diff --git a/public/app/features/alerting/unified/rule-editor/RuleEditorGrafanaRules.test.tsx b/public/app/features/alerting/unified/rule-editor/RuleEditorGrafanaRules.test.tsx index fedb898f955..632904914b1 100644 --- a/public/app/features/alerting/unified/rule-editor/RuleEditorGrafanaRules.test.tsx +++ b/public/app/features/alerting/unified/rule-editor/RuleEditorGrafanaRules.test.tsx @@ -8,7 +8,7 @@ import { contextSrv } from 'app/core/services/context_srv'; import { setupMswServer } from 'app/features/alerting/unified/mockApi'; import { PROMETHEUS_DATASOURCE_UID } from 'app/features/alerting/unified/mocks/server/constants'; import { DashboardSearchItemType } from 'app/features/search/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { grantUserPermissions, mockDataSource, mockFolder } from '../mocks'; import { grafanaRulerGroup, grafanaRulerGroup2, grafanaRulerRule } from '../mocks/grafanaRulerApi'; diff --git a/public/app/features/alerting/unified/rule-editor/RuleEditorRecordingRule.test.tsx b/public/app/features/alerting/unified/rule-editor/RuleEditorRecordingRule.test.tsx index 19166c01ea4..cd1f40deb43 100644 --- a/public/app/features/alerting/unified/rule-editor/RuleEditorRecordingRule.test.tsx +++ b/public/app/features/alerting/unified/rule-editor/RuleEditorRecordingRule.test.tsx @@ -5,7 +5,7 @@ import { clickSelectOption } from 'test/helpers/selectOptionInTest'; import { byText } from 'testing-library-selector'; import { setupMswServer } from 'app/features/alerting/unified/mockApi'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { RecordingRuleEditorProps } from '../components/rule-editor/RecordingRuleEditor'; import { grantUserPermissions } from '../mocks'; diff --git a/public/app/features/alerting/unified/rule-list/DataSourceGroupLoader.test.tsx b/public/app/features/alerting/unified/rule-list/DataSourceGroupLoader.test.tsx index c1fe5eeec29..2c8411e09a9 100644 --- a/public/app/features/alerting/unified/rule-list/DataSourceGroupLoader.test.tsx +++ b/public/app/features/alerting/unified/rule-list/DataSourceGroupLoader.test.tsx @@ -3,7 +3,7 @@ import { byRole } from 'testing-library-selector'; import { DataSourceInstanceSettings } from '@grafana/data'; import { setPluginComponentsHook, setPluginLinksHook } from '@grafana/runtime'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { DataSourceRuleGroupIdentifier, DataSourceRulesSourceIdentifier } from 'app/types/unified-alerting'; import { PromRuleGroupDTO, RulerRuleDTO } from 'app/types/unified-alerting-dto'; diff --git a/public/app/features/alerting/unified/rule-list/FilterView.test.tsx b/public/app/features/alerting/unified/rule-list/FilterView.test.tsx index b9120e57eb1..b37e08dda81 100644 --- a/public/app/features/alerting/unified/rule-list/FilterView.test.tsx +++ b/public/app/features/alerting/unified/rule-list/FilterView.test.tsx @@ -2,7 +2,7 @@ import { mockIntersectionObserver } from 'jsdom-testing-mocks'; import { act, render, screen, waitForElementToBeRemoved } from 'test/test-utils'; import { setPluginComponentsHook, setPluginLinksHook } from '@grafana/runtime'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { setupMswServer } from '../mockApi'; import { grantUserPermissions } from '../mocks'; diff --git a/public/app/features/alerting/unified/rule-list/GrafanaGroupLoader.test.tsx b/public/app/features/alerting/unified/rule-list/GrafanaGroupLoader.test.tsx index 68913940e8e..e4de86c39e8 100644 --- a/public/app/features/alerting/unified/rule-list/GrafanaGroupLoader.test.tsx +++ b/public/app/features/alerting/unified/rule-list/GrafanaGroupLoader.test.tsx @@ -2,7 +2,7 @@ import { render } from 'test/test-utils'; import { byRole, byTitle } from 'testing-library-selector'; import { setPluginComponentsHook, setPluginLinksHook } from '@grafana/runtime'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { GrafanaRuleGroupIdentifier } from 'app/types/unified-alerting'; import { GrafanaPromRuleDTO, diff --git a/public/app/features/alerting/unified/rule-list/GroupedView.test.tsx b/public/app/features/alerting/unified/rule-list/GroupedView.test.tsx index 361d017b4d2..63723b06bdd 100644 --- a/public/app/features/alerting/unified/rule-list/GroupedView.test.tsx +++ b/public/app/features/alerting/unified/rule-list/GroupedView.test.tsx @@ -2,7 +2,7 @@ import { render, screen, waitFor, within } from 'test/test-utils'; import { byRole } from 'testing-library-selector'; import { setPluginComponentsHook, setPluginLinksHook, setReturnToPreviousHook } from '@grafana/runtime'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { setupMswServer } from '../mockApi'; import { grantUserPermissions } from '../mocks'; diff --git a/public/app/features/alerting/unified/rule-list/RuleList.v1.tsx b/public/app/features/alerting/unified/rule-list/RuleList.v1.tsx index d9df8e007d4..8e80dd0eff3 100644 --- a/public/app/features/alerting/unified/rule-list/RuleList.v1.tsx +++ b/public/app/features/alerting/unified/rule-list/RuleList.v1.tsx @@ -7,7 +7,7 @@ import { Trans, t } from '@grafana/i18n'; import { logInfo } from '@grafana/runtime'; import { Button, LinkButton, Stack } from '@grafana/ui'; import { useQueryParams } from 'app/core/hooks/useQueryParams'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { CombinedRuleNamespace } from 'app/types/unified-alerting'; import { LogMessages, trackRuleListNavigation } from '../Analytics'; diff --git a/public/app/features/alerting/unified/rule-list/RuleList.v2.test.tsx b/public/app/features/alerting/unified/rule-list/RuleList.v2.test.tsx index e29d4c2f65b..1f2f4c0b02e 100644 --- a/public/app/features/alerting/unified/rule-list/RuleList.v2.test.tsx +++ b/public/app/features/alerting/unified/rule-list/RuleList.v2.test.tsx @@ -2,7 +2,7 @@ import { render } from 'test/test-utils'; import { byRole, byTestId } from 'testing-library-selector'; import { setPluginComponentsHook, setPluginLinksHook } from '@grafana/runtime'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { setupMswServer } from '../mockApi'; import { grantUserPermissions } from '../mocks'; diff --git a/public/app/features/alerting/unified/state/actions.ts b/public/app/features/alerting/unified/state/actions.ts index f45b7ff1dde..90ccc17db20 100644 --- a/public/app/features/alerting/unified/state/actions.ts +++ b/public/app/features/alerting/unified/state/actions.ts @@ -9,7 +9,7 @@ import { Receiver, TestReceiversAlert, } from 'app/plugins/datasource/alertmanager/types'; -import { ThunkResult } from 'app/types'; +import { ThunkResult } from 'app/types/store'; import { RuleIdentifier, RuleNamespace, StateHistoryItem } from 'app/types/unified-alerting'; import { RulerRuleDTO, RulerRulesConfigDTO } from 'app/types/unified-alerting-dto'; diff --git a/public/app/features/alerting/unified/test/test-utils.ts b/public/app/features/alerting/unified/test/test-utils.ts index 66598dea083..0dea7f9eb58 100644 --- a/public/app/features/alerting/unified/test/test-utils.ts +++ b/public/app/features/alerting/unified/test/test-utils.ts @@ -2,7 +2,7 @@ import { act } from '@testing-library/react'; import { FeatureToggles } from '@grafana/data'; import { config } from '@grafana/runtime'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { grantUserPermissions } from '../mocks'; import { setFolderAccessControl } from '../mocks/server/configure'; diff --git a/public/app/features/alerting/unified/types/receiver-form.ts b/public/app/features/alerting/unified/types/receiver-form.ts index e17aa9d05f0..d2045a2c2a6 100644 --- a/public/app/features/alerting/unified/types/receiver-form.ts +++ b/public/app/features/alerting/unified/types/receiver-form.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { GrafanaManagedReceiverConfig } from 'app/plugins/datasource/alertmanager/types'; -import { CloudNotifierType, NotifierType } from 'app/types'; +import { CloudNotifierType, NotifierType } from 'app/types/alerting'; import { ControlledField } from '../hooks/useControlledFieldArray'; diff --git a/public/app/features/alerting/unified/utils/access-control.ts b/public/app/features/alerting/unified/utils/access-control.ts index edda81712ae..0821c92963b 100644 --- a/public/app/features/alerting/unified/utils/access-control.ts +++ b/public/app/features/alerting/unified/utils/access-control.ts @@ -1,6 +1,6 @@ import { getConfig } from 'app/core/config'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { GRAFANA_RULES_SOURCE_NAME, isGrafanaRulesSource } from './datasource'; diff --git a/public/app/features/alerting/unified/utils/cloud-alertmanager-notifier-types.ts b/public/app/features/alerting/unified/utils/cloud-alertmanager-notifier-types.ts index 96bc19b4aff..2475248dc34 100644 --- a/public/app/features/alerting/unified/utils/cloud-alertmanager-notifier-types.ts +++ b/public/app/features/alerting/unified/utils/cloud-alertmanager-notifier-types.ts @@ -1,5 +1,5 @@ import { config } from '@grafana/runtime'; -import { CloudNotifierType, NotificationChannelOption, NotifierDTO } from 'app/types'; +import { CloudNotifierType, NotificationChannelOption, NotifierDTO } from 'app/types/alerting'; import { option } from './notifier-types'; diff --git a/public/app/features/alerting/unified/utils/datasource.ts b/public/app/features/alerting/unified/utils/datasource.ts index a50eddcfa50..4bcf3757d2c 100644 --- a/public/app/features/alerting/unified/utils/datasource.ts +++ b/public/app/features/alerting/unified/utils/datasource.ts @@ -8,7 +8,7 @@ import { AlertManagerImplementation, AlertmanagerChoice, } from 'app/plugins/datasource/alertmanager/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { DataSourceRulesSourceIdentifier as DataSourceRulesSourceIdentifier, GrafanaRulesSourceIdentifier, diff --git a/public/app/features/alerting/unified/utils/notifier-types.ts b/public/app/features/alerting/unified/utils/notifier-types.ts index f7c9e0054bc..eeb2f30dae9 100644 --- a/public/app/features/alerting/unified/utils/notifier-types.ts +++ b/public/app/features/alerting/unified/utils/notifier-types.ts @@ -1,4 +1,4 @@ -import { NotificationChannelOption } from '../../../../types'; +import { NotificationChannelOption } from 'app/types/alerting'; export function option( propertyName: string, diff --git a/public/app/features/alerting/unified/utils/receiver-form.ts b/public/app/features/alerting/unified/utils/receiver-form.ts index c5ae3b55263..689bfe07c26 100644 --- a/public/app/features/alerting/unified/utils/receiver-form.ts +++ b/public/app/features/alerting/unified/utils/receiver-form.ts @@ -7,7 +7,7 @@ import { GrafanaManagedReceiverSecureFields, Receiver, } from 'app/plugins/datasource/alertmanager/types'; -import { CloudNotifierType, NotificationChannelOption, NotifierDTO, NotifierType } from 'app/types'; +import { CloudNotifierType, NotificationChannelOption, NotifierDTO, NotifierType } from 'app/types/alerting'; import { ChannelValues, diff --git a/public/app/features/auth-config/AuthDrawer.tsx b/public/app/features/auth-config/AuthDrawer.tsx index 06d1ebc948c..e6a3892bc1c 100644 --- a/public/app/features/auth-config/AuthDrawer.tsx +++ b/public/app/features/auth-config/AuthDrawer.tsx @@ -6,7 +6,7 @@ import { GrafanaTheme2 } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { Button, Drawer, Text, TextLink, Switch, useStyles2 } from '@grafana/ui'; import { useAppNotification } from 'app/core/copy/appNotification'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import { loadSettings, saveSettings } from './state/actions'; diff --git a/public/app/features/auth-config/AuthProvidersListPage.tsx b/public/app/features/auth-config/AuthProvidersListPage.tsx index d0ae5e73ab7..37fdf7c5cfe 100644 --- a/public/app/features/auth-config/AuthProvidersListPage.tsx +++ b/public/app/features/auth-config/AuthProvidersListPage.tsx @@ -7,7 +7,7 @@ import { reportInteraction } from '@grafana/runtime'; import { Grid, TextLink, ToolbarButton } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { config } from 'app/core/config'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import AuthDrawer from './AuthDrawer'; import ConfigureAuthCTA from './components/ConfigureAuthCTA'; diff --git a/public/app/features/auth-config/ErrorContainer.tsx b/public/app/features/auth-config/ErrorContainer.tsx index 79cf6514569..336dde9716a 100644 --- a/public/app/features/auth-config/ErrorContainer.tsx +++ b/public/app/features/auth-config/ErrorContainer.tsx @@ -1,7 +1,7 @@ import { connect, ConnectedProps } from 'react-redux'; import { Alert } from '@grafana/ui'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import { resetError, resetWarning } from './state/reducers'; diff --git a/public/app/features/auth-config/ProviderConfigPage.tsx b/public/app/features/auth-config/ProviderConfigPage.tsx index 617626660fa..34614ddb746 100644 --- a/public/app/features/auth-config/ProviderConfigPage.tsx +++ b/public/app/features/auth-config/ProviderConfigPage.tsx @@ -6,7 +6,7 @@ import { t } from '@grafana/i18n'; import { Badge, Stack, Text } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { PageNotFound } from 'app/core/components/PageNotFound/PageNotFound'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; import { ProviderConfigForm } from './ProviderConfigForm'; import { UIMap } from './constants'; diff --git a/public/app/features/auth-config/index.ts b/public/app/features/auth-config/index.ts index c927b22e701..69113401661 100644 --- a/public/app/features/auth-config/index.ts +++ b/public/app/features/auth-config/index.ts @@ -1,7 +1,8 @@ import config from 'app/core/config'; import { contextSrv } from 'app/core/core'; import { getBackendSrv } from 'app/core/services/backend_srv'; -import { AccessControlAction, Settings, SettingsSection } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { Settings, SettingsSection } from 'app/types/settings'; import { AuthProviderInfo, GetStatusHook, AuthProviderStatus } from './types'; diff --git a/public/app/features/auth-config/state/actions.ts b/public/app/features/auth-config/state/actions.ts index 074cb6b894f..cf1cdd8d7f7 100644 --- a/public/app/features/auth-config/state/actions.ts +++ b/public/app/features/auth-config/state/actions.ts @@ -2,7 +2,9 @@ import { lastValueFrom } from 'rxjs'; import { getBackendSrv, isFetchError } from '@grafana/runtime'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, Settings, ThunkResult, UpdateSettingsQuery } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { Settings, UpdateSettingsQuery } from 'app/types/settings'; +import { ThunkResult } from 'app/types/store'; import { getAuthProviderStatus, getRegisteredAuthProviders, SSOProvider } from '..'; import { AuthProviderStatus, SettingsError } from '../types'; diff --git a/public/app/features/auth-config/state/reducers.ts b/public/app/features/auth-config/state/reducers.ts index 0194ed538d0..0dac91d70a6 100644 --- a/public/app/features/auth-config/state/reducers.ts +++ b/public/app/features/auth-config/state/reducers.ts @@ -1,6 +1,6 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'; -import { Settings } from 'app/types'; +import { Settings } from 'app/types/settings'; import { SettingsError, AuthProviderStatus, AuthConfigState, SSOProvider } from '../types'; diff --git a/public/app/features/auth-config/types.ts b/public/app/features/auth-config/types.ts index b14336f06ab..6b6fd5c5a4e 100644 --- a/public/app/features/auth-config/types.ts +++ b/public/app/features/auth-config/types.ts @@ -2,7 +2,7 @@ import { ReactElement } from 'react'; import { Validate, UseFormSetValue } from 'react-hook-form'; import { IconName, SelectableValue } from '@grafana/data'; -import { Settings } from 'app/types'; +import { Settings } from 'app/types/settings'; export interface AuthProviderInfo { id: string; type: string; diff --git a/public/app/features/bookmarks/BookmarksPage.tsx b/public/app/features/bookmarks/BookmarksPage.tsx index 6a4c1b704df..6b7f9ab08ae 100644 --- a/public/app/features/bookmarks/BookmarksPage.tsx +++ b/public/app/features/bookmarks/BookmarksPage.tsx @@ -7,7 +7,7 @@ import { usePinnedItems } from 'app/core/components/AppChrome/MegaMenu/hooks'; import { findByUrl } from 'app/core/components/AppChrome/MegaMenu/utils'; import { NavLandingPageCard } from 'app/core/components/NavLandingPage/NavLandingPageCard'; import { Page } from 'app/core/components/Page/Page'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; export function BookmarksPage() { const styles = useStyles2(getStyles); diff --git a/public/app/features/browse-dashboards/BrowseDashboardsPage.tsx b/public/app/features/browse-dashboards/BrowseDashboardsPage.tsx index 7a58ec579ae..e392e6a3f53 100644 --- a/public/app/features/browse-dashboards/BrowseDashboardsPage.tsx +++ b/public/app/features/browse-dashboards/BrowseDashboardsPage.tsx @@ -10,7 +10,7 @@ import { config, reportInteraction } from '@grafana/runtime'; import { LinkButton, FilterInput, useStyles2, Text, Stack } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { getConfig } from 'app/core/config'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { FolderRepo } from '../../core/components/NestedFolderPicker/FolderRepo'; import { contextSrv } from '../../core/services/context_srv'; diff --git a/public/app/features/browse-dashboards/RecentlyDeletedPage.tsx b/public/app/features/browse-dashboards/RecentlyDeletedPage.tsx index 06fc910a683..3e18b71d399 100644 --- a/public/app/features/browse-dashboards/RecentlyDeletedPage.tsx +++ b/public/app/features/browse-dashboards/RecentlyDeletedPage.tsx @@ -8,8 +8,7 @@ import { FilterInput, useStyles2 } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { ActionRow } from 'app/features/search/page/components/ActionRow'; import { getGrafanaSearcher } from 'app/features/search/service/searcher'; - -import { useDispatch } from '../../types'; +import { useDispatch } from 'app/types/store'; import { useRecentlyDeletedStateManager } from './api/useRecentlyDeletedStateManager'; import { RecentlyDeletedActions } from './components/RecentlyDeletedActions'; diff --git a/public/app/features/browse-dashboards/api/browseDashboardsAPI.ts b/public/app/features/browse-dashboards/api/browseDashboardsAPI.ts index fdd091aecc3..b9f5f4c9323 100644 --- a/public/app/features/browse-dashboards/api/browseDashboardsAPI.ts +++ b/public/app/features/browse-dashboards/api/browseDashboardsAPI.ts @@ -15,15 +15,9 @@ import { isDashboardV2Resource, isV1DashboardCommand, isV2DashboardCommand } fro import { SaveDashboardCommand } from 'app/features/dashboard/components/SaveDashboard/types'; import { dashboardWatcher } from 'app/features/live/dashboard/dashboardWatcher'; import { dispatch } from 'app/store/store'; -import { - DescendantCount, - DescendantCountDTO, - FolderDTO, - FolderListItemDTO, - ImportDashboardResponseDTO, - PermissionLevelString, - SaveDashboardResponseDTO, -} from 'app/types'; +import { PermissionLevelString } from 'app/types/acl'; +import { SaveDashboardResponseDTO, ImportDashboardResponseDTO } from 'app/types/dashboard'; +import { FolderListItemDTO, FolderDTO, DescendantCount, DescendantCountDTO } from 'app/types/folders'; import { refetchChildren, refreshParents } from '../state/actions'; import { DashboardTreeSelection } from '../types'; diff --git a/public/app/features/browse-dashboards/api/isProvisioned.ts b/public/app/features/browse-dashboards/api/isProvisioned.ts index 7df88e77de3..f0b948d4d5e 100644 --- a/public/app/features/browse-dashboards/api/isProvisioned.ts +++ b/public/app/features/browse-dashboards/api/isProvisioned.ts @@ -1,6 +1,6 @@ import { Folder } from 'app/api/clients/folder/v1beta1'; import { AnnoKeyManagerKind, ManagerKind } from 'app/features/apiserver/types'; -import { DashboardDTO } from 'app/types'; +import { DashboardDTO } from 'app/types/dashboard'; import { DashboardWithAccessInfo } from '../../dashboard/api/types'; diff --git a/public/app/features/browse-dashboards/api/services.ts b/public/app/features/browse-dashboards/api/services.ts index c5eb2375b65..a6a511ba0f7 100644 --- a/public/app/features/browse-dashboards/api/services.ts +++ b/public/app/features/browse-dashboards/api/services.ts @@ -4,9 +4,9 @@ import { getGrafanaSearcher } from 'app/features/search/service/searcher'; import { NestedFolderDTO } from 'app/features/search/service/types'; import { queryResultToViewItem } from 'app/features/search/service/utils'; import { DashboardViewItem } from 'app/features/search/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { contextSrv } from '../../../core/core'; -import { AccessControlAction } from '../../../types'; import { getFolderURL, isSharedWithMe } from '../components/utils'; export const PAGE_SIZE = 50; diff --git a/public/app/features/browse-dashboards/components/BrowseActions/BrowseActions.tsx b/public/app/features/browse-dashboards/components/BrowseActions/BrowseActions.tsx index 931c66cfd74..3dd60457c77 100644 --- a/public/app/features/browse-dashboards/components/BrowseActions/BrowseActions.tsx +++ b/public/app/features/browse-dashboards/components/BrowseActions/BrowseActions.tsx @@ -5,8 +5,8 @@ import { config, reportInteraction } from '@grafana/runtime'; import { Button, Stack, Tooltip } from '@grafana/ui'; import appEvents from 'app/core/app_events'; import { useSearchStateManager } from 'app/features/search/state/SearchStateManager'; -import { useDispatch } from 'app/types'; import { ShowModalReactEvent } from 'app/types/events'; +import { useDispatch } from 'app/types/store'; import { useDeleteItemsMutation, useMoveItemsMutation } from '../../api/browseDashboardsAPI'; import { useActionSelectionState } from '../../state/hooks'; diff --git a/public/app/features/browse-dashboards/components/BrowseView.tsx b/public/app/features/browse-dashboards/components/BrowseView.tsx index 2a6c55a4ed3..b20fa522fc7 100644 --- a/public/app/features/browse-dashboards/components/BrowseView.tsx +++ b/public/app/features/browse-dashboards/components/BrowseView.tsx @@ -3,7 +3,7 @@ import { useCallback } from 'react'; import { Trans, t } from '@grafana/i18n'; import { CallToActionCard, EmptyState, LinkButton, TextLink } from '@grafana/ui'; import { DashboardViewItem } from 'app/features/search/types'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { PAGE_SIZE } from '../api/services'; import { fetchNextChildrenPage } from '../state/actions'; diff --git a/public/app/features/browse-dashboards/components/CreateNewButton.test.tsx b/public/app/features/browse-dashboards/components/CreateNewButton.test.tsx index 902f3b0ef2a..e5635cdfd4d 100644 --- a/public/app/features/browse-dashboards/components/CreateNewButton.test.tsx +++ b/public/app/features/browse-dashboards/components/CreateNewButton.test.tsx @@ -2,7 +2,7 @@ import { render as rtlRender, screen, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { TestProvider } from 'test/helpers/TestProvider'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; import { mockFolderDTO } from '../fixtures/folder.fixture'; diff --git a/public/app/features/browse-dashboards/components/CreateNewButton.tsx b/public/app/features/browse-dashboards/components/CreateNewButton.tsx index bb00a254d31..d1c487da4f8 100644 --- a/public/app/features/browse-dashboards/components/CreateNewButton.tsx +++ b/public/app/features/browse-dashboards/components/CreateNewButton.tsx @@ -12,7 +12,7 @@ import { getNewFolderPhrase, getNewPhrase, } from 'app/features/search/tempI18nPhrases'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; import { ManagerKind } from '../../apiserver/types'; import { useNewFolderMutation } from '../api/browseDashboardsAPI'; diff --git a/public/app/features/browse-dashboards/components/DeleteProvisionedFolderForm.test.tsx b/public/app/features/browse-dashboards/components/DeleteProvisionedFolderForm.test.tsx index f56e50bf023..0412efd0c18 100644 --- a/public/app/features/browse-dashboards/components/DeleteProvisionedFolderForm.test.tsx +++ b/public/app/features/browse-dashboards/components/DeleteProvisionedFolderForm.test.tsx @@ -2,7 +2,7 @@ import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { RepositoryView, useDeleteRepositoryFilesWithPathMutation } from 'app/api/clients/provisioning/v0alpha1'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; import { ProvisionedFolderFormDataResult, useProvisionedFolderFormData } from '../hooks/useProvisionedFolderFormData'; diff --git a/public/app/features/browse-dashboards/components/DeleteProvisionedFolderForm.tsx b/public/app/features/browse-dashboards/components/DeleteProvisionedFolderForm.tsx index 995f68bbd23..2b4a6ebb92f 100644 --- a/public/app/features/browse-dashboards/components/DeleteProvisionedFolderForm.tsx +++ b/public/app/features/browse-dashboards/components/DeleteProvisionedFolderForm.tsx @@ -10,7 +10,7 @@ import { RepositoryView, useDeleteRepositoryFilesWithPathMutation } from 'app/ap import { AnnoKeySourcePath } from 'app/features/apiserver/types'; import { ResourceEditFormSharedFields } from 'app/features/dashboard-scene/components/Provisioned/ResourceEditFormSharedFields'; import { BaseProvisionedFormData } from 'app/features/dashboard-scene/saving/shared'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; import { useProvisionedFolderFormData } from '../hooks/useProvisionedFolderFormData'; diff --git a/public/app/features/browse-dashboards/components/FolderActionsButton.tsx b/public/app/features/browse-dashboards/components/FolderActionsButton.tsx index d5cef0b3aa1..9640314aec9 100644 --- a/public/app/features/browse-dashboards/components/FolderActionsButton.tsx +++ b/public/app/features/browse-dashboards/components/FolderActionsButton.tsx @@ -5,8 +5,8 @@ import { config, locationService, reportInteraction } from '@grafana/runtime'; import { Button, Drawer, Dropdown, Icon, Menu, MenuItem } from '@grafana/ui'; import { Permissions } from 'app/core/components/AccessControl'; import { appEvents } from 'app/core/core'; -import { FolderDTO } from 'app/types'; import { ShowModalReactEvent } from 'app/types/events'; +import { FolderDTO } from 'app/types/folders'; import { ManagerKind } from '../../apiserver/types'; import { useDeleteFolderMutation, useMoveFolderMutation } from '../api/browseDashboardsAPI'; diff --git a/public/app/features/browse-dashboards/components/NewProvisionedFolderForm.test.tsx b/public/app/features/browse-dashboards/components/NewProvisionedFolderForm.test.tsx index e4c7527c079..a983a66ada0 100644 --- a/public/app/features/browse-dashboards/components/NewProvisionedFolderForm.test.tsx +++ b/public/app/features/browse-dashboards/components/NewProvisionedFolderForm.test.tsx @@ -6,8 +6,8 @@ import { getAppEvents } from '@grafana/runtime'; import { useCreateRepositoryFilesWithPathMutation } from 'app/api/clients/provisioning/v0alpha1'; import { validationSrv } from 'app/features/manage-dashboards/services/ValidationSrv'; import { usePullRequestParam } from 'app/features/provisioning/hooks/usePullRequestParam'; +import { FolderDTO } from 'app/types/folders'; -import { FolderDTO } from '../../../types'; import { ProvisionedFolderFormDataResult, useProvisionedFolderFormData } from '../hooks/useProvisionedFolderFormData'; import { NewProvisionedFolderForm } from './NewProvisionedFolderForm'; diff --git a/public/app/features/browse-dashboards/components/NewProvisionedFolderForm.tsx b/public/app/features/browse-dashboards/components/NewProvisionedFolderForm.tsx index 291696baeeb..f79cb371636 100644 --- a/public/app/features/browse-dashboards/components/NewProvisionedFolderForm.tsx +++ b/public/app/features/browse-dashboards/components/NewProvisionedFolderForm.tsx @@ -14,7 +14,7 @@ import { BaseProvisionedFormData } from 'app/features/dashboard-scene/saving/sha import { validationSrv } from 'app/features/manage-dashboards/services/ValidationSrv'; import { PROVISIONING_URL } from 'app/features/provisioning/constants'; import { usePullRequestParam } from 'app/features/provisioning/hooks/usePullRequestParam'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; import { useProvisionedFolderFormData } from '../hooks/useProvisionedFolderFormData'; interface FormProps extends Props { diff --git a/public/app/features/browse-dashboards/components/RecentlyDeletedActions.tsx b/public/app/features/browse-dashboards/components/RecentlyDeletedActions.tsx index 158c8d9fa71..18cc800213e 100644 --- a/public/app/features/browse-dashboards/components/RecentlyDeletedActions.tsx +++ b/public/app/features/browse-dashboards/components/RecentlyDeletedActions.tsx @@ -6,8 +6,8 @@ import { Button, Stack } from '@grafana/ui'; import appEvents from 'app/core/app_events'; import { AnnoKeyFolder } from 'app/features/apiserver/types'; import { GENERAL_FOLDER_UID } from 'app/features/search/constants'; -import { useDispatch } from 'app/types'; import { ShowModalReactEvent } from 'app/types/events'; +import { useDispatch } from 'app/types/store'; import { deletedDashboardsCache } from '../../search/service/deletedDashboardsCache'; import { useListDeletedDashboardsQuery, useRestoreDashboardMutation } from '../api/browseDashboardsAPI'; diff --git a/public/app/features/browse-dashboards/components/SearchView.tsx b/public/app/features/browse-dashboards/components/SearchView.tsx index 203d46a4307..281455f140e 100644 --- a/public/app/features/browse-dashboards/components/SearchView.tsx +++ b/public/app/features/browse-dashboards/components/SearchView.tsx @@ -7,7 +7,7 @@ import { useKeyNavigationListener } from 'app/features/search/hooks/useSearchKey import { SearchResultsProps, SearchResultsTable } from 'app/features/search/page/components/SearchResultsTable'; import { SearchStateManager } from 'app/features/search/state/SearchStateManager'; import { DashboardViewItemKind, SearchState } from 'app/features/search/types'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; import { useHasSelection } from '../state/hooks'; import { setAllSelection, setItemSelectionState } from '../state/slice'; diff --git a/public/app/features/browse-dashboards/fixtures/folder.fixture.ts b/public/app/features/browse-dashboards/fixtures/folder.fixture.ts index 14cb3a83652..bab54a40975 100644 --- a/public/app/features/browse-dashboards/fixtures/folder.fixture.ts +++ b/public/app/features/browse-dashboards/fixtures/folder.fixture.ts @@ -1,6 +1,6 @@ import { Chance } from 'chance'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; export function mockFolderDTO(seed = 1, partial?: Partial): FolderDTO { const random = Chance(seed); diff --git a/public/app/features/browse-dashboards/permissions.ts b/public/app/features/browse-dashboards/permissions.ts index 49eff8d69ff..d589af9480a 100644 --- a/public/app/features/browse-dashboards/permissions.ts +++ b/public/app/features/browse-dashboards/permissions.ts @@ -1,6 +1,7 @@ import { config } from '@grafana/runtime'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, FolderDTO } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { FolderDTO } from 'app/types/folders'; function checkFolderPermission(action: AccessControlAction, folderDTO?: FolderDTO) { return folderDTO ? contextSrv.hasPermissionInMetadata(action, folderDTO) : contextSrv.hasPermission(action); diff --git a/public/app/features/browse-dashboards/state/actions.ts b/public/app/features/browse-dashboards/state/actions.ts index 88073d0e518..f738493b342 100644 --- a/public/app/features/browse-dashboards/state/actions.ts +++ b/public/app/features/browse-dashboards/state/actions.ts @@ -1,6 +1,6 @@ import { GENERAL_FOLDER_UID } from 'app/features/search/constants'; import { DashboardViewItem, DashboardViewItemKind } from 'app/features/search/types'; -import { createAsyncThunk } from 'app/types'; +import { createAsyncThunk } from 'app/types/store'; import { listDashboards, listFolders, PAGE_SIZE } from '../api/services'; import { DashboardViewItemWithUIItems, UIDashboardViewItem } from '../types'; diff --git a/public/app/features/browse-dashboards/state/hooks.test.ts b/public/app/features/browse-dashboards/state/hooks.test.ts index 373a6c0a0f7..d5fd74b4bb0 100644 --- a/public/app/features/browse-dashboards/state/hooks.test.ts +++ b/public/app/features/browse-dashboards/state/hooks.test.ts @@ -1,13 +1,13 @@ import { configureStore } from 'app/store/configureStore'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { fullyLoadedViewItemCollection } from '../fixtures/state.fixtures'; import { BrowseDashboardsState } from '../types'; import { useBrowseLoadingStatus } from './hooks'; -jest.mock('app/types', () => { - const original = jest.requireActual('app/types'); +jest.mock('app/types/store', () => { + const original = jest.requireActual('app/types/store'); return { ...original, useSelector: jest.fn(), diff --git a/public/app/features/browse-dashboards/state/hooks.ts b/public/app/features/browse-dashboards/state/hooks.ts index d46f0b44708..2c0bee62a98 100644 --- a/public/app/features/browse-dashboards/state/hooks.ts +++ b/public/app/features/browse-dashboards/state/hooks.ts @@ -2,7 +2,7 @@ import { useCallback, useRef } from 'react'; import { createSelector } from 'reselect'; import { DashboardViewItem } from 'app/features/search/types'; -import { useSelector, StoreState, useDispatch } from 'app/types'; +import { useSelector, StoreState, useDispatch } from 'app/types/store'; import { PAGE_SIZE } from '../api/services'; import { isSharedWithMe } from '../components/utils'; diff --git a/public/app/features/commandPalette/actions/staticActions.ts b/public/app/features/commandPalette/actions/staticActions.ts index d3304f0db78..e7e8c8d6734 100644 --- a/public/app/features/commandPalette/actions/staticActions.ts +++ b/public/app/features/commandPalette/actions/staticActions.ts @@ -6,8 +6,8 @@ import { enrichHelpItem } from 'app/core/components/AppChrome/MegaMenu/utils'; import { performInviteUserClick, shouldRenderInviteUserButton } from 'app/core/components/InviteUserButton/utils'; import { changeTheme } from 'app/core/services/theme'; import { currentMockApiState, toggleMockApiAndReload, togglePseudoLocale } from 'app/dev-utils'; +import { useSelector } from 'app/types/store'; -import { useSelector } from '../../../types'; import { CommandPaletteAction } from '../types'; import { ACTIONS_PRIORITY, DEFAULT_PRIORITY, PREFERENCES_PRIORITY } from '../values'; diff --git a/public/app/features/connections/Connections.tsx b/public/app/features/connections/Connections.tsx index 5515e9bf96b..e4119a6bf3f 100644 --- a/public/app/features/connections/Connections.tsx +++ b/public/app/features/connections/Connections.tsx @@ -1,6 +1,6 @@ import { Navigate, Routes, Route, useLocation } from 'react-router-dom-v5-compat'; -import { StoreState, useSelector } from 'app/types'; +import { StoreState, useSelector } from 'app/types/store'; import { ROUTES } from './constants'; import { AddNewConnectionPage } from './pages/AddNewConnectionPage'; diff --git a/public/app/features/connections/components/ConnectionsRedirectNotice/ConnectionsRedirectNotice.tsx b/public/app/features/connections/components/ConnectionsRedirectNotice/ConnectionsRedirectNotice.tsx index f9bb04c72de..438868f7751 100644 --- a/public/app/features/connections/components/ConnectionsRedirectNotice/ConnectionsRedirectNotice.tsx +++ b/public/app/features/connections/components/ConnectionsRedirectNotice/ConnectionsRedirectNotice.tsx @@ -4,9 +4,9 @@ import { useState } from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { Alert, LinkButton, useStyles2 } from '@grafana/ui'; +import { AccessControlAction } from 'app/types/accessControl'; import { contextSrv } from '../../../../core/core'; -import { AccessControlAction } from '../../../../types'; import { ROUTES } from '../../constants'; const getStyles = (theme: GrafanaTheme2) => ({ diff --git a/public/app/features/connections/hooks/useDataSourceSettingsNav.ts b/public/app/features/connections/hooks/useDataSourceSettingsNav.ts index d5898d370d2..72c4a09059a 100644 --- a/public/app/features/connections/hooks/useDataSourceSettingsNav.ts +++ b/public/app/features/connections/hooks/useDataSourceSettingsNav.ts @@ -7,7 +7,7 @@ import { getNavModel } from 'app/core/selectors/navModel'; import { useDataSource, useDataSourceMeta, useDataSourceSettings } from 'app/features/datasources/state/hooks'; import { getDataSourceLoadingNav, buildNavModel, getDataSourceNav } from 'app/features/datasources/state/navModel'; import { useGetSingle } from 'app/features/plugins/admin/state/hooks'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; export function useDataSourceSettingsNav(pageIdParam?: string) { const { uid = '' } = useParams<{ uid: string }>(); diff --git a/public/app/features/connections/pages/DataSourceDetailsPage.tsx b/public/app/features/connections/pages/DataSourceDetailsPage.tsx index be345ee77ed..f7223abc418 100644 --- a/public/app/features/connections/pages/DataSourceDetailsPage.tsx +++ b/public/app/features/connections/pages/DataSourceDetailsPage.tsx @@ -3,7 +3,8 @@ import { useParams } from 'react-router-dom-v5-compat'; import { Trans, t } from '@grafana/i18n'; import { Alert, Badge, TextLink } from '@grafana/ui'; import { PluginDetailsPage } from 'app/features/plugins/admin/components/PluginDetailsPage'; -import { StoreState, useSelector, AppNotificationSeverity } from 'app/types'; +import { AppNotificationSeverity } from 'app/types/appNotifications'; +import { StoreState, useSelector } from 'app/types/store'; import { ROUTES } from '../constants'; diff --git a/public/app/features/connections/pages/DataSourcesListPage.tsx b/public/app/features/connections/pages/DataSourcesListPage.tsx index 5c67b07da24..7ec9062b1d7 100644 --- a/public/app/features/connections/pages/DataSourcesListPage.tsx +++ b/public/app/features/connections/pages/DataSourcesListPage.tsx @@ -3,7 +3,7 @@ import { AdvisorRedirectNotice } from 'app/features/connections/components/Advis import { DataSourceAddButton } from 'app/features/datasources/components/DataSourceAddButton'; import { DataSourcesList } from 'app/features/datasources/components/DataSourcesList'; import { getDataSourcesCount } from 'app/features/datasources/state/selectors'; -import { StoreState, useSelector } from 'app/types'; +import { StoreState, useSelector } from 'app/types/store'; export function DataSourcesListPage() { const dataSourcesCount = useSelector(({ dataSources }: StoreState) => getDataSourcesCount(dataSources)); diff --git a/public/app/features/connections/tabs/ConnectData/ConnectData.test.tsx b/public/app/features/connections/tabs/ConnectData/ConnectData.test.tsx index 0215b463ca9..a4dabd2bbf9 100644 --- a/public/app/features/connections/tabs/ConnectData/ConnectData.test.tsx +++ b/public/app/features/connections/tabs/ConnectData/ConnectData.test.tsx @@ -7,7 +7,7 @@ import { locationService } from '@grafana/runtime'; import { contextSrv } from 'app/core/core'; import { getCatalogPluginMock, getPluginsStateMock } from 'app/features/plugins/admin/mocks/mockHelpers'; import { CatalogPlugin } from 'app/features/plugins/admin/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { AddNewConnection } from './ConnectData'; diff --git a/public/app/features/connections/tabs/ConnectData/ConnectData.tsx b/public/app/features/connections/tabs/ConnectData/ConnectData.tsx index 30f0464b7ce..3668047af9f 100644 --- a/public/app/features/connections/tabs/ConnectData/ConnectData.tsx +++ b/public/app/features/connections/tabs/ConnectData/ConnectData.tsx @@ -14,7 +14,7 @@ import { SearchField } from 'app/features/plugins/admin/components/SearchField'; import { Sorters } from 'app/features/plugins/admin/helpers'; import { useHistory } from 'app/features/plugins/admin/hooks/useHistory'; import { useGetAll, useIsRemotePluginsAvailable } from 'app/features/plugins/admin/state/hooks'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { ROUTES } from '../../constants'; diff --git a/public/app/features/correlations/CorrelationsPage.tsx b/public/app/features/correlations/CorrelationsPage.tsx index bab13964ae6..60ce5a5b166 100644 --- a/public/app/features/correlations/CorrelationsPage.tsx +++ b/public/app/features/correlations/CorrelationsPage.tsx @@ -22,7 +22,7 @@ import { import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/core'; import { useNavModel } from 'app/core/hooks/useNavModel'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { AddCorrelationForm } from './Forms/AddCorrelationForm'; import { EditCorrelationForm } from './Forms/EditCorrelationForm'; diff --git a/public/app/features/correlations/utils.ts b/public/app/features/correlations/utils.ts index 1a6f97157da..37c81fc6728 100644 --- a/public/app/features/correlations/utils.ts +++ b/public/app/features/correlations/utils.ts @@ -9,7 +9,7 @@ import { getBackendSrv, getDataSourceSrv, } from '@grafana/runtime'; -import { ExploreItemState } from 'app/types'; +import { ExploreItemState } from 'app/types/explore'; import { formatValueName } from '../explore/PrometheusListView/ItemLabels'; import { parseLogsFrame } from '../logs/logsFrame'; diff --git a/public/app/features/dashboard-scene/addToDashboard/AddToDashboardForm.tsx b/public/app/features/dashboard-scene/addToDashboard/AddToDashboardForm.tsx index d437e1308ce..17ecf87eb8f 100644 --- a/public/app/features/dashboard-scene/addToDashboard/AddToDashboardForm.tsx +++ b/public/app/features/dashboard-scene/addToDashboard/AddToDashboardForm.tsx @@ -9,7 +9,7 @@ import { Panel } from '@grafana/schema'; import { Alert, Button, Field, Modal, RadioButtonGroup } from '@grafana/ui'; import { DashboardPicker } from 'app/core/components/Select/DashboardPicker'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { addToDashboard, SubmissionError } from './addToDashboard'; diff --git a/public/app/features/dashboard-scene/addToDashboard/addPanelsOnLoadBehavior.ts b/public/app/features/dashboard-scene/addToDashboard/addPanelsOnLoadBehavior.ts index 7cad2fc7c3d..90afde16cd4 100644 --- a/public/app/features/dashboard-scene/addToDashboard/addPanelsOnLoadBehavior.ts +++ b/public/app/features/dashboard-scene/addToDashboard/addPanelsOnLoadBehavior.ts @@ -1,7 +1,7 @@ import { SceneTimeRange } from '@grafana/scenes'; import store from 'app/core/store'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; -import { DASHBOARD_FROM_LS_KEY, DashboardDTO } from 'app/types'; +import { DASHBOARD_FROM_LS_KEY, DashboardDTO } from 'app/types/dashboard'; import { DashboardScene } from '../scene/DashboardScene'; import { buildGridItemForPanel } from '../serialization/transformSaveModelToScene'; diff --git a/public/app/features/dashboard-scene/addToDashboard/addToDashboard.ts b/public/app/features/dashboard-scene/addToDashboard/addToDashboard.ts index e0f929c6f2e..e22feb9a502 100644 --- a/public/app/features/dashboard-scene/addToDashboard/addToDashboard.ts +++ b/public/app/features/dashboard-scene/addToDashboard/addToDashboard.ts @@ -4,7 +4,7 @@ import { config, locationService } from '@grafana/runtime'; import { Panel } from '@grafana/schema'; import store from 'app/core/store'; import { DASHBOARD_SCHEMA_VERSION } from 'app/features/dashboard/state/DashboardMigrator'; -import { DASHBOARD_FROM_LS_KEY, DashboardDTO } from 'app/types'; +import { DASHBOARD_FROM_LS_KEY, DashboardDTO } from 'app/types/dashboard'; export enum GenericError { UNKNOWN = 'unknown-error', diff --git a/public/app/features/dashboard-scene/embedding/EmbeddedDashboard.tsx b/public/app/features/dashboard-scene/embedding/EmbeddedDashboard.tsx index 90b1524c1d2..ae55db117d0 100644 --- a/public/app/features/dashboard-scene/embedding/EmbeddedDashboard.tsx +++ b/public/app/features/dashboard-scene/embedding/EmbeddedDashboard.tsx @@ -7,7 +7,7 @@ import { EmbeddedDashboardProps } from '@grafana/runtime'; import { SceneObjectStateChangedEvent, sceneUtils } from '@grafana/scenes'; import { Spinner, Alert, useStyles2 } from '@grafana/ui'; import { getMessageFromError } from 'app/core/utils/errors'; -import { DashboardRoutes } from 'app/types'; +import { DashboardRoutes } from 'app/types/dashboard'; import { getDashboardScenePageStateManager } from '../pages/DashboardScenePageStateManager'; import { DashboardScene } from '../scene/DashboardScene'; diff --git a/public/app/features/dashboard-scene/inspect/HelpWizard/HelpWizard.tsx b/public/app/features/dashboard-scene/inspect/HelpWizard/HelpWizard.tsx index e6a1c1ffbf4..cab5eaf608c 100644 --- a/public/app/features/dashboard-scene/inspect/HelpWizard/HelpWizard.tsx +++ b/public/app/features/dashboard-scene/inspect/HelpWizard/HelpWizard.tsx @@ -24,7 +24,7 @@ import { TextLink, } from '@grafana/ui'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { ShowMessage, SnapshotTab, SupportSnapshotService } from './SupportSnapshotService'; diff --git a/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx b/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx index b2776dc9414..016e72010bf 100644 --- a/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx +++ b/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx @@ -15,7 +15,7 @@ import { getRouteComponentProps } from 'app/core/navigation/mocks/routeProps'; import { GrafanaRouteComponentProps } from 'app/core/navigation/types'; import store from 'app/core/store'; import { DashboardLoaderSrv, setDashboardLoaderSrv } from 'app/features/dashboard/services/DashboardLoaderSrv'; -import { DASHBOARD_FROM_LS_KEY, DashboardRoutes } from 'app/types'; +import { DASHBOARD_FROM_LS_KEY, DashboardRoutes } from 'app/types/dashboard'; import { dashboardSceneGraph } from '../utils/dashboardSceneGraph'; import { setupLoadDashboardMockReject, setupLoadDashboardRuntimeErrorMock } from '../utils/test-utils'; diff --git a/public/app/features/dashboard-scene/pages/DashboardScenePage.tsx b/public/app/features/dashboard-scene/pages/DashboardScenePage.tsx index bcdcff100ec..ef1ec38b653 100644 --- a/public/app/features/dashboard-scene/pages/DashboardScenePage.tsx +++ b/public/app/features/dashboard-scene/pages/DashboardScenePage.tsx @@ -11,7 +11,7 @@ import PageLoader from 'app/core/components/PageLoader/PageLoader'; import { GrafanaRouteComponentProps } from 'app/core/navigation/types'; import { DashboardPageError } from 'app/features/dashboard/containers/DashboardPageError'; import { DashboardPageRouteParams, DashboardPageRouteSearchParams } from 'app/features/dashboard/containers/types'; -import { DashboardRoutes } from 'app/types'; +import { DashboardRoutes } from 'app/types/dashboard'; import { DashboardPrompt } from '../saving/DashboardPrompt'; import { DashboardPreviewBanner } from '../saving/provisioned/DashboardPreviewBanner'; diff --git a/public/app/features/dashboard-scene/pages/DashboardScenePageStateManager.test.ts b/public/app/features/dashboard-scene/pages/DashboardScenePageStateManager.test.ts index a38fe4fb66f..1b971c981ee 100644 --- a/public/app/features/dashboard-scene/pages/DashboardScenePageStateManager.test.ts +++ b/public/app/features/dashboard-scene/pages/DashboardScenePageStateManager.test.ts @@ -14,7 +14,7 @@ import { setDashboardLoaderSrv, } from 'app/features/dashboard/services/DashboardLoaderSrv'; import { getDashboardSnapshotSrv } from 'app/features/dashboard/services/SnapshotSrv'; -import { DASHBOARD_FROM_LS_KEY, DashboardDataDTO, DashboardDTO, DashboardRoutes } from 'app/types'; +import { DASHBOARD_FROM_LS_KEY, DashboardDataDTO, DashboardDTO, DashboardRoutes } from 'app/types/dashboard'; import { DashboardScene } from '../scene/DashboardScene'; import { setupLoadDashboardMock, setupLoadDashboardMockReject } from '../utils/test-utils'; diff --git a/public/app/features/dashboard-scene/pages/DashboardScenePageStateManager.ts b/public/app/features/dashboard-scene/pages/DashboardScenePageStateManager.ts index e6c2cb3e0a8..1039767ed95 100644 --- a/public/app/features/dashboard-scene/pages/DashboardScenePageStateManager.ts +++ b/public/app/features/dashboard-scene/pages/DashboardScenePageStateManager.ts @@ -27,7 +27,7 @@ import { DashboardRoutes, HomeDashboardRedirectDTO, isRedirectResponse, -} from 'app/types'; +} from 'app/types/dashboard'; import { PanelEditor } from '../panel-edit/PanelEditor'; import { DashboardScene } from '../scene/DashboardScene'; diff --git a/public/app/features/dashboard-scene/pages/PublicDashboardScenePage.tsx b/public/app/features/dashboard-scene/pages/PublicDashboardScenePage.tsx index f7c88b2815a..07bcf478336 100644 --- a/public/app/features/dashboard-scene/pages/PublicDashboardScenePage.tsx +++ b/public/app/features/dashboard-scene/pages/PublicDashboardScenePage.tsx @@ -16,7 +16,7 @@ import { PublicDashboardPageRouteParams, PublicDashboardPageRouteSearchParams, } from 'app/features/dashboard/containers/types'; -import { AppNotificationSeverity } from 'app/types'; +import { AppNotificationSeverity } from 'app/types/appNotifications'; import { DashboardRoutes } from 'app/types/dashboard'; import { DashboardScene } from '../scene/DashboardScene'; 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 7f2b930b208..06573cc06ef 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 @@ -25,7 +25,8 @@ import { DataSourceType, GRAFANA_RULES_SOURCE_NAME } from 'app/features/alerting import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { configureStore } from 'app/store/configureStore'; -import { AccessControlAction, DashboardDataDTO } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { DashboardDataDTO } from 'app/types/dashboard'; import { AlertQuery, PromRulesResponse } from 'app/types/unified-alerting-dto'; import { createDashboardSceneFromDashboardModel } from '../../serialization/transformSaveModelToScene'; diff --git a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.test.tsx b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.test.tsx index c76896c4afd..241b37165b5 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.test.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.test.tsx @@ -22,7 +22,7 @@ import { config, locationService } from '@grafana/runtime'; import { PANEL_EDIT_LAST_USED_DATASOURCE } from 'app/features/dashboard/utils/dashboard'; import { InspectTab } from 'app/features/inspector/types'; import { SHARED_DASHBOARD_QUERY, DASHBOARD_DATASOURCE_PLUGIN_ID } from 'app/plugins/datasource/dashboard/constants'; -import { DashboardDataDTO } from 'app/types'; +import { DashboardDataDTO } from 'app/types/dashboard'; import { PanelTimeRange, PanelTimeRangeState } from '../../scene/PanelTimeRange'; import { transformSaveModelToScene } from '../../serialization/transformSaveModelToScene'; diff --git a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx index 19a1e3af6c5..ce2784758be 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx @@ -26,7 +26,7 @@ import { QueryEditorRows } from 'app/features/query/components/QueryEditorRows'; import { QueryGroupTopSection } from 'app/features/query/components/QueryGroup'; import { updateQueries } from 'app/features/query/state/updateQueries'; import { isSharedDashboardQuery } from 'app/plugins/datasource/dashboard/runSharedRequest'; -import { QueryGroupOptions } from 'app/types'; +import { QueryGroupOptions } from 'app/types/query'; import { MIXED_DATASOURCE_NAME } from '../../../../plugins/datasource/mixed/MixedDataSource'; import { useQueryLibraryContext } from '../../../explore/QueryLibrary/QueryLibraryContext'; diff --git a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataTransformationsTab.test.tsx b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataTransformationsTab.test.tsx index 7ff6453297a..e06b9fc6da2 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataTransformationsTab.test.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataTransformationsTab.test.tsx @@ -14,7 +14,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { SceneDataTransformer, SceneQueryRunner } from '@grafana/scenes'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; import { getStandardTransformers } from 'app/features/transformers/standardTransformers'; -import { DashboardDataDTO } from 'app/types'; +import { DashboardDataDTO } from 'app/types/dashboard'; import { transformSaveModelToScene } from '../../serialization/transformSaveModelToScene'; import { DashboardModelCompatibilityWrapper } from '../../utils/DashboardModelCompatibilityWrapper'; diff --git a/public/app/features/dashboard-scene/saving/SaveDashboardDrawer.test.tsx b/public/app/features/dashboard-scene/saving/SaveDashboardDrawer.test.tsx index d78b4971bfe..dd4d6734919 100644 --- a/public/app/features/dashboard-scene/saving/SaveDashboardDrawer.test.tsx +++ b/public/app/features/dashboard-scene/saving/SaveDashboardDrawer.test.tsx @@ -6,7 +6,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { config } from '@grafana/runtime'; import { sceneGraph, SceneRefreshPicker } from '@grafana/scenes'; import { AnnoKeyManagerKind, ManagerKind } from 'app/features/apiserver/types'; -import { SaveDashboardResponseDTO } from 'app/types'; +import { SaveDashboardResponseDTO } from 'app/types/dashboard'; import { DashboardSceneState } from '../scene/DashboardScene'; import { transformSaveModelToScene } from '../serialization/transformSaveModelToScene'; diff --git a/public/app/features/dashboard-scene/saving/getDashboardChanges.ts b/public/app/features/dashboard-scene/saving/getDashboardChanges.ts index b47c88473ef..17ef35baa60 100644 --- a/public/app/features/dashboard-scene/saving/getDashboardChanges.ts +++ b/public/app/features/dashboard-scene/saving/getDashboardChanges.ts @@ -10,7 +10,7 @@ import { } from '@grafana/schema/dist/esm/schema/dashboard/v2alpha1/types.spec.gen'; import { ResponseTransformers } from 'app/features/dashboard/api/ResponseTransformers'; import { isDashboardV2Spec } from 'app/features/dashboard/api/utils'; -import { DashboardDataDTO, DashboardDTO } from 'app/types'; +import { DashboardDataDTO, DashboardDTO } from 'app/types/dashboard'; import { validateFiltersOrigin } from '../serialization/sceneVariablesSetToVariables'; import { jsonDiff } from '../settings/version-history/utils'; diff --git a/public/app/features/dashboard-scene/saving/provisioned/DashboardPreviewBanner.tsx b/public/app/features/dashboard-scene/saving/provisioned/DashboardPreviewBanner.tsx index ee306bad2f9..f44552cbd69 100644 --- a/public/app/features/dashboard-scene/saving/provisioned/DashboardPreviewBanner.tsx +++ b/public/app/features/dashboard-scene/saving/provisioned/DashboardPreviewBanner.tsx @@ -4,7 +4,7 @@ import { Alert } from '@grafana/ui'; import { useGetRepositoryFilesWithPathQuery } from 'app/api/clients/provisioning/v0alpha1'; import { DashboardPageRouteSearchParams } from 'app/features/dashboard/containers/types'; import { usePullRequestParam } from 'app/features/provisioning/hooks/usePullRequestParam'; -import { DashboardRoutes } from 'app/types'; +import { DashboardRoutes } from 'app/types/dashboard'; import { PreviewBannerViewPR } from './PreviewBannerViewPR'; diff --git a/public/app/features/dashboard-scene/saving/provisioned/hooks.ts b/public/app/features/dashboard-scene/saving/provisioned/hooks.ts index a274c9c7f88..e82ebcee548 100644 --- a/public/app/features/dashboard-scene/saving/provisioned/hooks.ts +++ b/public/app/features/dashboard-scene/saving/provisioned/hooks.ts @@ -4,7 +4,7 @@ import { RepositoryView } from 'app/api/clients/provisioning/v0alpha1'; import { useUrlParams } from 'app/core/navigation/hooks'; import { AnnoKeyManagerIdentity, AnnoKeyManagerKind, AnnoKeySourcePath } from 'app/features/apiserver/types'; import { useGetResourceRepositoryView } from 'app/features/provisioning/hooks/useGetResourceRepositoryView'; -import { DashboardMeta } from 'app/types'; +import { DashboardMeta } from 'app/types/dashboard'; import { DashboardScene } from '../../scene/DashboardScene'; import { ProvisionedDashboardFormData } from '../shared'; diff --git a/public/app/features/dashboard-scene/saving/useSaveDashboard.ts b/public/app/features/dashboard-scene/saving/useSaveDashboard.ts index 97a50aa3621..8f75ecf0751 100644 --- a/public/app/features/dashboard-scene/saving/useSaveDashboard.ts +++ b/public/app/features/dashboard-scene/saving/useSaveDashboard.ts @@ -10,8 +10,8 @@ import { useAppNotification } from 'app/core/copy/appNotification'; import { updateDashboardName } from 'app/core/reducers/navBarTree'; import { useSaveDashboardMutation } from 'app/features/browse-dashboards/api/browseDashboardsAPI'; import { SaveDashboardAsOptions, SaveDashboardOptions } from 'app/features/dashboard/components/SaveDashboard/types'; -import { useDispatch } from 'app/types'; import { DashboardSavedEvent } from 'app/types/events'; +import { useDispatch } from 'app/types/store'; import { updateDashboardUidLastUsedDatasource } from '../../dashboard/utils/dashboard'; import { DashboardScene } from '../scene/DashboardScene'; diff --git a/public/app/features/dashboard-scene/scene/AlertStatesDataLayer.ts b/public/app/features/dashboard-scene/scene/AlertStatesDataLayer.ts index 643ea0ac56f..f939f4a2a24 100644 --- a/public/app/features/dashboard-scene/scene/AlertStatesDataLayer.ts +++ b/public/app/features/dashboard-scene/scene/AlertStatesDataLayer.ts @@ -19,7 +19,7 @@ import { Annotation } from 'app/features/alerting/unified/utils/constants'; import { GRAFANA_RULES_SOURCE_NAME } from 'app/features/alerting/unified/utils/datasource'; import { prometheusRuleType } from 'app/features/alerting/unified/utils/rules'; import { dispatch } from 'app/store/store'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { RuleNamespace } from 'app/types/unified-alerting'; import { PromAlertingRuleState, PromRuleGroupDTO } from 'app/types/unified-alerting-dto'; diff --git a/public/app/features/dashboard-scene/scene/DashboardScene.tsx b/public/app/features/dashboard-scene/scene/DashboardScene.tsx index 2d5a2901b06..46e67142648 100644 --- a/public/app/features/dashboard-scene/scene/DashboardScene.tsx +++ b/public/app/features/dashboard-scene/scene/DashboardScene.tsx @@ -31,7 +31,7 @@ import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { dashboardWatcher } from 'app/features/live/dashboard/dashboardWatcher'; import { DashboardJson } from 'app/features/manage-dashboards/types'; import { VariablesChanged } from 'app/features/variables/types'; -import { DashboardDTO, DashboardMeta, KioskMode, SaveDashboardResponseDTO } from 'app/types'; +import { DashboardMeta, KioskMode, SaveDashboardResponseDTO, DashboardDTO } from 'app/types/dashboard'; import { ShowConfirmModalEvent } from 'app/types/events'; import { diff --git a/public/app/features/dashboard-scene/scene/DashboardSceneRenderer.tsx b/public/app/features/dashboard-scene/scene/DashboardSceneRenderer.tsx index bd300a5bbd3..19a6916552c 100644 --- a/public/app/features/dashboard-scene/scene/DashboardSceneRenderer.tsx +++ b/public/app/features/dashboard-scene/scene/DashboardSceneRenderer.tsx @@ -6,7 +6,7 @@ import { ScopesContext } from '@grafana/runtime'; import { SceneComponentProps } from '@grafana/scenes'; import { Page } from 'app/core/components/Page/Page'; import { getNavModel } from 'app/core/selectors/navModel'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { DashboardEditPaneSplitter } from '../edit-pane/DashboardEditPaneSplitter'; diff --git a/public/app/features/dashboard-scene/scene/DashboardSceneUrlSync.test.ts b/public/app/features/dashboard-scene/scene/DashboardSceneUrlSync.test.ts index 4a7e9fca190..9dbd47cf919 100644 --- a/public/app/features/dashboard-scene/scene/DashboardSceneUrlSync.test.ts +++ b/public/app/features/dashboard-scene/scene/DashboardSceneUrlSync.test.ts @@ -1,7 +1,7 @@ import { AppEvents } from '@grafana/data'; import { SceneQueryRunner, VizPanel } from '@grafana/scenes'; import appEvents from 'app/core/app_events'; -import { KioskMode } from 'app/types'; +import { KioskMode } from 'app/types/dashboard'; import { getCloneKey } from '../utils/clone'; diff --git a/public/app/features/dashboard-scene/scene/DashboardSceneUrlSync.ts b/public/app/features/dashboard-scene/scene/DashboardSceneUrlSync.ts index 1740fe87c8a..3d9acceed0b 100644 --- a/public/app/features/dashboard-scene/scene/DashboardSceneUrlSync.ts +++ b/public/app/features/dashboard-scene/scene/DashboardSceneUrlSync.ts @@ -5,7 +5,7 @@ import { config, locationService } from '@grafana/runtime'; import { SceneObjectUrlSyncHandler, SceneObjectUrlValues, VizPanel } from '@grafana/scenes'; import appEvents from 'app/core/app_events'; import { contextSrv } from 'app/core/core'; -import { KioskMode } from 'app/types'; +import { KioskMode } from 'app/types/dashboard'; import { PanelInspectDrawer } from '../inspect/PanelInspectDrawer'; import { buildPanelEditScene } from '../panel-edit/PanelEditor'; diff --git a/public/app/features/dashboard-scene/scene/ManagedDashboardNavBarBadge.tsx b/public/app/features/dashboard-scene/scene/ManagedDashboardNavBarBadge.tsx index 3e6761dfed0..fe025098988 100644 --- a/public/app/features/dashboard-scene/scene/ManagedDashboardNavBarBadge.tsx +++ b/public/app/features/dashboard-scene/scene/ManagedDashboardNavBarBadge.tsx @@ -1,6 +1,6 @@ import { Badge } from '@grafana/ui'; import { AnnoKeyManagerIdentity, AnnoKeyManagerKind, ManagerKind } from 'app/features/apiserver/types'; -import { DashboardMeta } from 'app/types'; +import { DashboardMeta } from 'app/types/dashboard'; export default function ManagedDashboardNavBarBadge({ meta }: { meta: DashboardMeta }) { const obj = meta.k8s; diff --git a/public/app/features/dashboard-scene/scene/NavToolbarActions.test.tsx b/public/app/features/dashboard-scene/scene/NavToolbarActions.test.tsx index abca5175425..3a6e2f7935c 100644 --- a/public/app/features/dashboard-scene/scene/NavToolbarActions.test.tsx +++ b/public/app/features/dashboard-scene/scene/NavToolbarActions.test.tsx @@ -7,7 +7,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { LocationServiceProvider, config, locationService } from '@grafana/runtime'; import { SceneQueryRunner, SceneTimeRange, UrlSyncContextProvider, VizPanel } from '@grafana/scenes'; import { playlistSrv } from 'app/features/playlist/PlaylistSrv'; -import { DashboardMeta } from 'app/types'; +import { DashboardMeta } from 'app/types/dashboard'; import { buildPanelEditScene } from '../panel-edit/PanelEditor'; diff --git a/public/app/features/dashboard-scene/scene/NavToolbarActions.tsx b/public/app/features/dashboard-scene/scene/NavToolbarActions.tsx index 2e36a248586..49b4a3c9f53 100644 --- a/public/app/features/dashboard-scene/scene/NavToolbarActions.tsx +++ b/public/app/features/dashboard-scene/scene/NavToolbarActions.tsx @@ -13,7 +13,7 @@ import { LS_PANEL_COPY_KEY } from 'app/core/constants'; import { contextSrv } from 'app/core/core'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; import { playlistSrv } from 'app/features/playlist/PlaylistSrv'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { shareDashboardType } from '../../dashboard/components/ShareModal/utils'; import { selectFolderRepository } from '../../provisioning/utils/selectors'; diff --git a/public/app/features/dashboard-scene/scene/PanelMenuBehavior.test.tsx b/public/app/features/dashboard-scene/scene/PanelMenuBehavior.test.tsx index 998541edf80..10191b32a58 100644 --- a/public/app/features/dashboard-scene/scene/PanelMenuBehavior.test.tsx +++ b/public/app/features/dashboard-scene/scene/PanelMenuBehavior.test.tsx @@ -23,7 +23,7 @@ import { GetExploreUrlArguments } from 'app/core/utils/explore'; import { grantUserPermissions } from 'app/features/alerting/unified/mocks'; import { scenesPanelToRuleFormValues } from 'app/features/alerting/unified/utils/rule-form'; import * as storeModule from 'app/store/store'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { buildPanelEditScene } from '../panel-edit/PanelEditor'; diff --git a/public/app/features/dashboard-scene/scene/PanelMenuBehavior.tsx b/public/app/features/dashboard-scene/scene/PanelMenuBehavior.tsx index 8b07ede1cb8..d10b2ab5b65 100644 --- a/public/app/features/dashboard-scene/scene/PanelMenuBehavior.tsx +++ b/public/app/features/dashboard-scene/scene/PanelMenuBehavior.tsx @@ -29,7 +29,7 @@ import { pluginExtensionRegistries } from 'app/features/plugins/extensions/regis import { GetPluginExtensions } from 'app/features/plugins/extensions/types'; import { createExtensionSubMenu } from 'app/features/plugins/extensions/utils'; import { dispatch } from 'app/store/store'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { ShowConfirmModalEvent } from 'app/types/events'; import { ShareDrawer } from '../sharing/ShareDrawer/ShareDrawer'; diff --git a/public/app/features/dashboard-scene/scene/keyboardShortcuts.ts b/public/app/features/dashboard-scene/scene/keyboardShortcuts.ts index cde032a413e..0d7ad8f85a8 100644 --- a/public/app/features/dashboard-scene/scene/keyboardShortcuts.ts +++ b/public/app/features/dashboard-scene/scene/keyboardShortcuts.ts @@ -4,7 +4,7 @@ import { sceneGraph, VizPanel } from '@grafana/scenes'; import appEvents from 'app/core/app_events'; import { KeybindingSet } from 'app/core/services/KeybindingSet'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { shareDashboardType } from '../../dashboard/components/ShareModal/utils'; import { ShareDrawer } from '../sharing/ShareDrawer/ShareDrawer'; diff --git a/public/app/features/dashboard-scene/serialization/DashboardSceneSerializer.ts b/public/app/features/dashboard-scene/serialization/DashboardSceneSerializer.ts index e96284c1008..9e73bed659e 100644 --- a/public/app/features/dashboard-scene/serialization/DashboardSceneSerializer.ts +++ b/public/app/features/dashboard-scene/serialization/DashboardSceneSerializer.ts @@ -12,7 +12,7 @@ import { getV2SchemaVariables, } from 'app/features/dashboard/utils/tracking'; import { DashboardJson } from 'app/features/manage-dashboards/types'; -import { DashboardMeta, SaveDashboardResponseDTO } from 'app/types'; +import { DashboardMeta, SaveDashboardResponseDTO } from 'app/types/dashboard'; import { getRawDashboardChanges, getRawDashboardV2Changes } from '../saving/getDashboardChanges'; import { DashboardChangeInfo } from '../saving/shared'; diff --git a/public/app/features/dashboard-scene/serialization/buildNewDashboardSaveModel.ts b/public/app/features/dashboard-scene/serialization/buildNewDashboardSaveModel.ts index 705ab15ddee..436563c8379 100644 --- a/public/app/features/dashboard-scene/serialization/buildNewDashboardSaveModel.ts +++ b/public/app/features/dashboard-scene/serialization/buildNewDashboardSaveModel.ts @@ -13,7 +13,7 @@ import { import { AnnoKeyFolder } from 'app/features/apiserver/types'; import { DashboardWithAccessInfo } from 'app/features/dashboard/api/types'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; -import { DashboardDTO } from 'app/types'; +import { DashboardDTO } from 'app/types/dashboard'; export async function buildNewDashboardSaveModel(urlFolderUid?: string): Promise { let variablesList = defaultDashboard.templating?.list; diff --git a/public/app/features/dashboard-scene/serialization/transformSaveModelSchemaV2ToScene.ts b/public/app/features/dashboard-scene/serialization/transformSaveModelSchemaV2ToScene.ts index f37598bb45e..12f14fee511 100644 --- a/public/app/features/dashboard-scene/serialization/transformSaveModelSchemaV2ToScene.ts +++ b/public/app/features/dashboard-scene/serialization/transformSaveModelSchemaV2ToScene.ts @@ -51,7 +51,7 @@ import { DeprecatedInternalId, } from 'app/features/apiserver/types'; import { DashboardWithAccessInfo } from 'app/features/dashboard/api/types'; -import { DashboardMeta } from 'app/types'; +import { DashboardMeta } from 'app/types/dashboard'; import { addPanelsOnLoadBehavior } from '../addToDashboard/addPanelsOnLoadBehavior'; import { DashboardAnnotationsDataLayer } from '../scene/DashboardAnnotationsDataLayer'; diff --git a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts index cc1e2ee2ec1..ef03bdd17ee 100644 --- a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts +++ b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts @@ -25,7 +25,7 @@ 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, DASHBOARD_DATASOURCE_PLUGIN_ID } from 'app/plugins/datasource/dashboard/constants'; -import { DashboardDataDTO } from 'app/types'; +import { DashboardDataDTO } from 'app/types/dashboard'; import { DashboardDataLayerSet } from '../scene/DashboardDataLayerSet'; import { LibraryPanelBehavior } from '../scene/LibraryPanelBehavior'; diff --git a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts index 2c51bee4427..2936ccfcf49 100644 --- a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts +++ b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts @@ -25,7 +25,7 @@ import { contextSrv } from 'app/core/core'; import { K8S_V1_DASHBOARD_API_CONFIG } from 'app/features/dashboard/api/v1'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; -import { DashboardDTO, DashboardDataDTO } from 'app/types'; +import { DashboardDTO, DashboardDataDTO } from 'app/types/dashboard'; import { addPanelsOnLoadBehavior } from '../addToDashboard/addPanelsOnLoadBehavior'; import { AlertStatesDataLayer } from '../scene/AlertStatesDataLayer'; diff --git a/public/app/features/dashboard-scene/serialization/transformSceneToSaveModel.test.ts b/public/app/features/dashboard-scene/serialization/transformSceneToSaveModel.test.ts index 9b6ec578234..9d4fbea9aa2 100644 --- a/public/app/features/dashboard-scene/serialization/transformSceneToSaveModel.test.ts +++ b/public/app/features/dashboard-scene/serialization/transformSceneToSaveModel.test.ts @@ -21,7 +21,7 @@ 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/constants'; -import { DashboardDataDTO } from 'app/types'; +import { DashboardDataDTO } from 'app/types/dashboard'; import { DashboardDataLayerSet } from '../scene/DashboardDataLayerSet'; import { LibraryPanelBehavior } from '../scene/LibraryPanelBehavior'; diff --git a/public/app/features/dashboard-scene/settings/JsonModelEditView.tsx b/public/app/features/dashboard-scene/settings/JsonModelEditView.tsx index 803068b979d..c6b40b81ff0 100644 --- a/public/app/features/dashboard-scene/settings/JsonModelEditView.tsx +++ b/public/app/features/dashboard-scene/settings/JsonModelEditView.tsx @@ -11,7 +11,7 @@ import { Page } from 'app/core/components/Page/Page'; import { getDashboardAPI } from 'app/features/dashboard/api/dashboard_api'; import { isDashboardV2Spec } from 'app/features/dashboard/api/utils'; import { getPrettyJSON } from 'app/features/inspector/utils/utils'; -import { DashboardDataDTO, SaveDashboardResponseDTO } from 'app/types'; +import { DashboardDataDTO, SaveDashboardResponseDTO } from 'app/types/dashboard'; import { NameAlreadyExistsError, diff --git a/public/app/features/dashboard-scene/settings/PermissionsEditView.tsx b/public/app/features/dashboard-scene/settings/PermissionsEditView.tsx index 5dfa1a49659..d438ff9e694 100644 --- a/public/app/features/dashboard-scene/settings/PermissionsEditView.tsx +++ b/public/app/features/dashboard-scene/settings/PermissionsEditView.tsx @@ -3,7 +3,7 @@ import { SceneComponentProps, SceneObjectBase } from '@grafana/scenes'; import { Permissions } from 'app/core/components/AccessControl'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { DashboardScene } from '../scene/DashboardScene'; import { NavToolbarActions } from '../scene/NavToolbarActions'; diff --git a/public/app/features/dashboard-scene/settings/utils.ts b/public/app/features/dashboard-scene/settings/utils.ts index 907612875c8..88011f08b00 100644 --- a/public/app/features/dashboard-scene/settings/utils.ts +++ b/public/app/features/dashboard-scene/settings/utils.ts @@ -5,7 +5,8 @@ import { t } from '@grafana/i18n'; import { SceneObject, SceneObjectState } from '@grafana/scenes'; import { contextSrv } from 'app/core/core'; import { getNavModel } from 'app/core/selectors/navModel'; -import { AccessControlAction, useSelector } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { useSelector } from 'app/types/store'; import { DashboardScene } from '../scene/DashboardScene'; diff --git a/public/app/features/dashboard-scene/sharing/ShareButton/ShareMenu.test.tsx b/public/app/features/dashboard-scene/sharing/ShareButton/ShareMenu.test.tsx index 91439fe662a..c049579fb38 100644 --- a/public/app/features/dashboard-scene/sharing/ShareButton/ShareMenu.test.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareButton/ShareMenu.test.tsx @@ -3,9 +3,9 @@ import { render, screen } from '@testing-library/react'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors'; import { SceneTimeRange, VizPanel } from '@grafana/scenes'; import { contextSrv } from 'app/core/services/context_srv'; +import { AccessControlAction } from 'app/types/accessControl'; import { config } from '../../../../core/config'; -import { AccessControlAction } from '../../../../types'; import { grantUserPermissions } from '../../../alerting/unified/mocks'; import { DashboardScene, DashboardSceneState } from '../../scene/DashboardScene'; import { DefaultGridLayoutManager } from '../../scene/layout-default/DefaultGridLayoutManager'; diff --git a/public/app/features/dashboard-scene/sharing/ShareButton/ShareMenu.tsx b/public/app/features/dashboard-scene/sharing/ShareButton/ShareMenu.tsx index bd8c983e1c8..0a50fb9530e 100644 --- a/public/app/features/dashboard-scene/sharing/ShareButton/ShareMenu.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareButton/ShareMenu.tsx @@ -7,7 +7,7 @@ import { config, locationService } from '@grafana/runtime'; import { VizPanel } from '@grafana/scenes'; import { IconName, Menu } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { isPublicDashboardsEnabled } from '../../../dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; import { getTrackingSource, shareDashboardType } from '../../../dashboard/components/ShareModal/utils'; diff --git a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/EmailShare/ConfigEmailSharing/ConfigEmailSharing.tsx b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/EmailShare/ConfigEmailSharing/ConfigEmailSharing.tsx index d2affefd482..4d6ca049b89 100644 --- a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/EmailShare/ConfigEmailSharing/ConfigEmailSharing.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/EmailShare/ConfigEmailSharing/ConfigEmailSharing.tsx @@ -7,7 +7,7 @@ import { contextSrv } from 'app/core/core'; import { publicDashboardApi, useAddRecipientMutation } from 'app/features/dashboard/api/publicDashboardApi'; import { validEmailRegex } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { useShareDrawerContext } from '../../../../ShareDrawer/ShareDrawerContext'; import ShareConfiguration from '../../ShareConfiguration'; diff --git a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/EmailShare/CreateEmailSharing.tsx b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/EmailShare/CreateEmailSharing.tsx index 3f1c51db7b8..4c482660047 100644 --- a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/EmailShare/CreateEmailSharing.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/EmailShare/CreateEmailSharing.tsx @@ -9,7 +9,7 @@ import { contextSrv } from 'app/core/core'; import { useCreatePublicDashboardMutation } from 'app/features/dashboard/api/publicDashboardApi'; import { PublicDashboardShareType } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { EmailSharingPricingAlert } from '../../../../../dashboard/components/ShareModal/SharePublicDashboard/ModalAlerts/EmailSharingPricingAlert'; import { useShareDrawerContext } from '../../../ShareDrawer/ShareDrawerContext'; diff --git a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/PublicShare/CreatePublicSharing.tsx b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/PublicShare/CreatePublicSharing.tsx index 8352e8a9495..c871537e4c4 100644 --- a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/PublicShare/CreatePublicSharing.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/PublicShare/CreatePublicSharing.tsx @@ -9,7 +9,7 @@ import { contextSrv } from 'app/core/core'; import { useCreatePublicDashboardMutation } from 'app/features/dashboard/api/publicDashboardApi'; import { PublicDashboardShareType } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { PublicDashboardAlert } from '../../../../../dashboard/components/ShareModal/SharePublicDashboard/ModalAlerts/PublicDashboardAlert'; import { useShareDrawerContext } from '../../../ShareDrawer/ShareDrawerContext'; diff --git a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareAlerts.tsx b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareAlerts.tsx index 9e74065d62e..6c7b0d55ec7 100644 --- a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareAlerts.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareAlerts.tsx @@ -7,7 +7,7 @@ import { PublicDashboard, PublicDashboardShareType, } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { NoUpsertPermissionsAlert } from '../../../../dashboard/components/ShareModal/SharePublicDashboard/ModalAlerts/NoUpsertPermissionsAlert'; import { PublicDashboardAlert } from '../../../../dashboard/components/ShareModal/SharePublicDashboard/ModalAlerts/PublicDashboardAlert'; diff --git a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareConfiguration.tsx b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareConfiguration.tsx index 57d2423e167..62d22223663 100644 --- a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareConfiguration.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareConfiguration.tsx @@ -10,7 +10,7 @@ import { contextSrv } from 'app/core/core'; import { publicDashboardApi, useUpdatePublicDashboardMutation } from 'app/features/dashboard/api/publicDashboardApi'; import { ConfigPublicDashboardForm } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/ConfigPublicDashboard'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { useShareDrawerContext } from '../../ShareDrawer/ShareDrawerContext'; diff --git a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareExternally.tsx b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareExternally.tsx index ca95eee9110..41637090ad0 100644 --- a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareExternally.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareExternally.tsx @@ -21,7 +21,7 @@ import { } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; import { getDashboardSceneFor } from 'app/features/dashboard-scene/utils/utils'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { ShareDrawerConfirmAction } from '../../ShareDrawer/ShareDrawerConfirmAction'; import { useShareDrawerContext } from '../../ShareDrawer/ShareDrawerContext'; diff --git a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareTypeSelect.tsx b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareTypeSelect.tsx index f58c16298ca..89e14df3c5f 100644 --- a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareTypeSelect.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareTypeSelect.tsx @@ -14,7 +14,7 @@ import { PublicDashboardShareType, } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { useShareDrawerContext } from '../../ShareDrawer/ShareDrawerContext'; diff --git a/public/app/features/dashboard-scene/sharing/ShareButton/share-snapshot/ShareSnapshot.tsx b/public/app/features/dashboard-scene/sharing/ShareButton/share-snapshot/ShareSnapshot.tsx index 89285aa03a6..75861e9ee92 100644 --- a/public/app/features/dashboard-scene/sharing/ShareButton/share-snapshot/ShareSnapshot.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareButton/share-snapshot/ShareSnapshot.tsx @@ -6,7 +6,7 @@ import { Trans, t } from '@grafana/i18n'; import { SceneComponentProps } from '@grafana/scenes'; import { Alert, Button, ClipboardButton, Spinner, Stack, TextLink } from '@grafana/ui'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { SnapshotSharingOptions } from '../../../../dashboard/services/SnapshotSrv'; import { ShareDrawerConfirmAction } from '../../ShareDrawer/ShareDrawerConfirmAction'; diff --git a/public/app/features/dashboard-scene/sharing/ShareModal.tsx b/public/app/features/dashboard-scene/sharing/ShareModal.tsx index db5f89a32fb..f389382cbaf 100644 --- a/public/app/features/dashboard-scene/sharing/ShareModal.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareModal.tsx @@ -6,7 +6,7 @@ import { SceneComponentProps, SceneObjectBase, SceneObjectRef, SceneObjectState, import { Modal, ModalTabsHeader, TabContent } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; import { isPublicDashboardsEnabled } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { getTrackingSource } from '../../dashboard/components/ShareModal/utils'; import { DashboardInteractions } from '../utils/interactions'; diff --git a/public/app/features/dashboard-scene/sharing/public-dashboards/ConfigPublicDashboard.tsx b/public/app/features/dashboard-scene/sharing/public-dashboards/ConfigPublicDashboard.tsx index 303492f492f..99f55253598 100644 --- a/public/app/features/dashboard-scene/sharing/public-dashboards/ConfigPublicDashboard.tsx +++ b/public/app/features/dashboard-scene/sharing/public-dashboards/ConfigPublicDashboard.tsx @@ -8,7 +8,7 @@ import { contextSrv } from 'app/core/core'; import { useDeletePublicDashboardMutation } from 'app/features/dashboard/api/publicDashboardApi'; import { ConfigPublicDashboardBase } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/ConfigPublicDashboard'; import { PublicDashboard } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { shareDashboardType } from '../../../dashboard/components/ShareModal/utils'; import { getDashboardSceneFor } from '../../utils/utils'; diff --git a/public/app/features/dashboard-scene/solo/SoloPanelPage.tsx b/public/app/features/dashboard-scene/solo/SoloPanelPage.tsx index 6de468e798b..e38fd63e5d1 100644 --- a/public/app/features/dashboard-scene/solo/SoloPanelPage.tsx +++ b/public/app/features/dashboard-scene/solo/SoloPanelPage.tsx @@ -11,7 +11,7 @@ import PageLoader from 'app/core/components/PageLoader/PageLoader'; import { EntityNotFound } from 'app/core/components/PageNotFound/EntityNotFound'; import { GrafanaRouteComponentProps } from 'app/core/navigation/types'; import { DashboardPageRouteParams } from 'app/features/dashboard/containers/types'; -import { DashboardRoutes } from 'app/types'; +import { DashboardRoutes } from 'app/types/dashboard'; import { getDashboardScenePageStateManager } from '../pages/DashboardScenePageStateManager'; import { DashboardScene } from '../scene/DashboardScene'; diff --git a/public/app/features/dashboard-scene/utils/dashboardSessionState.test.ts b/public/app/features/dashboard-scene/utils/dashboardSessionState.test.ts index 9c5badd54f7..fe93bb0a479 100644 --- a/public/app/features/dashboard-scene/utils/dashboardSessionState.test.ts +++ b/public/app/features/dashboard-scene/utils/dashboardSessionState.test.ts @@ -1,6 +1,6 @@ import { config, locationService } from '@grafana/runtime'; import { CustomVariable, UrlSyncManager } from '@grafana/scenes'; -import { DashboardDataDTO } from 'app/types'; +import { DashboardDataDTO } from 'app/types/dashboard'; import { transformSaveModelToScene } from '../serialization/transformSaveModelToScene'; diff --git a/public/app/features/dashboard-scene/utils/test-utils.ts b/public/app/features/dashboard-scene/utils/test-utils.ts index 40a547f68e1..7576d80f18c 100644 --- a/public/app/features/dashboard-scene/utils/test-utils.ts +++ b/public/app/features/dashboard-scene/utils/test-utils.ts @@ -14,7 +14,7 @@ import { } from '@grafana/scenes'; import { DashboardLoaderSrv, setDashboardLoaderSrv } from 'app/features/dashboard/services/DashboardLoaderSrv'; import { ALL_VARIABLE_TEXT, ALL_VARIABLE_VALUE } from 'app/features/variables/constants'; -import { DashboardDTO } from 'app/types'; +import { DashboardDTO } from 'app/types/dashboard'; import { VizPanelLinks, VizPanelLinksMenu } from '../scene/PanelLinks'; import { DashboardGridItem, RepeatDirection } from '../scene/layout-default/DashboardGridItem'; diff --git a/public/app/features/dashboard-scene/v2schema/ImportDashboardOverviewV2.tsx b/public/app/features/dashboard-scene/v2schema/ImportDashboardOverviewV2.tsx index 4eb8476eaa5..aa4c06d3684 100644 --- a/public/app/features/dashboard-scene/v2schema/ImportDashboardOverviewV2.tsx +++ b/public/app/features/dashboard-scene/v2schema/ImportDashboardOverviewV2.tsx @@ -11,7 +11,7 @@ import { Form } from 'app/core/components/Form/Form'; import { getDashboardAPI } from 'app/features/dashboard/api/dashboard_api'; import { SaveDashboardCommand } from 'app/features/dashboard/components/SaveDashboard/types'; import { clearLoadedDashboard } from 'app/features/manage-dashboards/state/actions'; -import { useDispatch, useSelector, StoreState } from 'app/types'; +import { useDispatch, useSelector, StoreState } from 'app/types/store'; import { ImportDashboardFormV2 } from './ImportDashboardFormV2'; diff --git a/public/app/features/dashboard/api/ResponseTransformers.test.ts b/public/app/features/dashboard/api/ResponseTransformers.test.ts index 432aaa300c6..51a0cb00f36 100644 --- a/public/app/features/dashboard/api/ResponseTransformers.test.ts +++ b/public/app/features/dashboard/api/ResponseTransformers.test.ts @@ -25,7 +25,7 @@ import { transformVariableHideToEnum, transformVariableRefreshToEnum, } from 'app/features/dashboard-scene/serialization/transformToV2TypesUtils'; -import { DashboardDataDTO, DashboardDTO } from 'app/types'; +import { DashboardDataDTO, DashboardDTO } from 'app/types/dashboard'; import { getDefaultDatasource, diff --git a/public/app/features/dashboard/api/ResponseTransformers.ts b/public/app/features/dashboard/api/ResponseTransformers.ts index 66dbbb8fdec..aba26fbb7e4 100644 --- a/public/app/features/dashboard/api/ResponseTransformers.ts +++ b/public/app/features/dashboard/api/ResponseTransformers.ts @@ -75,7 +75,7 @@ import { transformVariableHideToEnum, transformVariableRefreshToEnum, } from 'app/features/dashboard-scene/serialization/transformToV2TypesUtils'; -import { DashboardDataDTO, DashboardDTO } from 'app/types'; +import { DashboardDataDTO, DashboardDTO } from 'app/types/dashboard'; import { DashboardWithAccessInfo } from './types'; import { isDashboardResource, isDashboardV0Spec, isDashboardV2Resource } from './utils'; diff --git a/public/app/features/dashboard/api/UnifiedDashboardAPI.test.ts b/public/app/features/dashboard/api/UnifiedDashboardAPI.test.ts index 6dc00b3190f..8b9e3cd2f47 100644 --- a/public/app/features/dashboard/api/UnifiedDashboardAPI.test.ts +++ b/public/app/features/dashboard/api/UnifiedDashboardAPI.test.ts @@ -4,7 +4,7 @@ import { defaultSpec as defaultDashboardV2Spec, } from '@grafana/schema/dist/esm/schema/dashboard/v2alpha1/types.spec.gen'; import { ResourceList } from 'app/features/apiserver/types'; -import { DashboardDataDTO, DashboardDTO } from 'app/types'; +import { DashboardDataDTO, DashboardDTO } from 'app/types/dashboard'; import { SaveDashboardCommand } from '../components/SaveDashboard/types'; diff --git a/public/app/features/dashboard/api/UnifiedDashboardAPI.ts b/public/app/features/dashboard/api/UnifiedDashboardAPI.ts index 344f3ba9cd2..6851a6c0f76 100644 --- a/public/app/features/dashboard/api/UnifiedDashboardAPI.ts +++ b/public/app/features/dashboard/api/UnifiedDashboardAPI.ts @@ -2,7 +2,7 @@ import { Dashboard } from '@grafana/schema'; import { Spec as DashboardV2Spec } from '@grafana/schema/dist/esm/schema/dashboard/v2alpha1/types.spec.gen'; import { isResource } from 'app/features/apiserver/guards'; import { Resource, ResourceList } from 'app/features/apiserver/types'; -import { DashboardDataDTO, DashboardDTO } from 'app/types'; +import { DashboardDataDTO, DashboardDTO } from 'app/types/dashboard'; import { SaveDashboardCommand } from '../components/SaveDashboard/types'; diff --git a/public/app/features/dashboard/api/dashboard_api.ts b/public/app/features/dashboard/api/dashboard_api.ts index fb930516a0e..c4a73deccb7 100644 --- a/public/app/features/dashboard/api/dashboard_api.ts +++ b/public/app/features/dashboard/api/dashboard_api.ts @@ -1,6 +1,6 @@ import { Dashboard } from '@grafana/schema'; import { Spec as DashboardV2Spec } from '@grafana/schema/dist/esm/schema/dashboard/v2alpha1/types.spec.gen'; -import { DashboardDTO } from 'app/types'; +import { DashboardDTO } from 'app/types/dashboard'; import { UnifiedDashboardAPI } from './UnifiedDashboardAPI'; import { LegacyDashboardAPI } from './legacy'; diff --git a/public/app/features/dashboard/api/legacy.test.ts b/public/app/features/dashboard/api/legacy.test.ts index b62450fd0ea..ce81f685afb 100644 --- a/public/app/features/dashboard/api/legacy.test.ts +++ b/public/app/features/dashboard/api/legacy.test.ts @@ -1,5 +1,5 @@ import { UrlQueryMap } from '@grafana/data'; -import { DashboardDTO } from 'app/types'; +import { DashboardDTO } from 'app/types/dashboard'; import { LegacyDashboardAPI } from './legacy'; diff --git a/public/app/features/dashboard/api/legacy.ts b/public/app/features/dashboard/api/legacy.ts index 5ce46cdf442..5a9e0b9707c 100644 --- a/public/app/features/dashboard/api/legacy.ts +++ b/public/app/features/dashboard/api/legacy.ts @@ -6,7 +6,7 @@ import appEvents from 'app/core/app_events'; import { Resource, ResourceList } from 'app/features/apiserver/types'; import { dashboardWatcher } from 'app/features/live/dashboard/dashboardWatcher'; import { DeleteDashboardResponse } from 'app/features/manage-dashboards/types'; -import { SaveDashboardResponseDTO, DashboardDTO } from 'app/types'; +import { SaveDashboardResponseDTO, DashboardDTO } from 'app/types/dashboard'; import { SaveDashboardCommand } from '../components/SaveDashboard/types'; diff --git a/public/app/features/dashboard/api/types.ts b/public/app/features/dashboard/api/types.ts index 568fcfcf4a5..90c16d527dc 100644 --- a/public/app/features/dashboard/api/types.ts +++ b/public/app/features/dashboard/api/types.ts @@ -2,7 +2,7 @@ import { UrlQueryMap } from '@grafana/data'; import { Status } from '@grafana/schema/src/schema/dashboard/v2alpha1/types.status.gen'; import { ListOptions, Resource, ResourceList } from 'app/features/apiserver/types'; import { DeleteDashboardResponse } from 'app/features/manage-dashboards/types'; -import { AnnotationsPermissions, SaveDashboardResponseDTO } from 'app/types'; +import { AnnotationsPermissions, SaveDashboardResponseDTO } from 'app/types/dashboard'; import { SaveDashboardCommand } from '../components/SaveDashboard/types'; diff --git a/public/app/features/dashboard/api/utils.ts b/public/app/features/dashboard/api/utils.ts index f49fcb9de12..ea9ba97cf57 100644 --- a/public/app/features/dashboard/api/utils.ts +++ b/public/app/features/dashboard/api/utils.ts @@ -3,7 +3,7 @@ import { Dashboard } from '@grafana/schema/dist/esm/index.gen'; import { Spec as DashboardV2Spec } from '@grafana/schema/dist/esm/schema/dashboard/v2alpha1/types.spec.gen'; import { Status } from '@grafana/schema/src/schema/dashboard/v2alpha1/types.status.gen'; import { Resource } from 'app/features/apiserver/types'; -import { DashboardDataDTO, DashboardDTO } from 'app/types'; +import { DashboardDataDTO, DashboardDTO } from 'app/types/dashboard'; import { SaveDashboardCommand } from '../components/SaveDashboard/types'; diff --git a/public/app/features/dashboard/api/v1.test.ts b/public/app/features/dashboard/api/v1.test.ts index a037136eeb9..7cdadd0995a 100644 --- a/public/app/features/dashboard/api/v1.test.ts +++ b/public/app/features/dashboard/api/v1.test.ts @@ -1,7 +1,7 @@ import { GrafanaConfig, locationUtil } from '@grafana/data'; import { backendSrv } from 'app/core/services/backend_srv'; import { AnnoKeyFolder } from 'app/features/apiserver/types'; -import { DashboardDataDTO } from 'app/types'; +import { DashboardDataDTO } from 'app/types/dashboard'; import { DashboardWithAccessInfo } from './types'; import { K8sDashboardAPI } from './v1'; diff --git a/public/app/features/dashboard/api/v1.ts b/public/app/features/dashboard/api/v1.ts index 58708bcdcd8..f196e9d71e2 100644 --- a/public/app/features/dashboard/api/v1.ts +++ b/public/app/features/dashboard/api/v1.ts @@ -21,7 +21,7 @@ import { } from 'app/features/apiserver/types'; import { getDashboardUrl } from 'app/features/dashboard-scene/utils/getDashboardUrl'; import { DeleteDashboardResponse } from 'app/features/manage-dashboards/types'; -import { DashboardDataDTO, DashboardDTO, SaveDashboardResponseDTO } from 'app/types'; +import { DashboardDataDTO, DashboardDTO, SaveDashboardResponseDTO } from 'app/types/dashboard'; import { SaveDashboardCommand } from '../components/SaveDashboard/types'; diff --git a/public/app/features/dashboard/api/v2.ts b/public/app/features/dashboard/api/v2.ts index 0a0830e4ffa..676f7b26e27 100644 --- a/public/app/features/dashboard/api/v2.ts +++ b/public/app/features/dashboard/api/v2.ts @@ -19,7 +19,7 @@ import { } from 'app/features/apiserver/types'; import { getDashboardUrl } from 'app/features/dashboard-scene/utils/getDashboardUrl'; import { DeleteDashboardResponse } from 'app/features/manage-dashboards/types'; -import { DashboardDTO, SaveDashboardResponseDTO } from 'app/types'; +import { DashboardDTO, SaveDashboardResponseDTO } from 'app/types/dashboard'; import { SaveDashboardCommand } from '../components/SaveDashboard/types'; diff --git a/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.test.tsx b/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.test.tsx index 8b634dab7f0..75cedae0807 100644 --- a/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.test.tsx +++ b/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.test.tsx @@ -13,8 +13,8 @@ import { import AddPanelMenu from './AddPanelMenu'; -jest.mock('app/types', () => ({ - ...jest.requireActual('app/types'), +jest.mock('app/types/store', () => ({ + ...jest.requireActual('app/types/store'), useDispatch: () => jest.fn(), useSelector: () => jest.fn(), })); diff --git a/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.tsx b/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.tsx index 560f924a8a3..138f2bf285d 100644 --- a/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.tsx +++ b/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.tsx @@ -13,7 +13,7 @@ import { onPasteCopiedPanel, } from 'app/features/dashboard/utils/dashboard'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; import { setInitialDatasource } from '../../state/reducers'; diff --git a/public/app/features/dashboard/components/DashNav/DashNav.tsx b/public/app/features/dashboard/components/DashNav/DashNav.tsx index aeb072faf93..78dd8c02a40 100644 --- a/public/app/features/dashboard/components/DashNav/DashNav.tsx +++ b/public/app/features/dashboard/components/DashNav/DashNav.tsx @@ -31,8 +31,9 @@ import { PublicDashboardBadgeLegacy } from 'app/features/dashboard-scene/scene/n import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; import { playlistSrv } from 'app/features/playlist/PlaylistSrv'; import { updateTimeZoneForSession } from 'app/features/profile/state/reducers'; -import { KioskMode, StoreState } from 'app/types'; +import { KioskMode } from 'app/types/dashboard'; import { DashboardMetaChangedEvent, ShowModalReactEvent } from 'app/types/events'; +import { StoreState } from 'app/types/store'; import { DynamicDashNavButtonModel, diff --git a/public/app/features/dashboard/components/DashboardLoading/DashboardFailed.tsx b/public/app/features/dashboard/components/DashboardLoading/DashboardFailed.tsx index 9601c1a026f..69fd629ccd6 100644 --- a/public/app/features/dashboard/components/DashboardLoading/DashboardFailed.tsx +++ b/public/app/features/dashboard/components/DashboardLoading/DashboardFailed.tsx @@ -2,7 +2,8 @@ import { css } from '@emotion/css'; import { Alert } from '@grafana/ui'; import { getMessageFromError } from 'app/core/utils/errors'; -import { DashboardInitError, AppNotificationSeverity } from 'app/types'; +import { AppNotificationSeverity } from 'app/types/appNotifications'; +import { DashboardInitError } from 'app/types/dashboard'; export interface Props { initError?: DashboardInitError; diff --git a/public/app/features/dashboard/components/DashboardLoading/DashboardLoading.tsx b/public/app/features/dashboard/components/DashboardLoading/DashboardLoading.tsx index 5dcb8d870f5..f5e279e5af1 100644 --- a/public/app/features/dashboard/components/DashboardLoading/DashboardLoading.tsx +++ b/public/app/features/dashboard/components/DashboardLoading/DashboardLoading.tsx @@ -4,7 +4,7 @@ import { GrafanaTheme2 } from '@grafana/data'; import { Trans } from '@grafana/i18n'; import { locationService } from '@grafana/runtime'; import { Button, HorizontalGroup, Spinner, useStyles2, VerticalGroup } from '@grafana/ui'; -import { DashboardInitPhase } from 'app/types'; +import { DashboardInitPhase } from 'app/types/dashboard'; export interface Props { initPhase: DashboardInitPhase; diff --git a/public/app/features/dashboard/components/DashboardPermissions/AccessControlDashboardPermissions.tsx b/public/app/features/dashboard/components/DashboardPermissions/AccessControlDashboardPermissions.tsx index 6b31090b447..479521c91bd 100644 --- a/public/app/features/dashboard/components/DashboardPermissions/AccessControlDashboardPermissions.tsx +++ b/public/app/features/dashboard/components/DashboardPermissions/AccessControlDashboardPermissions.tsx @@ -1,7 +1,7 @@ import { Permissions } from 'app/core/components/AccessControl'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { SettingsPageProps } from '../DashboardSettings/types'; diff --git a/public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.tsx b/public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.tsx index 5514f11da67..96c63448806 100644 --- a/public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.tsx +++ b/public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.tsx @@ -10,8 +10,8 @@ import { Prompt } from 'app/core/components/FormPrompt/Prompt'; import { contextSrv } from 'app/core/services/context_srv'; import { SaveLibraryPanelModal } from 'app/features/library-panels/components/SaveLibraryPanelModal/SaveLibraryPanelModal'; import { PanelModelWithLibraryPanel } from 'app/features/library-panels/types'; -import { useDispatch } from 'app/types'; import { DashboardSavedEvent } from 'app/types/events'; +import { useDispatch } from 'app/types/store'; import { DashboardModel } from '../../state/DashboardModel'; import { discardPanelChanges, exitPanelEditor } from '../PanelEditor/state/actions'; diff --git a/public/app/features/dashboard/components/DashboardSettings/DashboardSettings.tsx b/public/app/features/dashboard/components/DashboardSettings/DashboardSettings.tsx index 063eccf4ebc..26d52f52a63 100644 --- a/public/app/features/dashboard/components/DashboardSettings/DashboardSettings.tsx +++ b/public/app/features/dashboard/components/DashboardSettings/DashboardSettings.tsx @@ -10,7 +10,7 @@ import { Button, Stack, Text, ToolbarButtonRow } from '@grafana/ui'; import { AppChromeUpdate } from 'app/core/components/AppChrome/AppChromeUpdate'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { DashboardMetaChangedEvent } from 'app/types/events'; import { VariableEditorContainer } from '../../../variables/editor/VariableEditorContainer'; diff --git a/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx b/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx index b7eefcba85a..ff10cbf0367 100644 --- a/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx +++ b/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx @@ -23,7 +23,7 @@ import { } from '@grafana/ui'; import { contextSrv } from 'app/core/services/context_srv'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { ShowMessage, SnapshotTab, SupportSnapshotService } from './SupportSnapshotService'; diff --git a/public/app/features/dashboard/components/Inspector/PanelInspector.tsx b/public/app/features/dashboard/components/Inspector/PanelInspector.tsx index cbd6b6c4e3f..a60e02d2ae0 100644 --- a/public/app/features/dashboard/components/Inspector/PanelInspector.tsx +++ b/public/app/features/dashboard/components/Inspector/PanelInspector.tsx @@ -8,7 +8,7 @@ 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'; +import { StoreState } from 'app/types/store'; import { GetDataOptions } from '../../../query/state/PanelQueryRunner'; import { HelpWizard } from '../HelpWizard/HelpWizard'; diff --git a/public/app/features/dashboard/components/PanelEditor/OptionsPane.tsx b/public/app/features/dashboard/components/PanelEditor/OptionsPane.tsx index d44d699c978..cacdb672a11 100644 --- a/public/app/features/dashboard/components/PanelEditor/OptionsPane.tsx +++ b/public/app/features/dashboard/components/PanelEditor/OptionsPane.tsx @@ -3,7 +3,7 @@ import { css } from '@emotion/css'; import { GrafanaTheme2 } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; import { useStyles2 } from '@grafana/ui'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { OptionsPaneOptions } from './OptionsPaneOptions'; import { VisualizationButton } from './VisualizationButton'; diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx index 81e184b7e59..76c38e695d9 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx @@ -30,8 +30,8 @@ import { SaveLibraryPanelModal } from 'app/features/library-panels/components/Sa import { PanelModelWithLibraryPanel } from 'app/features/library-panels/types'; import { getPanelStateForModel } from 'app/features/panel/state/selectors'; import { updateTimeZoneForSession } from 'app/features/profile/state/reducers'; -import { StoreState } from 'app/types'; import { PanelOptionsChangedEvent, ShowModalReactEvent } from 'app/types/events'; +import { StoreState } from 'app/types/store'; import { notifyApp } from '../../../../core/actions'; import { UnlinkModal } from '../../../dashboard-scene/scene/UnlinkModal'; diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditorQueries.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditorQueries.tsx index 020eea8d8e8..b24344519db 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditorQueries.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditorQueries.tsx @@ -5,7 +5,7 @@ import { locationService } from '@grafana/runtime'; import { storeLastUsedDataSourceInLocalStorage } from 'app/features/datasources/components/picker/utils'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; import { QueryGroup } from 'app/features/query/components/QueryGroup'; -import { QueryGroupDataSource, QueryGroupOptions } from 'app/types'; +import { QueryGroupDataSource, QueryGroupOptions } from 'app/types/query'; import { getDashboardSrv } from '../../services/DashboardSrv'; import { PanelModel } from '../../state/PanelModel'; diff --git a/public/app/features/dashboard/components/PanelEditor/VisualizationButton.tsx b/public/app/features/dashboard/components/PanelEditor/VisualizationButton.tsx index d98b0ae99c2..51a84846f1d 100644 --- a/public/app/features/dashboard/components/PanelEditor/VisualizationButton.tsx +++ b/public/app/features/dashboard/components/PanelEditor/VisualizationButton.tsx @@ -3,7 +3,7 @@ import { css } from '@emotion/css'; import { selectors } from '@grafana/e2e-selectors'; import { t } from '@grafana/i18n'; import { ToolbarButton, ButtonGroup } from '@grafana/ui'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; import { PanelModel } from '../../state/PanelModel'; import { getPanelPluginWithFallback } from '../../state/selectors'; diff --git a/public/app/features/dashboard/components/PanelEditor/VisualizationSelectPane.tsx b/public/app/features/dashboard/components/PanelEditor/VisualizationSelectPane.tsx index 0edd8c13fe0..ffa32a42254 100644 --- a/public/app/features/dashboard/components/PanelEditor/VisualizationSelectPane.tsx +++ b/public/app/features/dashboard/components/PanelEditor/VisualizationSelectPane.tsx @@ -10,7 +10,7 @@ import { LS_VISUALIZATION_SELECT_TAB_KEY } from 'app/core/constants'; import { PanelLibraryOptionsGroup } from 'app/features/library-panels/components/PanelLibraryOptionsGroup/PanelLibraryOptionsGroup'; import { VisualizationSuggestions } from 'app/features/panel/components/VizTypePicker/VisualizationSuggestions'; import { VizTypeChangeDetails } from 'app/features/panel/components/VizTypePicker/types'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; import { VizTypePicker } from '../../../panel/components/VizTypePicker/VizTypePicker'; import { changePanelPlugin } from '../../../panel/state/actions'; diff --git a/public/app/features/dashboard/components/PanelEditor/state/actions.ts b/public/app/features/dashboard/components/PanelEditor/state/actions.ts index 00a96421aea..f1313156cb0 100644 --- a/public/app/features/dashboard/components/PanelEditor/state/actions.ts +++ b/public/app/features/dashboard/components/PanelEditor/state/actions.ts @@ -4,7 +4,7 @@ import store from 'app/core/store'; import { removePanel } from 'app/features/dashboard/utils/panel'; import { cleanUpPanelState } from 'app/features/panel/state/actions'; import { panelModelAndPluginReady } from 'app/features/panel/state/reducers'; -import { ThunkResult } from 'app/types'; +import { ThunkResult } from 'app/types/store'; import { DashboardModel } from '../../../state/DashboardModel'; import { PanelModel } from '../../../state/PanelModel'; diff --git a/public/app/features/dashboard/components/RepeatRowSelect/RepeatRowSelect.tsx b/public/app/features/dashboard/components/RepeatRowSelect/RepeatRowSelect.tsx index cafa4578540..de68a822e3a 100644 --- a/public/app/features/dashboard/components/RepeatRowSelect/RepeatRowSelect.tsx +++ b/public/app/features/dashboard/components/RepeatRowSelect/RepeatRowSelect.tsx @@ -4,7 +4,7 @@ import { SelectableValue } from '@grafana/data'; import { t } from '@grafana/i18n'; import { SceneObject, sceneGraph } from '@grafana/scenes'; import { Combobox, ComboboxOption, Select } from '@grafana/ui'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { getLastKey, getVariablesByKey } from '../../../variables/state/selectors'; 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 264a2640ebf..de5b14e257c 100644 --- a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.test.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.test.tsx @@ -3,7 +3,7 @@ import { render, screen } from 'test/test-utils'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import * as api from 'app/features/manage-dashboards/state/actions'; -import { SaveDashboardResponseDTO } from 'app/types'; +import { SaveDashboardResponseDTO } from 'app/types/dashboard'; import { SaveDashboardAsForm, SaveDashboardAsFormProps } from './SaveDashboardAsForm'; 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 3c2ec091317..0f50238b88b 100644 --- a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.test.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.test.tsx @@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event'; import { Dashboard } from '@grafana/schema'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { createDashboardModelFixture } from 'app/features/dashboard/state/__fixtures__/dashboardFixtures'; -import { SaveDashboardResponseDTO } from 'app/types'; +import { SaveDashboardResponseDTO } from 'app/types/dashboard'; import { SaveDashboardOptions } from '../types'; diff --git a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx index 510222479bd..18f0c61f02e 100644 --- a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx @@ -8,7 +8,7 @@ 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/DashboardModel'; -import { SaveDashboardResponseDTO } from 'app/types'; +import { SaveDashboardResponseDTO } from 'app/types/dashboard'; import { GenAIDashboardChangesButton } from '../../GenAI/GenAIDashboardChangesButton'; import { SaveDashboardData, SaveDashboardOptions } from '../types'; diff --git a/public/app/features/dashboard/components/SaveDashboard/types.ts b/public/app/features/dashboard/components/SaveDashboard/types.ts index 7e8eccc605f..05c6356f61f 100644 --- a/public/app/features/dashboard/components/SaveDashboard/types.ts +++ b/public/app/features/dashboard/components/SaveDashboard/types.ts @@ -2,7 +2,7 @@ import { Dashboard } from '@grafana/schema'; import { ObjectMeta } from 'app/features/apiserver/types'; import { CloneOptions, DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { Diffs } from 'app/features/dashboard-scene/settings/version-history/utils'; -import { SaveDashboardResponseDTO } from 'app/types'; +import { SaveDashboardResponseDTO } from 'app/types/dashboard'; export interface SaveDashboardData { clone: Dashboard; // cloned copy diff --git a/public/app/features/dashboard/components/SaveDashboard/useDashboardSave.tsx b/public/app/features/dashboard/components/SaveDashboard/useDashboardSave.tsx index 18435bc1e31..33b036e05a8 100644 --- a/public/app/features/dashboard/components/SaveDashboard/useDashboardSave.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/useDashboardSave.tsx @@ -10,8 +10,8 @@ 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/DashboardModel'; -import { useDispatch } from 'app/types'; import { DashboardSavedEvent } from 'app/types/events'; +import { useDispatch } from 'app/types/store'; import { updateDashboardUidLastUsedDatasource } from '../../utils/dashboard'; diff --git a/public/app/features/dashboard/components/ShareModal/ShareModal.tsx b/public/app/features/dashboard/components/ShareModal/ShareModal.tsx index 73597b197f2..16d6220adcc 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareModal.tsx +++ b/public/app/features/dashboard/components/ShareModal/ShareModal.tsx @@ -10,7 +10,7 @@ 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'; +import { AccessControlAction } from 'app/types/accessControl'; import { ShareEmbed } from './ShareEmbed'; import { ShareExport } from './ShareExport'; 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 b08aebc934e..ae88d932140 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/ConfigPublicDashboard.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/ConfigPublicDashboard.tsx @@ -26,9 +26,10 @@ 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'; import { DeletePublicDashboardModal } from 'app/features/manage-dashboards/components/PublicDashboardListTable/DeletePublicDashboardModal'; +import { AccessControlAction } from 'app/types/accessControl'; +import { useSelector } from 'app/types/store'; import { contextSrv } from '../../../../../../core/services/context_srv'; -import { AccessControlAction, useSelector } from '../../../../../../types'; import { useIsDesktop } from '../../../../utils/screen'; import { ShareModal } from '../../ShareModal'; import { shareDashboardType } from '../../utils'; diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/EmailSharingConfiguration.tsx b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/EmailSharingConfiguration.tsx index 930953f859e..c63628c8d17 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/EmailSharingConfiguration.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/EmailSharingConfiguration.tsx @@ -17,7 +17,7 @@ import { 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 } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { PublicDashboard, PublicDashboardShareType, validEmailRegex } from '../SharePublicDashboardUtils'; 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 3d4d098023d..7cbc1b6b9f6 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/CreatePublicDashboard/CreatePublicDashboard.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/CreatePublicDashboard/CreatePublicDashboard.tsx @@ -10,7 +10,8 @@ import { useCreatePublicDashboardMutation } from 'app/features/dashboard/api/pub 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'; +import { AccessControlAction } from 'app/types/accessControl'; +import { useSelector } from 'app/types/store'; import { NoUpsertPermissionsAlert } from '../ModalAlerts/NoUpsertPermissionsAlert'; import { UnsupportedDataSourcesAlert } from '../ModalAlerts/UnsupportedDataSourcesAlert'; diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.tsx b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.tsx index 1df31f7b635..9636e2dd6ef 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.tsx @@ -6,7 +6,7 @@ import { Spinner, useStyles2 } from '@grafana/ui'; import { useGetPublicDashboardQuery } from 'app/features/dashboard/api/publicDashboardApi'; import { publicDashboardPersisted } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; import { ShareModalTabProps } from 'app/features/dashboard/components/ShareModal/types'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { HorizontalGroup } from '../../../../plugins/admin/components/HorizontalGroup'; diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/utilsTest.tsx b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/utilsTest.tsx index f1a2eb97686..993fc55ae8e 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/utilsTest.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/utilsTest.tsx @@ -3,8 +3,9 @@ import { http, HttpResponse } from 'msw'; import * as React from 'react'; import { Provider } from 'react-redux'; +import { DashboardInitPhase } from 'app/types/dashboard'; + import { configureStore } from '../../../../../store/configureStore'; -import { DashboardInitPhase } from '../../../../../types'; import { DashboardModel } from '../../../state/DashboardModel'; import { PanelModel } from '../../../state/PanelModel'; import { createDashboardModelFixture } from '../../../state/__fixtures__/dashboardFixtures'; diff --git a/public/app/features/dashboard/components/SubMenu/SubMenu.tsx b/public/app/features/dashboard/components/SubMenu/SubMenu.tsx index fdc83c449d8..3ec288df413 100644 --- a/public/app/features/dashboard/components/SubMenu/SubMenu.tsx +++ b/public/app/features/dashboard/components/SubMenu/SubMenu.tsx @@ -7,8 +7,8 @@ import { AnnotationQuery, DataQuery, TypedVariableModel, GrafanaTheme2 } from '@ import { t } from '@grafana/i18n'; import { DashboardLink } from '@grafana/schema'; import { stylesFactory, Themeable2, withTheme2 } from '@grafana/ui'; +import { StoreState } from 'app/types/store'; -import { StoreState } from '../../../../types'; import { getSubMenuVariables, getVariablesState } from '../../../variables/state/selectors'; import { DashboardModel } from '../../state/DashboardModel'; diff --git a/public/app/features/dashboard/components/VersionHistory/useDashboardRestore.tsx b/public/app/features/dashboard/components/VersionHistory/useDashboardRestore.tsx index f95568f8159..53c7633fbaa 100644 --- a/public/app/features/dashboard/components/VersionHistory/useDashboardRestore.tsx +++ b/public/app/features/dashboard/components/VersionHistory/useDashboardRestore.tsx @@ -5,7 +5,7 @@ import { locationUtil } from '@grafana/data'; import { config, locationService } from '@grafana/runtime'; import { useAppNotification } from 'app/core/copy/appNotification'; import { historySrv } from 'app/features/dashboard-scene/settings/version-history/HistorySrv'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { dashboardWatcher } from '../../../live/dashboard/dashboardWatcher'; import { DashboardModel } from '../../state/DashboardModel'; diff --git a/public/app/features/dashboard/containers/DashboardPage.test.tsx b/public/app/features/dashboard/containers/DashboardPage.test.tsx index 19e245cf03b..da7454a6d02 100644 --- a/public/app/features/dashboard/containers/DashboardPage.test.tsx +++ b/public/app/features/dashboard/containers/DashboardPage.test.tsx @@ -14,7 +14,7 @@ import { AppChrome } from 'app/core/components/AppChrome/AppChrome'; import { getRouteComponentProps } from 'app/core/navigation/mocks/routeProps'; import { RouteDescriptor } from 'app/core/navigation/types'; import { HOME_NAV_ID } from 'app/core/reducers/navModel'; -import { DashboardInitPhase, DashboardMeta, DashboardRoutes } from 'app/types'; +import { DashboardInitPhase, DashboardMeta, DashboardRoutes } from 'app/types/dashboard'; import { Props as LazyLoaderProps } from '../dashgrid/LazyLoader'; import { DashboardSrv, setDashboardSrv } from '../services/DashboardSrv'; diff --git a/public/app/features/dashboard/containers/DashboardPage.tsx b/public/app/features/dashboard/containers/DashboardPage.tsx index bb4ad2a995c..16ed48ea618 100644 --- a/public/app/features/dashboard/containers/DashboardPage.tsx +++ b/public/app/features/dashboard/containers/DashboardPage.tsx @@ -17,8 +17,9 @@ import { ID_PREFIX } from 'app/core/reducers/navBarTree'; import { getNavModel } from 'app/core/selectors/navModel'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { dashboardWatcher } from 'app/features/live/dashboard/dashboardWatcher'; -import { KioskMode, StoreState } from 'app/types'; +import { KioskMode } from 'app/types/dashboard'; import { PanelEditEnteredEvent, PanelEditExitedEvent } from 'app/types/events'; +import { StoreState } from 'app/types/store'; import { cancelVariables, templateVarsChangedInUrl } from '../../variables/state/actions'; import { findTemplateVarChanges } from '../../variables/utils'; diff --git a/public/app/features/dashboard/containers/DashboardPageProxy.test.tsx b/public/app/features/dashboard/containers/DashboardPageProxy.test.tsx index ee38959345f..e26b1099d2d 100644 --- a/public/app/features/dashboard/containers/DashboardPageProxy.test.tsx +++ b/public/app/features/dashboard/containers/DashboardPageProxy.test.tsx @@ -13,7 +13,7 @@ import { setupLoadDashboardMockReject, setupLoadDashboardRuntimeErrorMock, } from 'app/features/dashboard-scene/utils/test-utils'; -import { DashboardDTO, DashboardRoutes } from 'app/types'; +import { DashboardDTO, DashboardRoutes } from 'app/types/dashboard'; import { DashboardLoaderSrv, setDashboardLoaderSrv } from '../services/DashboardLoaderSrv'; diff --git a/public/app/features/dashboard/containers/DashboardPageProxy.tsx b/public/app/features/dashboard/containers/DashboardPageProxy.tsx index a574ceb1e7e..2e37c4b3749 100644 --- a/public/app/features/dashboard/containers/DashboardPageProxy.tsx +++ b/public/app/features/dashboard/containers/DashboardPageProxy.tsx @@ -5,7 +5,7 @@ import { config } from '@grafana/runtime'; import { GrafanaRouteComponentProps } from 'app/core/navigation/types'; import DashboardScenePage from 'app/features/dashboard-scene/pages/DashboardScenePage'; import { getDashboardScenePageStateManager } from 'app/features/dashboard-scene/pages/DashboardScenePageStateManager'; -import { DashboardRoutes } from 'app/types'; +import { DashboardRoutes } from 'app/types/dashboard'; import { isDashboardV2Resource } from '../api/utils'; diff --git a/public/app/features/dashboard/containers/NewDashboardWithDS.tsx b/public/app/features/dashboard/containers/NewDashboardWithDS.tsx index f247b8865d5..46064030ca2 100644 --- a/public/app/features/dashboard/containers/NewDashboardWithDS.tsx +++ b/public/app/features/dashboard/containers/NewDashboardWithDS.tsx @@ -4,7 +4,7 @@ import { useParams } from 'react-router-dom-v5-compat'; import { Trans } from '@grafana/i18n'; import { getDataSourceSrv, locationService } from '@grafana/runtime'; import { Page } from 'app/core/components/Page/Page'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { setInitialDatasource } from '../state/reducers'; diff --git a/public/app/features/dashboard/containers/PublicDashboardPage.test.tsx b/public/app/features/dashboard/containers/PublicDashboardPage.test.tsx index 6b3ebdcbee8..d9038bf1f2b 100644 --- a/public/app/features/dashboard/containers/PublicDashboardPage.test.tsx +++ b/public/app/features/dashboard/containers/PublicDashboardPage.test.tsx @@ -8,8 +8,8 @@ import { render } from 'test/test-utils'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src'; import { Dashboard, DashboardCursorSync, FieldConfigSource, Panel, ThresholdsMode } from '@grafana/schema/src'; import { getRouteComponentProps } from 'app/core/navigation/mocks/routeProps'; -import * as appTypes from 'app/types'; -import { DashboardInitPhase, DashboardMeta, DashboardRoutes } from 'app/types'; +import { DashboardInitPhase, DashboardMeta, DashboardRoutes } from 'app/types/dashboard'; +import { StoreState } from 'app/types/store'; import { configureStore } from '../../../store/configureStore'; import { Props as LazyLoaderProps } from '../dashgrid/LazyLoader'; @@ -45,12 +45,12 @@ jest.mock('app/features/dashboard/state/initDashboard', () => ({ initDashboard: jest.fn(), })); -jest.mock('app/types', () => ({ - ...jest.requireActual('app/types'), +jest.mock('app/types/store', () => ({ + ...jest.requireActual('app/types/store'), useDispatch: () => jest.fn(), })); -const setup = (propOverrides?: Partial, initialState?: Partial) => { +const setup = (propOverrides?: Partial, initialState?: Partial) => { const store = configureStore(initialState); const props: Props = { ...getRouteComponentProps({ diff --git a/public/app/features/dashboard/containers/PublicDashboardPage.tsx b/public/app/features/dashboard/containers/PublicDashboardPage.tsx index 4c3957431d8..b6f74800a76 100644 --- a/public/app/features/dashboard/containers/PublicDashboardPage.tsx +++ b/public/app/features/dashboard/containers/PublicDashboardPage.tsx @@ -14,7 +14,8 @@ import { PublicDashboardPageRouteSearchParams, } from 'app/features/dashboard/containers/types'; import { updateTimeZoneForSession } from 'app/features/profile/state/reducers'; -import { useSelector, useDispatch, DashboardInitError } from 'app/types'; +import { DashboardInitError } from 'app/types/dashboard'; +import { useDispatch, useSelector } from 'app/types/store'; import { DashNavTimeControls } from '../components/DashNav/DashNavTimeControls'; import { DashboardFailed } from '../components/DashboardLoading/DashboardFailed'; diff --git a/public/app/features/dashboard/containers/PublicDashboardPageProxy.test.tsx b/public/app/features/dashboard/containers/PublicDashboardPageProxy.test.tsx index 04b3678a0a1..b8ca09b1b4e 100644 --- a/public/app/features/dashboard/containers/PublicDashboardPageProxy.test.tsx +++ b/public/app/features/dashboard/containers/PublicDashboardPageProxy.test.tsx @@ -5,8 +5,7 @@ import { render } from 'test/test-utils'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors'; import { config, locationService } from '@grafana/runtime'; import { backendSrv } from 'app/core/services/backend_srv'; - -import { DashboardRoutes } from '../../../types'; +import { DashboardRoutes } from 'app/types/dashboard'; import PublicDashboardPageProxy, { PublicDashboardPageProxyProps } from './PublicDashboardPageProxy'; diff --git a/public/app/features/dashboard/containers/SoloPanelPage.test.tsx b/public/app/features/dashboard/containers/SoloPanelPage.test.tsx index 2a159054622..421d7456acf 100644 --- a/public/app/features/dashboard/containers/SoloPanelPage.test.tsx +++ b/public/app/features/dashboard/containers/SoloPanelPage.test.tsx @@ -5,7 +5,7 @@ import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock'; import { Dashboard } from '@grafana/schema'; import { GrafanaContext } from 'app/core/context/GrafanaContext'; import { RouteDescriptor } from 'app/core/navigation/types'; -import { DashboardMeta, DashboardRoutes } from 'app/types'; +import { DashboardMeta, DashboardRoutes } from 'app/types/dashboard'; import { getRouteComponentProps } from '../../../core/navigation/mocks/routeProps'; import { Props as DashboardPanelProps } from '../dashgrid/DashboardPanel'; diff --git a/public/app/features/dashboard/containers/SoloPanelPage.tsx b/public/app/features/dashboard/containers/SoloPanelPage.tsx index 7fbb737de76..1904e5eb487 100644 --- a/public/app/features/dashboard/containers/SoloPanelPage.tsx +++ b/public/app/features/dashboard/containers/SoloPanelPage.tsx @@ -10,7 +10,7 @@ import { Alert, useStyles2 } from '@grafana/ui'; import { GrafanaRouteComponentProps } from 'app/core/navigation/types'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import { useGrafana } from '../../../core/context/GrafanaContext'; import { DashboardPanel } from '../dashgrid/DashboardPanel'; diff --git a/public/app/features/dashboard/dashgrid/DashboardEmpty.test.tsx b/public/app/features/dashboard/dashgrid/DashboardEmpty.test.tsx index d18120fc5f0..09370002336 100644 --- a/public/app/features/dashboard/dashgrid/DashboardEmpty.test.tsx +++ b/public/app/features/dashboard/dashgrid/DashboardEmpty.test.tsx @@ -8,8 +8,8 @@ import { onCreateNewPanel, onImportDashboard, onAddLibraryPanel } from '../utils import DashboardEmpty, { Props } from './DashboardEmpty'; -jest.mock('app/types', () => ({ - ...jest.requireActual('app/types'), +jest.mock('app/types/store', () => ({ + ...jest.requireActual('app/types/store'), useDispatch: () => jest.fn(), useSelector: () => jest.fn(), })); diff --git a/public/app/features/dashboard/dashgrid/DashboardEmpty.tsx b/public/app/features/dashboard/dashgrid/DashboardEmpty.tsx index 9c82b005616..38f57b344e5 100644 --- a/public/app/features/dashboard/dashgrid/DashboardEmpty.tsx +++ b/public/app/features/dashboard/dashgrid/DashboardEmpty.tsx @@ -14,7 +14,7 @@ import { import { buildPanelEditScene } from 'app/features/dashboard-scene/panel-edit/PanelEditor'; import { DashboardScene } from 'app/features/dashboard-scene/scene/DashboardScene'; import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; import { setInitialDatasource } from '../state/reducers'; diff --git a/public/app/features/dashboard/dashgrid/DashboardGrid.test.tsx b/public/app/features/dashboard/dashgrid/DashboardGrid.test.tsx index 164d49ba4b8..330b4df5a43 100644 --- a/public/app/features/dashboard/dashgrid/DashboardGrid.test.tsx +++ b/public/app/features/dashboard/dashgrid/DashboardGrid.test.tsx @@ -7,7 +7,7 @@ import { Dashboard } from '@grafana/schema'; import appEvents from 'app/core/app_events'; import { GetVariables } from 'app/features/variables/state/selectors'; import { VariablesChanged } from 'app/features/variables/types'; -import { DashboardMeta } from 'app/types'; +import { DashboardMeta } from 'app/types/dashboard'; import { DashboardModel } from '../state/DashboardModel'; import { createDashboardModelFixture } from '../state/__fixtures__/dashboardFixtures'; diff --git a/public/app/features/dashboard/dashgrid/DashboardPanel.tsx b/public/app/features/dashboard/dashgrid/DashboardPanel.tsx index e1ba53b8142..db9f93bb92a 100644 --- a/public/app/features/dashboard/dashgrid/DashboardPanel.tsx +++ b/public/app/features/dashboard/dashgrid/DashboardPanel.tsx @@ -1,7 +1,7 @@ import { PureComponent } from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import { initPanelState } from '../../panel/state/actions'; import { setPanelInstanceState } from '../../panel/state/reducers'; diff --git a/public/app/features/dashboard/routes.ts b/public/app/features/dashboard/routes.ts index 4c20ec7229f..84e7d514b99 100644 --- a/public/app/features/dashboard/routes.ts +++ b/public/app/features/dashboard/routes.ts @@ -1,7 +1,8 @@ +import { DashboardRoutes } from 'app/types/dashboard'; + import { SafeDynamicImport } from '../../core/components/DynamicImports/SafeDynamicImport'; import { config } from '../../core/config'; import { RouteDescriptor } from '../../core/navigation/types'; -import { DashboardRoutes } from '../../types'; export const getPublicDashboardRoutes = (): RouteDescriptor[] => { if (!config.publicDashboardsEnabled) { diff --git a/public/app/features/dashboard/services/DashboardLoaderSrv.ts b/public/app/features/dashboard/services/DashboardLoaderSrv.ts index 22bb842a761..d28f575ce86 100644 --- a/public/app/features/dashboard/services/DashboardLoaderSrv.ts +++ b/public/app/features/dashboard/services/DashboardLoaderSrv.ts @@ -10,7 +10,7 @@ import impressionSrv from 'app/core/services/impression_srv'; import kbn from 'app/core/utils/kbn'; import { getDashboardScenePageStateManager } from 'app/features/dashboard-scene/pages/DashboardScenePageStateManager'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; -import { DashboardDTO } from 'app/types'; +import { DashboardDTO } from 'app/types/dashboard'; import { appEvents } from '../../../core/core'; import { ResponseTransformers } from '../api/ResponseTransformers'; diff --git a/public/app/features/dashboard/services/DashboardSrv.ts b/public/app/features/dashboard/services/DashboardSrv.ts index 99d7423e389..0ae57780d81 100644 --- a/public/app/features/dashboard/services/DashboardSrv.ts +++ b/public/app/features/dashboard/services/DashboardSrv.ts @@ -5,7 +5,7 @@ import { Dashboard } from '@grafana/schema'; import { appEvents } from 'app/core/app_events'; import { getBackendSrv } from 'app/core/services/backend_srv'; import { getDashboardAPI } from 'app/features/dashboard/api/dashboard_api'; -import { DashboardMeta } from 'app/types'; +import { DashboardMeta } from 'app/types/dashboard'; import { RemovePanelEvent } from '../../../types/events'; import { DashboardModel } from '../state/DashboardModel'; diff --git a/public/app/features/dashboard/services/SnapshotSrv.ts b/public/app/features/dashboard/services/SnapshotSrv.ts index 1ca4894de22..c9d240ee3b4 100644 --- a/public/app/features/dashboard/services/SnapshotSrv.ts +++ b/public/app/features/dashboard/services/SnapshotSrv.ts @@ -2,7 +2,7 @@ import { lastValueFrom, map } from 'rxjs'; import { config, getBackendSrv, FetchResponse } from '@grafana/runtime'; import { contextSrv } from 'app/core/core'; -import { DashboardDataDTO, DashboardDTO } from 'app/types'; +import { DashboardDataDTO, DashboardDTO } from 'app/types/dashboard'; import { getAPINamespace } from '../../../api/utils'; diff --git a/public/app/features/dashboard/state/DashboardModel.ts b/public/app/features/dashboard/state/DashboardModel.ts index eacc6be7378..cea82ff384a 100644 --- a/public/app/features/dashboard/state/DashboardModel.ts +++ b/public/app/features/dashboard/state/DashboardModel.ts @@ -27,8 +27,13 @@ import { sortedDeepCloneWithoutNulls } from 'app/core/utils/object'; import { variableAdapters } from 'app/features/variables/adapters'; import { onTimeRangeUpdated } from 'app/features/variables/state/actions'; import { GetVariables, getVariablesByKey } from 'app/features/variables/state/selectors'; -import { CoreEvents, DashboardMeta } from 'app/types'; -import { DashboardMetaChangedEvent, DashboardPanelsChangedEvent, RenderEvent } from 'app/types/events'; +import { DashboardMeta } from 'app/types/dashboard'; +import { + DashboardMetaChangedEvent, + DashboardPanelsChangedEvent, + RenderEvent, + templateVariableValueUpdated, +} from 'app/types/events'; import { appEvents } from '../../../core/core'; import { dispatch } from '../../../store/store'; @@ -1155,7 +1160,7 @@ export class DashboardModel implements TimeModel { templateVariableValueUpdated() { this.processRepeats(); - this.events.emit(CoreEvents.templateVariableValueUpdated); + this.events.emit(templateVariableValueUpdated); } getPanelByUrlId(panelUrlId: string) { diff --git a/public/app/features/dashboard/state/PanelModel.ts b/public/app/features/dashboard/state/PanelModel.ts index 3002dd32134..8556006879d 100644 --- a/public/app/features/dashboard/state/PanelModel.ts +++ b/public/app/features/dashboard/state/PanelModel.ts @@ -25,13 +25,13 @@ import { getTemplateSrv, RefreshEvent } from '@grafana/runtime'; import { LibraryPanel, LibraryPanelRef } from '@grafana/schema'; import config from 'app/core/config'; import { safeStringifyValue } from 'app/core/utils/explore'; -import { QueryGroupOptions } from 'app/types'; import { PanelOptionsChangedEvent, PanelQueriesChangedEvent, PanelTransformationsChangedEvent, RenderEvent, } from 'app/types/events'; +import { QueryGroupOptions } from 'app/types/query'; import { PanelQueryRunner } from '../../query/state/PanelQueryRunner'; import { TimeOverrideResult } from '../utils/panel'; diff --git a/public/app/features/dashboard/state/__fixtures__/dashboardFixtures.ts b/public/app/features/dashboard/state/__fixtures__/dashboardFixtures.ts index 8dec4d28339..28bc7897330 100644 --- a/public/app/features/dashboard/state/__fixtures__/dashboardFixtures.ts +++ b/public/app/features/dashboard/state/__fixtures__/dashboardFixtures.ts @@ -8,7 +8,7 @@ import { VariableModel, } from '@grafana/schema'; import { GetVariables } from 'app/features/variables/state/selectors'; -import { DashboardMeta } from 'app/types'; +import { DashboardMeta } from 'app/types/dashboard'; import { DashboardModel } from '../DashboardModel'; diff --git a/public/app/features/dashboard/state/actions.ts b/public/app/features/dashboard/state/actions.ts index ed28663f745..0395c6e9201 100644 --- a/public/app/features/dashboard/state/actions.ts +++ b/public/app/features/dashboard/state/actions.ts @@ -7,7 +7,7 @@ import { getDashboardAPI } from 'app/features/dashboard/api/dashboard_api'; import { dashboardWatcher } from 'app/features/live/dashboard/dashboardWatcher'; import { removeAllPanels } from 'app/features/panel/state/reducers'; import { updateTimeZoneForSession, updateWeekStartForSession } from 'app/features/profile/state/reducers'; -import { ThunkResult } from 'app/types'; +import { ThunkResult } from 'app/types/store'; import { loadPluginDashboards } from '../../plugins/admin/state/actions'; import { cancelVariables } from '../../variables/state/actions'; diff --git a/public/app/features/dashboard/state/initDashboard.test.ts b/public/app/features/dashboard/state/initDashboard.test.ts index d291b62f379..123552c6984 100644 --- a/public/app/features/dashboard/state/initDashboard.test.ts +++ b/public/app/features/dashboard/state/initDashboard.test.ts @@ -9,7 +9,7 @@ import { KeybindingSrv } from 'app/core/services/keybindingSrv'; import { variableAdapters } from 'app/features/variables/adapters'; import { createConstantVariableAdapter } from 'app/features/variables/constant/adapter'; import { constantBuilder } from 'app/features/variables/shared/testing/builders'; -import { DashboardInitPhase, DashboardRoutes } from 'app/types'; +import { DashboardInitPhase, DashboardRoutes } from 'app/types/dashboard'; import { Echo } from '../../../core/services/echo/Echo'; import { diff --git a/public/app/features/dashboard/state/initDashboard.ts b/public/app/features/dashboard/state/initDashboard.ts index 92feb552f55..348bb55616c 100644 --- a/public/app/features/dashboard/state/initDashboard.ts +++ b/public/app/features/dashboard/state/initDashboard.ts @@ -27,10 +27,8 @@ import { DashboardRoutes, HomeDashboardRedirectDTO, isRedirectResponse, - StoreState, - ThunkDispatch, - ThunkResult, -} from 'app/types'; +} from 'app/types/dashboard'; +import { StoreState, ThunkDispatch, ThunkResult } from 'app/types/store'; import { createDashboardQueryRunner } from '../../query/state/DashboardQueryRunner/DashboardQueryRunner'; import { initVariablesTransaction } from '../../variables/state/actions'; diff --git a/public/app/features/dashboard/state/reducers.test.ts b/public/app/features/dashboard/state/reducers.test.ts index 0cb8ee5cd32..f2d44fa61fb 100644 --- a/public/app/features/dashboard/state/reducers.test.ts +++ b/public/app/features/dashboard/state/reducers.test.ts @@ -1,4 +1,4 @@ -import { DashboardInitPhase, DashboardState } from 'app/types'; +import { DashboardInitPhase, DashboardState } from 'app/types/dashboard'; import { createDashboardModelFixture, createPanelSaveModel } from './__fixtures__/dashboardFixtures'; import { diff --git a/public/app/features/dashboard/state/reducers.ts b/public/app/features/dashboard/state/reducers.ts index ddc842fc568..c96d82d8bef 100644 --- a/public/app/features/dashboard/state/reducers.ts +++ b/public/app/features/dashboard/state/reducers.ts @@ -3,7 +3,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'; import { PanelPlugin } from '@grafana/data'; import { t } from '@grafana/i18n'; import { defaultDashboard } from '@grafana/schema'; -import { DashboardInitError, DashboardInitPhase, DashboardState } from 'app/types'; +import { DashboardInitError, DashboardInitPhase, DashboardState } from 'app/types/dashboard'; import { DashboardModel } from './DashboardModel'; import { PanelModel } from './PanelModel'; diff --git a/public/app/features/dashboard/state/selectors.ts b/public/app/features/dashboard/state/selectors.ts index 59d486d3a73..d45630812fd 100644 --- a/public/app/features/dashboard/state/selectors.ts +++ b/public/app/features/dashboard/state/selectors.ts @@ -1,5 +1,5 @@ import { PanelPlugin } from '@grafana/data'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import { getPanelPluginNotFound } from '../../panel/components/PanelPluginError'; diff --git a/public/app/features/dashboard/utils/getPanelMenu.test.ts b/public/app/features/dashboard/utils/getPanelMenu.test.ts index 496e825cb69..3a18ce049dc 100644 --- a/public/app/features/dashboard/utils/getPanelMenu.test.ts +++ b/public/app/features/dashboard/utils/getPanelMenu.test.ts @@ -6,7 +6,7 @@ import config from 'app/core/config'; import { grantUserPermissions } from 'app/features/alerting/unified/mocks'; import * as actions from 'app/features/explore/state/main'; import { setStore } from 'app/store/store'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { PanelModel } from '../state/PanelModel'; import { createDashboardModelFixture } from '../state/__fixtures__/dashboardFixtures'; diff --git a/public/app/features/datasources/components/DashboardsTable.test.tsx b/public/app/features/datasources/components/DashboardsTable.test.tsx index 3aac4b5a6a9..46b8148c992 100644 --- a/public/app/features/datasources/components/DashboardsTable.test.tsx +++ b/public/app/features/datasources/components/DashboardsTable.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { PluginDashboard } from 'app/types'; +import { PluginDashboard } from 'app/types/plugins'; import DashboardsTable, { Props } from './DashboardsTable'; diff --git a/public/app/features/datasources/components/DashboardsTable.tsx b/public/app/features/datasources/components/DashboardsTable.tsx index 0f3424a05df..145114ed6d5 100644 --- a/public/app/features/datasources/components/DashboardsTable.tsx +++ b/public/app/features/datasources/components/DashboardsTable.tsx @@ -1,6 +1,6 @@ import { Trans, t } from '@grafana/i18n'; import { Button, Icon } from '@grafana/ui'; -import { PluginDashboard } from 'app/types'; +import { PluginDashboard } from 'app/types/plugins'; export interface Props { // List of plugin dashboards to show in the table diff --git a/public/app/features/datasources/components/DataSourceAddButton.tsx b/public/app/features/datasources/components/DataSourceAddButton.tsx index f41ad1a657b..627c3695da0 100644 --- a/public/app/features/datasources/components/DataSourceAddButton.tsx +++ b/public/app/features/datasources/components/DataSourceAddButton.tsx @@ -5,7 +5,7 @@ import { config } from '@grafana/runtime'; import { LinkButton } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; import { ROUTES } from 'app/features/connections/constants'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { trackAddNewDsClicked } from '../tracking'; diff --git a/public/app/features/datasources/components/DataSourceCategories.tsx b/public/app/features/datasources/components/DataSourceCategories.tsx index 58fa0e3783f..45eb2623e45 100644 --- a/public/app/features/datasources/components/DataSourceCategories.tsx +++ b/public/app/features/datasources/components/DataSourceCategories.tsx @@ -5,7 +5,7 @@ import { DataSourcePluginMeta, GrafanaTheme2 } from '@grafana/data'; import { Trans } from '@grafana/i18n'; import { reportInteraction } from '@grafana/runtime'; import { LinkButton, useStyles2 } from '@grafana/ui'; -import { DataSourcePluginCategory } from 'app/types'; +import { DataSourcePluginCategory } from 'app/types/datasources'; import { ROUTES } from '../../connections/constants'; diff --git a/public/app/features/datasources/components/DataSourceDashboards.tsx b/public/app/features/datasources/components/DataSourceDashboards.tsx index d4011844e4c..0a16c265a02 100644 --- a/public/app/features/datasources/components/DataSourceDashboards.tsx +++ b/public/app/features/datasources/components/DataSourceDashboards.tsx @@ -3,7 +3,8 @@ import { useEffect } from 'react'; import PageLoader from 'app/core/components/PageLoader/PageLoader'; import { importDashboard, removeDashboard } from 'app/features/dashboard/state/actions'; import { loadPluginDashboards } from 'app/features/plugins/admin/state/actions'; -import { PluginDashboard, StoreState, useDispatch, useSelector } from 'app/types'; +import { PluginDashboard } from 'app/types/plugins'; +import { StoreState, useDispatch, useSelector } from 'app/types/store'; import DashboardTable from '../components/DashboardsTable'; import { useInitDataSourceSettings } from '../state/hooks'; diff --git a/public/app/features/datasources/components/DataSourcesList.tsx b/public/app/features/datasources/components/DataSourcesList.tsx index 1437fa395e8..b4337792ebc 100644 --- a/public/app/features/datasources/components/DataSourcesList.tsx +++ b/public/app/features/datasources/components/DataSourcesList.tsx @@ -7,7 +7,8 @@ import { Trans, t } from '@grafana/i18n'; import { config } from '@grafana/runtime'; import { EmptyState, LinkButton, TextLink, useStyles2 } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; -import { StoreState, AccessControlAction, useSelector } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { StoreState, useSelector } from 'app/types/store'; import { ROUTES } from '../../connections/constants'; import { useLoadDataSources } from '../state/hooks'; diff --git a/public/app/features/datasources/components/DataSourcesListHeader.tsx b/public/app/features/datasources/components/DataSourcesListHeader.tsx index f23f8b3cb6b..26db52a7a33 100644 --- a/public/app/features/datasources/components/DataSourcesListHeader.tsx +++ b/public/app/features/datasources/components/DataSourcesListHeader.tsx @@ -3,7 +3,7 @@ import { useCallback, useMemo } from 'react'; import { SelectableValue } from '@grafana/data'; import PageActionBar from 'app/core/components/PageActionBar/PageActionBar'; -import { StoreState, useSelector, useDispatch } from 'app/types'; +import { StoreState, useSelector, useDispatch } from 'app/types/store'; import { setDataSourcesSearchQuery, setIsSortAscending } from '../state/reducers'; import { getDataSourcesSearchQuery, getDataSourcesSort } from '../state/selectors'; diff --git a/public/app/features/datasources/components/EditDataSource.tsx b/public/app/features/datasources/components/EditDataSource.tsx index 920979f0cd4..06877e8ad72 100644 --- a/public/app/features/datasources/components/EditDataSource.tsx +++ b/public/app/features/datasources/components/EditDataSource.tsx @@ -13,7 +13,8 @@ import { import { getDataSourceSrv, usePluginComponents, UsePluginComponentsResult } from '@grafana/runtime'; import appEvents from 'app/core/app_events'; import PageLoader from 'app/core/components/PageLoader/PageLoader'; -import { DataSourceSettingsState, useDispatch } from 'app/types'; +import { DataSourceSettingsState } from 'app/types/datasources'; +import { useDispatch } from 'app/types/store'; import { useDataSource, diff --git a/public/app/features/datasources/components/NewDataSource.tsx b/public/app/features/datasources/components/NewDataSource.tsx index 7803caac224..8db925f5e87 100644 --- a/public/app/features/datasources/components/NewDataSource.tsx +++ b/public/app/features/datasources/components/NewDataSource.tsx @@ -5,7 +5,8 @@ import { Trans, t } from '@grafana/i18n'; import { LinkButton, FilterInput } from '@grafana/ui'; import PageLoader from 'app/core/components/PageLoader/PageLoader'; import { PluginsErrorsInfo } from 'app/features/plugins/components/PluginsErrorsInfo'; -import { DataSourcePluginCategory, StoreState, useDispatch, useSelector } from 'app/types'; +import { DataSourcePluginCategory } from 'app/types/datasources'; +import { StoreState, useDispatch, useSelector } from 'app/types/store'; import { ROUTES } from '../../connections/constants'; import { DataSourceCategories } from '../components/DataSourceCategories'; diff --git a/public/app/features/datasources/components/picker/AddNewDataSourceButton.tsx b/public/app/features/datasources/components/picker/AddNewDataSourceButton.tsx index b5489e59cb1..7e03ccf2c8b 100644 --- a/public/app/features/datasources/components/picker/AddNewDataSourceButton.tsx +++ b/public/app/features/datasources/components/picker/AddNewDataSourceButton.tsx @@ -3,7 +3,7 @@ import { Trans, t } from '@grafana/i18n'; import { LinkButton, ButtonVariant } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; import { ROUTES as CONNECTIONS_ROUTES } from 'app/features/connections/constants'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; interface AddNewDataSourceButtonProps { onClick?: () => void; diff --git a/public/app/features/datasources/components/picker/utils.ts b/public/app/features/datasources/components/picker/utils.ts index c626047631c..ff987c26f5b 100644 --- a/public/app/features/datasources/components/picker/utils.ts +++ b/public/app/features/datasources/components/picker/utils.ts @@ -5,7 +5,7 @@ import { setLastUsedDatasourceKeyForDashboard, } from 'app/features/dashboard/utils/dashboard'; import { MIXED_DATASOURCE_NAME } from 'app/plugins/datasource/mixed/MixedDataSource'; -import { QueryGroupDataSource } from 'app/types'; +import { QueryGroupDataSource } from 'app/types/query'; export function isDataSourceMatch( ds: DataSourceInstanceSettings | undefined, diff --git a/public/app/features/datasources/mocks/dataSourcesMocks.ts b/public/app/features/datasources/mocks/dataSourcesMocks.ts index b58dec19453..807082bd843 100644 --- a/public/app/features/datasources/mocks/dataSourcesMocks.ts +++ b/public/app/features/datasources/mocks/dataSourcesMocks.ts @@ -2,7 +2,8 @@ import { merge } from 'lodash'; import { DataSourceSettings, DataSourcePluginMeta, DataSourceJsonData } from '@grafana/data'; import amazonWebServicesPng from 'app/plugins/datasource/cloudwatch/img/amazon-web-services.png'; -import { DataSourceSettingsState, PluginDashboard } from 'app/types'; +import { DataSourceSettingsState } from 'app/types/datasources'; +import { PluginDashboard } from 'app/types/plugins'; export const getMockDashboard = (override?: Partial) => ({ uid: 'G1btqkgkK', diff --git a/public/app/features/datasources/state/actions.test.ts b/public/app/features/datasources/state/actions.test.ts index 0109a8c70fe..79aaf70a62c 100644 --- a/public/app/features/datasources/state/actions.test.ts +++ b/public/app/features/datasources/state/actions.test.ts @@ -4,7 +4,7 @@ import { AppPluginMeta, DataSourceSettings, PluginMetaInfo, PluginType } from '@ import { DataSourceSrv, FetchError } from '@grafana/runtime'; import { appEvents } from 'app/core/core'; import { getBackendSrv } from 'app/core/services/backend_srv'; -import { ThunkResult, ThunkDispatch } from 'app/types'; +import { ThunkResult, ThunkDispatch } from 'app/types/store'; import * as api from '../api'; import { DATASOURCES_ROUTES } from '../constants'; diff --git a/public/app/features/datasources/state/actions.ts b/public/app/features/datasources/state/actions.ts index 7cd1411b9eb..46623ac6112 100644 --- a/public/app/features/datasources/state/actions.ts +++ b/public/app/features/datasources/state/actions.ts @@ -25,7 +25,9 @@ import { ROUTES as CONNECTIONS_ROUTES } from 'app/features/connections/constants import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; import { getPluginSettings } from 'app/features/plugins/pluginSettings'; import { importDataSourcePlugin } from 'app/features/plugins/plugin_loader'; -import { AccessControlAction, DataSourcePluginCategory, ThunkDispatch, ThunkResult } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { DataSourcePluginCategory } from 'app/types/datasources'; +import { ThunkDispatch, ThunkResult } from 'app/types/store'; import * as api from '../api'; import { DATASOURCES_ROUTES } from '../constants'; diff --git a/public/app/features/datasources/state/buildCategories.ts b/public/app/features/datasources/state/buildCategories.ts index b357798fdaa..ec813a6e1e6 100644 --- a/public/app/features/datasources/state/buildCategories.ts +++ b/public/app/features/datasources/state/buildCategories.ts @@ -1,7 +1,7 @@ import { DataSourcePluginMeta, PluginType } from '@grafana/data'; import { t } from '@grafana/i18n'; import { featureEnabled } from '@grafana/runtime'; -import { DataSourcePluginCategory } from 'app/types'; +import { DataSourcePluginCategory } from 'app/types/datasources'; import grafanaIconSvg from 'img/grafana_icon.svg'; import adobeAnalyticsSvg from 'img/plugins/adobe-analytics.svg'; import appdynamicsSvg from 'img/plugins/appdynamics.svg'; diff --git a/public/app/features/datasources/state/hooks.ts b/public/app/features/datasources/state/hooks.ts index af0c5dd7e6b..61e7be7ae09 100644 --- a/public/app/features/datasources/state/hooks.ts +++ b/public/app/features/datasources/state/hooks.ts @@ -5,8 +5,9 @@ import { t } from '@grafana/i18n'; import { cleanUpAction } from 'app/core/actions/cleanUp'; import appEvents from 'app/core/app_events'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, useDispatch, useSelector } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { ShowConfirmModalEvent } from 'app/types/events'; +import { useDispatch, useSelector } from 'app/types/store'; import { ROUTES } from '../../connections/constants'; import { DataSourceRights } from '../types'; diff --git a/public/app/features/datasources/state/navModel.ts b/public/app/features/datasources/state/navModel.ts index c71bff78248..2c685beae68 100644 --- a/public/app/features/datasources/state/navModel.ts +++ b/public/app/features/datasources/state/navModel.ts @@ -5,7 +5,7 @@ import { ProBadge } from 'app/core/components/Upgrade/ProBadge'; import config from 'app/core/config'; import { contextSrv } from 'app/core/core'; import { highlightTrial } from 'app/features/admin/utils'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import icnDatasourceSvg from 'img/icn-datasource.svg'; import { GenericDataSourcePlugin } from '../types'; diff --git a/public/app/features/datasources/state/reducers.test.ts b/public/app/features/datasources/state/reducers.test.ts index 85f6455e837..43555d3208b 100644 --- a/public/app/features/datasources/state/reducers.test.ts +++ b/public/app/features/datasources/state/reducers.test.ts @@ -1,7 +1,7 @@ import { reducerTester } from 'test/core/redux/reducerTester'; import { PluginMeta, PluginMetaInfo, PluginType, LayoutModes } from '@grafana/data'; -import { DataSourceSettingsState, DataSourcesState } from 'app/types'; +import { DataSourceSettingsState, DataSourcesState } from 'app/types/datasources'; import { getMockDataSource, getMockDataSources } from '../mocks/dataSourcesMocks'; import { GenericDataSourcePlugin } from '../types'; diff --git a/public/app/features/datasources/state/reducers.ts b/public/app/features/datasources/state/reducers.ts index e5b2588499c..700f06e6133 100644 --- a/public/app/features/datasources/state/reducers.ts +++ b/public/app/features/datasources/state/reducers.ts @@ -3,7 +3,7 @@ import { AnyAction, createAction } from '@reduxjs/toolkit'; import { DataSourcePluginMeta, DataSourceSettings, LayoutMode, LayoutModes } from '@grafana/data'; import { t } from '@grafana/i18n'; import { TestingStatus } from '@grafana/runtime'; -import { DataSourcesState, DataSourceSettingsState } from 'app/types'; +import { DataSourcesState, DataSourceSettingsState } from 'app/types/datasources'; import { GenericDataSourcePlugin } from '../types'; diff --git a/public/app/features/explore/CorrelationEditorModeBar.tsx b/public/app/features/explore/CorrelationEditorModeBar.tsx index 87d531eb41d..25739ad1b5c 100644 --- a/public/app/features/explore/CorrelationEditorModeBar.tsx +++ b/public/app/features/explore/CorrelationEditorModeBar.tsx @@ -7,7 +7,8 @@ import { Trans, t } from '@grafana/i18n'; import { reportInteraction } from '@grafana/runtime'; import { Button, Icon, Stack, Tooltip, useStyles2 } from '@grafana/ui'; import { Prompt } from 'app/core/components/FormPrompt/Prompt'; -import { CORRELATION_EDITOR_POST_CONFIRM_ACTION, ExploreItemState, useDispatch, useSelector } from 'app/types'; +import { CORRELATION_EDITOR_POST_CONFIRM_ACTION, ExploreItemState } from 'app/types/explore'; +import { useDispatch, useSelector } from 'app/types/store'; import { CorrelationUnsavedChangesModal } from './CorrelationUnsavedChangesModal'; import { showModalMessage } from './correlationEditLogic'; diff --git a/public/app/features/explore/CorrelationHelper.tsx b/public/app/features/explore/CorrelationHelper.tsx index 2444a4dd7b6..bf57509bf63 100644 --- a/public/app/features/explore/CorrelationHelper.tsx +++ b/public/app/features/explore/CorrelationHelper.tsx @@ -19,7 +19,7 @@ import { Icon, Stack, } from '@grafana/ui'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; import { getTransformationVars } from '../correlations/transformations'; import { generateDefaultLabel } from '../correlations/utils'; diff --git a/public/app/features/explore/Explore.tsx b/public/app/features/explore/Explore.tsx index bbaf27f3524..57ef823de4d 100644 --- a/public/app/features/explore/Explore.tsx +++ b/public/app/features/explore/Explore.tsx @@ -33,7 +33,7 @@ import { import { FILTER_FOR_OPERATOR, FILTER_OUT_OPERATOR } from '@grafana/ui/internal'; import { supportedFeatures } from 'app/core/history/richHistoryStorageProvider'; import { MIXED_DATASOURCE_NAME } from 'app/plugins/datasource/mixed/MixedDataSource'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import { getTimeZone } from '../profile/state/selectors'; diff --git a/public/app/features/explore/ExploreActions.tsx b/public/app/features/explore/ExploreActions.tsx index de35e644b4e..376cc25d715 100644 --- a/public/app/features/explore/ExploreActions.tsx +++ b/public/app/features/explore/ExploreActions.tsx @@ -4,7 +4,8 @@ import { useEffect, useState } from 'react'; import { config } from '@grafana/runtime'; import { contextSrv } from 'app/core/services/context_srv'; import { MIXED_DATASOURCE_NAME } from 'app/plugins/datasource/mixed/MixedDataSource'; -import { AccessControlAction, useDispatch, useSelector } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { useDispatch, useSelector } from 'app/types/store'; import { splitOpen, splitClose, changeCorrelationEditorDetails } from './state/main'; import { runQueries } from './state/query'; diff --git a/public/app/features/explore/ExplorePage.tsx b/public/app/features/explore/ExplorePage.tsx index 6799eddec3b..d5974011bbb 100644 --- a/public/app/features/explore/ExplorePage.tsx +++ b/public/app/features/explore/ExplorePage.tsx @@ -9,8 +9,8 @@ import { SplitPaneWrapper } from 'app/core/components/SplitPaneWrapper/SplitPane import { useGrafana } from 'app/core/context/GrafanaContext'; import { useNavModel } from 'app/core/hooks/useNavModel'; import { GrafanaRouteComponentProps } from 'app/core/navigation/types'; -import { useSelector } from 'app/types'; import { ExploreQueryParams } from 'app/types/explore'; +import { useSelector } from 'app/types/store'; import { CorrelationEditorModeBar } from './CorrelationEditorModeBar'; import { ExploreActions } from './ExploreActions'; diff --git a/public/app/features/explore/ExplorePaneContainer.tsx b/public/app/features/explore/ExplorePaneContainer.tsx index 07aba1a5a41..d6d9831bbc2 100644 --- a/public/app/features/explore/ExplorePaneContainer.tsx +++ b/public/app/features/explore/ExplorePaneContainer.tsx @@ -5,7 +5,7 @@ import { connect } from 'react-redux'; import { EventBusSrv, getTimeZone } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; import { stopQueryState } from 'app/core/utils/explore'; -import { StoreState, useSelector } from 'app/types'; +import { StoreState, useSelector } from 'app/types/store'; import Explore from './Explore'; import ExploreQueryInspector from './ExploreQueryInspector'; diff --git a/public/app/features/explore/ExploreQueryInspector.tsx b/public/app/features/explore/ExploreQueryInspector.tsx index 24f73322bc1..70badc6c689 100644 --- a/public/app/features/explore/ExploreQueryInspector.tsx +++ b/public/app/features/explore/ExploreQueryInspector.tsx @@ -15,7 +15,8 @@ import { InspectJSONTab } from 'app/features/inspector/InspectJSONTab'; import { InspectStatsTab } from 'app/features/inspector/InspectStatsTab'; import { QueryInspector } from 'app/features/inspector/QueryInspector'; import { mixedRequestId } from 'app/plugins/datasource/mixed/MixedDataSource'; -import { StoreState, ExploreItemState } from 'app/types'; +import { ExploreItemState } from 'app/types/explore'; +import { StoreState } from 'app/types/store'; import { GetDataOptions } from '../query/state/PanelQueryRunner'; diff --git a/public/app/features/explore/ExploreRunQueryButton.test.tsx b/public/app/features/explore/ExploreRunQueryButton.test.tsx index e2b518654e9..0cb9290f62c 100644 --- a/public/app/features/explore/ExploreRunQueryButton.test.tsx +++ b/public/app/features/explore/ExploreRunQueryButton.test.tsx @@ -6,7 +6,7 @@ import { DatasourceSrvMock, MockDataSourceApi } from 'test/mocks/datasource_srv' import { DataSourceApi } from '@grafana/data'; import { DataQuery } from '@grafana/schema'; import { configureStore } from 'app/store/configureStore'; -import { ExploreItemState, ExploreState } from 'app/types'; +import { ExploreItemState, ExploreState } from 'app/types/explore'; import { Props, ExploreRunQueryButton } from './ExploreRunQueryButton'; import { makeExplorePaneState } from './state/utils'; diff --git a/public/app/features/explore/ExploreRunQueryButton.tsx b/public/app/features/explore/ExploreRunQueryButton.tsx index 49a2fe3acaa..78f54525705 100644 --- a/public/app/features/explore/ExploreRunQueryButton.tsx +++ b/public/app/features/explore/ExploreRunQueryButton.tsx @@ -5,7 +5,7 @@ import { t } from '@grafana/i18n'; import { config, reportInteraction } from '@grafana/runtime'; import { DataQuery } from '@grafana/schema'; import { Button, Dropdown, Menu, ToolbarButton } from '@grafana/ui'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { changeDatasource } from './state/datasource'; import { setQueries } from './state/query'; diff --git a/public/app/features/explore/Graph/ExploreGraph.tsx b/public/app/features/explore/Graph/ExploreGraph.tsx index cd69a11af37..e4dedb3f76c 100644 --- a/public/app/features/explore/Graph/ExploreGraph.tsx +++ b/public/app/features/explore/Graph/ExploreGraph.tsx @@ -31,7 +31,7 @@ import { import { PanelContext, PanelContextProvider, SeriesVisibilityChangeMode, useTheme2 } from '@grafana/ui'; import { defaultGraphConfig, getGraphFieldConfig } from 'app/plugins/panel/timeseries/config'; import { Options as TimeSeriesOptions } from 'app/plugins/panel/timeseries/panelcfg.gen'; -import { ExploreGraphStyle } from 'app/types'; +import { ExploreGraphStyle } from 'app/types/explore'; import { seriesVisibilityConfigFactory } from '../../dashboard/dashgrid/SeriesVisibilityConfigFactory'; import { useExploreDataLinkPostProcessor } from '../hooks/useExploreDataLinkPostProcessor'; diff --git a/public/app/features/explore/Graph/ExploreGraphLabel.tsx b/public/app/features/explore/Graph/ExploreGraphLabel.tsx index a8be709f53b..9b2069546eb 100644 --- a/public/app/features/explore/Graph/ExploreGraphLabel.tsx +++ b/public/app/features/explore/Graph/ExploreGraphLabel.tsx @@ -1,6 +1,6 @@ import { SelectableValue } from '@grafana/data'; import { RadioButtonGroup } from '@grafana/ui'; -import { EXPLORE_GRAPH_STYLES, ExploreGraphStyle } from 'app/types'; +import { EXPLORE_GRAPH_STYLES, ExploreGraphStyle } from 'app/types/explore'; const ALL_GRAPH_STYLE_OPTIONS: Array> = EXPLORE_GRAPH_STYLES.map((style) => ({ value: style, diff --git a/public/app/features/explore/Graph/GraphContainer.tsx b/public/app/features/explore/Graph/GraphContainer.tsx index b9a9fe44a5f..7cbf420dccf 100644 --- a/public/app/features/explore/Graph/GraphContainer.tsx +++ b/public/app/features/explore/Graph/GraphContainer.tsx @@ -13,7 +13,7 @@ import { } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { GraphThresholdsStyleConfig, PanelChrome, PanelChromeProps } from '@grafana/ui'; -import { ExploreGraphStyle } from 'app/types'; +import { ExploreGraphStyle } from 'app/types/explore'; import { LimitedDataDisclaimer } from '../LimitedDataDisclaimer'; import { storeGraphStyle } from '../state/utils'; diff --git a/public/app/features/explore/Graph/exploreGraphStyleUtils.ts b/public/app/features/explore/Graph/exploreGraphStyleUtils.ts index 224ece64100..6206d387058 100644 --- a/public/app/features/explore/Graph/exploreGraphStyleUtils.ts +++ b/public/app/features/explore/Graph/exploreGraphStyleUtils.ts @@ -2,7 +2,7 @@ import { produce } from 'immer'; import { FieldConfigSource, ThresholdsConfig } from '@grafana/data'; import { GraphDrawStyle, GraphFieldConfig, GraphThresholdsStyleConfig, StackingMode } from '@grafana/schema'; -import { ExploreGraphStyle } from 'app/types'; +import { ExploreGraphStyle } from 'app/types/explore'; export type FieldConfig = FieldConfigSource; diff --git a/public/app/features/explore/Graph/utils.ts b/public/app/features/explore/Graph/utils.ts index 3b42e342c1f..38ee661969b 100644 --- a/public/app/features/explore/Graph/utils.ts +++ b/public/app/features/explore/Graph/utils.ts @@ -1,5 +1,5 @@ import store from 'app/core/store'; -import { ExploreGraphStyle, EXPLORE_GRAPH_STYLES } from 'app/types'; +import { ExploreGraphStyle, EXPLORE_GRAPH_STYLES } from 'app/types/explore'; const GRAPH_STYLE_KEY = 'grafana.explore.style.graph'; export const storeGraphStyle = (graphStyle: string): void => { diff --git a/public/app/features/explore/Logs/Logs.tsx b/public/app/features/explore/Logs/Logs.tsx index 897bca4f24d..4507fa9e028 100644 --- a/public/app/features/explore/Logs/Logs.tsx +++ b/public/app/features/explore/Logs/Logs.tsx @@ -60,7 +60,8 @@ import { LokiQueryDirection } from 'app/plugins/datasource/loki/dataquery.gen'; import { isLokiQuery } from 'app/plugins/datasource/loki/queryUtils'; import { GetFieldLinksFn } from 'app/plugins/panel/logs/types'; import { getState } from 'app/store/store'; -import { ExploreItemState, useDispatch } from 'app/types'; +import { ExploreItemState } from 'app/types/explore'; +import { useDispatch } from 'app/types/store'; import { contentOutlineTrackPinAdded, diff --git a/public/app/features/explore/Logs/LogsContainer.tsx b/public/app/features/explore/Logs/LogsContainer.tsx index 8ca38ab007d..6ff6c9a248c 100644 --- a/public/app/features/explore/Logs/LogsContainer.tsx +++ b/public/app/features/explore/Logs/LogsContainer.tsx @@ -27,8 +27,8 @@ import { DataQuery } from '@grafana/schema'; import { Collapse } from '@grafana/ui'; import { MIXED_DATASOURCE_NAME } from 'app/plugins/datasource/mixed/MixedDataSource'; import { GetFieldLinksFn } from 'app/plugins/panel/logs/types'; -import { StoreState } from 'app/types'; import { ExploreItemState } from 'app/types/explore'; +import { StoreState } from 'app/types/store'; import { getTimeZone } from '../../profile/state/selectors'; import { diff --git a/public/app/features/explore/NoDataSourceCallToAction.tsx b/public/app/features/explore/NoDataSourceCallToAction.tsx index 822da87b1c6..5d67b2d1475 100644 --- a/public/app/features/explore/NoDataSourceCallToAction.tsx +++ b/public/app/features/explore/NoDataSourceCallToAction.tsx @@ -4,7 +4,7 @@ import { GrafanaTheme2 } from '@grafana/data'; import { Trans } from '@grafana/i18n'; import { LinkButton, CallToActionCard, Icon, useStyles2 } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; function getCardStyles(theme: GrafanaTheme2) { return css({ diff --git a/public/app/features/explore/NodeGraph/NodeGraphContainer.tsx b/public/app/features/explore/NodeGraph/NodeGraphContainer.tsx index c0e15131f0d..5c73e85776f 100644 --- a/public/app/features/explore/NodeGraph/NodeGraphContainer.tsx +++ b/public/app/features/explore/NodeGraph/NodeGraphContainer.tsx @@ -8,11 +8,11 @@ import { Trans, t } from '@grafana/i18n'; import { config, reportInteraction } from '@grafana/runtime'; import { useStyles2, useTheme2, PanelChrome } from '@grafana/ui'; import { layeredLayoutThreshold } from 'app/plugins/panel/nodeGraph/NodeGraph'; +import { StoreState } from 'app/types/store'; import { NodeGraph } from '../../../plugins/panel/nodeGraph'; import { LayoutAlgorithm } from '../../../plugins/panel/nodeGraph/panelcfg.gen'; import { useCategorizeFrames } from '../../../plugins/panel/nodeGraph/useCategorizeFrames'; -import { StoreState } from '../../../types'; import { useLinks } from '../utils/links'; const getStyles = (theme: GrafanaTheme2) => ({ diff --git a/public/app/features/explore/QueriesDrawer/QueriesDrawerContext.tsx b/public/app/features/explore/QueriesDrawer/QueriesDrawerContext.tsx index abcbc468bd5..67cf1055912 100644 --- a/public/app/features/explore/QueriesDrawer/QueriesDrawerContext.tsx +++ b/public/app/features/explore/QueriesDrawer/QueriesDrawerContext.tsx @@ -1,6 +1,6 @@ import { PropsWithChildren, useState, createContext, useContext, useEffect } from 'react'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { selectRichHistorySettings } from '../state/selectors'; diff --git a/public/app/features/explore/QueryRows.test.tsx b/public/app/features/explore/QueryRows.test.tsx index 8acb5e80b71..03989ec2950 100644 --- a/public/app/features/explore/QueryRows.test.tsx +++ b/public/app/features/explore/QueryRows.test.tsx @@ -5,7 +5,7 @@ import { DataSourceApi } from '@grafana/data'; import { DataSourceSrv, setDataSourceSrv } from '@grafana/runtime'; import { DataQuery } from '@grafana/schema'; import { configureStore } from 'app/store/configureStore'; -import { ExploreState } from 'app/types'; +import { ExploreState } from 'app/types/explore'; import { UserState } from '../profile/state/reducers'; diff --git a/public/app/features/explore/QueryRows.tsx b/public/app/features/explore/QueryRows.tsx index 42b39a20f6b..084c180544f 100644 --- a/public/app/features/explore/QueryRows.tsx +++ b/public/app/features/explore/QueryRows.tsx @@ -4,7 +4,7 @@ import { useCallback, useMemo } from 'react'; import { CoreApp, getNextRefId } from '@grafana/data'; import { reportInteraction } from '@grafana/runtime'; import { DataQuery, DataSourceRef } from '@grafana/schema'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; import { getDatasourceSrv } from '../plugins/datasource_srv'; import { QueryEditorRows } from '../query/components/QueryEditorRows'; diff --git a/public/app/features/explore/RawPrometheus/RawPrometheusContainer.test.tsx b/public/app/features/explore/RawPrometheus/RawPrometheusContainer.test.tsx index 7efd5f866e9..c1f0ed2aad2 100644 --- a/public/app/features/explore/RawPrometheus/RawPrometheusContainer.test.tsx +++ b/public/app/features/explore/RawPrometheus/RawPrometheusContainer.test.tsx @@ -2,7 +2,7 @@ import { fireEvent, render, screen, within } from '@testing-library/react'; import { FieldType, getDefaultTimeRange, InternalTimeZones, toDataFrame, LoadingState } from '@grafana/data'; import { getTemplateSrv } from 'app/features/templating/template_srv'; -import { TABLE_RESULTS_STYLE } from 'app/types'; +import { TABLE_RESULTS_STYLE } from 'app/types/explore'; import { RawPrometheusContainer } from './RawPrometheusContainer'; diff --git a/public/app/features/explore/RawPrometheus/RawPrometheusContainer.tsx b/public/app/features/explore/RawPrometheus/RawPrometheusContainer.tsx index 4269c1d7724..5ba8c1a9e2b 100644 --- a/public/app/features/explore/RawPrometheus/RawPrometheusContainer.tsx +++ b/public/app/features/explore/RawPrometheus/RawPrometheusContainer.tsx @@ -8,8 +8,8 @@ import { TimeZone } from '@grafana/schema'; import { RadioButtonGroup, Table, AdHocFilterItem, PanelChrome } from '@grafana/ui'; import { config } from 'app/core/config'; import { PANEL_BORDER } from 'app/core/constants'; -import { StoreState, TABLE_RESULTS_STYLE } from 'app/types'; -import { ExploreItemState, TABLE_RESULTS_STYLES, TableResultsStyle } from 'app/types/explore'; +import { ExploreItemState, TABLE_RESULTS_STYLE, TABLE_RESULTS_STYLES, TableResultsStyle } from 'app/types/explore'; +import { StoreState } from 'app/types/store'; import { MetaInfoText } from '../MetaInfoText'; import RawListContainer from '../PrometheusListView/RawListContainer'; diff --git a/public/app/features/explore/ResponseErrorContainer.tsx b/public/app/features/explore/ResponseErrorContainer.tsx index e0724c1a666..8124d2e68d1 100644 --- a/public/app/features/explore/ResponseErrorContainer.tsx +++ b/public/app/features/explore/ResponseErrorContainer.tsx @@ -1,5 +1,5 @@ import { LoadingState } from '@grafana/data'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { ErrorContainer } from './ErrorContainer'; diff --git a/public/app/features/explore/RichHistory/RichHistory.tsx b/public/app/features/explore/RichHistory/RichHistory.tsx index d78a69d14f5..b4fdc2b28e6 100644 --- a/public/app/features/explore/RichHistory/RichHistory.tsx +++ b/public/app/features/explore/RichHistory/RichHistory.tsx @@ -11,8 +11,8 @@ import { RichHistorySettings, createDatasourcesList, } from 'app/core/utils/richHistory'; -import { useSelector } from 'app/types'; import { RichHistoryQuery } from 'app/types/explore'; +import { useSelector } from 'app/types/store'; import { supportedFeatures } from '../../../core/history/richHistoryStorageProvider'; import { Tabs } from '../QueriesDrawer/QueriesDrawerContext'; diff --git a/public/app/features/explore/RichHistory/RichHistoryCard.test.tsx b/public/app/features/explore/RichHistory/RichHistoryCard.test.tsx index f0a9d5410f3..669f7d0dd4a 100644 --- a/public/app/features/explore/RichHistory/RichHistoryCard.test.tsx +++ b/public/app/features/explore/RichHistory/RichHistoryCard.test.tsx @@ -6,8 +6,8 @@ import { DataSourceApi, DataSourceInstanceSettings, DataSourcePluginMeta } from import { DataQuery, DataSourceRef } from '@grafana/schema'; import { MixedDatasource } from 'app/plugins/datasource/mixed/MixedDataSource'; import { configureStore } from 'app/store/configureStore'; -import { ExploreState, RichHistoryQuery } from 'app/types'; import { ShowConfirmModalEvent } from 'app/types/events'; +import { ExploreState, RichHistoryQuery } from 'app/types/explore'; import { RichHistoryCard, Props } from './RichHistoryCard'; diff --git a/public/app/features/explore/RichHistory/RichHistoryContainer.tsx b/public/app/features/explore/RichHistory/RichHistoryContainer.tsx index a08c439aa33..6d622353d38 100644 --- a/public/app/features/explore/RichHistory/RichHistoryContainer.tsx +++ b/public/app/features/explore/RichHistory/RichHistoryContainer.tsx @@ -6,7 +6,7 @@ import { Trans } from '@grafana/i18n'; import { config, reportInteraction } from '@grafana/runtime'; import { useTheme2 } from '@grafana/ui'; // Types -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; // Components, enums import { useQueriesDrawerContext } from '../QueriesDrawer/QueriesDrawerContext'; diff --git a/public/app/features/explore/RichHistory/RichHistoryStarredTab.tsx b/public/app/features/explore/RichHistory/RichHistoryStarredTab.tsx index 542f3b3d9e1..51c8f36851b 100644 --- a/public/app/features/explore/RichHistory/RichHistoryStarredTab.tsx +++ b/public/app/features/explore/RichHistory/RichHistoryStarredTab.tsx @@ -12,8 +12,8 @@ import { RichHistorySearchFilters, RichHistorySettings, } from 'app/core/utils/richHistory'; -import { useSelector } from 'app/types'; import { RichHistoryQuery } from 'app/types/explore'; +import { useSelector } from 'app/types/store'; import { selectExploreDSMaps } from '../state/selectors'; diff --git a/public/app/features/explore/SecondaryActions.tsx b/public/app/features/explore/SecondaryActions.tsx index e1f378bf262..cd9d25b860b 100644 --- a/public/app/features/explore/SecondaryActions.tsx +++ b/public/app/features/explore/SecondaryActions.tsx @@ -4,7 +4,7 @@ import { GrafanaTheme2 } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; import { Trans, t } from '@grafana/i18n'; import { ToolbarButton, useTheme2 } from '@grafana/ui'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { createDatasourcesList } from '../../core/utils/richHistory'; import { MIXED_DATASOURCE_NAME } from '../../plugins/datasource/mixed/MixedDataSource'; diff --git a/public/app/features/explore/ShortLinkButtonMenu.tsx b/public/app/features/explore/ShortLinkButtonMenu.tsx index 11ba51875e8..6764e007e3b 100644 --- a/public/app/features/explore/ShortLinkButtonMenu.tsx +++ b/public/app/features/explore/ShortLinkButtonMenu.tsx @@ -6,7 +6,7 @@ import { reportInteraction, config } from '@grafana/runtime'; import { Dropdown, Menu, MenuGroup, ButtonGroup, Button } from '@grafana/ui'; import { copyStringToClipboard } from 'app/core/utils/explore'; import { createAndCopyShortLink } from 'app/core/utils/shortLinks'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { selectPanes } from './state/selectors'; import { constructAbsoluteUrl } from './utils/links'; diff --git a/public/app/features/explore/Table/TableContainer.tsx b/public/app/features/explore/Table/TableContainer.tsx index 802c5602861..b0a203bd22a 100644 --- a/public/app/features/explore/Table/TableContainer.tsx +++ b/public/app/features/explore/Table/TableContainer.tsx @@ -12,8 +12,8 @@ import { hasDeprecatedParentRowIndex, migrateFromParentRowIndexToNestedFrames, } from 'app/plugins/panel/table/migrations'; -import { StoreState } from 'app/types'; import { ExploreItemState } from 'app/types/explore'; +import { StoreState } from 'app/types/store'; import { LimitedDataDisclaimer } from '../LimitedDataDisclaimer'; import { MetaInfoText } from '../MetaInfoText'; diff --git a/public/app/features/explore/TraceView/TraceView.tsx b/public/app/features/explore/TraceView/TraceView.tsx index 4afbe1d6b4a..ecb71ee92a8 100644 --- a/public/app/features/explore/TraceView/TraceView.tsx +++ b/public/app/features/explore/TraceView/TraceView.tsx @@ -23,7 +23,7 @@ import { useStyles2 } from '@grafana/ui'; import { TempoQuery } from '@grafana-plugins/tempo/types'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; import { getTimeZone } from 'app/features/profile/state/selectors'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; import { changePanelState } from '../state/explorePane'; diff --git a/public/app/features/explore/TraceView/TraceViewContainer.tsx b/public/app/features/explore/TraceView/TraceViewContainer.tsx index 5fbcd3ba4a5..9eff3de76f2 100644 --- a/public/app/features/explore/TraceView/TraceViewContainer.tsx +++ b/public/app/features/explore/TraceView/TraceViewContainer.tsx @@ -3,7 +3,7 @@ import { useMemo } from 'react'; import { DataFrame, SplitOpen, TimeRange } from '@grafana/data'; import { t } from '@grafana/i18n'; import { PanelChrome } from '@grafana/ui'; -import { StoreState, useSelector } from 'app/types'; +import { StoreState, useSelector } from 'app/types/store'; import { TraceView } from './TraceView'; import { transformDataFrames } from './utils/transform'; diff --git a/public/app/features/explore/correlationEditLogic.test.ts b/public/app/features/explore/correlationEditLogic.test.ts index dd3c37e95c6..fa80b340226 100644 --- a/public/app/features/explore/correlationEditLogic.test.ts +++ b/public/app/features/explore/correlationEditLogic.test.ts @@ -1,4 +1,4 @@ -import { CORRELATION_EDITOR_POST_CONFIRM_ACTION } from 'app/types'; +import { CORRELATION_EDITOR_POST_CONFIRM_ACTION } from 'app/types/explore'; import { showModalMessage } from './correlationEditLogic'; diff --git a/public/app/features/explore/correlationEditLogic.ts b/public/app/features/explore/correlationEditLogic.ts index 326389505c7..0e507453306 100644 --- a/public/app/features/explore/correlationEditLogic.ts +++ b/public/app/features/explore/correlationEditLogic.ts @@ -1,6 +1,6 @@ import { template } from 'lodash'; -import { CORRELATION_EDITOR_POST_CONFIRM_ACTION } from 'app/types'; +import { CORRELATION_EDITOR_POST_CONFIRM_ACTION } from 'app/types/explore'; enum CONSEQUENCES { SOURCE_TARGET_CHANGE = 'cause the query in the right pane to be re-ran and links added to that data', diff --git a/public/app/features/explore/extensions/AddToDashboard/ExploreToDashboardPanel.tsx b/public/app/features/explore/extensions/AddToDashboard/ExploreToDashboardPanel.tsx index 87dbc64f5ac..a3c5f1a22fb 100644 --- a/public/app/features/explore/extensions/AddToDashboard/ExploreToDashboardPanel.tsx +++ b/public/app/features/explore/extensions/AddToDashboard/ExploreToDashboardPanel.tsx @@ -1,7 +1,7 @@ import { type ReactElement } from 'react'; import { AddToDashboardForm } from 'app/features/dashboard-scene/addToDashboard/AddToDashboardForm'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { getExploreItemSelector } from '../../state/selectors'; diff --git a/public/app/features/explore/extensions/AddToDashboard/addToDashboard.test.ts b/public/app/features/explore/extensions/AddToDashboard/addToDashboard.test.ts index 1c7c8912a17..2f42709c2b0 100644 --- a/public/app/features/explore/extensions/AddToDashboard/addToDashboard.test.ts +++ b/public/app/features/explore/extensions/AddToDashboard/addToDashboard.test.ts @@ -1,6 +1,6 @@ import { getDefaultTimeRange, MutableDataFrame } from '@grafana/data'; import { DataQuery, LoadingState } from '@grafana/schema'; -import { ExplorePanelData } from 'app/types'; +import { ExplorePanelData } from 'app/types/explore'; import { buildDashboardPanelFromExploreState } from './addToDashboard'; diff --git a/public/app/features/explore/extensions/AddToDashboard/addToDashboard.ts b/public/app/features/explore/extensions/AddToDashboard/addToDashboard.ts index ac2e9cca741..ea78a8f81ff 100644 --- a/public/app/features/explore/extensions/AddToDashboard/addToDashboard.ts +++ b/public/app/features/explore/extensions/AddToDashboard/addToDashboard.ts @@ -2,7 +2,7 @@ import { DataFrame, ExplorePanelsState } from '@grafana/data'; import { t } from '@grafana/i18n'; import { DataQuery, DataSourceRef, Panel } from '@grafana/schema'; import { DataTransformerConfig } from '@grafana/schema/dist/esm/raw/dashboard/x/dashboard_types.gen'; -import { ExplorePanelData } from 'app/types'; +import { ExplorePanelData } from 'app/types/explore'; interface ExploreToDashboardPanelOptions { queries: DataQuery[]; diff --git a/public/app/features/explore/extensions/AddToDashboard/getAddToDashboardTitle.ts b/public/app/features/explore/extensions/AddToDashboard/getAddToDashboardTitle.ts index d528956cb9f..ed90ef5aff7 100644 --- a/public/app/features/explore/extensions/AddToDashboard/getAddToDashboardTitle.ts +++ b/public/app/features/explore/extensions/AddToDashboard/getAddToDashboardTitle.ts @@ -1,5 +1,5 @@ import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; export function getAddToDashboardTitle(): string { const canCreateDashboard = contextSrv.hasPermission(AccessControlAction.DashboardsCreate); diff --git a/public/app/features/explore/extensions/AddToDashboard/index.test.tsx b/public/app/features/explore/extensions/AddToDashboard/index.test.tsx index 79a51c929cb..32d84a9466b 100644 --- a/public/app/features/explore/extensions/AddToDashboard/index.test.tsx +++ b/public/app/features/explore/extensions/AddToDashboard/index.test.tsx @@ -8,7 +8,7 @@ import { DataQuery } from '@grafana/schema'; import { contextSrv } from 'app/core/services/context_srv'; import { Echo } from 'app/core/services/echo/Echo'; import { configureStore } from 'app/store/configureStore'; -import { ExploreState } from 'app/types'; +import { ExploreState } from 'app/types/explore'; import { createEmptyQueryResponse } from '../../state/utils'; diff --git a/public/app/features/explore/extensions/AddToDashboard/index.tsx b/public/app/features/explore/extensions/AddToDashboard/index.tsx index 32277343c17..ef3278a58e9 100644 --- a/public/app/features/explore/extensions/AddToDashboard/index.tsx +++ b/public/app/features/explore/extensions/AddToDashboard/index.tsx @@ -2,7 +2,7 @@ import { useCallback, useState } from 'react'; import { t } from '@grafana/i18n'; import { Modal, ToolbarButton } from '@grafana/ui'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { getExploreItemSelector } from '../../state/selectors'; diff --git a/public/app/features/explore/extensions/ToolbarExtensionPoint.test.tsx b/public/app/features/explore/extensions/ToolbarExtensionPoint.test.tsx index 3adcc8ca6fb..0a72d621269 100644 --- a/public/app/features/explore/extensions/ToolbarExtensionPoint.test.tsx +++ b/public/app/features/explore/extensions/ToolbarExtensionPoint.test.tsx @@ -8,7 +8,7 @@ import { usePluginLinks } from '@grafana/runtime'; import { DataQuery } from '@grafana/schema'; import { contextSrv } from 'app/core/services/context_srv'; import { configureStore } from 'app/store/configureStore'; -import { ExplorePanelData, ExploreState } from 'app/types'; +import { ExplorePanelData, ExploreState } from 'app/types/explore'; import { createEmptyQueryResponse } from '../state/utils'; diff --git a/public/app/features/explore/extensions/ToolbarExtensionPoint.tsx b/public/app/features/explore/extensions/ToolbarExtensionPoint.tsx index df78195ab3d..3c3a5f2286a 100644 --- a/public/app/features/explore/extensions/ToolbarExtensionPoint.tsx +++ b/public/app/features/explore/extensions/ToolbarExtensionPoint.tsx @@ -4,7 +4,9 @@ import { type PluginExtensionLink, PluginExtensionPoints, RawTimeRange, getTimeZ import { config, reportInteraction, usePluginLinks } from '@grafana/runtime'; import { DataQuery, TimeZone } from '@grafana/schema'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction, ExplorePanelData, useSelector } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { ExplorePanelData } from 'app/types/explore'; +import { useSelector } from 'app/types/store'; import { getExploreItemSelector, isLeftPaneSelector, selectCorrelationDetails } from '../state/selectors'; diff --git a/public/app/features/explore/extensions/getExploreExtensionConfigs.tsx b/public/app/features/explore/extensions/getExploreExtensionConfigs.tsx index 9be348955cf..7bbade45ad9 100644 --- a/public/app/features/explore/extensions/getExploreExtensionConfigs.tsx +++ b/public/app/features/explore/extensions/getExploreExtensionConfigs.tsx @@ -1,7 +1,7 @@ import { PluginExtensionAddedLinkConfig, PluginExtensionPoints } from '@grafana/data'; import { contextSrv } from 'app/core/core'; import { dispatch } from 'app/store/store'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { log } from '../../plugins/extensions/logs/log'; import { createAddedLinkConfig } from '../../plugins/extensions/utils'; diff --git a/public/app/features/explore/hooks/useExplorePageTitle.ts b/public/app/features/explore/hooks/useExplorePageTitle.ts index 804b2cf69d9..564064ef8dc 100644 --- a/public/app/features/explore/hooks/useExplorePageTitle.ts +++ b/public/app/features/explore/hooks/useExplorePageTitle.ts @@ -4,7 +4,7 @@ import { getDataSourceSrv } from '@grafana/runtime'; import { Branding } from 'app/core/components/Branding/Branding'; import { useGrafana } from 'app/core/context/GrafanaContext'; import { useNavModel } from 'app/core/hooks/useNavModel'; -import { ExploreQueryParams } from 'app/types'; +import { ExploreQueryParams } from 'app/types/explore'; import { isFulfilled, hasKey } from './utils'; diff --git a/public/app/features/explore/hooks/useKeyboardShortcuts.ts b/public/app/features/explore/hooks/useKeyboardShortcuts.ts index bd90b13e3f2..9ff1e32e5ed 100644 --- a/public/app/features/explore/hooks/useKeyboardShortcuts.ts +++ b/public/app/features/explore/hooks/useKeyboardShortcuts.ts @@ -3,8 +3,8 @@ import { Unsubscribable } from 'rxjs'; import { getAppEvents } from '@grafana/runtime'; import { useGrafana } from 'app/core/context/GrafanaContext'; -import { useDispatch } from 'app/types'; import { AbsoluteTimeEvent, CopyTimeEvent, PasteTimeEvent, ShiftTimeEvent, ZoomOutEvent } from 'app/types/events'; +import { useDispatch } from 'app/types/store'; import { copyTimeRangeToClipboard, diff --git a/public/app/features/explore/hooks/useSplitSizeUpdater.ts b/public/app/features/explore/hooks/useSplitSizeUpdater.ts index ea2f6279b8a..81c9fa2edeb 100644 --- a/public/app/features/explore/hooks/useSplitSizeUpdater.ts +++ b/public/app/features/explore/hooks/useSplitSizeUpdater.ts @@ -2,7 +2,7 @@ import { inRange } from 'lodash'; import { useState } from 'react'; import { useWindowSize } from 'react-use'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; import { splitSizeUpdateAction } from '../state/main'; import { isSplit, selectPanesEntries } from '../state/selectors'; diff --git a/public/app/features/explore/hooks/useStateSync/external.utils.ts b/public/app/features/explore/hooks/useStateSync/external.utils.ts index e691ba13b33..2df25f0dfde 100644 --- a/public/app/features/explore/hooks/useStateSync/external.utils.ts +++ b/public/app/features/explore/hooks/useStateSync/external.utils.ts @@ -2,7 +2,7 @@ import { isEmpty, isObject, mapValues, omitBy } from 'lodash'; import { ExploreUrlState, toURLRange } from '@grafana/data'; import { clearQueryKeys } from 'app/core/utils/explore'; -import { ExploreItemState } from 'app/types'; +import { ExploreItemState } from 'app/types/explore'; export function getUrlStateFromPaneState(pane: ExploreItemState): ExploreUrlState { return { diff --git a/public/app/features/explore/hooks/useStateSync/index.ts b/public/app/features/explore/hooks/useStateSync/index.ts index 348a12b0ac4..44462fa0d35 100644 --- a/public/app/features/explore/hooks/useStateSync/index.ts +++ b/public/app/features/explore/hooks/useStateSync/index.ts @@ -2,7 +2,8 @@ import { useEffect, useRef } from 'react'; import { useGrafana } from 'app/core/context/GrafanaContext'; import { useAppNotification } from 'app/core/copy/appNotification'; -import { addListener, ExploreQueryParams, useDispatch, useSelector } from 'app/types'; +import { ExploreQueryParams } from 'app/types/explore'; +import { addListener, useDispatch, useSelector } from 'app/types/store'; import { selectPanes } from '../../state/selectors'; diff --git a/public/app/features/explore/hooks/useStateSync/parseURL.ts b/public/app/features/explore/hooks/useStateSync/parseURL.ts index 4325630c1a9..ca40e024e0f 100644 --- a/public/app/features/explore/hooks/useStateSync/parseURL.ts +++ b/public/app/features/explore/hooks/useStateSync/parseURL.ts @@ -1,4 +1,4 @@ -import { ExploreQueryParams } from 'app/types'; +import { ExploreQueryParams } from 'app/types/explore'; import { v0Migrator } from './migrators/v0'; import { ExploreURLV1, v1Migrator } from './migrators/v1'; diff --git a/public/app/features/explore/hooks/useStateSync/synchronizer/fromURL.ts b/public/app/features/explore/hooks/useStateSync/synchronizer/fromURL.ts index 5497f481407..c196320a859 100644 --- a/public/app/features/explore/hooks/useStateSync/synchronizer/fromURL.ts +++ b/public/app/features/explore/hooks/useStateSync/synchronizer/fromURL.ts @@ -8,7 +8,8 @@ import { cancelQueries, runQueries, setQueriesAction } from 'app/features/explor import { updateTime } from 'app/features/explore/state/time'; import { fromURLRange } from 'app/features/explore/state/utils'; import { withUniqueRefIds } from 'app/features/explore/utils/queries'; -import { ExploreItemState, ThunkDispatch } from 'app/types'; +import { ExploreItemState } from 'app/types/explore'; +import { ThunkDispatch } from 'app/types/store'; import { getUrlStateFromPaneState } from '../index'; import { urlDiff } from '../internal.utils'; diff --git a/public/app/features/explore/hooks/useStateSync/synchronizer/init.ts b/public/app/features/explore/hooks/useStateSync/synchronizer/init.ts index dae7cd105d3..f4dec0dcecb 100644 --- a/public/app/features/explore/hooks/useStateSync/synchronizer/init.ts +++ b/public/app/features/explore/hooks/useStateSync/synchronizer/init.ts @@ -9,7 +9,7 @@ import { clearPanes, syncTimesAction } from 'app/features/explore/state/main'; import { fromURLRange } from 'app/features/explore/state/utils'; import { withUniqueRefIds } from 'app/features/explore/utils/queries'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; -import { ThunkDispatch } from 'app/types'; +import { ThunkDispatch } from 'app/types/store'; import { getUrlStateFromPaneState } from '../index'; import { diff --git a/public/app/features/explore/hooks/useStateSync/synchronizer/toURL.ts b/public/app/features/explore/hooks/useStateSync/synchronizer/toURL.ts index ba164419822..9485eef2446 100644 --- a/public/app/features/explore/hooks/useStateSync/synchronizer/toURL.ts +++ b/public/app/features/explore/hooks/useStateSync/synchronizer/toURL.ts @@ -9,7 +9,7 @@ import { changePanelsStateAction } from 'app/features/explore/state/explorePane' import { splitClose, splitOpen } from 'app/features/explore/state/main'; import { runQueries } from 'app/features/explore/state/query'; import { changeRangeAction } from 'app/features/explore/state/time'; -import { ExploreState } from 'app/types'; +import { ExploreState } from 'app/types/explore'; import { getUrlStateFromPaneState } from '../index'; import { InitState } from '../internal.utils'; diff --git a/public/app/features/explore/mocks/data.ts b/public/app/features/explore/mocks/data.ts index 46f9355c104..3cf601b623f 100644 --- a/public/app/features/explore/mocks/data.ts +++ b/public/app/features/explore/mocks/data.ts @@ -1,8 +1,7 @@ import { Observable, of } from 'rxjs'; import { getDefaultTimeRange, LoadingState, LogsModel } from '@grafana/data'; - -import { ExplorePanelData } from '../../../types'; +import { ExplorePanelData } from 'app/types/explore'; type MockProps = { logsResult?: Partial; diff --git a/public/app/features/explore/spec/helper/setup.tsx b/public/app/features/explore/spec/helper/setup.tsx index de530b584cc..647284ad25c 100644 --- a/public/app/features/explore/spec/helper/setup.tsx +++ b/public/app/features/explore/spec/helper/setup.tsx @@ -39,11 +39,11 @@ import { Echo } from 'app/core/services/echo/Echo'; import { setLastUsedDatasourceUID } from 'app/core/utils/explore'; import { MIXED_DATASOURCE_NAME } from 'app/plugins/datasource/mixed/MixedDataSource'; import { configureStore } from 'app/store/configureStore'; +import { ExploreQueryParams } from 'app/types/explore'; import { RichHistoryRemoteStorageDTO } from '../../../../core/history/RichHistoryRemoteStorage'; import { LokiDatasource } from '../../../../plugins/datasource/loki/datasource'; import { LokiQuery } from '../../../../plugins/datasource/loki/types'; -import { ExploreQueryParams } from '../../../../types'; import { initialUserState } from '../../../profile/state/reducers'; import ExplorePage from '../../ExplorePage'; import { QueriesDrawerContextProvider } from '../../QueriesDrawer/QueriesDrawerContext'; diff --git a/public/app/features/explore/state/correlations.ts b/public/app/features/explore/state/correlations.ts index 4e093ca3669..cc99f6388b7 100644 --- a/public/app/features/explore/state/correlations.ts +++ b/public/app/features/explore/state/correlations.ts @@ -7,7 +7,7 @@ import { createErrorNotification } from 'app/core/copy/appNotification'; import { CreateCorrelationParams } from 'app/features/correlations/types'; import { getCorrelationsBySourceUIDs, createCorrelation, generateDefaultLabel } from 'app/features/correlations/utils'; import { store } from 'app/store/store'; -import { ThunkResult } from 'app/types'; +import { ThunkResult } from 'app/types/store'; import { saveCorrelationsAction } from './explorePane'; import { splitClose } from './main'; diff --git a/public/app/features/explore/state/datasource.test.ts b/public/app/features/explore/state/datasource.test.ts index b024fdb35dd..44e6d7c74e5 100644 --- a/public/app/features/explore/state/datasource.test.ts +++ b/public/app/features/explore/state/datasource.test.ts @@ -1,6 +1,6 @@ import { DataSourceApi } from '@grafana/data'; import { DataQuery } from '@grafana/schema'; -import { ExploreItemState } from 'app/types'; +import { ExploreItemState } from 'app/types/explore'; import { updateDatasourceInstanceAction, datasourceReducer } from './datasource'; import { createEmptyQueryResponse } from './utils'; diff --git a/public/app/features/explore/state/datasource.ts b/public/app/features/explore/state/datasource.ts index 762aebe3ee8..0cea9e1126c 100644 --- a/public/app/features/explore/state/datasource.ts +++ b/public/app/features/explore/state/datasource.ts @@ -7,7 +7,8 @@ import { DataSourceRef } from '@grafana/schema'; import { RefreshPicker } from '@grafana/ui'; import { stopQueryState } from 'app/core/utils/explore'; import { getCorrelationsBySourceUIDs } from 'app/features/correlations/utils'; -import { ExploreItemState, createAsyncThunk } from 'app/types'; +import { ExploreItemState } from 'app/types/explore'; +import { createAsyncThunk } from 'app/types/store'; import { loadSupplementaryQueries } from '../utils/supplementaryQueries'; diff --git a/public/app/features/explore/state/explorePane.ts b/public/app/features/explore/state/explorePane.ts index 601ceea2dae..9835b9f3e09 100644 --- a/public/app/features/explore/state/explorePane.ts +++ b/public/app/features/explore/state/explorePane.ts @@ -16,8 +16,8 @@ import { DataQuery, DataSourceRef } from '@grafana/schema'; import { getQueryKeys } from 'app/core/utils/explore'; import { getCorrelationsBySourceUIDs } from 'app/features/correlations/utils'; import { getTimeZone } from 'app/features/profile/state/selectors'; -import { createAsyncThunk, ThunkResult } from 'app/types'; import { ExploreItemState } from 'app/types/explore'; +import { createAsyncThunk, ThunkResult } from 'app/types/store'; import { datasourceReducer } from './datasource'; import { queryReducer, runQueries } from './query'; diff --git a/public/app/features/explore/state/history.ts b/public/app/features/explore/state/history.ts index d582ef42878..4168668091d 100644 --- a/public/app/features/explore/state/history.ts +++ b/public/app/features/explore/state/history.ts @@ -12,7 +12,8 @@ import { updateRichHistorySettings, updateStarredInRichHistory, } from 'app/core/utils/richHistory'; -import { RichHistoryQuery, ThunkResult } from 'app/types'; +import { RichHistoryQuery } from 'app/types/explore'; +import { ThunkResult } from 'app/types/store'; import { supportedFeatures } from '../../../core/history/richHistoryStorageProvider'; import { RichHistorySearchFilters, RichHistorySettings } from '../../../core/utils/richHistoryTypes'; diff --git a/public/app/features/explore/state/main.test.ts b/public/app/features/explore/state/main.test.ts index d52a1be7211..7d504613831 100644 --- a/public/app/features/explore/state/main.test.ts +++ b/public/app/features/explore/state/main.test.ts @@ -3,11 +3,12 @@ import { thunkTester } from 'test/core/thunk/thunkTester'; import { dateTime, ExploreUrlState, serializeStateToUrlParam } from '@grafana/data'; import { locationService } from '@grafana/runtime'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; +import { ExploreItemState, ExploreState } from 'app/types/explore'; +import { StoreState, ThunkDispatch } from 'app/types/store'; import { reducerTester } from '../../../../test/core/redux/reducerTester'; import { MockDataSourceApi } from '../../../../test/mocks/datasource_srv'; import { configureStore } from '../../../store/configureStore'; -import { ExploreItemState, ExploreState, StoreState, ThunkDispatch } from '../../../types'; import { exploreReducer, navigateToExplore, splitClose, splitOpen } from './main'; diff --git a/public/app/features/explore/state/main.ts b/public/app/features/explore/state/main.ts index 42a3a054d7f..d64ec7eca95 100644 --- a/public/app/features/explore/state/main.ts +++ b/public/app/features/explore/state/main.ts @@ -8,10 +8,10 @@ import { generateExploreId, GetExploreUrlArguments } from 'app/core/utils/explor import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { getTemplateSrv } from 'app/features/templating/template_srv'; import { CorrelationEditorDetailsUpdate, ExploreItemState, ExploreState } from 'app/types/explore'; +import { createAsyncThunk, ThunkResult } from 'app/types/store'; import { RichHistoryResults } from '../../../core/history/RichHistoryStorage'; import { RichHistorySearchFilters, RichHistorySettings } from '../../../core/utils/richHistoryTypes'; -import { createAsyncThunk, ThunkResult } from '../../../types'; import { withUniqueRefIds } from '../utils/queries'; import { DEFAULT_RANGE } from './constants'; diff --git a/public/app/features/explore/state/query.test.ts b/public/app/features/explore/state/query.test.ts index 8a4f3b96be0..42e486fa978 100644 --- a/public/app/features/explore/state/query.test.ts +++ b/public/app/features/explore/state/query.test.ts @@ -18,7 +18,8 @@ import { import { DataQuery, DataSourceRef } from '@grafana/schema'; import config from 'app/core/config'; import { queryLogsSample, queryLogsVolume } from 'app/features/logs/logsModel'; -import { createAsyncThunk, ExploreItemState, StoreState, ThunkDispatch } from 'app/types'; +import { ExploreItemState } from 'app/types/explore'; +import { createAsyncThunk, StoreState, ThunkDispatch } from 'app/types/store'; import { reducerTester } from '../../../../test/core/redux/reducerTester'; import * as richHistory from '../../../core/utils/richHistory'; diff --git a/public/app/features/explore/state/query.ts b/public/app/features/explore/state/query.ts index a070253ebc3..63091242c47 100644 --- a/public/app/features/explore/state/query.ts +++ b/public/app/features/explore/state/query.ts @@ -39,15 +39,14 @@ import { getFiscalYearStartMonth, getTimeZone } from 'app/features/profile/state import { SupportingQueryType } from 'app/plugins/datasource/loki/types'; import { MIXED_DATASOURCE_NAME } from 'app/plugins/datasource/mixed/MixedDataSource'; import { - createAsyncThunk, ExploreItemState, ExplorePanelData, + ExploreState, + QueryOptions, QueryTransaction, - StoreState, - ThunkDispatch, - ThunkResult, -} from 'app/types'; -import { ExploreState, QueryOptions, SupplementaryQueries } from 'app/types/explore'; + SupplementaryQueries, +} from 'app/types/explore'; +import { createAsyncThunk, StoreState, ThunkDispatch, ThunkResult } from 'app/types/store'; import { notifyApp } from '../../../core/actions'; import { createErrorNotification } from '../../../core/copy/appNotification'; diff --git a/public/app/features/explore/state/selectors.test.ts b/public/app/features/explore/state/selectors.test.ts index 7e3bd990fe1..12531a34fec 100644 --- a/public/app/features/explore/state/selectors.test.ts +++ b/public/app/features/explore/state/selectors.test.ts @@ -1,7 +1,7 @@ import { DataSourceApi, DataSourceJsonData } from '@grafana/data'; import { DataQuery } from '@grafana/schema/dist/esm/index'; import { configureStore } from 'app/store/configureStore'; -import { StoreState, ThunkDispatch } from 'app/types'; +import { StoreState, ThunkDispatch } from 'app/types/store'; import { selectExploreDSMaps } from './selectors'; import { createDefaultInitialState } from './testHelpers'; diff --git a/public/app/features/explore/state/selectors.ts b/public/app/features/explore/state/selectors.ts index 9f5ea7f86df..c184d3745c5 100644 --- a/public/app/features/explore/state/selectors.ts +++ b/public/app/features/explore/state/selectors.ts @@ -2,7 +2,8 @@ import { createSelector } from '@reduxjs/toolkit'; import { flatten, uniqBy } from 'lodash'; import { DataSourceRef } from '@grafana/schema'; -import { ExploreItemState, StoreState } from 'app/types'; +import { ExploreItemState } from 'app/types/explore'; +import { StoreState } from 'app/types/store'; export const selectPanes = (state: Pick) => state.explore.panes; export const selectExploreRoot = (state: Pick) => state.explore; diff --git a/public/app/features/explore/state/time.test.ts b/public/app/features/explore/state/time.test.ts index 1a382acbf17..43e0643ab9b 100644 --- a/public/app/features/explore/state/time.test.ts +++ b/public/app/features/explore/state/time.test.ts @@ -2,7 +2,7 @@ import { reducerTester } from 'test/core/redux/reducerTester'; import { dateTime } from '@grafana/data'; import { configureStore } from 'app/store/configureStore'; -import { ExploreItemState } from 'app/types'; +import { ExploreItemState } from 'app/types/explore'; import { createDefaultInitialState } from './testHelpers'; import { changeRangeAction, timeReducer, updateTime } from './time'; diff --git a/public/app/features/explore/state/time.ts b/public/app/features/explore/state/time.ts index f975a59d44f..536c51f9f96 100644 --- a/public/app/features/explore/state/time.ts +++ b/public/app/features/explore/state/time.ts @@ -17,7 +17,8 @@ import { getCopiedTimeRange, getShiftedTimeRange, getZoomedTimeRange } from 'app import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv'; import { sortLogsResult } from 'app/features/logs/utils'; import { getFiscalYearStartMonth, getTimeZone } from 'app/features/profile/state/selectors'; -import { ExploreItemState, ThunkDispatch, ThunkResult } from 'app/types'; +import { ExploreItemState } from 'app/types/explore'; +import { ThunkDispatch, ThunkResult } from 'app/types/store'; import { syncTimesAction } from './main'; import { runLoadMoreLogsQueries, runQueries } from './query'; diff --git a/public/app/features/explore/state/utils.ts b/public/app/features/explore/state/utils.ts index 45b8b39e0e4..4aba4a85f35 100644 --- a/public/app/features/explore/state/utils.ts +++ b/public/app/features/explore/state/utils.ts @@ -25,8 +25,8 @@ import { DataQuery, DataSourceJsonData, DataSourceRef, TimeZone } from '@grafana import { getLocalRichHistoryStorage } from 'app/core/history/richHistoryStorageProvider'; import { SortOrder } from 'app/core/utils/richHistoryTypes'; import { MIXED_DATASOURCE_NAME } from 'app/plugins/datasource/mixed/MixedDataSource'; -import { ExplorePanelData, StoreState } from 'app/types'; -import { ExploreItemState, RichHistoryQuery } from 'app/types/explore'; +import { ExploreItemState, ExplorePanelData, RichHistoryQuery } from 'app/types/explore'; +import { StoreState } from 'app/types/store'; import store from '../../../core/store'; import { setLastUsedDatasourceUID } from '../../../core/utils/explore'; diff --git a/public/app/features/explore/useLiveTailControls.ts b/public/app/features/explore/useLiveTailControls.ts index 42837521e05..e78c1272ad7 100644 --- a/public/app/features/explore/useLiveTailControls.ts +++ b/public/app/features/explore/useLiveTailControls.ts @@ -2,7 +2,7 @@ import { useCallback } from 'react'; import * as React from 'react'; import { RefreshPicker } from '@grafana/ui'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { setPausedStateAction, runQueries, clearLogs } from './state/query'; import { changeRefreshInterval } from './state/time'; diff --git a/public/app/features/explore/utils/decorators.test.ts b/public/app/features/explore/utils/decorators.test.ts index 5e2e1517eee..3be590a31f5 100644 --- a/public/app/features/explore/utils/decorators.test.ts +++ b/public/app/features/explore/utils/decorators.test.ts @@ -13,7 +13,7 @@ import { import { CorrelationData } from '@grafana/runtime'; import { DataSourceJsonData, DataQuery } from '@grafana/schema'; import TableModel from 'app/core/TableModel'; -import { ExplorePanelData } from 'app/types'; +import { ExplorePanelData } from 'app/types/explore'; import { decorateWithCorrelations, diff --git a/public/app/features/explore/utils/decorators.ts b/public/app/features/explore/utils/decorators.ts index 08dc24b6a7d..5a877294649 100644 --- a/public/app/features/explore/utils/decorators.ts +++ b/public/app/features/explore/utils/decorators.ts @@ -16,9 +16,9 @@ import { } from '@grafana/data'; import { config, CorrelationData } from '@grafana/runtime'; import { DataQuery } from '@grafana/schema'; +import { ExplorePanelData } from 'app/types/explore'; import { refreshIntervalToSortOrder } from '../../../core/utils/explore'; -import { ExplorePanelData } from '../../../types'; import { attachCorrelationsToDataFrames } from '../../correlations/utils'; import { dataFrameToLogsModel } from '../../logs/logsModel'; import { sortLogsResult } from '../../logs/utils'; diff --git a/public/app/features/explore/utils/supplementaryQueries.test.ts b/public/app/features/explore/utils/supplementaryQueries.test.ts index 8d274f162b1..ebc1be38292 100644 --- a/public/app/features/explore/utils/supplementaryQueries.test.ts +++ b/public/app/features/explore/utils/supplementaryQueries.test.ts @@ -17,10 +17,10 @@ import { DataQueryResponse, } from '@grafana/data'; import { DataQuery } from '@grafana/schema'; +import { ExplorePanelData } from 'app/types/explore'; import { MockDataSourceApi } from '../../../../test/mocks/datasource_srv'; import { MockDataQueryRequest, MockQuery } from '../../../../test/mocks/query'; -import { ExplorePanelData } from '../../../types'; import { mockExplorePanelData } from '../mocks/data'; import { getSupplementaryQueryProvider } from './supplementaryQueries'; diff --git a/public/app/features/explore/utils/supplementaryQueries.ts b/public/app/features/explore/utils/supplementaryQueries.ts index ae25b8902b4..a705c8193fb 100644 --- a/public/app/features/explore/utils/supplementaryQueries.ts +++ b/public/app/features/explore/utils/supplementaryQueries.ts @@ -16,7 +16,7 @@ import { SupplementaryQueryType, } from '@grafana/data'; import store from 'app/core/store'; -import { ExplorePanelData, SupplementaryQueries } from 'app/types'; +import { ExplorePanelData, SupplementaryQueries } from 'app/types/explore'; import { makeDataFramesForLogs, queryLogsSample, queryLogsVolume } from '../../logs/logsModel'; diff --git a/public/app/features/explore/utils/supplementaryQueries_legacy.test.ts b/public/app/features/explore/utils/supplementaryQueries_legacy.test.ts index 6d6735a12c5..da43739db79 100644 --- a/public/app/features/explore/utils/supplementaryQueries_legacy.test.ts +++ b/public/app/features/explore/utils/supplementaryQueries_legacy.test.ts @@ -22,10 +22,10 @@ import { } from '@grafana/data'; import { getDataSourceSrv } from '@grafana/runtime'; import { DataQuery } from '@grafana/schema'; +import { ExplorePanelData } from 'app/types/explore'; import { MockDataSourceApi } from '../../../../test/mocks/datasource_srv'; import { MockDataQueryRequest, MockQuery } from '../../../../test/mocks/query'; -import { ExplorePanelData } from '../../../types'; import { mockExplorePanelData } from '../mocks/data'; import { getSupplementaryQueryProvider } from './supplementaryQueries'; diff --git a/public/app/features/folders/state/actions.ts b/public/app/features/folders/state/actions.ts index e79c97f97f5..27b22a3102d 100644 --- a/public/app/features/folders/state/actions.ts +++ b/public/app/features/folders/state/actions.ts @@ -1,6 +1,7 @@ import { updateNavIndex } from 'app/core/actions'; import { backendSrv } from 'app/core/services/backend_srv'; -import { FolderDTO, ThunkResult } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; +import { ThunkResult } from 'app/types/store'; import { buildNavModel } from './navModel'; import { loadFolder } from './reducers'; diff --git a/public/app/features/folders/state/navModel.ts b/public/app/features/folders/state/navModel.ts index 7db065815b2..49a5167652f 100644 --- a/public/app/features/folders/state/navModel.ts +++ b/public/app/features/folders/state/navModel.ts @@ -3,7 +3,8 @@ import { t } from '@grafana/i18n'; import { config } from '@grafana/runtime'; import { contextSrv } from 'app/core/services/context_srv'; import { getNavSubTitle } from 'app/core/utils/navBarItem-translations'; -import { AccessControlAction, FolderDTO, FolderParent } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { FolderDTO, FolderParent } from 'app/types/folders'; export const FOLDER_ID = 'manage-folder'; diff --git a/public/app/features/folders/state/reducers.test.ts b/public/app/features/folders/state/reducers.test.ts index 2665316f39e..33f9fe0e4e9 100644 --- a/public/app/features/folders/state/reducers.test.ts +++ b/public/app/features/folders/state/reducers.test.ts @@ -1,4 +1,4 @@ -import { FolderDTO, FolderState } from 'app/types'; +import { FolderDTO, FolderState } from 'app/types/folders'; import { reducerTester } from '../../../../test/core/redux/reducerTester'; diff --git a/public/app/features/folders/state/reducers.ts b/public/app/features/folders/state/reducers.ts index f544fde391a..849f57e7631 100644 --- a/public/app/features/folders/state/reducers.ts +++ b/public/app/features/folders/state/reducers.ts @@ -1,7 +1,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'; import { endpoints } from 'app/features/browse-dashboards/api/browseDashboardsAPI'; -import { FolderDTO, FolderState } from 'app/types'; +import { FolderState, FolderDTO } from 'app/types/folders'; export const initialState: FolderState = { id: 0, diff --git a/public/app/features/invites/InviteeRow.tsx b/public/app/features/invites/InviteeRow.tsx index dd819e7ddbb..d5fd484e083 100644 --- a/public/app/features/invites/InviteeRow.tsx +++ b/public/app/features/invites/InviteeRow.tsx @@ -3,7 +3,7 @@ import { connect, ConnectedProps } from 'react-redux'; import { t } from '@grafana/i18n'; import { Button, ClipboardButton } from '@grafana/ui'; -import { Invitee } from 'app/types'; +import { Invitee } from 'app/types/user'; import { revokeInvite } from './state/actions'; diff --git a/public/app/features/invites/InviteesTable.tsx b/public/app/features/invites/InviteesTable.tsx index 2bab93ecfdb..04fc9544562 100644 --- a/public/app/features/invites/InviteesTable.tsx +++ b/public/app/features/invites/InviteesTable.tsx @@ -1,7 +1,7 @@ import { PureComponent } from 'react'; import { Trans } from '@grafana/i18n'; -import { Invitee } from 'app/types'; +import { Invitee } from 'app/types/user'; import InviteeRow from './InviteeRow'; diff --git a/public/app/features/invites/state/actions.ts b/public/app/features/invites/state/actions.ts index d4af5d085b1..72a40840bd6 100644 --- a/public/app/features/invites/state/actions.ts +++ b/public/app/features/invites/state/actions.ts @@ -1,7 +1,9 @@ import { getBackendSrv } from '@grafana/runtime'; import { contextSrv } from 'app/core/core'; import { FormModel } from 'app/features/org/UserInviteForm'; -import { AccessControlAction, createAsyncThunk, Invitee } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { createAsyncThunk } from 'app/types/store'; +import { Invitee } from 'app/types/user'; export const fetchInvitees = createAsyncThunk('users/fetchInvitees', async () => { if (!contextSrv.hasPermission(AccessControlAction.OrgUsersAdd)) { diff --git a/public/app/features/invites/state/reducers.ts b/public/app/features/invites/state/reducers.ts index 35ac54eeca0..00a5701cba8 100644 --- a/public/app/features/invites/state/reducers.ts +++ b/public/app/features/invites/state/reducers.ts @@ -1,6 +1,6 @@ import { createEntityAdapter, createSlice } from '@reduxjs/toolkit'; -import { Invitee } from 'app/types'; +import { Invitee } from 'app/types/user'; import { fetchInvitees, revokeInvite } from './actions'; diff --git a/public/app/features/invites/state/selectors.ts b/public/app/features/invites/state/selectors.ts index 5722ecb263f..4f5af894ee9 100644 --- a/public/app/features/invites/state/selectors.ts +++ b/public/app/features/invites/state/selectors.ts @@ -1,6 +1,6 @@ import { EntityState, createSelector } from '@reduxjs/toolkit'; -import { Invitee } from 'app/types'; +import { Invitee } from 'app/types/user'; import { selectors } from './reducers'; diff --git a/public/app/features/library-panels/components/LibraryPanelsSearch/LibraryPanelsSearch.tsx b/public/app/features/library-panels/components/LibraryPanelsSearch/LibraryPanelsSearch.tsx index 9c6ca73c898..d86f7a55517 100644 --- a/public/app/features/library-panels/components/LibraryPanelsSearch/LibraryPanelsSearch.tsx +++ b/public/app/features/library-panels/components/LibraryPanelsSearch/LibraryPanelsSearch.tsx @@ -5,7 +5,7 @@ import { useDebounce } from 'react-use'; import { GrafanaTheme2, PanelPluginMeta, SelectableValue } from '@grafana/data'; import { t } from '@grafana/i18n'; import { useStyles2, VerticalGroup, FilterInput } from '@grafana/ui'; -import { FolderInfo } from 'app/types'; +import { FolderInfo } from 'app/types/folders'; import { FolderFilter } from '../../../../core/components/FolderFilter/FolderFilter'; import { PanelTypeFilter } from '../../../../core/components/PanelTypeFilter/PanelTypeFilter'; diff --git a/public/app/features/library-panels/components/PanelLibraryOptionsGroup/PanelLibraryOptionsGroup.tsx b/public/app/features/library-panels/components/PanelLibraryOptionsGroup/PanelLibraryOptionsGroup.tsx index 4d3820e6609..d9dafffe82d 100644 --- a/public/app/features/library-panels/components/PanelLibraryOptionsGroup/PanelLibraryOptionsGroup.tsx +++ b/public/app/features/library-panels/components/PanelLibraryOptionsGroup/PanelLibraryOptionsGroup.tsx @@ -7,7 +7,7 @@ import { Button, VerticalGroup } from '@grafana/ui'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { changeToLibraryPanel } from 'app/features/panel/state/actions'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { PanelTypeFilter } from '../../../../core/components/PanelTypeFilter/PanelTypeFilter'; import { LibraryElementDTO } from '../../types'; diff --git a/public/app/features/logs/components/log-context/LogRowContextModal.test.tsx b/public/app/features/logs/components/log-context/LogRowContextModal.test.tsx index 29cf6c6c5e3..f6446e804e1 100644 --- a/public/app/features/logs/components/log-context/LogRowContextModal.test.tsx +++ b/public/app/features/logs/components/log-context/LogRowContextModal.test.tsx @@ -57,8 +57,8 @@ const dfAfter = createDataFrame({ let getRowContext = jest.fn(); const dispatchMock = jest.fn(); -jest.mock('app/types', () => ({ - ...jest.requireActual('app/types'), +jest.mock('app/types/store', () => ({ + ...jest.requireActual('app/types/store'), useDispatch: () => dispatchMock, })); diff --git a/public/app/features/logs/components/log-context/LogRowContextModal.tsx b/public/app/features/logs/components/log-context/LogRowContextModal.tsx index 5956c892c40..c7aaa58a3af 100644 --- a/public/app/features/logs/components/log-context/LogRowContextModal.tsx +++ b/public/app/features/logs/components/log-context/LogRowContextModal.tsx @@ -24,7 +24,7 @@ import { Button, Modal, useTheme2 } from '@grafana/ui'; import store from 'app/core/store'; import { SETTINGS_KEYS } from 'app/features/explore/Logs/utils/logs'; import { splitOpen } from 'app/features/explore/state/main'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { dataFrameToLogsModel } from '../../logsModel'; import { sortLogRows } from '../../utils'; diff --git a/public/app/features/manage-dashboards/DashboardImportPage.tsx b/public/app/features/manage-dashboards/DashboardImportPage.tsx index cf23c94f73e..4652a4811bd 100644 --- a/public/app/features/manage-dashboards/DashboardImportPage.tsx +++ b/public/app/features/manage-dashboards/DashboardImportPage.tsx @@ -28,7 +28,7 @@ import { Form } from 'app/core/components/Form/Form'; import { Page } from 'app/core/components/Page/Page'; import { GrafanaRouteComponentProps } from 'app/core/navigation/types'; import { dispatch } from 'app/store/store'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import { cleanUpAction } from '../../core/actions/cleanUp'; import { ImportDashboardOverviewV2 } from '../dashboard-scene/v2schema/ImportDashboardOverviewV2'; diff --git a/public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx b/public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx index 314954ca16c..66508d4b07f 100644 --- a/public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx +++ b/public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx @@ -6,7 +6,7 @@ import { Trans } from '@grafana/i18n'; import { locationService, reportInteraction } from '@grafana/runtime'; import { Box, Legend, TextLink } from '@grafana/ui'; import { Form } from 'app/core/components/Form/Form'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import { clearLoadedDashboard, importDashboard } from '../state/actions'; import { DashboardSource, ImportDashboardDTO } from '../state/reducers'; diff --git a/public/app/features/manage-dashboards/components/PublicDashboardListTable/PublicDashboardListTable.tsx b/public/app/features/manage-dashboards/components/PublicDashboardListTable/PublicDashboardListTable.tsx index 79676bc4a19..282227e4f31 100644 --- a/public/app/features/manage-dashboards/components/PublicDashboardListTable/PublicDashboardListTable.tsx +++ b/public/app/features/manage-dashboards/components/PublicDashboardListTable/PublicDashboardListTable.tsx @@ -27,7 +27,7 @@ import { generatePublicDashboardConfigUrl, generatePublicDashboardUrl, } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { PublicDashboardListResponse } from '../../types'; diff --git a/public/app/features/manage-dashboards/components/SnapshotListTableRow.test.tsx b/public/app/features/manage-dashboards/components/SnapshotListTableRow.test.tsx index f6268790dcf..29d062da35d 100644 --- a/public/app/features/manage-dashboards/components/SnapshotListTableRow.test.tsx +++ b/public/app/features/manage-dashboards/components/SnapshotListTableRow.test.tsx @@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event'; import { contextSrv } from 'app/core/services/context_srv'; import { grantUserPermissions } from 'app/features/alerting/unified/mocks'; import { Snapshot } from 'app/features/dashboard/services/SnapshotSrv'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { SnapshotListTableRow } from './SnapshotListTableRow'; diff --git a/public/app/features/manage-dashboards/components/SnapshotListTableRow.tsx b/public/app/features/manage-dashboards/components/SnapshotListTableRow.tsx index 5e0c08b7395..6a217ca63ce 100644 --- a/public/app/features/manage-dashboards/components/SnapshotListTableRow.tsx +++ b/public/app/features/manage-dashboards/components/SnapshotListTableRow.tsx @@ -6,7 +6,7 @@ import { Button, LinkButton, useStyles2 } from '@grafana/ui'; import { SkeletonComponent, attachSkeleton } from '@grafana/ui/unstable'; import { contextSrv } from 'app/core/services/context_srv'; import { Snapshot } from 'app/features/dashboard/services/SnapshotSrv'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; export interface Props { snapshot: Snapshot; diff --git a/public/app/features/manage-dashboards/state/actions.ts b/public/app/features/manage-dashboards/state/actions.ts index fad40fbec18..191ec9c2657 100644 --- a/public/app/features/manage-dashboards/state/actions.ts +++ b/public/app/features/manage-dashboards/state/actions.ts @@ -10,7 +10,8 @@ import { notifyApp } from 'app/core/actions'; import { createErrorNotification } from 'app/core/copy/appNotification'; import { browseDashboardsAPI, ImportInputs } from 'app/features/browse-dashboards/api/browseDashboardsAPI'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; -import { PermissionLevelString, SearchQueryType, ThunkResult } from 'app/types'; +import { PermissionLevelString, SearchQueryType } from 'app/types/acl'; +import { ThunkResult } from 'app/types/store'; import { Input, diff --git a/public/app/features/manage-dashboards/utils/validation.test.ts b/public/app/features/manage-dashboards/utils/validation.test.ts index 40d1a8ee2b4..d6fb178bf80 100644 --- a/public/app/features/manage-dashboards/utils/validation.test.ts +++ b/public/app/features/manage-dashboards/utils/validation.test.ts @@ -5,7 +5,7 @@ import { import { AnnoKeyFolder, AnnoKeyFolderTitle } from 'app/features/apiserver/types'; import { setDashboardAPI } from 'app/features/dashboard/api/dashboard_api'; import { DashboardWithAccessInfo } from 'app/features/dashboard/api/types'; -import { DashboardDTO } from 'app/types'; +import { DashboardDTO } from 'app/types/dashboard'; import { validateUid } from './validation'; diff --git a/public/app/features/notifications/StoredNotifications.tsx b/public/app/features/notifications/StoredNotifications.tsx index 5443458036e..b5db2d1327a 100644 --- a/public/app/features/notifications/StoredNotifications.tsx +++ b/public/app/features/notifications/StoredNotifications.tsx @@ -14,7 +14,7 @@ import { selectWarningsAndErrors, selectLastReadTimestamp, } from 'app/core/reducers/appNotification'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; export function StoredNotifications() { const dispatch = useDispatch(); diff --git a/public/app/features/org/OrgDetailsPage.test.tsx b/public/app/features/org/OrgDetailsPage.test.tsx index 0fc7ab9e728..c71bfd1eff8 100644 --- a/public/app/features/org/OrgDetailsPage.test.tsx +++ b/public/app/features/org/OrgDetailsPage.test.tsx @@ -4,9 +4,9 @@ import { mockToolkitActionCreator } from 'test/core/redux/mocks'; import { TestProvider } from 'test/helpers/TestProvider'; import { NavModel } from '@grafana/data'; +import { Organization } from 'app/types/organization'; import { backendSrv } from '../../core/services/backend_srv'; -import { Organization } from '../../types'; import { OrgDetailsPage, Props } from './OrgDetailsPage'; import { setOrganizationName } from './state/reducers'; diff --git a/public/app/features/org/OrgDetailsPage.tsx b/public/app/features/org/OrgDetailsPage.tsx index d97faf6636b..bffc18ef3c7 100644 --- a/public/app/features/org/OrgDetailsPage.tsx +++ b/public/app/features/org/OrgDetailsPage.tsx @@ -7,8 +7,9 @@ import { Page } from 'app/core/components/Page/Page'; import SharedPreferences from 'app/core/components/SharedPreferences/SharedPreferences'; import { appEvents, contextSrv } from 'app/core/core'; import { getNavModel } from 'app/core/selectors/navModel'; -import { AccessControlAction, StoreState } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { ShowConfirmModalEvent } from 'app/types/events'; +import { StoreState } from 'app/types/store'; import OrgProfile from './OrgProfile'; import { loadOrganization, updateOrganization } from './state/actions'; diff --git a/public/app/features/org/OrgProfile.tsx b/public/app/features/org/OrgProfile.tsx index 23d56e2d92a..46b5cfa0c9b 100644 --- a/public/app/features/org/OrgProfile.tsx +++ b/public/app/features/org/OrgProfile.tsx @@ -2,7 +2,7 @@ import { Trans, t } from '@grafana/i18n'; import { Input, Field, FieldSet, Button } from '@grafana/ui'; import { Form } from 'app/core/components/Form/Form'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; export interface Props { orgName: string; diff --git a/public/app/features/org/SelectOrgPage.tsx b/public/app/features/org/SelectOrgPage.tsx index f9d93c63e93..3990613cbf8 100644 --- a/public/app/features/org/SelectOrgPage.tsx +++ b/public/app/features/org/SelectOrgPage.tsx @@ -5,7 +5,8 @@ import { Trans } from '@grafana/i18n'; import { config } from '@grafana/runtime'; import { Button, Stack } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; -import { StoreState, UserOrg } from 'app/types'; +import { StoreState } from 'app/types/store'; +import { UserOrg } from 'app/types/user'; import { getUserOrganizations, setUserOrganization } from './state/actions'; diff --git a/public/app/features/org/UserInviteForm.tsx b/public/app/features/org/UserInviteForm.tsx index b4bc4bf67c2..1a0ad769b76 100644 --- a/public/app/features/org/UserInviteForm.tsx +++ b/public/app/features/org/UserInviteForm.tsx @@ -1,6 +1,6 @@ import { Controller } from 'react-hook-form'; -import { locationUtil, SelectableValue } from '@grafana/data'; +import { locationUtil, OrgRole, SelectableValue } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { locationService } from '@grafana/runtime'; import { @@ -18,7 +18,7 @@ import { Stack, } from '@grafana/ui'; import { getConfig } from 'app/core/config'; -import { OrgRole, useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { Form } from '../../core/components/Form/Form'; import { addInvitee } from '../invites/state/actions'; diff --git a/public/app/features/org/state/actions.test.ts b/public/app/features/org/state/actions.test.ts index dedda1a8fb5..b624430697a 100644 --- a/public/app/features/org/state/actions.test.ts +++ b/public/app/features/org/state/actions.test.ts @@ -1,8 +1,8 @@ import { thunkTester } from 'test/core/thunk/thunkTester'; +import { OrgRole } from '@grafana/data'; import { BackendSrv } from '@grafana/runtime'; import { updateConfigurationSubtitle } from 'app/core/actions'; -import { OrgRole } from 'app/types'; import { updateOrganization, setUserOrganization, getUserOrganizations } from './actions'; diff --git a/public/app/features/org/state/actions.ts b/public/app/features/org/state/actions.ts index af1b46f49b0..1d580c5b3ae 100644 --- a/public/app/features/org/state/actions.ts +++ b/public/app/features/org/state/actions.ts @@ -1,6 +1,7 @@ import { getBackendSrv } from '@grafana/runtime'; import { updateConfigurationSubtitle } from 'app/core/actions'; -import { ThunkResult, UserOrg } from 'app/types'; +import { ThunkResult } from 'app/types/store'; +import { UserOrg } from 'app/types/user'; import { organizationLoaded, userOrganizationsLoaded } from './reducers'; diff --git a/public/app/features/org/state/reducers.test.ts b/public/app/features/org/state/reducers.test.ts index b99e2ce762f..6bcc44a6aac 100644 --- a/public/app/features/org/state/reducers.test.ts +++ b/public/app/features/org/state/reducers.test.ts @@ -1,5 +1,7 @@ +import { OrgRole } from '@grafana/data'; +import { OrganizationState } from 'app/types/organization'; + import { reducerTester } from '../../../../test/core/redux/reducerTester'; -import { OrganizationState, OrgRole } from '../../../types'; import { initialState, diff --git a/public/app/features/org/state/reducers.ts b/public/app/features/org/state/reducers.ts index d43850ffb2b..151c8cb40f0 100644 --- a/public/app/features/org/state/reducers.ts +++ b/public/app/features/org/state/reducers.ts @@ -1,6 +1,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'; -import { Organization, OrganizationState, UserOrg } from 'app/types'; +import { OrganizationState, Organization } from 'app/types/organization'; +import { UserOrg } from 'app/types/user'; export const initialState: OrganizationState = { organization: {} as Organization, diff --git a/public/app/features/panel/components/PanelDataErrorView.tsx b/public/app/features/panel/components/PanelDataErrorView.tsx index 339a33d84a2..ba2ddcf7f8d 100644 --- a/public/app/features/panel/components/PanelDataErrorView.tsx +++ b/public/app/features/panel/components/PanelDataErrorView.tsx @@ -20,7 +20,7 @@ import { VisualizationSelectPaneTab } from 'app/features/dashboard/components/Pa import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; import { DashboardScene } from 'app/features/dashboard-scene/scene/DashboardScene'; import { findVizPanelByKey, getVizPanelKeyForPanelId } from 'app/features/dashboard-scene/utils/utils'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { changePanelPlugin } from '../state/actions'; diff --git a/public/app/features/panel/components/PanelPluginError.tsx b/public/app/features/panel/components/PanelPluginError.tsx index d4edf2d1027..39ec1eec5d0 100644 --- a/public/app/features/panel/components/PanelPluginError.tsx +++ b/public/app/features/panel/components/PanelPluginError.tsx @@ -5,7 +5,7 @@ import { PureComponent, ReactNode } from 'react'; import { PanelProps, PanelPlugin, PluginType, PanelPluginMeta } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { Alert } from '@grafana/ui'; -import { AppNotificationSeverity } from 'app/types'; +import { AppNotificationSeverity } from 'app/types/appNotifications'; import grafanaIconSvg from 'img/grafana_icon.svg'; interface Props { diff --git a/public/app/features/panel/state/actions.ts b/public/app/features/panel/state/actions.ts index 6bde8fc0480..24d7c2b1a92 100644 --- a/public/app/features/panel/state/actions.ts +++ b/public/app/features/panel/state/actions.ts @@ -4,8 +4,8 @@ import { getLibraryPanel } from 'app/features/library-panels/state/api'; import { LibraryElementDTO } from 'app/features/library-panels/types'; import { getPanelPluginNotFound } from 'app/features/panel/components/PanelPluginError'; import { loadPanelPlugin } from 'app/features/plugins/admin/state/actions'; -import { ThunkResult } from 'app/types'; import { DashboardPanelsChangedEvent, PanelOptionsChangedEvent, PanelQueriesChangedEvent } from 'app/types/events'; +import { ThunkResult } from 'app/types/store'; import { changePanelKey, panelModelAndPluginReady, removePanel } from './reducers'; diff --git a/public/app/features/panel/state/selectors.ts b/public/app/features/panel/state/selectors.ts index 6851c061940..492e73af8e0 100644 --- a/public/app/features/panel/state/selectors.ts +++ b/public/app/features/panel/state/selectors.ts @@ -1,5 +1,5 @@ import { PanelModel } from 'app/features/dashboard/state/PanelModel'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import { PanelState } from './reducers'; diff --git a/public/app/features/plugins/admin/components/ConnectionsTab.test.tsx b/public/app/features/plugins/admin/components/ConnectionsTab.test.tsx index 340e455e14b..c7e4bb6cb02 100644 --- a/public/app/features/plugins/admin/components/ConnectionsTab.test.tsx +++ b/public/app/features/plugins/admin/components/ConnectionsTab.test.tsx @@ -5,7 +5,7 @@ import { DataSourceSettings } from '@grafana/data'; import { config } from '@grafana/runtime'; import { ContextSrv, setContextSrv } from 'app/core/services/context_srv'; import { getMockDataSources } from 'app/features/datasources/mocks/dataSourcesMocks'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { datasourcePlugin } from '../mocks/catalogPlugin.mock'; diff --git a/public/app/features/plugins/admin/components/ConnectionsTab.tsx b/public/app/features/plugins/admin/components/ConnectionsTab.tsx index a7b82b35774..70a2a26f900 100644 --- a/public/app/features/plugins/admin/components/ConnectionsTab.tsx +++ b/public/app/features/plugins/admin/components/ConnectionsTab.tsx @@ -8,7 +8,8 @@ import { ViewProps } from 'app/features/datasources/components/DataSourcesList'; import { DataSourcesListCard } from 'app/features/datasources/components/DataSourcesListCard'; import { useLoadDataSources } from 'app/features/datasources/state/hooks'; import { getDataSources } from 'app/features/datasources/state/selectors'; -import { AccessControlAction, useSelector } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { useSelector } from 'app/types/store'; import { CatalogPlugin } from '../types'; diff --git a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithApp.tsx b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithApp.tsx index 6e0ab172f3a..f15eefad873 100644 --- a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithApp.tsx +++ b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithApp.tsx @@ -5,7 +5,7 @@ import { Trans } from '@grafana/i18n'; import { reportInteraction } from '@grafana/runtime'; import { Button } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { updatePluginSettings } from '../../api'; import { usePluginConfig } from '../../hooks/usePluginConfig'; diff --git a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.test.tsx b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.test.tsx index a1b80773d8a..b36b4a936b9 100644 --- a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.test.tsx +++ b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.test.tsx @@ -4,7 +4,7 @@ import { TestProvider } from 'test/helpers/TestProvider'; import { PluginSignatureStatus } from '@grafana/data'; import { config } from '@grafana/runtime'; import { ContextSrv, setContextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { CatalogPlugin } from '../../types'; diff --git a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx index 13b490c3797..eba64519719 100644 --- a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx +++ b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx @@ -7,7 +7,7 @@ import { config } from '@grafana/runtime'; import { Button } from '@grafana/ui'; import { ROUTES } from 'app/features/connections/constants'; import { addDataSource } from 'app/features/datasources/state/actions'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { isDataSourceEditor } from '../../permissions'; import { CatalogPlugin } from '../../types'; diff --git a/public/app/features/plugins/admin/components/InstallControls/InstallControlsButton.tsx b/public/app/features/plugins/admin/components/InstallControls/InstallControlsButton.tsx index b4774e0dadd..5e5a61b0365 100644 --- a/public/app/features/plugins/admin/components/InstallControls/InstallControlsButton.tsx +++ b/public/app/features/plugins/admin/components/InstallControls/InstallControlsButton.tsx @@ -9,7 +9,7 @@ import { Button, ConfirmModal, LinkButton, Stack } from '@grafana/ui'; import appEvents from 'app/core/app_events'; import { useQueryParams } from 'app/core/hooks/useQueryParams'; import { removePluginFromNavTree } from 'app/core/reducers/navBarTree'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { getExternalManageLink, isDisabledAngularPlugin } from '../../helpers'; import { diff --git a/public/app/features/plugins/admin/components/InstallControls/InstallControlsWarning.tsx b/public/app/features/plugins/admin/components/InstallControls/InstallControlsWarning.tsx index 1ccdc6e5311..99a198c1455 100644 --- a/public/app/features/plugins/admin/components/InstallControls/InstallControlsWarning.tsx +++ b/public/app/features/plugins/admin/components/InstallControls/InstallControlsWarning.tsx @@ -6,7 +6,7 @@ import { Trans, t } from '@grafana/i18n'; import { config, featureEnabled } from '@grafana/runtime'; import { LinkButton, useStyles2, Alert, TextLink, Stack } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { getExternalManageLink } from '../../helpers'; import { useIsRemotePluginsAvailable } from '../../state/hooks'; diff --git a/public/app/features/plugins/admin/components/PluginDashboards.tsx b/public/app/features/plugins/admin/components/PluginDashboards.tsx index fafd1b19874..8d5caba5861 100644 --- a/public/app/features/plugins/admin/components/PluginDashboards.tsx +++ b/public/app/features/plugins/admin/components/PluginDashboards.tsx @@ -6,7 +6,7 @@ import { Trans } from '@grafana/i18n'; import { getBackendSrv } from '@grafana/runtime'; import { appEvents } from 'app/core/core'; import DashboardsTable from 'app/features/datasources/components/DashboardsTable'; -import { PluginDashboard } from 'app/types'; +import { PluginDashboard } from 'app/types/plugins'; interface Props { plugin: PluginMeta; diff --git a/public/app/features/plugins/admin/components/PluginDetailsPage.tsx b/public/app/features/plugins/admin/components/PluginDetailsPage.tsx index ef6f56c0559..d5a69de88ec 100644 --- a/public/app/features/plugins/admin/components/PluginDetailsPage.tsx +++ b/public/app/features/plugins/admin/components/PluginDetailsPage.tsx @@ -8,7 +8,7 @@ import { Trans, t } from '@grafana/i18n'; import { config } from '@grafana/runtime'; import { Alert, Box, Stack, TabContent, TextLink, useStyles2 } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; -import { AppNotificationSeverity } from 'app/types'; +import { AppNotificationSeverity } from 'app/types/appNotifications'; import { Loader } from '../components/Loader'; import { PluginDetailsBody } from '../components/PluginDetailsBody'; diff --git a/public/app/features/plugins/admin/helpers.ts b/public/app/features/plugins/admin/helpers.ts index b13716b8ca2..171644b2546 100644 --- a/public/app/features/plugins/admin/helpers.ts +++ b/public/app/features/plugins/admin/helpers.ts @@ -3,7 +3,7 @@ import uFuzzy from '@leeoniya/ufuzzy'; import { PluginSignatureStatus, dateTimeParse, PluginError, PluginType, PluginErrorCode } from '@grafana/data'; import { config, featureEnabled } from '@grafana/runtime'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { CatalogPlugin, diff --git a/public/app/features/plugins/admin/hooks/usePluginDetailsTabs.tsx b/public/app/features/plugins/admin/hooks/usePluginDetailsTabs.tsx index 26c700658ff..f0eebd3bd0a 100644 --- a/public/app/features/plugins/admin/hooks/usePluginDetailsTabs.tsx +++ b/public/app/features/plugins/admin/hooks/usePluginDetailsTabs.tsx @@ -5,7 +5,7 @@ import { GrafanaPlugin, NavModelItem, PluginIncludeType, PluginType } from '@gra import { t } from '@grafana/i18n'; import { config } from '@grafana/runtime'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { usePluginConfig } from '../hooks/usePluginConfig'; import { CatalogPlugin, PluginTabIds, PluginTabLabels } from '../types'; diff --git a/public/app/features/plugins/admin/pages/Browse.tsx b/public/app/features/plugins/admin/pages/Browse.tsx index 4cc44785f5b..a8b0ee559e7 100644 --- a/public/app/features/plugins/admin/pages/Browse.tsx +++ b/public/app/features/plugins/admin/pages/Browse.tsx @@ -10,7 +10,7 @@ import { Page } from 'app/core/components/Page/Page'; import { getNavModel } from 'app/core/selectors/navModel'; import { AdvisorRedirectNotice } from 'app/features/connections/components/AdvisorRedirectNotice/AdvisorRedirectNotice'; import { ROUTES as CONNECTIONS_ROUTES } from 'app/features/connections/constants'; -import { useSelector } from 'app/types'; +import { useSelector } from 'app/types/store'; import { HorizontalGroup } from '../components/HorizontalGroup'; import { PluginList } from '../components/PluginList'; diff --git a/public/app/features/plugins/admin/permissions.ts b/public/app/features/plugins/admin/permissions.ts index e0b7d752881..4ea5eccdd34 100644 --- a/public/app/features/plugins/admin/permissions.ts +++ b/public/app/features/plugins/admin/permissions.ts @@ -1,6 +1,6 @@ import { config } from 'app/core/config'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; export function isGrafanaAdmin(): boolean { return config.bootData.user.isGrafanaAdmin; diff --git a/public/app/features/plugins/admin/routes.tsx b/public/app/features/plugins/admin/routes.tsx index ab7fb2d13ce..6b85ddc14e7 100644 --- a/public/app/features/plugins/admin/routes.tsx +++ b/public/app/features/plugins/admin/routes.tsx @@ -1,7 +1,7 @@ import { SafeDynamicImport } from 'app/core/components/DynamicImports/SafeDynamicImport'; import { contextSrv } from 'app/core/core'; import { RouteDescriptor } from 'app/core/navigation/types'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { PluginAdminRoutes } from './types'; diff --git a/public/app/features/plugins/admin/state/actions.ts b/public/app/features/plugins/admin/state/actions.ts index 6f2c5400cf0..599a588d160 100644 --- a/public/app/features/plugins/admin/state/actions.ts +++ b/public/app/features/plugins/admin/state/actions.ts @@ -5,7 +5,7 @@ import { PanelPlugin, PluginError } from '@grafana/data'; import { config, getBackendSrv, isFetchError } from '@grafana/runtime'; import { Settings } from 'app/core/config'; import { importPanelPlugin } from 'app/features/plugins/importPanelPlugin'; -import { StoreState, ThunkResult } from 'app/types'; +import { StoreState, ThunkResult } from 'app/types/store'; import { invalidatePluginInCache } from '../../loader/cache'; import { diff --git a/public/app/features/plugins/admin/state/hooks.ts b/public/app/features/plugins/admin/state/hooks.ts index 457f2f1d73e..2185ec99465 100644 --- a/public/app/features/plugins/admin/state/hooks.ts +++ b/public/app/features/plugins/admin/state/hooks.ts @@ -1,7 +1,7 @@ import { useEffect, useMemo } from 'react'; import { PluginError, PluginType } from '@grafana/data'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; import { sortPlugins, Sorters, isPluginUpdatable } from '../helpers'; import { CatalogPlugin, PluginStatus } from '../types'; diff --git a/public/app/features/plugins/admin/types.ts b/public/app/features/plugins/admin/types.ts index 791a6d4eb28..eaedf1766ee 100644 --- a/public/app/features/plugins/admin/types.ts +++ b/public/app/features/plugins/admin/types.ts @@ -9,7 +9,8 @@ import { WithAccessControlMetadata, } from '@grafana/data'; import { IconName } from '@grafana/ui'; -import { StoreState, PluginsState } from 'app/types'; +import { PluginsState } from 'app/types/plugins'; +import { StoreState } from 'app/types/store'; export type PluginTypeCode = 'app' | 'panel' | 'datasource'; diff --git a/public/app/features/profile/ChangePasswordForm.tsx b/public/app/features/profile/ChangePasswordForm.tsx index fd7d7e58974..6f4ae223651 100644 --- a/public/app/features/profile/ChangePasswordForm.tsx +++ b/public/app/features/profile/ChangePasswordForm.tsx @@ -9,7 +9,7 @@ import { strongPasswordValidationRegister, } from 'app/core/components/ValidationLabels/ValidationLabels'; import config from 'app/core/config'; -import { UserDTO } from 'app/types'; +import { UserDTO } from 'app/types/user'; import { PasswordField } from '../../core/components/PasswordField/PasswordField'; diff --git a/public/app/features/profile/ChangePasswordPage.tsx b/public/app/features/profile/ChangePasswordPage.tsx index 3b7452cbfc5..0be35c8c0fc 100644 --- a/public/app/features/profile/ChangePasswordPage.tsx +++ b/public/app/features/profile/ChangePasswordPage.tsx @@ -2,7 +2,7 @@ import { connect, ConnectedProps } from 'react-redux'; import { useMount } from 'react-use'; import { Page } from 'app/core/components/Page/Page'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import { ChangePasswordForm } from './ChangePasswordForm'; import { changePassword, loadUser } from './state/actions'; diff --git a/public/app/features/profile/UserOrganizations.tsx b/public/app/features/profile/UserOrganizations.tsx index 43638455d41..8f808173438 100644 --- a/public/app/features/profile/UserOrganizations.tsx +++ b/public/app/features/profile/UserOrganizations.tsx @@ -3,7 +3,7 @@ import { PureComponent } from 'react'; import { selectors } from '@grafana/e2e-selectors'; import { Trans, t } from '@grafana/i18n'; import { Button, LoadingPlaceholder, ScrollContainer } from '@grafana/ui'; -import { UserDTO, UserOrg } from 'app/types'; +import { UserDTO, UserOrg } from 'app/types/user'; export interface Props { user: UserDTO | null; diff --git a/public/app/features/profile/UserProfileEditForm.tsx b/public/app/features/profile/UserProfileEditForm.tsx index 3b99618268d..25b8c9a0b2b 100644 --- a/public/app/features/profile/UserProfileEditForm.tsx +++ b/public/app/features/profile/UserProfileEditForm.tsx @@ -3,7 +3,7 @@ import { Trans, t } from '@grafana/i18n'; import { Button, Field, FieldSet, Icon, Input, Tooltip } from '@grafana/ui'; import { Form } from 'app/core/components/Form/Form'; import config from 'app/core/config'; -import { UserDTO } from 'app/types'; +import { UserDTO } from 'app/types/user'; import { ProfileUpdateFields } from './types'; diff --git a/public/app/features/profile/UserProfileEditPage.tsx b/public/app/features/profile/UserProfileEditPage.tsx index c5f84818cb2..1dfa6045e81 100644 --- a/public/app/features/profile/UserProfileEditPage.tsx +++ b/public/app/features/profile/UserProfileEditPage.tsx @@ -6,7 +6,7 @@ import { usePluginComponents } from '@grafana/runtime'; import { Stack } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import SharedPreferences from 'app/core/components/SharedPreferences/SharedPreferences'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import UserOrganizations from './UserOrganizations'; import UserProfileEditForm from './UserProfileEditForm'; diff --git a/public/app/features/profile/UserSessions.tsx b/public/app/features/profile/UserSessions.tsx index 0eac0199b33..375db224fd0 100644 --- a/public/app/features/profile/UserSessions.tsx +++ b/public/app/features/profile/UserSessions.tsx @@ -6,7 +6,7 @@ import { Trans, t } from '@grafana/i18n'; import { Button, Icon, LoadingPlaceholder, ScrollContainer } from '@grafana/ui'; import { TagBadge } from 'app/core/components/TagFilter/TagBadge'; import { formatDate } from 'app/core/internationalization/dates'; -import { UserSession } from 'app/types'; +import { UserSession } from 'app/types/user'; interface Props { sessions: UserSession[]; diff --git a/public/app/features/profile/UserTeams.tsx b/public/app/features/profile/UserTeams.tsx index 65d14160d7b..74b9c1e9aff 100644 --- a/public/app/features/profile/UserTeams.tsx +++ b/public/app/features/profile/UserTeams.tsx @@ -2,7 +2,7 @@ import { PureComponent } from 'react'; import { Trans, t } from '@grafana/i18n'; import { LoadingPlaceholder, ScrollContainer } from '@grafana/ui'; -import { Team } from 'app/types'; +import { Team } from 'app/types/teams'; export interface Props { teams: Team[]; diff --git a/public/app/features/profile/api.ts b/public/app/features/profile/api.ts index bb7e30d6b34..a5ab3247c9e 100644 --- a/public/app/features/profile/api.ts +++ b/public/app/features/profile/api.ts @@ -1,6 +1,6 @@ import { getBackendSrv } from '@grafana/runtime'; - -import { Team, UserDTO, UserOrg, UserSession } from '../../types'; +import { Team } from 'app/types/teams'; +import { UserDTO, UserOrg, UserSession } from 'app/types/user'; import { ChangePasswordFields, ProfileUpdateFields } from './types'; diff --git a/public/app/features/profile/state/actions.ts b/public/app/features/profile/state/actions.ts index e1e5f25600c..c98d764be78 100644 --- a/public/app/features/profile/state/actions.ts +++ b/public/app/features/profile/state/actions.ts @@ -1,6 +1,7 @@ import { config } from '@grafana/runtime'; +import { ThunkResult } from 'app/types/store'; +import { UserOrg } from 'app/types/user'; -import { ThunkResult, UserOrg } from '../../../types'; import { api } from '../api'; import { ChangePasswordFields, ProfileUpdateFields } from '../types'; diff --git a/public/app/features/profile/state/reducers.test.ts b/public/app/features/profile/state/reducers.test.ts index 67ff64f9e56..226b8e94d88 100644 --- a/public/app/features/profile/state/reducers.test.ts +++ b/public/app/features/profile/state/reducers.test.ts @@ -1,5 +1,6 @@ +import { OrgRole } from '@grafana/data'; + import { reducerTester } from '../../../../test/core/redux/reducerTester'; -import { OrgRole } from '../../../types'; import { getMockTeam } from '../../teams/mocks/teamMocks'; import { diff --git a/public/app/features/profile/state/reducers.ts b/public/app/features/profile/state/reducers.ts index f4de9c34f0b..6d1bb9096e6 100644 --- a/public/app/features/profile/state/reducers.ts +++ b/public/app/features/profile/state/reducers.ts @@ -5,7 +5,9 @@ import { dateTimeFormatTimeAgo, setWeekStart, TimeZone } from '@grafana/data'; import { getWeekStart, WeekStart } from '@grafana/ui'; import config from 'app/core/config'; import { contextSrv } from 'app/core/core'; -import { Team, ThunkResult, UserDTO, UserOrg, UserSession } from 'app/types'; +import { ThunkResult } from 'app/types/store'; +import { Team } from 'app/types/teams'; +import { UserDTO, UserOrg, UserSession } from 'app/types/user'; export interface UserState { orgId: number; diff --git a/public/app/features/provisioning/utils/routes.ts b/public/app/features/provisioning/utils/routes.ts index c0e828a66a6..891ecd090d9 100644 --- a/public/app/features/provisioning/utils/routes.ts +++ b/public/app/features/provisioning/utils/routes.ts @@ -1,6 +1,6 @@ import { SafeDynamicImport } from 'app/core/components/DynamicImports/SafeDynamicImport'; import { RouteDescriptor } from 'app/core/navigation/types'; -import { DashboardRoutes } from 'app/types'; +import { DashboardRoutes } from 'app/types/dashboard'; import { checkRequiredFeatures } from '../GettingStarted/features'; import { PROVISIONING_URL, CONNECT_URL, GETTING_STARTED_URL } from '../constants'; diff --git a/public/app/features/query/components/QueryGroup.tsx b/public/app/features/query/components/QueryGroup.tsx index b5275a367e9..8737449101f 100644 --- a/public/app/features/query/components/QueryGroup.tsx +++ b/public/app/features/query/components/QueryGroup.tsx @@ -26,7 +26,7 @@ import { DataSourcePicker } from 'app/features/datasources/components/picker/Dat import { dataSource as expressionDatasource } from 'app/features/expressions/ExpressionDatasource'; import { isSharedDashboardQuery } from 'app/plugins/datasource/dashboard/runSharedRequest'; import { GrafanaQuery } from 'app/plugins/datasource/grafana/types'; -import { QueryGroupOptions } from 'app/types'; +import { QueryGroupOptions } from 'app/types/query'; import { PanelQueryRunner } from '../state/PanelQueryRunner'; import { updateQueries } from '../state/updateQueries'; diff --git a/public/app/features/query/components/QueryGroupOptions.tsx b/public/app/features/query/components/QueryGroupOptions.tsx index b28c4ce7128..2404236e483 100644 --- a/public/app/features/query/components/QueryGroupOptions.tsx +++ b/public/app/features/query/components/QueryGroupOptions.tsx @@ -5,7 +5,7 @@ import { rangeUtil, PanelData, DataSourceApi, GrafanaTheme2 } from '@grafana/dat import { Trans, t } from '@grafana/i18n'; import { Input, InlineSwitch, useStyles2, InlineLabel } from '@grafana/ui'; import { QueryOperationRow } from 'app/core/components/QueryOperationRow/QueryOperationRow'; -import { QueryGroupOptions } from 'app/types'; +import { QueryGroupOptions } from 'app/types/query'; interface Props { options: QueryGroupOptions; diff --git a/public/app/features/query/state/DashboardQueryRunner/DashboardQueryRunner.test.ts b/public/app/features/query/state/DashboardQueryRunner/DashboardQueryRunner.test.ts index 3c07c21bf5c..4c0f49aacd9 100644 --- a/public/app/features/query/state/DashboardQueryRunner/DashboardQueryRunner.test.ts +++ b/public/app/features/query/state/DashboardQueryRunner/DashboardQueryRunner.test.ts @@ -12,7 +12,7 @@ import { import { Annotation } from 'app/features/alerting/unified/utils/constants'; import { TimeSrv } from 'app/features/dashboard/services/TimeSrv'; import * as store from 'app/store/store'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { PromAlertingRuleState, PromRulesResponse, PromRuleType } from 'app/types/unified-alerting-dto'; import { silenceConsoleOutput } from '../../../../../test/core/utils/silenceConsoleOutput'; diff --git a/public/app/features/query/state/DashboardQueryRunner/UnifiedAlertStatesWorker.ts b/public/app/features/query/state/DashboardQueryRunner/UnifiedAlertStatesWorker.ts index 18c001c983c..8610d84f8e1 100644 --- a/public/app/features/query/state/DashboardQueryRunner/UnifiedAlertStatesWorker.ts +++ b/public/app/features/query/state/DashboardQueryRunner/UnifiedAlertStatesWorker.ts @@ -11,7 +11,7 @@ import { GRAFANA_RULES_SOURCE_NAME } from 'app/features/alerting/unified/utils/d import { prometheusRuleType } from 'app/features/alerting/unified/utils/rules'; import { promAlertStateToAlertState } from 'app/features/dashboard-scene/scene/AlertStatesDataLayer'; import { dispatch } from 'app/store/store'; -import { AccessControlAction } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; import { RuleNamespace } from 'app/types/unified-alerting'; import { PromRuleGroupDTO } from 'app/types/unified-alerting-dto'; diff --git a/public/app/features/scopes/tests/utils/render.tsx b/public/app/features/scopes/tests/utils/render.tsx index e4c6993928b..ed126b5b2d7 100644 --- a/public/app/features/scopes/tests/utils/render.tsx +++ b/public/app/features/scopes/tests/utils/render.tsx @@ -8,7 +8,7 @@ import { sceneGraph } from '@grafana/scenes'; import { defaultDashboard } from '@grafana/schema'; import { AppChrome } from 'app/core/components/AppChrome/AppChrome'; import { transformSaveModelToScene } from 'app/features/dashboard-scene/serialization/transformSaveModelToScene'; -import { DashboardDataDTO, DashboardDTO, DashboardMeta } from 'app/types'; +import { DashboardDataDTO, DashboardDTO, DashboardMeta } from 'app/types/dashboard'; import { defaultScopesServices, ScopesContextProvider } from '../../ScopesContextProvider'; diff --git a/public/app/features/search/service/deletedDashboardsCache.ts b/public/app/features/search/service/deletedDashboardsCache.ts index cab6774b97b..7559d00605c 100644 --- a/public/app/features/search/service/deletedDashboardsCache.ts +++ b/public/app/features/search/service/deletedDashboardsCache.ts @@ -1,7 +1,6 @@ import { isResourceList } from 'app/features/apiserver/guards'; import { getDashboardAPI } from 'app/features/dashboard/api/dashboard_api'; - -import { DashboardDataDTO } from '../../../types'; +import { DashboardDataDTO } from 'app/types/dashboard'; import { SearchHit } from './unified'; import { resourceToSearchResult } from './utils'; diff --git a/public/app/features/search/service/sql.ts b/public/app/features/search/service/sql.ts index d8f468ee774..ba0dbc9c894 100644 --- a/public/app/features/search/service/sql.ts +++ b/public/app/features/search/service/sql.ts @@ -2,7 +2,7 @@ import { DataFrame, DataFrameView, FieldType, getDisplayProcessor, SelectableVal import { config } from '@grafana/runtime'; import { TermCount } from 'app/core/components/TagFilter/TagFilter'; import { backendSrv } from 'app/core/services/backend_srv'; -import { PermissionLevelString } from 'app/types'; +import { PermissionLevelString } from 'app/types/acl'; import { DEFAULT_MAX_VALUES, GENERAL_FOLDER_UID, TYPE_KIND_MAP } from '../constants'; import { DashboardSearchHit, DashboardSearchItemType } from '../types'; diff --git a/public/app/features/search/service/types.ts b/public/app/features/search/service/types.ts index cb360ba8deb..3ebda023037 100644 --- a/public/app/features/search/service/types.ts +++ b/public/app/features/search/service/types.ts @@ -1,6 +1,6 @@ import { DataFrameView, SelectableValue } from '@grafana/data'; import { TermCount } from 'app/core/components/TagFilter/TagFilter'; -import { PermissionLevelString } from 'app/types'; +import { PermissionLevelString } from 'app/types/acl'; import { ManagerKind } from '../../apiserver/types'; diff --git a/public/app/features/search/service/utils.ts b/public/app/features/search/service/utils.ts index 94fb1e7d345..981127f6688 100644 --- a/public/app/features/search/service/utils.ts +++ b/public/app/features/search/service/utils.ts @@ -2,8 +2,8 @@ import { DataFrameView, IconName, fuzzySearch } from '@grafana/data'; import { isSharedWithMe } from 'app/features/browse-dashboards/components/utils'; import { DashboardViewItemWithUIItems } from 'app/features/browse-dashboards/types'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; +import { DashboardDataDTO } from 'app/types/dashboard'; -import { DashboardDataDTO } from '../../../types'; import { AnnoKeyFolder, ResourceList } from '../../apiserver/types'; import { DashboardSearchHit, DashboardSearchItemType, DashboardViewItem, DashboardViewItemKind } from '../types'; diff --git a/public/app/features/serviceaccounts/ServiceAccountCreatePage.tsx b/public/app/features/serviceaccounts/ServiceAccountCreatePage.tsx index fb210f4b0c0..b65b380cebf 100644 --- a/public/app/features/serviceaccounts/ServiceAccountCreatePage.tsx +++ b/public/app/features/serviceaccounts/ServiceAccountCreatePage.tsx @@ -1,6 +1,7 @@ import { useCallback, useEffect, useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; +import { OrgRole } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { config, getBackendSrv, locationService } from '@grafana/runtime'; import { Button, Input, Field, FieldSet } from '@grafana/ui'; @@ -10,7 +11,8 @@ import { UserRolePicker } from 'app/core/components/RolePicker/UserRolePicker'; import { fetchRoleOptions, updateUserRoles } from 'app/core/components/RolePicker/api'; import { RolePickerSelect } from 'app/core/components/RolePickerDrawer/RolePickerSelect'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, OrgRole, Role, ServiceAccountCreateApiResponse, ServiceAccountDTO } from 'app/types'; +import { Role, AccessControlAction } from 'app/types/accessControl'; +import { ServiceAccountDTO, ServiceAccountCreateApiResponse } from 'app/types/serviceaccount'; import { OrgRolePicker } from '../admin/OrgRolePicker'; diff --git a/public/app/features/serviceaccounts/ServiceAccountPage.test.tsx b/public/app/features/serviceaccounts/ServiceAccountPage.test.tsx index ee61c2af792..4de16f29479 100644 --- a/public/app/features/serviceaccounts/ServiceAccountPage.test.tsx +++ b/public/app/features/serviceaccounts/ServiceAccountPage.test.tsx @@ -2,7 +2,9 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { TestProvider } from 'test/helpers/TestProvider'; -import { ApiKey, OrgRole, ServiceAccountDTO } from 'app/types'; +import { OrgRole } from '@grafana/data'; +import { ApiKey } from 'app/types/apiKeys'; +import { ServiceAccountDTO } from 'app/types/serviceaccount'; import { ServiceAccountPageUnconnected, Props } from './ServiceAccountPage'; diff --git a/public/app/features/serviceaccounts/ServiceAccountPage.tsx b/public/app/features/serviceaccounts/ServiceAccountPage.tsx index ccc445fae5e..b21f6c9fe6d 100644 --- a/public/app/features/serviceaccounts/ServiceAccountPage.tsx +++ b/public/app/features/serviceaccounts/ServiceAccountPage.tsx @@ -7,7 +7,10 @@ import { Trans, t } from '@grafana/i18n'; import { Button, ConfirmModal, IconButton, Stack } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, ApiKey, ServiceAccountDTO, StoreState } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { ApiKey } from 'app/types/apiKeys'; +import { ServiceAccountDTO } from 'app/types/serviceaccount'; +import { StoreState } from 'app/types/store'; import { ServiceAccountPermissions } from './ServiceAccountPermissions'; import { CreateTokenModal, ServiceAccountToken } from './components/CreateTokenModal'; diff --git a/public/app/features/serviceaccounts/ServiceAccountPermissions.tsx b/public/app/features/serviceaccounts/ServiceAccountPermissions.tsx index e6f3adc78b3..303dfc79716 100644 --- a/public/app/features/serviceaccounts/ServiceAccountPermissions.tsx +++ b/public/app/features/serviceaccounts/ServiceAccountPermissions.tsx @@ -1,8 +1,8 @@ import { t } from '@grafana/i18n'; import { Permissions } from 'app/core/components/AccessControl'; import { contextSrv } from 'app/core/services/context_srv'; - -import { AccessControlAction, ServiceAccountDTO } from '../../types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { ServiceAccountDTO } from 'app/types/serviceaccount'; type ServiceAccountPermissionsProps = { serviceAccount: ServiceAccountDTO; diff --git a/public/app/features/serviceaccounts/ServiceAccountTable.tsx b/public/app/features/serviceaccounts/ServiceAccountTable.tsx index 648cb391fb8..8d7363fa37f 100644 --- a/public/app/features/serviceaccounts/ServiceAccountTable.tsx +++ b/public/app/features/serviceaccounts/ServiceAccountTable.tsx @@ -1,6 +1,7 @@ import { useMemo } from 'react'; import Skeleton from 'react-loading-skeleton'; +import { OrgRole } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { Avatar, @@ -16,7 +17,8 @@ import { } from '@grafana/ui'; import { UserRolePicker } from 'app/core/components/RolePicker/UserRolePicker'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, OrgRole, Role, ServiceAccountDTO } from 'app/types'; +import { Role, AccessControlAction } from 'app/types/accessControl'; +import { ServiceAccountDTO } from 'app/types/serviceaccount'; import { OrgRolePicker } from '../admin/OrgRolePicker'; diff --git a/public/app/features/serviceaccounts/ServiceAccountsListPage.test.tsx b/public/app/features/serviceaccounts/ServiceAccountsListPage.test.tsx index f5f563321af..d4b870c2921 100644 --- a/public/app/features/serviceaccounts/ServiceAccountsListPage.test.tsx +++ b/public/app/features/serviceaccounts/ServiceAccountsListPage.test.tsx @@ -2,7 +2,8 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { TestProvider } from 'test/helpers/TestProvider'; -import { OrgRole, ServiceAccountDTO, ServiceAccountStateFilter } from 'app/types'; +import { OrgRole } from '@grafana/data'; +import { ServiceAccountStateFilter, ServiceAccountDTO } from 'app/types/serviceaccount'; import { Props, ServiceAccountsListPageUnconnected } from './ServiceAccountsListPage'; diff --git a/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx b/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx index ff6218e43e4..9929f0dfe91 100644 --- a/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx +++ b/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx @@ -19,7 +19,9 @@ import { import { Page } from 'app/core/components/Page/Page'; import config from 'app/core/config'; import { contextSrv } from 'app/core/core'; -import { StoreState, ServiceAccountDTO, AccessControlAction, ServiceAccountStateFilter } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { ServiceAccountStateFilter, ServiceAccountDTO } from 'app/types/serviceaccount'; +import { StoreState } from 'app/types/store'; import { ServiceAccountTable } from './ServiceAccountTable'; import { CreateTokenModal, ServiceAccountToken } from './components/CreateTokenModal'; diff --git a/public/app/features/serviceaccounts/components/ServiceAccountProfile.tsx b/public/app/features/serviceaccounts/components/ServiceAccountProfile.tsx index 9e52f25df92..563d0d8b89d 100644 --- a/public/app/features/serviceaccounts/components/ServiceAccountProfile.tsx +++ b/public/app/features/serviceaccounts/components/ServiceAccountProfile.tsx @@ -6,7 +6,8 @@ import { Trans, t } from '@grafana/i18n'; import { Label, TextLink, useStyles2 } from '@grafana/ui'; import { fetchRoleOptions } from 'app/core/components/RolePicker/api'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, Role, ServiceAccountDTO } from 'app/types'; +import { AccessControlAction, Role } from 'app/types/accessControl'; +import { ServiceAccountDTO } from 'app/types/serviceaccount'; import { ServiceAccountProfileRow } from './ServiceAccountProfileRow'; import { ServiceAccountRoleRow } from './ServiceAccountRoleRow'; diff --git a/public/app/features/serviceaccounts/components/ServiceAccountRoleRow.tsx b/public/app/features/serviceaccounts/components/ServiceAccountRoleRow.tsx index 015fd003b33..33a33229b87 100644 --- a/public/app/features/serviceaccounts/components/ServiceAccountRoleRow.tsx +++ b/public/app/features/serviceaccounts/components/ServiceAccountRoleRow.tsx @@ -1,9 +1,11 @@ +import { OrgRole } from '@grafana/data'; import { t } from '@grafana/i18n'; import { Label } from '@grafana/ui'; import { UserRolePicker } from 'app/core/components/RolePicker/UserRolePicker'; import { contextSrv } from 'app/core/core'; import { OrgRolePicker } from 'app/features/admin/OrgRolePicker'; -import { AccessControlAction, OrgRole, Role, ServiceAccountDTO } from 'app/types'; +import { Role, AccessControlAction } from 'app/types/accessControl'; +import { ServiceAccountDTO } from 'app/types/serviceaccount'; interface Props { label: string; diff --git a/public/app/features/serviceaccounts/components/ServiceAccountTokensTable.tsx b/public/app/features/serviceaccounts/components/ServiceAccountTokensTable.tsx index 4c065d0d1df..66b2e818efd 100644 --- a/public/app/features/serviceaccounts/components/ServiceAccountTokensTable.tsx +++ b/public/app/features/serviceaccounts/components/ServiceAccountTokensTable.tsx @@ -3,7 +3,7 @@ import { css, cx } from '@emotion/css'; import { dateTimeFormat, GrafanaTheme2, TimeZone } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; import { DeleteButton, Icon, Tooltip, useStyles2, useTheme2 } from '@grafana/ui'; -import { ApiKey } from 'app/types'; +import { ApiKey } from 'app/types/apiKeys'; interface Props { tokens: ApiKey[]; diff --git a/public/app/features/serviceaccounts/components/ServiceAccountsListItem.tsx b/public/app/features/serviceaccounts/components/ServiceAccountsListItem.tsx index e9a2478557b..9bf659f1500 100644 --- a/public/app/features/serviceaccounts/components/ServiceAccountsListItem.tsx +++ b/public/app/features/serviceaccounts/components/ServiceAccountsListItem.tsx @@ -9,7 +9,8 @@ import { SkeletonComponent, attachSkeleton } from '@grafana/ui/unstable'; import { UserRolePicker } from 'app/core/components/RolePicker/UserRolePicker'; import { contextSrv } from 'app/core/core'; import { OrgRolePicker } from 'app/features/admin/OrgRolePicker'; -import { AccessControlAction, Role, ServiceAccountDTO } from 'app/types'; +import { Role, AccessControlAction } from 'app/types/accessControl'; +import { ServiceAccountDTO } from 'app/types/serviceaccount'; type ServiceAccountListItemProps = { serviceAccount: ServiceAccountDTO; diff --git a/public/app/features/serviceaccounts/state/actions.ts b/public/app/features/serviceaccounts/state/actions.ts index 06591867aa4..5e75bc5378f 100644 --- a/public/app/features/serviceaccounts/state/actions.ts +++ b/public/app/features/serviceaccounts/state/actions.ts @@ -3,7 +3,9 @@ import { debounce } from 'lodash'; import { getBackendSrv } from '@grafana/runtime'; import { fetchRoleOptions } from 'app/core/components/RolePicker/api'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction, ServiceAccountDTO, ServiceAccountStateFilter, ThunkResult } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { ServiceAccountDTO, ServiceAccountStateFilter } from 'app/types/serviceaccount'; +import { ThunkResult } from 'app/types/store'; import { ServiceAccountToken } from '../components/CreateTokenModal'; diff --git a/public/app/features/serviceaccounts/state/actionsServiceAccountPage.ts b/public/app/features/serviceaccounts/state/actionsServiceAccountPage.ts index 4644d3ae136..0921d2e28c4 100644 --- a/public/app/features/serviceaccounts/state/actionsServiceAccountPage.ts +++ b/public/app/features/serviceaccounts/state/actionsServiceAccountPage.ts @@ -1,6 +1,7 @@ import { getBackendSrv, locationService } from '@grafana/runtime'; import { accessControlQueryParam } from 'app/core/utils/accessControl'; -import { ServiceAccountDTO, ThunkResult } from 'app/types'; +import { ServiceAccountDTO } from 'app/types/serviceaccount'; +import { ThunkResult } from 'app/types/store'; import { ServiceAccountToken } from '../components/CreateTokenModal'; diff --git a/public/app/features/serviceaccounts/state/reducers.ts b/public/app/features/serviceaccounts/state/reducers.ts index 5794233d434..705c07c4287 100644 --- a/public/app/features/serviceaccounts/state/reducers.ts +++ b/public/app/features/serviceaccounts/state/reducers.ts @@ -1,13 +1,13 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'; +import { Role } from 'app/types/accessControl'; +import { ApiKey } from 'app/types/apiKeys'; import { - ApiKey, - Role, - ServiceAccountDTO, ServiceAccountProfileState, + ServiceAccountDTO, ServiceAccountsState, ServiceAccountStateFilter, -} from 'app/types'; +} from 'app/types/serviceaccount'; // serviceAccountsProfilePage export const initialStateProfile: ServiceAccountProfileState = { diff --git a/public/app/features/support-bundles/SupportBundles.tsx b/public/app/features/support-bundles/SupportBundles.tsx index 2963dad4d0f..b21604caae0 100644 --- a/public/app/features/support-bundles/SupportBundles.tsx +++ b/public/app/features/support-bundles/SupportBundles.tsx @@ -6,7 +6,8 @@ import { Trans, t } from '@grafana/i18n'; import { LinkButton, Spinner, IconButton } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, StoreState } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { StoreState } from 'app/types/store'; import { loadBundles, removeBundle, checkBundles } from './state/actions'; diff --git a/public/app/features/support-bundles/SupportBundlesCreate.tsx b/public/app/features/support-bundles/SupportBundlesCreate.tsx index 1d916884cb8..4461870556a 100644 --- a/public/app/features/support-bundles/SupportBundlesCreate.tsx +++ b/public/app/features/support-bundles/SupportBundlesCreate.tsx @@ -5,7 +5,7 @@ import { Trans, t } from '@grafana/i18n'; import { Button, Field, Checkbox, LinkButton, Stack, Alert } from '@grafana/ui'; import { Form } from 'app/core/components/Form/Form'; import { Page } from 'app/core/components/Page/Page'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import { loadSupportBundleCollectors, createSupportBundle } from './state/actions'; diff --git a/public/app/features/support-bundles/state/actions.ts b/public/app/features/support-bundles/state/actions.ts index f42babe81ec..d3270e1a5da 100644 --- a/public/app/features/support-bundles/state/actions.ts +++ b/public/app/features/support-bundles/state/actions.ts @@ -1,7 +1,8 @@ import { throttle } from 'lodash'; import { getBackendSrv, locationService } from '@grafana/runtime'; -import { SupportBundle, SupportBundleCollector, SupportBundleCreateRequest, ThunkResult } from 'app/types'; +import { ThunkResult } from 'app/types/store'; +import { SupportBundle, SupportBundleCollector, SupportBundleCreateRequest } from 'app/types/supportBundles'; import { collectorsFetchBegin, diff --git a/public/app/features/support-bundles/state/reducers.ts b/public/app/features/support-bundles/state/reducers.ts index 21e32402ec0..81a1e0d5e80 100644 --- a/public/app/features/support-bundles/state/reducers.ts +++ b/public/app/features/support-bundles/state/reducers.ts @@ -1,6 +1,6 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'; -import { SupportBundle, SupportBundleCollector, SupportBundlesState } from 'app/types'; +import { SupportBundlesState, SupportBundle, SupportBundleCollector } from 'app/types/supportBundles'; export const initialState: SupportBundlesState = { supportBundles: [], diff --git a/public/app/features/teams/CreateTeam.tsx b/public/app/features/teams/CreateTeam.tsx index c52a71e4bcb..0744271c048 100644 --- a/public/app/features/teams/CreateTeam.tsx +++ b/public/app/features/teams/CreateTeam.tsx @@ -10,7 +10,8 @@ import { TeamRolePicker } from 'app/core/components/RolePicker/TeamRolePicker'; import { updateTeamRoles } from 'app/core/components/RolePicker/api'; import { useRoleOptions } from 'app/core/components/RolePicker/hooks'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, Role, TeamDTO } from 'app/types'; +import { Role, AccessControlAction } from 'app/types/accessControl'; +import { TeamDTO } from 'app/types/teams'; const pageNav: NavModelItem = { icon: 'users-alt', diff --git a/public/app/features/teams/TeamGroupSync.test.tsx b/public/app/features/teams/TeamGroupSync.test.tsx index 841a85b5d4b..bda03e89d5d 100644 --- a/public/app/features/teams/TeamGroupSync.test.tsx +++ b/public/app/features/teams/TeamGroupSync.test.tsx @@ -1,7 +1,7 @@ import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { TeamGroup } from '../../types'; +import { TeamGroup } from 'app/types/teams'; import { Props, TeamGroupSync } from './TeamGroupSync'; import { getMockTeamGroups } from './mocks/teamMocks'; diff --git a/public/app/features/teams/TeamGroupSync.tsx b/public/app/features/teams/TeamGroupSync.tsx index e45c525144f..e87a1d4380f 100644 --- a/public/app/features/teams/TeamGroupSync.tsx +++ b/public/app/features/teams/TeamGroupSync.tsx @@ -9,8 +9,8 @@ import { CloseButton } from 'app/core/components/CloseButton/CloseButton'; import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA'; import { UpgradeBox, UpgradeContent, UpgradeContentProps } from 'app/core/components/Upgrade/UpgradeBox'; import { highlightTrial } from 'app/features/admin/utils'; - -import { StoreState, TeamGroup } from '../../types'; +import { StoreState } from 'app/types/store'; +import { TeamGroup } from 'app/types/teams'; import { addTeamGroup, loadTeamGroups, removeTeamGroup } from './state/actions'; import { getTeamGroups } from './state/selectors'; diff --git a/public/app/features/teams/TeamList.test.tsx b/public/app/features/teams/TeamList.test.tsx index 4826c2bc24f..a5f8adc3f6e 100644 --- a/public/app/features/teams/TeamList.test.tsx +++ b/public/app/features/teams/TeamList.test.tsx @@ -3,8 +3,7 @@ import userEvent from '@testing-library/user-event'; import { TestProvider } from 'test/helpers/TestProvider'; import { contextSrv } from 'app/core/services/context_srv'; - -import { Team } from '../../types'; +import { Team } from 'app/types/teams'; import { Props, TeamList } from './TeamList'; import { getMockTeam, getMultipleMockTeams } from './mocks/teamMocks'; diff --git a/public/app/features/teams/TeamList.tsx b/public/app/features/teams/TeamList.tsx index dd93bd941e7..b1a5952eca8 100644 --- a/public/app/features/teams/TeamList.tsx +++ b/public/app/features/teams/TeamList.tsx @@ -24,7 +24,9 @@ import { import { Page } from 'app/core/components/Page/Page'; import { fetchRoleOptions } from 'app/core/components/RolePicker/api'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction, Role, StoreState, TeamWithRoles } from 'app/types'; +import { Role, AccessControlAction } from 'app/types/accessControl'; +import { StoreState } from 'app/types/store'; +import { TeamWithRoles } from 'app/types/teams'; import { TeamRolePicker } from '../../core/components/RolePicker/TeamRolePicker'; import { EnterpriseAuthFeaturesCard } from '../admin/EnterpriseAuthFeaturesCard'; diff --git a/public/app/features/teams/TeamPages.tsx b/public/app/features/teams/TeamPages.tsx index 940f6950d1a..89a5cb5e032 100644 --- a/public/app/features/teams/TeamPages.tsx +++ b/public/app/features/teams/TeamPages.tsx @@ -9,7 +9,8 @@ import { UpgradeBox } from 'app/core/components/Upgrade/UpgradeBox'; import config from 'app/core/config'; import { getNavModel } from 'app/core/selectors/navModel'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction, StoreState, useDispatch, useSelector } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { StoreState, useDispatch, useSelector } from 'app/types/store'; import TeamGroupSync, { TeamSyncUpgradeContent } from './TeamGroupSync'; import TeamPermissions from './TeamPermissions'; diff --git a/public/app/features/teams/TeamPermissions.tsx b/public/app/features/teams/TeamPermissions.tsx index 349b2531dab..47823bfcae6 100644 --- a/public/app/features/teams/TeamPermissions.tsx +++ b/public/app/features/teams/TeamPermissions.tsx @@ -1,7 +1,7 @@ import { Permissions } from 'app/core/components/AccessControl'; import { contextSrv } from 'app/core/services/context_srv'; - -import { AccessControlAction, Team } from '../../types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { Team } from 'app/types/teams'; type TeamPermissionsProps = { team: Team; diff --git a/public/app/features/teams/TeamSettings.tsx b/public/app/features/teams/TeamSettings.tsx index fa960f25336..79e9ff95dd9 100644 --- a/public/app/features/teams/TeamSettings.tsx +++ b/public/app/features/teams/TeamSettings.tsx @@ -7,7 +7,8 @@ import { TeamRolePicker } from 'app/core/components/RolePicker/TeamRolePicker'; import { useRoleOptions } from 'app/core/components/RolePicker/hooks'; import { SharedPreferences } from 'app/core/components/SharedPreferences/SharedPreferences'; import { contextSrv } from 'app/core/services/context_srv'; -import { AccessControlAction, Team } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { Team } from 'app/types/teams'; import { updateTeam } from './state/actions'; diff --git a/public/app/features/teams/mocks/teamMocks.ts b/public/app/features/teams/mocks/teamMocks.ts index 3da74f056f1..d6472499cb2 100644 --- a/public/app/features/teams/mocks/teamMocks.ts +++ b/public/app/features/teams/mocks/teamMocks.ts @@ -1,6 +1,7 @@ import { randomBytes } from 'crypto'; -import { Team, TeamGroup, TeamMember, TeamPermissionLevel } from 'app/types'; +import { TeamPermissionLevel } from 'app/types/acl'; +import { Team, TeamMember, TeamGroup } from 'app/types/teams'; function generateShortUid(): string { return randomBytes(3).toString('hex'); // Generate a short UID diff --git a/public/app/features/teams/state/actions.ts b/public/app/features/teams/state/actions.ts index 967c87ac904..e7a6c5a923a 100644 --- a/public/app/features/teams/state/actions.ts +++ b/public/app/features/teams/state/actions.ts @@ -5,7 +5,9 @@ import { FetchDataArgs } from '@grafana/ui'; import { updateNavIndex } from 'app/core/actions'; import { contextSrv } from 'app/core/core'; import { accessControlQueryParam } from 'app/core/utils/accessControl'; -import { AccessControlAction, TeamWithRoles, TeamMember, ThunkResult, Team } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { ThunkResult } from 'app/types/store'; +import { Team, TeamMember, TeamWithRoles } from 'app/types/teams'; import { buildNavModel } from './navModel'; import { diff --git a/public/app/features/teams/state/navModel.ts b/public/app/features/teams/state/navModel.ts index 74decae3e94..b6267c73d0e 100644 --- a/public/app/features/teams/state/navModel.ts +++ b/public/app/features/teams/state/navModel.ts @@ -5,7 +5,9 @@ import { ProBadge } from 'app/core/components/Upgrade/ProBadge'; import config from 'app/core/config'; import { contextSrv } from 'app/core/services/context_srv'; import { highlightTrial } from 'app/features/admin/utils'; -import { AccessControlAction, Team, TeamPermissionLevel } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { TeamPermissionLevel } from 'app/types/acl'; +import { Team } from 'app/types/teams'; import userProfilePng from 'img/user_profile.png'; const loadingTeam = { diff --git a/public/app/features/teams/state/reducers.test.ts b/public/app/features/teams/state/reducers.test.ts index 483b22700f0..e42e467c6b1 100644 --- a/public/app/features/teams/state/reducers.test.ts +++ b/public/app/features/teams/state/reducers.test.ts @@ -1,5 +1,6 @@ +import { TeamsState, TeamState } from 'app/types/teams'; + import { reducerTester } from '../../../../test/core/redux/reducerTester'; -import { TeamsState, TeamState } from '../../../types'; import { getMockTeam, getMockTeamGroups, getMockTeamMember } from '../mocks/teamMocks'; import { diff --git a/public/app/features/teams/state/reducers.ts b/public/app/features/teams/state/reducers.ts index 4602f33540c..b98c6d21095 100644 --- a/public/app/features/teams/state/reducers.ts +++ b/public/app/features/teams/state/reducers.ts @@ -1,6 +1,6 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'; -import { Team, TeamGroup, TeamMember, TeamsState, TeamState } from 'app/types'; +import { TeamsState, Team, TeamState, TeamMember, TeamGroup } from 'app/types/teams'; export const initialTeamsState: TeamsState = { teams: [], diff --git a/public/app/features/teams/state/selectors.test.ts b/public/app/features/teams/state/selectors.test.ts index 58f4dbbeeef..b1fed3d1ef3 100644 --- a/public/app/features/teams/state/selectors.test.ts +++ b/public/app/features/teams/state/selectors.test.ts @@ -1,4 +1,5 @@ -import { TeamState } from '../../../types'; +import { TeamState } from 'app/types/teams'; + import { getMockTeam } from '../mocks/teamMocks'; import { getTeam } from './selectors'; diff --git a/public/app/features/teams/state/selectors.ts b/public/app/features/teams/state/selectors.ts index ec8e6eddfc4..ec99297158c 100644 --- a/public/app/features/teams/state/selectors.ts +++ b/public/app/features/teams/state/selectors.ts @@ -1,4 +1,4 @@ -import { Team, TeamState } from 'app/types'; +import { Team, TeamState } from 'app/types/teams'; export const getTeamGroups = (state: TeamState) => state.groups; diff --git a/public/app/features/users/UsersActionBar.tsx b/public/app/features/users/UsersActionBar.tsx index 79659a9e54f..18ab669a9f0 100644 --- a/public/app/features/users/UsersActionBar.tsx +++ b/public/app/features/users/UsersActionBar.tsx @@ -5,7 +5,8 @@ import { reportInteraction } from '@grafana/runtime'; import { RadioButtonGroup, LinkButton, FilterInput, InlineField } from '@grafana/ui'; import config from 'app/core/config'; import { contextSrv } from 'app/core/core'; -import { AccessControlAction, StoreState } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { StoreState } from 'app/types/store'; import { selectTotal } from '../invites/state/selectors'; diff --git a/public/app/features/users/UsersListPage.test.tsx b/public/app/features/users/UsersListPage.test.tsx index 4f8f88c3c4a..91dc6767767 100644 --- a/public/app/features/users/UsersListPage.test.tsx +++ b/public/app/features/users/UsersListPage.test.tsx @@ -3,7 +3,7 @@ import { Provider } from 'react-redux'; import { mockToolkitActionCreator } from 'test/core/redux/mocks'; import { configureStore } from 'app/store/configureStore'; -import { Invitee, OrgUser } from 'app/types'; +import { Invitee, OrgUser } from 'app/types/user'; import { Props, UsersListPageUnconnected } from './UsersListPage'; import { pageChanged, sortChanged } from './state/reducers'; diff --git a/public/app/features/users/UsersListPage.tsx b/public/app/features/users/UsersListPage.tsx index e1992a7f46a..b362bf81621 100644 --- a/public/app/features/users/UsersListPage.tsx +++ b/public/app/features/users/UsersListPage.tsx @@ -1,11 +1,12 @@ import { useEffect, useState } from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { renderMarkdown } from '@grafana/data'; +import { OrgRole, renderMarkdown } from '@grafana/data'; import { Alert } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/core'; -import { OrgUser, OrgRole, StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; +import { OrgUser } from 'app/types/user'; import { OrgUsersTable } from '../admin/Users/OrgUsersTable'; import InviteesTable from '../invites/InviteesTable'; diff --git a/public/app/features/users/mocks/userMocks.ts b/public/app/features/users/mocks/userMocks.ts index 68ce9a4bfba..6c0895f1887 100644 --- a/public/app/features/users/mocks/userMocks.ts +++ b/public/app/features/users/mocks/userMocks.ts @@ -1,4 +1,5 @@ -import { OrgRole, OrgUser } from 'app/types'; +import { OrgRole } from '@grafana/data'; +import { OrgUser } from 'app/types/user'; import { UsersFetchResult, initialState } from '../state/reducers'; diff --git a/public/app/features/users/state/actions.ts b/public/app/features/users/state/actions.ts index 9dbc7672f63..b13bf27e223 100644 --- a/public/app/features/users/state/actions.ts +++ b/public/app/features/users/state/actions.ts @@ -4,9 +4,9 @@ import { getBackendSrv } from '@grafana/runtime'; import { FetchDataArgs } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; import { accessControlQueryParam } from 'app/core/utils/accessControl'; -import { OrgUser } from 'app/types'; - -import { AccessControlAction, ThunkResult } from '../../../types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { ThunkResult } from 'app/types/store'; +import { OrgUser } from 'app/types/user'; import { usersLoaded, diff --git a/public/app/features/users/state/reducers.test.ts b/public/app/features/users/state/reducers.test.ts index 5c76c88ba5e..abfc484300b 100644 --- a/public/app/features/users/state/reducers.test.ts +++ b/public/app/features/users/state/reducers.test.ts @@ -1,5 +1,6 @@ +import { UsersState } from 'app/types/user'; + import { reducerTester } from '../../../../test/core/redux/reducerTester'; -import { UsersState } from '../../../types'; import { getMockUsers, getFetchUsersMock } from '../mocks/userMocks'; import { initialState, searchQueryChanged, usersLoaded, usersReducer } from './reducers'; diff --git a/public/app/features/users/state/reducers.ts b/public/app/features/users/state/reducers.ts index f74fea6ad1d..bb7cc4c8ea0 100644 --- a/public/app/features/users/state/reducers.ts +++ b/public/app/features/users/state/reducers.ts @@ -1,7 +1,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'; import config from 'app/core/config'; -import { OrgUser, UsersState } from 'app/types'; +import { UsersState, OrgUser } from 'app/types/user'; export const initialState: UsersState = { users: [], diff --git a/public/app/features/users/state/selectors.ts b/public/app/features/users/state/selectors.ts index 2d80444a47d..a2ba378aaf4 100644 --- a/public/app/features/users/state/selectors.ts +++ b/public/app/features/users/state/selectors.ts @@ -1,4 +1,4 @@ -import { UsersState } from 'app/types'; +import { UsersState } from 'app/types/user'; export const getUsers = (state: UsersState) => { const regex = new RegExp(state.searchQuery, 'i'); diff --git a/public/app/features/variables/adhoc/AdHocVariableEditor.tsx b/public/app/features/variables/adhoc/AdHocVariableEditor.tsx index 90e99866827..65745e8337f 100644 --- a/public/app/features/variables/adhoc/AdHocVariableEditor.tsx +++ b/public/app/features/variables/adhoc/AdHocVariableEditor.tsx @@ -3,7 +3,7 @@ import { connect, ConnectedProps } from 'react-redux'; import { AdHocVariableModel, DataSourceInstanceSettings, getDataSourceRef } from '@grafana/data'; import { AdHocVariableForm } from 'app/features/dashboard-scene/settings/variables/components/AdHocVariableForm'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import { initialVariableEditorState } from '../editor/reducer'; import { getAdhocVariableEditorState } from '../editor/selectors'; diff --git a/public/app/features/variables/adhoc/actions.ts b/public/app/features/variables/adhoc/actions.ts index 4263bd09d3f..7e57e0d6344 100644 --- a/public/app/features/variables/adhoc/actions.ts +++ b/public/app/features/variables/adhoc/actions.ts @@ -2,7 +2,7 @@ import { cloneDeep } from 'lodash'; import { AdHocVariableFilter, AdHocVariableModel, DataSourceRef } from '@grafana/data'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; -import { StoreState, ThunkResult } from 'app/types'; +import { StoreState, ThunkResult } from 'app/types/store'; import { changeVariableEditorExtended } from '../editor/reducer'; import { isAdHoc } from '../guard'; diff --git a/public/app/features/variables/constant/actions.ts b/public/app/features/variables/constant/actions.ts index 87f78229983..17ba4e9699b 100644 --- a/public/app/features/variables/constant/actions.ts +++ b/public/app/features/variables/constant/actions.ts @@ -1,4 +1,4 @@ -import { ThunkResult } from 'app/types'; +import { ThunkResult } from 'app/types/store'; import { validateVariableSelectionState } from '../state/actions'; import { toKeyedAction } from '../state/keyedVariablesReducer'; diff --git a/public/app/features/variables/custom/CustomVariableEditor.tsx b/public/app/features/variables/custom/CustomVariableEditor.tsx index 7488326cec7..82b783542e2 100644 --- a/public/app/features/variables/custom/CustomVariableEditor.tsx +++ b/public/app/features/variables/custom/CustomVariableEditor.tsx @@ -4,7 +4,7 @@ import { MapDispatchToProps, MapStateToProps } from 'react-redux'; import { CustomVariableModel, VariableWithMultiSupport } from '@grafana/data'; import { connectWithStore } from 'app/core/utils/connectWithReduxStore'; import { CustomVariableForm } from 'app/features/dashboard-scene/settings/variables/components/CustomVariableForm'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; import { OnPropChangeArguments, VariableEditorProps } from '../editor/types'; import { changeVariableMultiValue } from '../state/actions'; diff --git a/public/app/features/variables/custom/actions.ts b/public/app/features/variables/custom/actions.ts index d8751dd56ed..73eff38f5f5 100644 --- a/public/app/features/variables/custom/actions.ts +++ b/public/app/features/variables/custom/actions.ts @@ -1,5 +1,5 @@ import { getTemplateSrv } from '@grafana/runtime'; -import { ThunkResult } from 'app/types'; +import { ThunkResult } from 'app/types/store'; import { validateVariableSelectionState } from '../state/actions'; import { toKeyedAction } from '../state/keyedVariablesReducer'; diff --git a/public/app/features/variables/datasource/DataSourceVariableEditor.tsx b/public/app/features/variables/datasource/DataSourceVariableEditor.tsx index 2f9116d4d7b..256c5ff29fd 100644 --- a/public/app/features/variables/datasource/DataSourceVariableEditor.tsx +++ b/public/app/features/variables/datasource/DataSourceVariableEditor.tsx @@ -3,8 +3,8 @@ import { connect, ConnectedProps } from 'react-redux'; import { DataSourceVariableModel, SelectableValue, VariableWithMultiSupport } from '@grafana/data'; import { DataSourceVariableForm } from 'app/features/dashboard-scene/settings/variables/components/DataSourceVariableForm'; +import { StoreState } from 'app/types/store'; -import { StoreState } from '../../../types'; import { initialVariableEditorState } from '../editor/reducer'; import { getDatasourceVariableEditorState } from '../editor/selectors'; import { OnPropChangeArguments, VariableEditorProps } from '../editor/types'; diff --git a/public/app/features/variables/datasource/actions.ts b/public/app/features/variables/datasource/actions.ts index d2786309f44..8daf15ec8bc 100644 --- a/public/app/features/variables/datasource/actions.ts +++ b/public/app/features/variables/datasource/actions.ts @@ -2,8 +2,8 @@ import { chain } from 'lodash'; import { stringToJsRegex } from '@grafana/data'; import { getTemplateSrv } from '@grafana/runtime'; +import { ThunkResult } from 'app/types/store'; -import { ThunkResult } from '../../../types'; import { getDatasourceSrv } from '../../plugins/datasource_srv'; import { changeVariableEditorExtended } from '../editor/reducer'; import { validateVariableSelectionState } from '../state/actions'; diff --git a/public/app/features/variables/editor/VariableEditorContainer.tsx b/public/app/features/variables/editor/VariableEditorContainer.tsx index f810d4bfc88..07398d88f0b 100644 --- a/public/app/features/variables/editor/VariableEditorContainer.tsx +++ b/public/app/features/variables/editor/VariableEditorContainer.tsx @@ -5,8 +5,8 @@ import { bindActionCreators } from 'redux'; import { locationService } from '@grafana/runtime'; import { Page } from 'app/core/components/Page/Page'; import { SettingsPageProps } from 'app/features/dashboard/components/DashboardSettings/types'; +import { StoreState, ThunkDispatch } from 'app/types/store'; -import { StoreState, ThunkDispatch } from '../../../types'; import { VariablesUnknownTable } from '../inspect/VariablesUnknownTable'; import { toKeyedAction } from '../state/keyedVariablesReducer'; import { getEditorVariables, getVariablesState } from '../state/selectors'; diff --git a/public/app/features/variables/editor/VariableEditorEditor.tsx b/public/app/features/variables/editor/VariableEditorEditor.tsx index 07cc03bac26..3a8e4b88c62 100644 --- a/public/app/features/variables/editor/VariableEditorEditor.tsx +++ b/public/app/features/variables/editor/VariableEditorEditor.tsx @@ -8,8 +8,8 @@ import { selectors } from '@grafana/e2e-selectors'; import { Trans, t } from '@grafana/i18n'; import { locationService } from '@grafana/runtime'; import { Button, HorizontalGroup, Icon, Themeable2, withTheme2 } from '@grafana/ui'; +import { StoreState, ThunkDispatch } from 'app/types/store'; -import { StoreState, ThunkDispatch } from '../../../types'; import { VariableHideSelect } from '../../dashboard-scene/settings/variables/components/VariableHideSelect'; import { VariableLegend } from '../../dashboard-scene/settings/variables/components/VariableLegend'; import { VariableTextAreaField } from '../../dashboard-scene/settings/variables/components/VariableTextAreaField'; diff --git a/public/app/features/variables/editor/actions.ts b/public/app/features/variables/editor/actions.ts index 9f99d411b8a..827a951d56a 100644 --- a/public/app/features/variables/editor/actions.ts +++ b/public/app/features/variables/editor/actions.ts @@ -2,8 +2,8 @@ import { cloneDeep } from 'lodash'; import { TypedVariableModel, VariableType } from '@grafana/data'; import { locationService } from '@grafana/runtime'; +import { ThunkResult } from 'app/types/store'; -import { ThunkResult } from '../../../types'; import { variableAdapters } from '../adapters'; import { initInspect } from '../inspect/reducer'; import { createUsagesNetwork, transformUsagesToNetwork } from '../inspect/utils'; diff --git a/public/app/features/variables/interval/actions.ts b/public/app/features/variables/interval/actions.ts index f583eb7df57..3043da16e0d 100644 --- a/public/app/features/variables/interval/actions.ts +++ b/public/app/features/variables/interval/actions.ts @@ -1,6 +1,6 @@ import { rangeUtil } from '@grafana/data'; +import { ThunkResult } from 'app/types/store'; -import { ThunkResult } from '../../../types'; import { getTimeSrv } from '../../dashboard/services/TimeSrv'; import { getTemplateSrv, TemplateSrv } from '../../templating/template_srv'; import { validateVariableSelectionState } from '../state/actions'; diff --git a/public/app/features/variables/pickers/OptionsPicker/OptionsPicker.tsx b/public/app/features/variables/pickers/OptionsPicker/OptionsPicker.tsx index 7a52df41e12..df8736b4935 100644 --- a/public/app/features/variables/pickers/OptionsPicker/OptionsPicker.tsx +++ b/public/app/features/variables/pickers/OptionsPicker/OptionsPicker.tsx @@ -6,7 +6,7 @@ import { bindActionCreators } from 'redux'; import { LoadingState, VariableOption, VariableWithMultiSupport, VariableWithOptions } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; import { ClickOutsideWrapper } from '@grafana/ui'; -import { StoreState, ThunkDispatch } from 'app/types'; +import { StoreState, ThunkDispatch } from 'app/types/store'; import { VARIABLE_PREFIX } from '../../constants'; import { isMulti } from '../../guard'; diff --git a/public/app/features/variables/pickers/OptionsPicker/actions.ts b/public/app/features/variables/pickers/OptionsPicker/actions.ts index 43ef1fdec6e..e6049b37187 100644 --- a/public/app/features/variables/pickers/OptionsPicker/actions.ts +++ b/public/app/features/variables/pickers/OptionsPicker/actions.ts @@ -1,7 +1,7 @@ import { debounce, trim } from 'lodash'; import { isEmptyObject, containsSearchFilter, VariableWithOptions, VariableOption } from '@grafana/data'; -import { StoreState, ThunkDispatch, ThunkResult } from 'app/types'; +import { StoreState, ThunkDispatch, ThunkResult } from 'app/types/store'; import { variableAdapters } from '../../adapters'; import { hasOptions } from '../../guard'; diff --git a/public/app/features/variables/query/QueryVariableEditor.tsx b/public/app/features/variables/query/QueryVariableEditor.tsx index a10700237bd..5d6a56bdb5a 100644 --- a/public/app/features/variables/query/QueryVariableEditor.tsx +++ b/public/app/features/variables/query/QueryVariableEditor.tsx @@ -10,8 +10,8 @@ import { VariableSort, } from '@grafana/data'; import { QueryVariableEditorForm } from 'app/features/dashboard-scene/settings/variables/components/QueryVariableForm'; +import { StoreState } from 'app/types/store'; -import { StoreState } from '../../../types'; import { getTimeSrv } from '../../dashboard/services/TimeSrv'; import { initialVariableEditorState } from '../editor/reducer'; import { getQueryVariableEditorState } from '../editor/selectors'; diff --git a/public/app/features/variables/query/VariableQueryRunner.ts b/public/app/features/variables/query/VariableQueryRunner.ts index 2a21c3c1226..aae4819e01a 100644 --- a/public/app/features/variables/query/VariableQueryRunner.ts +++ b/public/app/features/variables/query/VariableQueryRunner.ts @@ -12,9 +12,9 @@ import { QueryVariableModel, ScopedVars, } from '@grafana/data'; +import { StoreState, ThunkDispatch } from 'app/types/store'; import { dispatch, getState } from '../../../store/store'; -import { StoreState, ThunkDispatch } from '../../../types'; import { getTimeSrv } from '../../dashboard/services/TimeSrv'; import { runRequest } from '../../query/state/runRequest'; import { getLastKey, getVariable } from '../state/selectors'; diff --git a/public/app/features/variables/query/actions.ts b/public/app/features/variables/query/actions.ts index fe494c17560..90fff7f6a46 100644 --- a/public/app/features/variables/query/actions.ts +++ b/public/app/features/variables/query/actions.ts @@ -2,8 +2,8 @@ import { Subscription } from 'rxjs'; import { DataSourceRef } from '@grafana/data'; import { getDataSourceSrv, toDataQueryError } from '@grafana/runtime'; +import { ThunkResult } from 'app/types/store'; -import { ThunkResult } from '../../../types'; import { getVariableQueryEditor } from '../editor/getVariableQueryEditor'; import { addVariableEditorError, changeVariableEditorExtended, removeVariableEditorError } from '../editor/reducer'; import { getQueryVariableEditorState } from '../editor/selectors'; diff --git a/public/app/features/variables/query/operators.ts b/public/app/features/variables/query/operators.ts index c4bb25960bb..a119b4ebd97 100644 --- a/public/app/features/variables/query/operators.ts +++ b/public/app/features/variables/query/operators.ts @@ -10,8 +10,8 @@ import { PanelData, QueryVariableModel, } from '@grafana/data'; +import { ThunkDispatch } from 'app/types/store'; -import { ThunkDispatch } from '../../../types'; import { validateVariableSelectionState } from '../state/actions'; import { toKeyedAction } from '../state/keyedVariablesReducer'; import { getTemplatedRegex, toKeyedVariableIdentifier, toVariablePayload } from '../utils'; diff --git a/public/app/features/variables/state/actions.ts b/public/app/features/variables/state/actions.ts index fdbc54bbbba..ffc45b6b939 100644 --- a/public/app/features/variables/state/actions.ts +++ b/public/app/features/variables/state/actions.ts @@ -26,12 +26,13 @@ import { contextSrv } from 'app/core/services/context_srv'; import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { store } from 'app/store/store'; +import { AppNotification } from 'app/types/appNotifications'; +import { ThunkResult, StoreState } from 'app/types/store'; import { createErrorNotification } from '../../../core/copy/appNotification'; import { appEvents } from '../../../core/core'; import { getBackendSrv } from '../../../core/services/backend_srv'; import { Graph, Node } from '../../../core/utils/dag'; -import { AppNotification, StoreState, ThunkResult } from '../../../types'; import { getDatasourceSrv } from '../../plugins/datasource_srv'; import { getTemplateSrv, TemplateSrv } from '../../templating/template_srv'; import { variableAdapters } from '../adapters'; diff --git a/public/app/features/variables/state/helpers.ts b/public/app/features/variables/state/helpers.ts index 9752d6ecf5a..163c6d7acf9 100644 --- a/public/app/features/variables/state/helpers.ts +++ b/public/app/features/variables/state/helpers.ts @@ -9,8 +9,9 @@ import { } from '@grafana/data'; import { VariableRefresh } from '@grafana/schema'; import { dashboardReducer } from 'app/features/dashboard/state/reducers'; +import { DashboardState } from 'app/types/dashboard'; +import { StoreState } from 'app/types/store'; -import { DashboardState, StoreState } from '../../../types'; import { VariableAdapter } from '../adapters'; import { NEW_VARIABLE_ID } from '../constants'; import { initialVariableModelState } from '../types'; diff --git a/public/app/features/variables/state/onTimeRangeUpdated.test.ts b/public/app/features/variables/state/onTimeRangeUpdated.test.ts index 528db0045ec..efed3f1b5ab 100644 --- a/public/app/features/variables/state/onTimeRangeUpdated.test.ts +++ b/public/app/features/variables/state/onTimeRangeUpdated.test.ts @@ -1,12 +1,12 @@ import { dateTime, TimeRange, VariableRefresh } from '@grafana/data'; import { config, DataSourceSrv } from '@grafana/runtime'; import * as runtime from '@grafana/runtime'; +import { DashboardState } from 'app/types/dashboard'; import { reduxTester } from '../../../../test/core/redux/reduxTester'; import { silenceConsoleOutput } from '../../../../test/core/utils/silenceConsoleOutput'; import { appEvents } from '../../../core/core'; import { notifyApp } from '../../../core/reducers/appNotification'; -import { DashboardState } from '../../../types'; import { DashboardModel } from '../../dashboard/state/DashboardModel'; import { createDashboardModelFixture } from '../../dashboard/state/__fixtures__/dashboardFixtures'; import { TemplateSrv } from '../../templating/template_srv'; diff --git a/public/app/features/variables/state/selectors.ts b/public/app/features/variables/state/selectors.ts index d9334fd17c0..31e14318d87 100644 --- a/public/app/features/variables/state/selectors.ts +++ b/public/app/features/variables/state/selectors.ts @@ -1,9 +1,9 @@ import memoizeOne from 'memoize-one'; import { TypedVariableModel } from '@grafana/data'; +import { StoreState } from 'app/types/store'; import { getState } from '../../../store/store'; -import { StoreState } from '../../../types'; import { toStateKey } from '../utils'; import { getInitialTemplatingState, TemplatingState } from './reducers'; diff --git a/public/app/features/variables/state/templateVarsChangedInUrl.test.ts b/public/app/features/variables/state/templateVarsChangedInUrl.test.ts index 8e6f6432599..5d6828877c7 100644 --- a/public/app/features/variables/state/templateVarsChangedInUrl.test.ts +++ b/public/app/features/variables/state/templateVarsChangedInUrl.test.ts @@ -1,6 +1,7 @@ import { TypedVariableModel } from '@grafana/data'; +import { DashboardState } from 'app/types/dashboard'; +import { StoreState } from 'app/types/store'; -import { DashboardState, StoreState } from '../../../types'; import { PanelModel } from '../../dashboard/state/PanelModel'; import { createDashboardModelFixture } from '../../dashboard/state/__fixtures__/dashboardFixtures'; import { initialState } from '../../dashboard/state/reducers'; diff --git a/public/app/features/variables/textbox/TextBoxVariablePicker.tsx b/public/app/features/variables/textbox/TextBoxVariablePicker.tsx index 260a57d972e..143cc6f128d 100644 --- a/public/app/features/variables/textbox/TextBoxVariablePicker.tsx +++ b/public/app/features/variables/textbox/TextBoxVariablePicker.tsx @@ -3,7 +3,7 @@ import { ChangeEvent, FocusEvent, KeyboardEvent, ReactElement, useCallback, useE import { TextBoxVariableModel, isEmptyObject } from '@grafana/data'; import { t } from '@grafana/i18n'; import { Input } from '@grafana/ui'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { variableAdapters } from '../adapters'; import { VARIABLE_PREFIX } from '../constants'; diff --git a/public/app/features/variables/textbox/actions.ts b/public/app/features/variables/textbox/actions.ts index c80cc3dd271..0e3c249614f 100644 --- a/public/app/features/variables/textbox/actions.ts +++ b/public/app/features/variables/textbox/actions.ts @@ -1,6 +1,6 @@ import { UrlQueryValue } from '@grafana/data'; +import { ThunkResult } from 'app/types/store'; -import { ThunkResult } from '../../../types'; import { variableAdapters } from '../adapters'; import { setOptionFromUrl } from '../state/actions'; import { toKeyedAction } from '../state/keyedVariablesReducer'; diff --git a/public/app/features/variables/utils.ts b/public/app/features/variables/utils.ts index 4ab42c8ec5c..6908bb9ce57 100644 --- a/public/app/features/variables/utils.ts +++ b/public/app/features/variables/utils.ts @@ -12,9 +12,9 @@ import { } from '@grafana/data'; import { getTemplateSrv, locationService } from '@grafana/runtime'; import { safeStringifyValue } from 'app/core/utils/explore'; +import { StoreState } from 'app/types/store'; import { getState } from '../../store/store'; -import { StoreState } from '../../types'; import { TimeSrv } from '../dashboard/services/TimeSrv'; import { variableAdapters } from './adapters'; diff --git a/public/app/plugins/datasource/elasticsearch/components/reducerTester.ts b/public/app/plugins/datasource/elasticsearch/components/reducerTester.ts index 38c466afa2b..79e2fddbc2d 100644 --- a/public/app/plugins/datasource/elasticsearch/components/reducerTester.ts +++ b/public/app/plugins/datasource/elasticsearch/components/reducerTester.ts @@ -2,7 +2,7 @@ import { AnyAction } from '@reduxjs/toolkit'; import { cloneDeep } from 'lodash'; import { Action } from 'redux'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; type GrafanaReducer = (state: S, action: A) => S; diff --git a/public/app/plugins/panel/alertlist/GroupByWithLoading.tsx b/public/app/plugins/panel/alertlist/GroupByWithLoading.tsx index d864dfaba37..48bc6d561fe 100644 --- a/public/app/plugins/panel/alertlist/GroupByWithLoading.tsx +++ b/public/app/plugins/panel/alertlist/GroupByWithLoading.tsx @@ -10,7 +10,7 @@ import { isAsyncRequestMapSlicePending, isAsyncRequestMapSliceSettled, } from 'app/features/alerting/unified/utils/redux'; -import { useDispatch } from 'app/types'; +import { useDispatch } from 'app/types/store'; import { AlertingRule } from 'app/types/unified-alerting'; import { PromRuleType } from 'app/types/unified-alerting-dto'; diff --git a/public/app/plugins/panel/alertlist/UnifiedAlertList.tsx b/public/app/plugins/panel/alertlist/UnifiedAlertList.tsx index 6043d715801..913ddbfcda6 100644 --- a/public/app/plugins/panel/alertlist/UnifiedAlertList.tsx +++ b/public/app/plugins/panel/alertlist/UnifiedAlertList.tsx @@ -38,7 +38,7 @@ import { flattenCombinedRules, getFirstActiveAt } from 'app/features/alerting/un import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { Matcher } from 'app/plugins/datasource/alertmanager/types'; -import { ThunkDispatch, useDispatch } from 'app/types'; +import { ThunkDispatch, useDispatch } from 'app/types/store'; import { PromAlertingRuleState } from 'app/types/unified-alerting-dto'; import { AlertingAction, useAlertingAbility } from '../../../features/alerting/unified/hooks/useAbilities'; diff --git a/public/app/plugins/panel/dashlist/DashList.tsx b/public/app/plugins/panel/dashlist/DashList.tsx index e3044da47d2..d5c13d5627a 100644 --- a/public/app/plugins/panel/dashlist/DashList.tsx +++ b/public/app/plugins/panel/dashlist/DashList.tsx @@ -23,7 +23,7 @@ import impressionSrv from 'app/core/services/impression_srv'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; import { DashboardSearchItem } from 'app/features/search/types'; import { VariablesChanged } from 'app/features/variables/types'; -import { useDispatch, useSelector } from 'app/types'; +import { useDispatch, useSelector } from 'app/types/store'; import { Options } from './panelcfg.gen'; import { getStyles } from './styles'; diff --git a/public/app/plugins/panel/dashlist/migrations.ts b/public/app/plugins/panel/dashlist/migrations.ts index 25f420108d2..a48c8f4f736 100644 --- a/public/app/plugins/panel/dashlist/migrations.ts +++ b/public/app/plugins/panel/dashlist/migrations.ts @@ -1,6 +1,6 @@ import { PanelModel } from '@grafana/data'; import { getBackendSrv } from '@grafana/runtime'; -import { FolderDTO } from 'app/types'; +import { FolderDTO } from 'app/types/folders'; import { Options } from './panelcfg.gen'; diff --git a/public/app/routes/routes.tsx b/public/app/routes/routes.tsx index e1baf824794..41221a4e772 100644 --- a/public/app/routes/routes.tsx +++ b/public/app/routes/routes.tsx @@ -17,7 +17,8 @@ import { ConfigureIRM } from 'app/features/gops/configuration-tracker/components import { getRoutes as getPluginCatalogRoutes } from 'app/features/plugins/admin/routes'; import { getAppPluginRoutes } from 'app/features/plugins/routes'; import { getProfileRoutes } from 'app/features/profile/routes'; -import { AccessControlAction, DashboardRoutes } from 'app/types'; +import { AccessControlAction } from 'app/types/accessControl'; +import { DashboardRoutes } from 'app/types/dashboard'; import { SafeDynamicImport } from '../core/components/DynamicImports/SafeDynamicImport'; import { RouteDescriptor } from '../core/navigation/types'; diff --git a/public/app/store/store.ts b/public/app/store/store.ts index 496a3e4b081..557ec7566f3 100644 --- a/public/app/store/store.ts +++ b/public/app/store/store.ts @@ -1,7 +1,7 @@ import { Store } from 'redux'; import { initialKeyedVariablesState } from 'app/features/variables/state/keyedVariablesReducer'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; export let store: Store; diff --git a/public/app/types/acl.ts b/public/app/types/acl.ts index 684a3a158b1..a3662165c92 100644 --- a/public/app/types/acl.ts +++ b/public/app/types/acl.ts @@ -1,12 +1,8 @@ -import { OrgRole } from '@grafana/data'; - export enum TeamPermissionLevel { Admin = 4, Member = 0, } -export { OrgRole as OrgRole }; - export type PermissionLevel = 'view' | 'edit' | 'admin'; /** @deprecated Use PermissionLevel instead */ diff --git a/public/app/types/apiKeys.ts b/public/app/types/apiKeys.ts index 37778e66a7a..e732ecc06cd 100644 --- a/public/app/types/apiKeys.ts +++ b/public/app/types/apiKeys.ts @@ -1,6 +1,4 @@ -import { WithAccessControlMetadata } from '@grafana/data'; - -import { OrgRole } from './acl'; +import { OrgRole, WithAccessControlMetadata } from '@grafana/data'; export interface ApiKey extends WithAccessControlMetadata { id?: number; diff --git a/public/app/types/index.ts b/public/app/types/index.ts deleted file mode 100644 index 546c2ab628d..00000000000 --- a/public/app/types/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -export * from './teams'; -export * from './alerting'; -export * from './location'; -export * from './folders'; -export * from './dashboard'; -export * from './acl'; -export * from './apiKeys'; -export * from './user'; -export * from './serviceaccount'; -export * from './datasources'; -export * from './plugins'; -export * from './organization'; -export * from './appNotifications'; -export * from './explore'; -export * from './store'; -export * from './ldap'; -export * from './query'; -export * from './accessControl'; -export * from './supportBundles'; -export * from './settings'; - -import * as CoreEvents from './events'; -export { CoreEvents }; diff --git a/public/app/types/organization.ts b/public/app/types/organization.ts index 926bced7bd5..367c7fcd55c 100644 --- a/public/app/types/organization.ts +++ b/public/app/types/organization.ts @@ -1,4 +1,4 @@ -import { UserOrg } from 'app/types'; +import { UserOrg } from 'app/types/user'; export interface Organization { name: string; diff --git a/public/app/types/serviceaccount.ts b/public/app/types/serviceaccount.ts index 85c2fe1c0de..2d9a56e95b7 100644 --- a/public/app/types/serviceaccount.ts +++ b/public/app/types/serviceaccount.ts @@ -1,6 +1,7 @@ -import { WithAccessControlMetadata } from '@grafana/data'; +import { OrgRole, WithAccessControlMetadata } from '@grafana/data'; -import { ApiKey, OrgRole, Role } from '.'; +import { Role } from './accessControl'; +import { ApiKey } from './apiKeys'; export interface OrgServiceAccount extends WithAccessControlMetadata { serviceAccountId: number; diff --git a/public/app/types/user.ts b/public/app/types/user.ts index 67264b0f298..e5cd1805e7f 100644 --- a/public/app/types/user.ts +++ b/public/app/types/user.ts @@ -1,7 +1,6 @@ -import { SelectableValue, WithAccessControlMetadata } from '@grafana/data'; -import { Role } from 'app/types'; +import { OrgRole, SelectableValue, WithAccessControlMetadata } from '@grafana/data'; -import { OrgRole } from '.'; +import { Role } from './accessControl'; export interface OrgUser extends WithAccessControlMetadata { avatarUrl: string; diff --git a/public/test/core/redux/reducerTester.ts b/public/test/core/redux/reducerTester.ts index 38c466afa2b..79e2fddbc2d 100644 --- a/public/test/core/redux/reducerTester.ts +++ b/public/test/core/redux/reducerTester.ts @@ -2,7 +2,7 @@ import { AnyAction } from '@reduxjs/toolkit'; import { cloneDeep } from 'lodash'; import { Action } from 'redux'; -import { StoreState } from 'app/types'; +import { StoreState } from 'app/types/store'; type GrafanaReducer = (state: S, action: A) => S; diff --git a/public/test/core/redux/reduxTester.ts b/public/test/core/redux/reduxTester.ts index 787ce13b59b..caf43717f21 100644 --- a/public/test/core/redux/reduxTester.ts +++ b/public/test/core/redux/reduxTester.ts @@ -3,7 +3,7 @@ import { Middleware, Store, StoreEnhancer, UnknownAction } from 'redux'; import { thunk, ThunkDispatch, ThunkMiddleware } from 'redux-thunk'; import { setStore } from '../../../app/store/store'; -import { StoreState } from '../../../app/types'; +import { StoreState } from '../../../app/types/store'; export interface ReduxTesterGiven { givenRootReducer: (rootReducer: Reducer>>) => ReduxTesterWhen; diff --git a/public/test/helpers/convertToStoreState.ts b/public/test/helpers/convertToStoreState.ts index 9f696b0e45a..92982147231 100644 --- a/public/test/helpers/convertToStoreState.ts +++ b/public/test/helpers/convertToStoreState.ts @@ -2,7 +2,7 @@ import { TypedVariableModel } from '@grafana/data'; import { getPreloadedState } from '../../app/features/variables/state/helpers'; import { VariablesState } from '../../app/features/variables/state/types'; -import { StoreState } from '../../app/types'; +import { StoreState } from '../../app/types/store'; export const convertToStoreState = (key: string, models: TypedVariableModel[]): StoreState => { const variables = models.reduce((byName, variable) => { diff --git a/public/test/helpers/getTemplateSrvDependencies.ts b/public/test/helpers/getTemplateSrvDependencies.ts index c1da0c4d247..d602d5aa03d 100644 --- a/public/test/helpers/getTemplateSrvDependencies.ts +++ b/public/test/helpers/getTemplateSrvDependencies.ts @@ -1,7 +1,7 @@ import { TemplateSrvDependencies } from 'app/features/templating/template_srv'; import { getFilteredVariables, getVariables, getVariableWithName } from '../../app/features/variables/state/selectors'; -import { StoreState } from '../../app/types'; +import { StoreState } from '../../app/types/store'; export const getTemplateSrvDependencies = (state: StoreState): TemplateSrvDependencies => ({ getFilteredVariables: (filter) => getFilteredVariables(filter, state),