apply core-imports codemod to all packages and plugins
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiRef, DiscoveryApi, ConfigApi } from '@backstage/core';
|
||||
import {
|
||||
Incident,
|
||||
OnCall,
|
||||
@@ -32,6 +31,11 @@ import {
|
||||
ListUserResponse,
|
||||
EscalationPolicyResponse,
|
||||
} from './types';
|
||||
import {
|
||||
createApiRef,
|
||||
DiscoveryApi,
|
||||
ConfigApi,
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
export class UnauthorizedError extends Error {}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
Team,
|
||||
User,
|
||||
} from '../components/types';
|
||||
import { DiscoveryApi } from '@backstage/core';
|
||||
import { DiscoveryApi } from '@backstage/core-plugin-api';
|
||||
|
||||
export type MessageType =
|
||||
| 'CRITICAL'
|
||||
|
||||
@@ -16,15 +16,6 @@
|
||||
import React from 'react';
|
||||
import { act, fireEvent, render, waitFor } from '@testing-library/react';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import {
|
||||
alertApiRef,
|
||||
ApiProvider,
|
||||
ApiRegistry,
|
||||
ConfigApi,
|
||||
configApiRef,
|
||||
ConfigReader,
|
||||
createApiRef,
|
||||
} from '@backstage/core';
|
||||
import { EntityContext } from '@backstage/plugin-catalog-react';
|
||||
import { wrapInTestApp } from '@backstage/test-utils';
|
||||
import {
|
||||
@@ -42,6 +33,18 @@ import {
|
||||
} from '../api/mocks';
|
||||
import { EntitySplunkOnCallCard } from './EntitySplunkOnCallCard';
|
||||
|
||||
import {
|
||||
alertApiRef,
|
||||
ConfigApi,
|
||||
configApiRef,
|
||||
createApiRef,
|
||||
} from '@backstage/core-plugin-api';
|
||||
import {
|
||||
ApiProvider,
|
||||
ApiRegistry,
|
||||
ConfigReader,
|
||||
} from '@backstage/core-app-api';
|
||||
|
||||
const mockSplunkOnCallApi: Partial<SplunkOnCallClient> = {
|
||||
getUsers: async () => [],
|
||||
getIncidents: async () => [MOCK_INCIDENT],
|
||||
|
||||
@@ -15,15 +15,6 @@
|
||||
*/
|
||||
import React, { useCallback, useState } from 'react';
|
||||
import { useAsync } from 'react-use';
|
||||
import {
|
||||
configApiRef,
|
||||
EmptyState,
|
||||
HeaderIconLinkRow,
|
||||
IconLinkVerticalProps,
|
||||
MissingAnnotationEmptyState,
|
||||
Progress,
|
||||
useApi,
|
||||
} from '@backstage/core';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { useEntity } from '@backstage/plugin-catalog-react';
|
||||
import {
|
||||
@@ -43,6 +34,16 @@ import { Incidents } from './Incident';
|
||||
import { TriggerDialog } from './TriggerDialog';
|
||||
import { User } from './types';
|
||||
|
||||
import { configApiRef, useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
import {
|
||||
EmptyState,
|
||||
HeaderIconLinkRow,
|
||||
IconLinkVerticalProps,
|
||||
MissingAnnotationEmptyState,
|
||||
Progress,
|
||||
} from '@backstage/core-components';
|
||||
|
||||
export const SPLUNK_ON_CALL_TEAM = 'splunk.com/on-call-team';
|
||||
|
||||
export const MissingTeamAnnotation = () => (
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { EmptyState } from '@backstage/core';
|
||||
import { Button } from '@material-ui/core';
|
||||
import { EmptyState } from '@backstage/core-components';
|
||||
|
||||
export const MissingApiKeyOrApiIdError = () => (
|
||||
<EmptyState
|
||||
|
||||
@@ -17,9 +17,9 @@ import React from 'react';
|
||||
import { render, waitFor } from '@testing-library/react';
|
||||
import { EscalationPolicy } from './EscalationPolicy';
|
||||
import { wrapInTestApp } from '@backstage/test-utils';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core';
|
||||
import { splunkOnCallApiRef } from '../../api';
|
||||
import { MOCKED_ON_CALL, MOCKED_USER } from '../../api/mocks';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
|
||||
const mockSplunkOnCallApi = {
|
||||
getOnCallUsers: () => [],
|
||||
|
||||
@@ -26,10 +26,12 @@ import { EscalationUsersEmptyState } from './EscalationUsersEmptyState';
|
||||
import { EscalationUser } from './EscalationUser';
|
||||
import { useAsync } from 'react-use';
|
||||
import { splunkOnCallApiRef } from '../../api';
|
||||
import { useApi, Progress } from '@backstage/core';
|
||||
import { Alert } from '@material-ui/lab';
|
||||
import { User } from '../types';
|
||||
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
import { Progress } from '@backstage/core-components';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) =>
|
||||
createStyles({
|
||||
root: {
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
ListItemText,
|
||||
makeStyles,
|
||||
} from '@material-ui/core';
|
||||
import { StatusWarning } from '@backstage/core';
|
||||
import { StatusWarning } from '@backstage/core-components';
|
||||
|
||||
const useStyles = makeStyles({
|
||||
denseListIcon: {
|
||||
|
||||
@@ -27,13 +27,6 @@ import {
|
||||
} from '@material-ui/core';
|
||||
import DoneIcon from '@material-ui/icons/Done';
|
||||
import DoneAllIcon from '@material-ui/icons/DoneAll';
|
||||
import {
|
||||
StatusError,
|
||||
StatusWarning,
|
||||
StatusOK,
|
||||
useApi,
|
||||
alertApiRef,
|
||||
} from '@backstage/core';
|
||||
import { DateTime, Duration } from 'luxon';
|
||||
import { Incident, IncidentPhase } from '../types';
|
||||
import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';
|
||||
@@ -41,6 +34,13 @@ import { splunkOnCallApiRef } from '../../api/client';
|
||||
import { useAsyncFn } from 'react-use';
|
||||
import { TriggerAlarmRequest } from '../../api/types';
|
||||
|
||||
import {
|
||||
StatusError,
|
||||
StatusWarning,
|
||||
StatusOK,
|
||||
} from '@backstage/core-components';
|
||||
import { useApi, alertApiRef } from '@backstage/core-plugin-api';
|
||||
|
||||
const useStyles = makeStyles({
|
||||
denseListIcon: {
|
||||
marginRight: 0,
|
||||
|
||||
@@ -17,16 +17,16 @@ import React from 'react';
|
||||
import { render, waitFor } from '@testing-library/react';
|
||||
import { Incidents } from './Incidents';
|
||||
import { wrapInTestApp } from '@backstage/test-utils';
|
||||
import { splunkOnCallApiRef } from '../../api';
|
||||
import { MOCK_TEAM, MOCK_INCIDENT } from '../../api/mocks';
|
||||
|
||||
import {
|
||||
alertApiRef,
|
||||
ApiProvider,
|
||||
ApiRegistry,
|
||||
createApiRef,
|
||||
IdentityApi,
|
||||
identityApiRef,
|
||||
} from '@backstage/core';
|
||||
import { splunkOnCallApiRef } from '../../api';
|
||||
import { MOCK_TEAM, MOCK_INCIDENT } from '../../api/mocks';
|
||||
} from '@backstage/core-plugin-api';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
|
||||
const mockIdentityApi: Partial<IdentityApi> = {
|
||||
getUserId: () => 'test',
|
||||
|
||||
@@ -26,9 +26,11 @@ import { IncidentListItem } from './IncidentListItem';
|
||||
import { IncidentsEmptyState } from './IncidentEmptyState';
|
||||
import { useAsyncFn } from 'react-use';
|
||||
import { splunkOnCallApiRef } from '../../api';
|
||||
import { useApi, Progress } from '@backstage/core';
|
||||
import { Alert } from '@material-ui/lab';
|
||||
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
import { Progress } from '@backstage/core-components';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) =>
|
||||
createStyles({
|
||||
root: {
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
import React from 'react';
|
||||
import { Grid, makeStyles } from '@material-ui/core';
|
||||
import { EntitySplunkOnCallCard } from './EntitySplunkOnCallCard';
|
||||
import {
|
||||
Content,
|
||||
ContentHeader,
|
||||
Page,
|
||||
Header,
|
||||
SupportButton,
|
||||
} from '@backstage/core';
|
||||
import { EntitySplunkOnCallCard } from './EntitySplunkOnCallCard';
|
||||
} from '@backstage/core-components';
|
||||
|
||||
const useStyles = makeStyles(() => ({
|
||||
overflowXScroll: {
|
||||
|
||||
@@ -16,15 +16,12 @@
|
||||
import React from 'react';
|
||||
import { render, fireEvent, act } from '@testing-library/react';
|
||||
import { wrapInTestApp } from '@backstage/test-utils';
|
||||
import {
|
||||
ApiRegistry,
|
||||
alertApiRef,
|
||||
createApiRef,
|
||||
ApiProvider,
|
||||
} from '@backstage/core';
|
||||
import { splunkOnCallApiRef } from '../../api';
|
||||
import { TriggerDialog } from './TriggerDialog';
|
||||
|
||||
import { ApiRegistry, ApiProvider } from '@backstage/core-app-api';
|
||||
import { alertApiRef, createApiRef } from '@backstage/core-plugin-api';
|
||||
|
||||
describe('TriggerDialog', () => {
|
||||
const mockTriggerAlarmFn = jest.fn();
|
||||
const mockSplunkOnCallApi = {
|
||||
|
||||
@@ -32,11 +32,11 @@ import {
|
||||
FormControl,
|
||||
InputLabel,
|
||||
} from '@material-ui/core';
|
||||
import { useApi, alertApiRef } from '@backstage/core';
|
||||
import { useAsyncFn } from 'react-use';
|
||||
import { splunkOnCallApiRef } from '../../api';
|
||||
import { Alert } from '@material-ui/lab';
|
||||
import { TriggerAlarmRequest } from '../../api/types';
|
||||
import { useApi, alertApiRef } from '@backstage/core-plugin-api';
|
||||
|
||||
type Props = {
|
||||
team: string;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { splunkOnCallApiRef, SplunkOnCallClient } from './api';
|
||||
import {
|
||||
createApiFactory,
|
||||
createPlugin,
|
||||
@@ -21,8 +22,7 @@ import {
|
||||
configApiRef,
|
||||
createRoutableExtension,
|
||||
createComponentExtension,
|
||||
} from '@backstage/core';
|
||||
import { splunkOnCallApiRef, SplunkOnCallClient } from './api';
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
export const rootRouteRef = createRouteRef({
|
||||
title: 'splunk-on-call',
|
||||
|
||||
Reference in New Issue
Block a user