@@ -836,7 +836,6 @@ playwright.storybook.config.ts @grafana/grafana-frontend-platform
|
||||
/public/app/core/constants.ts @grafana/grafana-frontend-platform
|
||||
/public/app/core/context/ @grafana/grafana-frontend-platform
|
||||
/public/app/core/copy/appNotification.ts @grafana/grafana-search-navigate-organise
|
||||
/public/app/core/core.ts @grafana/grafana-frontend-platform
|
||||
/public/app/core/crash/ @grafana/observability-traces-and-profiling
|
||||
/public/app/core/history/ @grafana/observability-traces-and-profiling
|
||||
/public/app/core/hooks/useBusEvent.ts @grafana/grafana-frontend-platform
|
||||
|
||||
@@ -1276,11 +1276,6 @@
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"public/app/core/core.ts": {
|
||||
"no-barrel-files/no-barrel-files": {
|
||||
"count": 7
|
||||
}
|
||||
},
|
||||
"public/app/core/navigation/types.ts": {
|
||||
"@typescript-eslint/no-explicit-any": {
|
||||
"count": 1
|
||||
|
||||
@@ -3,7 +3,7 @@ import { AppEvents } from '@grafana/data';
|
||||
import { t } from '@grafana/i18n';
|
||||
import { config } from '@grafana/runtime';
|
||||
|
||||
import appEvents from '../../../../core/app_events';
|
||||
import { appEvents } from '../../../../core/app_events';
|
||||
import { isProvisionedFolder } from '../../../../features/browse-dashboards/api/isProvisioned';
|
||||
import { useDispatch } from '../../../../types/store';
|
||||
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ import { getStandardTransformers } from 'app/features/transformers/standardTrans
|
||||
import getDefaultMonacoLanguages from '../lib/monaco-languages';
|
||||
|
||||
import { AppWrapper } from './AppWrapper';
|
||||
import appEvents from './core/app_events';
|
||||
import { appEvents } from './core/app_events';
|
||||
import { AppChromeService } from './core/components/AppChrome/AppChromeService';
|
||||
import { useChromeHeaderHeight } from './core/components/AppChrome/TopBar/useChromeHeaderHeight';
|
||||
import { useHelpNode } from './core/components/AppChrome/TopBar/useHelpNode';
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { EventBusSrv, EventBusExtended } from '@grafana/data';
|
||||
|
||||
export const appEvents: EventBusExtended = new EventBusSrv();
|
||||
|
||||
export default appEvents;
|
||||
|
||||
@@ -4,7 +4,7 @@ import { BehaviorSubject } from 'rxjs';
|
||||
import { AppEvents, NavModel, NavModelItem, PageLayoutType, UrlQueryValue } from '@grafana/data';
|
||||
import { t } from '@grafana/i18n';
|
||||
import { config, locationService, reportInteraction } from '@grafana/runtime';
|
||||
import appEvents from 'app/core/app_events';
|
||||
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/dashboard';
|
||||
|
||||
@@ -7,7 +7,7 @@ import { MEGA_MENU_TOGGLE_ID } from 'app/core/constants';
|
||||
import { HOME_NAV_ID } from 'app/core/reducers/navModel';
|
||||
|
||||
import { ShowModalReactEvent } from '../../../../types/events';
|
||||
import appEvents from '../../../app_events';
|
||||
import { appEvents } from '../../../app_events';
|
||||
import { getFooterLinks } from '../../Footer/Footer';
|
||||
import { HelpModal } from '../../help/HelpModal';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
import { config, reportInteraction } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { getExternalUserMngLinkUrl } from 'app/features/users/utils';
|
||||
|
||||
import { InviteUserButton } from './InviteUserButton';
|
||||
@@ -16,7 +16,7 @@ jest.mock('@grafana/runtime', () => ({
|
||||
reportInteraction: jest.fn(),
|
||||
}));
|
||||
|
||||
jest.mock('app/core/core', () => ({
|
||||
jest.mock('app/core/services/context_srv', () => ({
|
||||
contextSrv: {
|
||||
hasPermission: jest.fn(),
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { FeatureToggles } from '@grafana/data';
|
||||
import { reportInteraction, config } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { getExternalUserMngLinkUrl } from 'app/features/users/utils';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
|
||||
@@ -16,7 +16,7 @@ jest.mock('@grafana/runtime', () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
jest.mock('app/core/core', () => ({
|
||||
jest.mock('app/core/services/context_srv', () => ({
|
||||
contextSrv: {
|
||||
hasPermission: jest.fn(),
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { reportInteraction, config } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { getExternalUserMngLinkUrl } from 'app/features/users/utils';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { GrafanaTheme2, NavModelItem } from '@grafana/data';
|
||||
import { t } from '@grafana/i18n';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { Dropdown, Menu, MenuItem, ToolbarButton, useStyles2 } from '@grafana/ui';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
import { ThemeSelectorDrawer } from '../../ThemeSelector/ThemeSelectorDrawer';
|
||||
import { enrichWithInteractionTracking } from '../MegaMenu/utils';
|
||||
|
||||
@@ -9,9 +9,9 @@ import { Icon, Stack, ToolbarButton, useStyles2 } from '@grafana/ui';
|
||||
import { config } from 'app/core/config';
|
||||
import { MEGA_MENU_TOGGLE_ID } from 'app/core/constants';
|
||||
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 { contextSrv } from 'app/core/services/context_srv';
|
||||
import { useSelector } from 'app/types/store';
|
||||
|
||||
import { Branding } from '../../Branding/Branding';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { act, getWrapper, render, screen } from 'test/test-utils';
|
||||
|
||||
import { AppEvents } from '@grafana/data';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { KioskMode } from 'app/types/dashboard';
|
||||
|
||||
import { AppChromeService } from '../AppChrome/AppChromeService';
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useLocation } from 'react-router-dom';
|
||||
import { AlertErrorPayload, AppEvents, GrafanaTheme2 } from '@grafana/data';
|
||||
import { useStyles2, Stack } from '@grafana/ui';
|
||||
import { notifyApp, hideAppNotification } from 'app/core/actions';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { useGrafana } from 'app/core/context/GrafanaContext';
|
||||
import { selectVisible } from 'app/core/reducers/appNotification';
|
||||
import { useSelector, useDispatch } from 'app/types/store';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
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 { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
import { getStyles } from './styles';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useAsyncFn } from 'react-use';
|
||||
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { Role, AccessControlAction } from 'app/types/accessControl';
|
||||
|
||||
import { RolePicker } from './RolePicker';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useEffect } from 'react';
|
||||
import { useAsyncFn } from 'react-use';
|
||||
|
||||
import { OrgRole } from '@grafana/data';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { Role, AccessControlAction } from 'app/types/accessControl';
|
||||
|
||||
import { RolePicker } from './RolePicker';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useState } from 'react';
|
||||
import { useDeepCompareEffect } from 'react-use';
|
||||
import useAsync from 'react-use/lib/useAsync';
|
||||
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { Role, AccessControlAction } from 'app/types/accessControl';
|
||||
|
||||
import { fetchRoleOptions } from './api';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { uniqBy } from 'lodash';
|
||||
import { AppEvents, DateTime, LocalStorageValueProvider, TimeRange, isDateTime, rangeUtil } from '@grafana/data';
|
||||
import { t } from '@grafana/i18n';
|
||||
import { TimeRangePickerProps, TimeRangePicker } from '@grafana/ui';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
|
||||
const LOCAL_STORAGE_KEY = 'grafana.dashboard.timepicker.history';
|
||||
const MAX_HISTORY_ITEMS = 4;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ConfirmModal, ConfirmModalProps, ModalsContext } from '@grafana/ui';
|
||||
import { ModalsContextState } from '@grafana/ui/internal';
|
||||
import { ShowConfirmModalEvent, ShowModalReactEvent } from 'app/types/events';
|
||||
|
||||
import appEvents from '../app_events';
|
||||
import { appEvents } from '../app_events';
|
||||
|
||||
export interface Props {
|
||||
children: React.ReactNode;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import { colors, JsonExplorer } from '@grafana/ui';
|
||||
|
||||
import appEvents from './app_events';
|
||||
import { profiler } from './profiler';
|
||||
import { contextSrv } from './services/context_srv';
|
||||
import TimeSeries, { updateLegendValues } from './time_series2';
|
||||
|
||||
export { profiler, appEvents, colors, contextSrv, JsonExplorer, TimeSeries, updateLegendValues };
|
||||
@@ -1,5 +1,5 @@
|
||||
import { config } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
import { SortOrder } from '../utils/richHistoryTypes';
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import { AppEvents, DataQueryErrorType, deprecationWarning } from '@grafana/data';
|
||||
import { BackendSrv as BackendService, BackendSrvRequest, config, FetchError, FetchResponse } from '@grafana/runtime';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { getConfig } from 'app/core/config';
|
||||
import { getSessionExpiry, hasSessionExpiry } from 'app/core/utils/auth';
|
||||
import { loadUrlToken } from 'app/core/utils/urlToken';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { toggleAssistant, isAssistantAvailable } from '@grafana/assistant';
|
||||
import { LegacyGraphHoverClearEvent, SetPanelAttentionEvent, locationUtil } from '@grafana/data';
|
||||
import { LocationService } from '@grafana/runtime';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { getExploreUrl } from 'app/core/utils/explore';
|
||||
import { toggleMockApiAndReload, togglePseudoLocale } from 'app/dev-utils';
|
||||
import { SaveDashboardDrawer } from 'app/features/dashboard/components/SaveDashboard/SaveDashboardDrawer';
|
||||
@@ -21,8 +21,8 @@ import {
|
||||
} from '../../types/events';
|
||||
import { AppChromeService } from '../components/AppChrome/AppChromeService';
|
||||
import { HelpModal } from '../components/help/HelpModal';
|
||||
import { contextSrv } from '../core';
|
||||
import { RouteDescriptor } from '../navigation/types';
|
||||
import { contextSrv } from '../services/context_srv';
|
||||
|
||||
import { mousetrap } from './mousetrap';
|
||||
import { toggleTheme } from './theme';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { getThemeById } from '@grafana/data/internal';
|
||||
import { ThemeChangedEvent } from '@grafana/runtime';
|
||||
|
||||
import appEvents from '../app_events';
|
||||
import { appEvents } from '../app_events';
|
||||
import { config } from '../config';
|
||||
import { contextSrv } from '../core';
|
||||
import { contextSrv } from '../services/context_srv';
|
||||
|
||||
import { PreferencesService } from './PreferencesService';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { SkeletonTheme } from 'react-loading-skeleton';
|
||||
import { GrafanaTheme2, ThemeContext } from '@grafana/data';
|
||||
import { ThemeChangedEvent, config } from '@grafana/runtime';
|
||||
|
||||
import { appEvents } from '../core';
|
||||
import { appEvents } from '../app_events';
|
||||
|
||||
import 'react-loading-skeleton/dist/skeleton.css';
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
ValueLinkConfig,
|
||||
} from '@grafana/data';
|
||||
import { BackendSrvRequest, config as grafanaConfig, getBackendSrv } from '@grafana/runtime';
|
||||
import { appEvents } from 'app/core/core';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
|
||||
import { HttpRequestMethod } from '../../plugins/panel/canvas/panelcfg.gen';
|
||||
import { createAbsoluteUrl, RelativeUrl } from '../alerting/unified/utils/url';
|
||||
|
||||
@@ -7,7 +7,7 @@ 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 { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { OrgUser } from 'app/types/user';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { GrafanaTheme2 } from '@grafana/data';
|
||||
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 { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { Organization } from 'app/types/organization';
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ import { t, Trans } from '@grafana/i18n';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { Text, Stack, useStyles2, Button, LinkButton } from '@grafana/ui';
|
||||
import { CloudEnterpriseBadge } from 'app/core/components/Branding/CloudEnterpriseBadge';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { backendSrv } from 'app/core/services/backend_srv';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
export interface Props {
|
||||
page?: 'teams' | 'users';
|
||||
|
||||
@@ -7,7 +7,7 @@ import { t } from '@grafana/i18n';
|
||||
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 { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { SyncInfo } from 'app/types/ldap';
|
||||
import { StoreState } from 'app/types/store';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { memo } from 'react';
|
||||
import { dateTimeFormat } from '@grafana/data';
|
||||
import { Trans, t } from '@grafana/i18n';
|
||||
import { Button, LinkButton } from '@grafana/ui';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { SyncInfo } from 'app/types/ldap';
|
||||
import { UserDTO } from 'app/types/user';
|
||||
|
||||
@@ -7,7 +7,7 @@ import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src';
|
||||
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 { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { StoreState } from 'app/types/store';
|
||||
import { UserFilter } from 'app/types/user';
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
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 { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction, Role } from 'app/types/accessControl';
|
||||
import { Organization } from 'app/types/organization';
|
||||
import { UserOrg, UserDTO } from 'app/types/user';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useState } from 'react';
|
||||
import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { Trans, t } from '@grafana/i18n';
|
||||
import { ConfirmButton, RadioButtonGroup, Icon, useStyles2 } from '@grafana/ui';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { ExternalUserTooltip } from 'app/features/admin/UserOrgs';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ 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 { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { UserDTO } from 'app/types/user';
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { memo, useRef, useState } from 'react';
|
||||
import { Trans, t } from '@grafana/i18n';
|
||||
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 { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { UserSession } from 'app/types/user';
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { getMockUsers } from '../../users/mocks/userMocks';
|
||||
|
||||
import { OrgUsersTable, Props } from './OrgUsersTable';
|
||||
|
||||
jest.mock('app/core/core', () => ({
|
||||
jest.mock('app/core/services/context_srv', () => ({
|
||||
contextSrv: {
|
||||
hasPermission: () => true,
|
||||
hasPermissionInMetadata: () => true,
|
||||
|
||||
@@ -25,7 +25,7 @@ import { UserRolePicker } from 'app/core/components/RolePicker/UserRolePicker';
|
||||
import { fetchRoleOptions, updateUserRoles } from 'app/core/components/RolePicker/api';
|
||||
import { RolePickerBadges } from 'app/core/components/RolePickerDrawer/RolePickerBadges';
|
||||
import { TagBadge } from 'app/core/components/TagFilter/TagBadge';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction, Role } from 'app/types/accessControl';
|
||||
import { OrgUser } from 'app/types/user';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { UrlQueryValue } from '@grafana/data';
|
||||
import { getBackendSrv } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { accessControlQueryParam } from 'app/core/utils/accessControl';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { OrgUser } from 'app/types/user';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useFormContext } from 'react-hook-form';
|
||||
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 { contextSrv } from 'app/core/services/context_srv';
|
||||
import { LdapPayload } from 'app/types/ldap';
|
||||
|
||||
const roleOptions: Array<SelectableValue<string>> = Object.keys(OrgRole).map((key) => {
|
||||
|
||||
@@ -6,8 +6,8 @@ import { Trans, t } from '@grafana/i18n';
|
||||
import { featureEnabled } from '@grafana/runtime';
|
||||
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 { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { AppNotificationSeverity } from 'app/types/appNotifications';
|
||||
import { useDispatch, useSelector } from 'app/types/store';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useForm } from 'react-hook-form';
|
||||
import { Trans, t } from '@grafana/i18n';
|
||||
import { featureEnabled } from '@grafana/runtime';
|
||||
import { Alert, Button, Drawer, Field, Input, LoadingPlaceholder, Stack, Text } from '@grafana/ui';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { AppNotificationSeverity } from 'app/types/appNotifications';
|
||||
import { useDispatch, useSelector } from 'app/types/store';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { dateTimeFormatTimeAgo } from '@grafana/data';
|
||||
import { featureEnabled, getBackendSrv, isFetchError, locationService } from '@grafana/runtime';
|
||||
import { FetchDataArgs } from '@grafana/ui';
|
||||
import config from 'app/core/config';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { accessControlQueryParam } from 'app/core/utils/accessControl';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { LdapUser } from 'app/types/ldap';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { pickBy } from 'lodash';
|
||||
|
||||
import { config, createMonitoringLogger, reportInteraction } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
import { RuleNamespace } from '../../../types/unified-alerting';
|
||||
import { RulerRulesConfigDTO } from '../../../types/unified-alerting-dto';
|
||||
|
||||
@@ -6,7 +6,7 @@ import { byRole, byTestId, byText } from 'testing-library-selector';
|
||||
import { PluginExtensionTypes } from '@grafana/data';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
import { locationService, setAppEvents, usePluginLinks } from '@grafana/runtime';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { setupMswServer } from 'app/features/alerting/unified/mockApi';
|
||||
import { setAlertmanagerChoices } from 'app/features/alerting/unified/mocks/server/configure';
|
||||
import * as actions from 'app/features/alerting/unified/state/actions';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AppEvents } from '@grafana/data';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { Silence, SilenceCreatePayload } from 'app/plugins/datasource/alertmanager/types';
|
||||
|
||||
import { alertingApi } from './alertingApi';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { lastValueFrom } from 'rxjs';
|
||||
|
||||
import { AppEvents } from '@grafana/data';
|
||||
import { BackendSrvRequest, getBackendSrv } from '@grafana/runtime';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
|
||||
import { logMeasurement } from '../Analytics';
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
TabsBar,
|
||||
Text,
|
||||
} from '@grafana/ui';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
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/accessControl';
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Trans, t } from '@grafana/i18n';
|
||||
import { Button, Field, Input, Label, Modal, Stack, useStyles2 } from '@grafana/ui';
|
||||
import { useCreateFolder } from 'app/api/clients/folder/v1beta1/hooks';
|
||||
import { useAppNotification } from 'app/core/copy/appNotification';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
|
||||
import { Folder } from '../../types/rule-form';
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import { first, noop } from 'lodash';
|
||||
import { Route, Routes } from 'react-router-dom-v5-compat';
|
||||
import { render } from 'test/test-utils';
|
||||
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { ReceiversState } from 'app/features/alerting/unified/types/alerting';
|
||||
import {
|
||||
AlertmanagerGroup,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { GrafanaTheme2, PanelData, ThresholdsConfig, isTimeSeriesFrames } from '
|
||||
import { Trans } from '@grafana/i18n';
|
||||
import { GraphThresholdsStyleMode } from '@grafana/schema';
|
||||
import { useStyles2 } from '@grafana/ui';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { GraphContainer } from 'app/features/explore/Graph/GraphContainer';
|
||||
|
||||
import { ExpressionResult } from '../expressions/Expression';
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import { Trans, t } from '@grafana/i18n';
|
||||
import { config, locationService } from '@grafana/runtime';
|
||||
import { Alert, Button, Stack, useStyles2 } from '@grafana/ui';
|
||||
import { useAppNotification } from 'app/core/copy/appNotification';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import InfoPausedRule from 'app/features/alerting/unified/components/InfoPausedRule';
|
||||
import {
|
||||
getRuleGroupLocationFromFormValues,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { ExpressionDatasourceUID } from 'app/features/expressions/types';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { AlertQuery } from 'app/types/unified-alerting-dto';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { AppEvents } from '@grafana/data';
|
||||
import { t } from '@grafana/i18n';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { Button, ComponentSize, Dropdown, Menu } from '@grafana/ui';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import MenuItemPauseRule from 'app/features/alerting/unified/components/MenuItemPauseRule';
|
||||
import MoreButton from 'app/features/alerting/unified/components/MoreButton';
|
||||
import { useRulePluginLinkExtension } from 'app/features/alerting/unified/plugins/useRulePluginLinkExtensions';
|
||||
|
||||
@@ -7,7 +7,7 @@ import { DataSourceInstanceSettings, GrafanaTheme2, SelectableValue } from '@gra
|
||||
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 { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { PromAlertingRuleState, PromRuleType } from 'app/types/unified-alerting-dto';
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
useStyles2,
|
||||
useTheme2,
|
||||
} from '@grafana/ui';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import type { AdvancedFilters } from 'app/features/alerting/unified/rule-list/filter/types';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { PromAlertingRuleState, PromRuleType } from 'app/types/unified-alerting-dto';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { AsyncThunk, Draft, PayloadAction, SerializedError, createSlice, isAsync
|
||||
|
||||
import { AppEvents } from '@grafana/data';
|
||||
import { FetchError, isFetchError } from '@grafana/runtime';
|
||||
import { appEvents } from 'app/core/core';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
|
||||
import { LogMessages, logInfo } from '../Analytics';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getBackendSrv } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
import { DatasourceAPIVersions, ScopedResourceClient } from './client';
|
||||
import { GroupVersionResource } from './types';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Observable, from, retry, catchError, filter, map, mergeMap } from 'rxjs
|
||||
|
||||
import { isLiveChannelMessageEvent, LiveChannelScope } from '@grafana/data';
|
||||
import { config, getBackendSrv, getGrafanaLiveSrv } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
import { getAPINamespace } from '../../api/utils';
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ const testConfig: SSOProvider = {
|
||||
},
|
||||
};
|
||||
|
||||
jest.mock('app/core/core', () => {
|
||||
jest.mock('app/core/services/context_srv', () => {
|
||||
return {
|
||||
contextSrv: {
|
||||
isGrafanaAdmin: true,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { SelectableValue } from '@grafana/data';
|
||||
import { Trans, t } from '@grafana/i18n';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { TextLink } from '@grafana/ui';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
import { ServerDiscoveryField } from './components/ServerDiscoveryField';
|
||||
import { FieldData, SSOProvider, SSOSettingsField } from './types';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import config from 'app/core/config';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { getBackendSrv } from 'app/core/services/backend_srv';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { Settings, SettingsSection } from 'app/types/settings';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
|
||||
import { getBackendSrv, isFetchError } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { Settings, UpdateSettingsQuery } from 'app/types/settings';
|
||||
import { ThunkResult } from 'app/types/store';
|
||||
|
||||
@@ -7,8 +7,8 @@ import { selectors } from '@grafana/e2e-selectors';
|
||||
import { config, setBackendSrv } from '@grafana/runtime';
|
||||
import { setupMockServer } from '@grafana/test-utils/server';
|
||||
import { getFolderFixtures } from '@grafana/test-utils/unstable';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { backendSrv } from 'app/core/services/backend_srv';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
import BrowseDashboardsPage from './BrowseDashboardsPage';
|
||||
import * as permissions from './permissions';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { render, screen } from 'test/test-utils';
|
||||
|
||||
import { config } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { setupMswServer } from 'app/features/alerting/unified/mockApi';
|
||||
|
||||
import { rulerTestDb } from '../alerting/unified/mocks/grafanaRulerApi';
|
||||
|
||||
@@ -5,8 +5,8 @@ import { render, screen } from 'test/test-utils';
|
||||
import { config, setBackendSrv } from '@grafana/runtime';
|
||||
import server, { setupMockServer } from '@grafana/test-utils/server';
|
||||
import { getFolderFixtures } from '@grafana/test-utils/unstable';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { backendSrv } from 'app/core/services/backend_srv';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
import BrowseFolderLibraryPanelsPage from './BrowseFolderLibraryPanelsPage';
|
||||
import { getLibraryElementsResponse } from './fixtures/libraryElements.fixture';
|
||||
|
||||
@@ -9,9 +9,9 @@ import { config, getBackendSrv, isFetchError, locationService } from '@grafana/r
|
||||
import { Dashboard } from '@grafana/schema';
|
||||
import { Spec as DashboardV2Spec } from '@grafana/schema/dist/esm/schema/dashboard/v2';
|
||||
import { isProvisionedFolderCheck } from 'app/api/clients/folder/v1beta1/utils';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { setStarred } from 'app/core/reducers/navBarTree';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AnnoKeyFolder, Resource, ResourceList } from 'app/features/apiserver/types';
|
||||
import { getDashboardAPI } from 'app/features/dashboard/api/dashboard_api';
|
||||
import { isDashboardV2Resource, isV1DashboardCommand, isV2DashboardCommand } from 'app/features/dashboard/api/utils';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { getBackendSrv } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { GENERAL_FOLDER_UID } from 'app/features/search/constants';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service/searcher';
|
||||
import { NestedFolderDTO } from 'app/features/search/service/types';
|
||||
@@ -6,7 +7,6 @@ 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 { getFolderURL, isSharedWithMe } from '../components/utils';
|
||||
|
||||
export const PAGE_SIZE = 50;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useState } from 'react';
|
||||
import { Trans, t } from '@grafana/i18n';
|
||||
import { config, reportInteraction } from '@grafana/runtime';
|
||||
import { Button, Drawer, Stack, Text } from '@grafana/ui';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { ManagerKind } from 'app/features/apiserver/types';
|
||||
import { BulkDeleteProvisionedResource } from 'app/features/provisioning/components/BulkActions/BulkDeleteProvisionedResource';
|
||||
import { BulkMoveProvisionedResource } from 'app/features/provisioning/components/BulkActions/BulkMoveProvisionedResource';
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Trans, t } from '@grafana/i18n';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { CallToActionCard, EmptyState, LinkButton, TextLink } from '@grafana/ui';
|
||||
import { useGetFrontendSettingsQuery } from 'app/api/clients/provisioning/v0alpha1';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { useIsProvisionedInstance } from 'app/features/provisioning/hooks/useIsProvisionedInstance';
|
||||
import { useSearchStateManager } from 'app/features/search/state/SearchStateManager';
|
||||
import { DashboardViewItem } from 'app/features/search/types';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { render as rtlRender, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { TestProvider } from 'test/helpers/TestProvider';
|
||||
|
||||
import { appEvents } from 'app/core/core';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { ManagerKind } from 'app/features/apiserver/types';
|
||||
import { ShowModalReactEvent } from 'app/types/events';
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import { AppEvents } from '@grafana/data';
|
||||
import { Trans, t } from '@grafana/i18n';
|
||||
import { locationService, reportInteraction } from '@grafana/runtime';
|
||||
import { Button, Drawer, Dropdown, Icon, Menu, MenuItem, Text } from '@grafana/ui';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { Permissions } from 'app/core/components/AccessControl/Permissions';
|
||||
import { appEvents } from 'app/core/core';
|
||||
import { RepoType } from 'app/features/provisioning/Wizard/types';
|
||||
import { BulkMoveProvisionedResource } from 'app/features/provisioning/components/BulkActions/BulkMoveProvisionedResource';
|
||||
import { DeleteProvisionedFolderForm } from 'app/features/provisioning/components/Folders/DeleteProvisionedFolderForm';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { AppEvents } from '@grafana/data';
|
||||
import { t, Trans } from '@grafana/i18n';
|
||||
import { reportInteraction } from '@grafana/runtime';
|
||||
import { Button, Stack } from '@grafana/ui';
|
||||
import appEvents from 'app/core/app_events';
|
||||
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/store';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { config } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { ResourceRef } from 'app/features/provisioning/components/BulkActions/useBulkActionJob';
|
||||
|
||||
import { DashboardTreeSelection, DashboardViewItemWithUIItems, BrowseDashboardsPermissions } from '../types';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { FolderDTO } from 'app/types/folders';
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import { Connections2 } from 'app/plugins/panel/canvas/components/connections/Co
|
||||
import { Options } from 'app/plugins/panel/canvas/panelcfg.gen';
|
||||
import { AnchorPoint, CanvasTooltipPayload } from 'app/plugins/panel/canvas/types';
|
||||
|
||||
import appEvents from '../../../core/app_events';
|
||||
import { appEvents } from '../../../core/app_events';
|
||||
import { CanvasPanel } from '../../../plugins/panel/canvas/CanvasPanel';
|
||||
import { isInfinityActionWithAuth } from '../../actions/utils';
|
||||
import { getDashboardSrv } from '../../dashboard/services/DashboardSrv';
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event';
|
||||
|
||||
import { PluginLoadingStrategy } from '@grafana/data';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
import { AdvisorRedirectNotice } from './AdvisorRedirectNotice';
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import { Trans, t } from '@grafana/i18n';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { UserStorage } from '@grafana/runtime/internal';
|
||||
import { Alert, LinkButton, useStyles2 } from '@grafana/ui';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
const getStyles = (theme: GrafanaTheme2) => ({
|
||||
alertContent: css({
|
||||
|
||||
+1
-1
@@ -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 { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
|
||||
import { contextSrv } from '../../../../core/core';
|
||||
import { ROUTES } from '../../constants';
|
||||
|
||||
const getStyles = (theme: GrafanaTheme2) => ({
|
||||
|
||||
@@ -4,7 +4,7 @@ import { TestProvider } from 'test/helpers/TestProvider';
|
||||
|
||||
import { PluginType } from '@grafana/data';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { getCatalogPluginMock, getPluginsStateMock } from 'app/features/plugins/admin/mocks/mockHelpers';
|
||||
import { CatalogPlugin } from 'app/features/plugins/admin/types';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
|
||||
@@ -6,8 +6,8 @@ import { PluginType, GrafanaTheme2, SelectableValue } from '@grafana/data';
|
||||
import { Trans, t } from '@grafana/i18n';
|
||||
import { locationSearchToObject, reportInteraction } from '@grafana/runtime';
|
||||
import { LoadingPlaceholder, EmptyState, Field, RadioButtonGroup, Tooltip, Combobox, useStyles2 } from '@grafana/ui';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { useQueryParams } from 'app/core/hooks/useQueryParams';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { HorizontalGroup } from 'app/features/plugins/admin/components/HorizontalGroup';
|
||||
import { SearchField } from 'app/features/plugins/admin/components/SearchField';
|
||||
import { Sorters } from 'app/features/plugins/admin/helpers';
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
setAppEvents,
|
||||
setDataSourceSrv,
|
||||
} from '@grafana/runtime';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { configureStore } from 'app/store/configureStore';
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ import {
|
||||
TextLink,
|
||||
} from '@grafana/ui';
|
||||
import { Page } from 'app/core/components/Page/Page';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { useNavModel } from 'app/core/hooks/useNavModel';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
|
||||
import { AddCorrelationForm } from './Forms/AddCorrelationForm';
|
||||
|
||||
@@ -8,7 +8,7 @@ import { reportInteraction } from '@grafana/runtime';
|
||||
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 { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
|
||||
import { addToDashboard, SubmissionError } from './addToDashboard';
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { t } from '@grafana/i18n';
|
||||
import { appEvents } from 'app/core/core';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { OptionsPaneCategoryDescriptor } from 'app/features/dashboard/components/PanelEditor/OptionsPaneCategoryDescriptor';
|
||||
import { ShowConfirmModalEvent } from 'app/types/events';
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import { t } from '@grafana/i18n';
|
||||
import { appEvents } from 'app/core/core';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { OptionsPaneCategoryDescriptor } from 'app/features/dashboard/components/PanelEditor/OptionsPaneCategoryDescriptor';
|
||||
import { ShowConfirmModalEvent } from 'app/types/events';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Trans, t } from '@grafana/i18n';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
import { sceneGraph, VizPanel } from '@grafana/scenes';
|
||||
import { Stack, Button } from '@grafana/ui';
|
||||
import { appEvents } from 'app/core/core';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { OptionsPaneCategoryDescriptor } from 'app/features/dashboard/components/PanelEditor/OptionsPaneCategoryDescriptor';
|
||||
import { OptionsPaneItemDescriptor } from 'app/features/dashboard/components/PanelEditor/OptionsPaneItemDescriptor';
|
||||
import { ShowConfirmModalEvent } from 'app/types/events';
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import { Trans, t } from '@grafana/i18n';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { SceneComponentProps, SceneObjectBase, SceneObjectRef, SceneObjectState, VizPanel } from '@grafana/scenes';
|
||||
import { Alert, LoadingPlaceholder, Tab, useStyles2 } from '@grafana/ui';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { RulesTable } from 'app/features/alerting/unified/components/rules/RulesTable';
|
||||
import { usePanelCombinedRules } from 'app/features/alerting/unified/hooks/usePanelCombinedRules';
|
||||
import { getRulesPermissions } from 'app/features/alerting/unified/utils/access-control';
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
} from '@grafana/scenes';
|
||||
import { Container, ScrollContainer, TabContent, TabsBar, useStyles2 } from '@grafana/ui';
|
||||
import { getConfig } from 'app/core/config';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { getRulesPermissions } from 'app/features/alerting/unified/utils/access-control';
|
||||
import { GRAFANA_RULES_SOURCE_NAME } from 'app/features/alerting/unified/utils/datasource';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { t } from '@grafana/i18n';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
import { Dashboard } from '@grafana/schema';
|
||||
import { Spec as DashboardV2Spec } from '@grafana/schema/dist/esm/schema/dashboard/v2';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { useAppNotification } from 'app/core/copy/appNotification';
|
||||
import { updateDashboardName } from 'app/core/reducers/navBarTree';
|
||||
import { useSaveDashboardMutation } from 'app/features/browse-dashboards/api/browseDashboardsAPI';
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from '@grafana/scenes';
|
||||
import { notifyApp } from 'app/core/actions';
|
||||
import { createErrorNotification } from 'app/core/copy/appNotification';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { getMessageFromError } from 'app/core/utils/errors';
|
||||
import { alertRuleApi } from 'app/features/alerting/unified/api/alertRuleApi';
|
||||
import { ungroupRulesByFileName } from 'app/features/alerting/unified/api/prometheus';
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
} from '@grafana/scenes';
|
||||
import { Dashboard, DashboardCursorSync, LibraryPanel } from '@grafana/schema';
|
||||
import { Spec as DashboardV2Spec } from '@grafana/schema/dist/esm/schema/dashboard/v2';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { LS_PANEL_COPY_KEY } from 'app/core/constants';
|
||||
import { AnnoKeyManagerKind, ManagerKind } from 'app/features/apiserver/types';
|
||||
import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
} from '@grafana/scenes';
|
||||
import { Dashboard, DashboardLink, LibraryPanel } from '@grafana/schema';
|
||||
import { Spec as DashboardV2Spec } from '@grafana/schema/dist/esm/schema/dashboard/v2';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { ScrollRefElement } from 'app/core/components/NativeScrollbar';
|
||||
import { LS_PANEL_COPY_KEY } from 'app/core/constants';
|
||||
import { getNavModel } from 'app/core/selectors/navModel';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SceneObjectUrlSyncHandler, SceneObjectUrlValues, VizPanel } from '@grafana/scenes';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { KioskMode } from 'app/types/dashboard';
|
||||
|
||||
import { buildPanelEditScene } from '../panel-edit/PanelEditor';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { fireEvent, render, screen } from '@testing-library/react';
|
||||
import { config, locationService } from '@grafana/runtime';
|
||||
import { ConfirmModal } from '@grafana/ui';
|
||||
|
||||
import appEvents from '../../../core/app_events';
|
||||
import { appEvents } from '../../../core/app_events';
|
||||
import { ShowModalReactEvent } from '../../../types/events';
|
||||
|
||||
import { GoToSnapshotOriginButton } from './GoToSnapshotOriginButton';
|
||||
|
||||
@@ -5,7 +5,7 @@ import { t } from '@grafana/i18n';
|
||||
import { config, locationService } from '@grafana/runtime';
|
||||
import { ConfirmModal, ToolbarButton } from '@grafana/ui';
|
||||
|
||||
import appEvents from '../../../core/app_events';
|
||||
import { appEvents } from '../../../core/app_events';
|
||||
import { ShowModalReactEvent } from '../../../types/events';
|
||||
|
||||
export function GoToSnapshotOriginButton(props: { originalURL: string }) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
import { AppChromeUpdate } from 'app/core/components/AppChrome/AppChromeUpdate';
|
||||
import { NavToolbarSeparator } from 'app/core/components/AppChrome/NavToolbar/NavToolbarSeparator';
|
||||
import { LS_PANEL_COPY_KEY } from 'app/core/constants';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
|
||||
import { trackDashboardSceneEditButtonClicked } from 'app/features/dashboard-scene/utils/tracking';
|
||||
import { playlistSrv } from 'app/features/playlist/PlaylistSrv';
|
||||
|
||||
@@ -15,7 +15,7 @@ import { t } from '@grafana/i18n';
|
||||
import { config, locationService } from '@grafana/runtime';
|
||||
import { LocalValueVariable, sceneGraph, VizPanel, VizPanelMenu } from '@grafana/scenes';
|
||||
import { DataQuery, OptionsWithLegend } from '@grafana/schema';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { createErrorNotification } from 'app/core/copy/appNotification';
|
||||
import { notifyApp } from 'app/core/reducers/appNotification';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { LegacyGraphHoverClearEvent } from '@grafana/data';
|
||||
import { behaviors, sceneGraph, SceneTimeRange } from '@grafana/scenes';
|
||||
import { DashboardCursorSync } from '@grafana/schema';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { appEvents } from 'app/core/app_events';
|
||||
import { KeybindingSet } from 'app/core/services/KeybindingSet';
|
||||
|
||||
import { DashboardScene } from './DashboardScene';
|
||||
@@ -9,8 +9,10 @@ import { setupKeyboardShortcuts } from './keyboardShortcuts';
|
||||
|
||||
// Mock dependencies
|
||||
jest.mock('app/core/app_events', () => ({
|
||||
subscribe: jest.fn(() => ({ unsubscribe: jest.fn() })),
|
||||
publish: jest.fn(),
|
||||
appEvents: {
|
||||
subscribe: jest.fn(() => ({ unsubscribe: jest.fn() })),
|
||||
publish: jest.fn(),
|
||||
},
|
||||
}));
|
||||
jest.mock('app/core/services/KeybindingSet');
|
||||
const mockOnRefresh = jest.fn();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user