apply core-imports codemod to all packages and plugins
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -19,7 +19,7 @@ import { screen, fireEvent, waitFor } from '@testing-library/react';
|
||||
import { AddShortcut } from './AddShortcut';
|
||||
import { LocalStoredShortcuts } from './api';
|
||||
import { MockStorageApi, renderInTestApp } from '@backstage/test-utils';
|
||||
import { AlertDisplay } from '@backstage/core';
|
||||
import { AlertDisplay } from '@backstage/core-components';
|
||||
|
||||
describe('AddShortcut', () => {
|
||||
const api = new LocalStoredShortcuts(MockStorageApi.create());
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import React, { useState } from 'react';
|
||||
import { useLocation } from 'react-router';
|
||||
import { SubmitHandler } from 'react-hook-form';
|
||||
import { alertApiRef, useApi } from '@backstage/core';
|
||||
import {
|
||||
Button,
|
||||
Card,
|
||||
@@ -28,6 +27,7 @@ import {
|
||||
import { ShortcutForm } from './ShortcutForm';
|
||||
import { FormValues, Shortcut } from './types';
|
||||
import { ShortcutApi } from './api';
|
||||
import { alertApiRef, useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
card: {
|
||||
|
||||
@@ -20,7 +20,7 @@ import { EditShortcut } from './EditShortcut';
|
||||
import { Shortcut } from './types';
|
||||
import { LocalStoredShortcuts } from './api';
|
||||
import { MockStorageApi, renderInTestApp } from '@backstage/test-utils';
|
||||
import { AlertDisplay } from '@backstage/core';
|
||||
import { AlertDisplay } from '@backstage/core-components';
|
||||
|
||||
describe('EditShortcut', () => {
|
||||
const shortcut: Shortcut = {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import React from 'react';
|
||||
import { SubmitHandler } from 'react-hook-form';
|
||||
import { alertApiRef, useApi } from '@backstage/core';
|
||||
import {
|
||||
Button,
|
||||
Card,
|
||||
@@ -28,6 +27,7 @@ import { ShortcutForm } from './ShortcutForm';
|
||||
import { FormValues, Shortcut } from './types';
|
||||
import DeleteIcon from '@material-ui/icons/Delete';
|
||||
import { ShortcutApi } from './api';
|
||||
import { alertApiRef, useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
card: {
|
||||
|
||||
@@ -18,7 +18,6 @@ import React from 'react';
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { ShortcutItem } from './ShortcutItem';
|
||||
import { Shortcut } from './types';
|
||||
import { SidebarContext } from '@backstage/core';
|
||||
import { LocalStoredShortcuts } from './api';
|
||||
import {
|
||||
MockStorageApi,
|
||||
@@ -26,6 +25,7 @@ import {
|
||||
wrapInTestApp,
|
||||
} from '@backstage/test-utils';
|
||||
import { pageTheme } from '@backstage/theme';
|
||||
import { SidebarContext } from '@backstage/core-components';
|
||||
|
||||
describe('ShortcutItem', () => {
|
||||
const shortcut: Shortcut = {
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { SidebarItem } from '@backstage/core';
|
||||
import { IconButton, makeStyles } from '@material-ui/core';
|
||||
import EditIcon from '@material-ui/icons/Edit';
|
||||
import { ShortcutIcon } from './ShortcutIcon';
|
||||
import { EditShortcut } from './EditShortcut';
|
||||
import { ShortcutApi } from './api';
|
||||
import { Shortcut } from './types';
|
||||
import { SidebarItem } from '@backstage/core-components';
|
||||
|
||||
const useStyles = makeStyles({
|
||||
root: {
|
||||
|
||||
@@ -15,12 +15,14 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { SidebarContext, ApiProvider, ApiRegistry } from '@backstage/core';
|
||||
import { MockStorageApi, renderInTestApp } from '@backstage/test-utils';
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { Shortcuts } from './Shortcuts';
|
||||
import { LocalStoredShortcuts, shortcutsApiRef } from './api';
|
||||
|
||||
import { SidebarContext } from '@backstage/core-components';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
|
||||
const apis = ApiRegistry.from([
|
||||
[shortcutsApiRef, new LocalStoredShortcuts(MockStorageApi.create())],
|
||||
]);
|
||||
|
||||
@@ -16,13 +16,15 @@
|
||||
|
||||
import React, { useMemo } from 'react';
|
||||
import { useObservable } from 'react-use';
|
||||
import { Progress, SidebarItem, useApi } from '@backstage/core';
|
||||
import { makeStyles } from '@material-ui/core';
|
||||
import PlayListAddIcon from '@material-ui/icons/PlaylistAdd';
|
||||
import { ShortcutItem } from './ShortcutItem';
|
||||
import { AddShortcut } from './AddShortcut';
|
||||
import { shortcutsApiRef } from './api';
|
||||
|
||||
import { Progress, SidebarItem } from '@backstage/core-components';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
const useStyles = makeStyles({
|
||||
root: {
|
||||
flex: '1 1 auto',
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { StorageApi } from '@backstage/core';
|
||||
import { pageTheme } from '@backstage/theme';
|
||||
import ObservableImpl from 'zen-observable';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { ShortcutApi } from './ShortcutApi';
|
||||
import { Shortcut } from '../types';
|
||||
import { StorageApi } from '@backstage/core-plugin-api';
|
||||
|
||||
/**
|
||||
* Implementation of the ShortcutApi that uses the StorageApi to store shortcuts.
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiRef, Observable } from '@backstage/core';
|
||||
import { Shortcut } from '../types';
|
||||
import { createApiRef, Observable } from '@backstage/core-plugin-api';
|
||||
|
||||
export const shortcutsApiRef = createApiRef<ShortcutApi>({
|
||||
id: 'plugin.shortcuts.api',
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LocalStoredShortcuts, shortcutsApiRef } from './api';
|
||||
import {
|
||||
createApiFactory,
|
||||
createComponentExtension,
|
||||
createPlugin,
|
||||
storageApiRef,
|
||||
} from '@backstage/core';
|
||||
import { LocalStoredShortcuts, shortcutsApiRef } from './api';
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
export const shortcutsPlugin = createPlugin({
|
||||
id: 'shortcuts',
|
||||
|
||||
Reference in New Issue
Block a user