apply core-imports codemod to all packages and plugins
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -14,9 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiRef, DiscoveryApi, IdentityApi } from '@backstage/core';
|
||||
import { SearchQuery, SearchResultSet } from '@backstage/search-common';
|
||||
import qs from 'qs';
|
||||
import {
|
||||
createApiRef,
|
||||
DiscoveryApi,
|
||||
IdentityApi,
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
export const searchApiRef = createApiRef<SearchApi>({
|
||||
id: 'plugin.search.queryservice',
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Link } from '@backstage/core';
|
||||
import { IndexableDocument } from '@backstage/search-common';
|
||||
import { ListItem, ListItemText, Divider } from '@material-ui/core';
|
||||
import { Link } from '@backstage/core-components';
|
||||
|
||||
type Props = {
|
||||
result: IndexableDocument;
|
||||
|
||||
@@ -13,12 +13,17 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Content, Header, Page, useQueryParamState } from '@backstage/core';
|
||||
import { Grid } from '@material-ui/core';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useDebounce } from 'react-use';
|
||||
import { SearchBar } from './LegacySearchBar';
|
||||
import { SearchResult } from './LegacySearchResult';
|
||||
import {
|
||||
Content,
|
||||
Header,
|
||||
Page,
|
||||
useQueryParamState,
|
||||
} from '@backstage/core-components';
|
||||
|
||||
/**
|
||||
* @deprecated This SearchPage, powered directly by the Catalog API, will be
|
||||
|
||||
@@ -13,14 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {
|
||||
EmptyState,
|
||||
Link,
|
||||
Progress,
|
||||
Table,
|
||||
TableColumn,
|
||||
useApi,
|
||||
} from '@backstage/core';
|
||||
import { Divider, Grid, makeStyles, Typography } from '@material-ui/core';
|
||||
import { Alert } from '@material-ui/lab';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
@@ -30,6 +22,15 @@ import { catalogApiRef } from '@backstage/plugin-catalog-react';
|
||||
import { Filters, FiltersButton, FiltersState } from './Filters';
|
||||
import { Entity, ENTITY_DEFAULT_NAMESPACE } from '@backstage/catalog-model';
|
||||
|
||||
import {
|
||||
EmptyState,
|
||||
Link,
|
||||
Progress,
|
||||
Table,
|
||||
TableColumn,
|
||||
} from '@backstage/core-components';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
type Result = {
|
||||
name: string;
|
||||
description: string | undefined;
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
import React from 'react';
|
||||
import { screen, render, waitFor, act } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { useApi } from '@backstage/core';
|
||||
|
||||
import { SearchContextProvider } from '../SearchContext';
|
||||
|
||||
import { SearchBar } from './SearchBar';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
jest.mock('@backstage/core', () => ({
|
||||
...jest.requireActual('@backstage/core'),
|
||||
|
||||
@@ -18,10 +18,10 @@ import React from 'react';
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import { renderHook, act } from '@testing-library/react-hooks';
|
||||
|
||||
import { useApi } from '@backstage/core';
|
||||
|
||||
import { useSearch, SearchContextProvider } from './SearchContext';
|
||||
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
jest.mock('@backstage/core', () => ({
|
||||
...jest.requireActual('@backstage/core'),
|
||||
useApi: jest.fn(),
|
||||
|
||||
@@ -22,11 +22,11 @@ import React, {
|
||||
useEffect,
|
||||
} from 'react';
|
||||
import { useAsync, usePrevious } from 'react-use';
|
||||
import { useApi } from '@backstage/core';
|
||||
import { SearchResultSet } from '@backstage/search-common';
|
||||
import { searchApiRef } from '../../apis';
|
||||
import { AsyncState } from 'react-use/lib/useAsync';
|
||||
import { JsonObject } from '@backstage/config';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
type SearchContextValue = {
|
||||
result: AsyncState<SearchResultSet>;
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
import React from 'react';
|
||||
import { screen, render, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { useApi } from '@backstage/core';
|
||||
|
||||
import { SearchFilter } from './SearchFilter';
|
||||
|
||||
import { SearchContextProvider } from '../SearchContext';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
jest.mock('@backstage/core', () => ({
|
||||
...jest.requireActual('@backstage/core'),
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { EmptyState, Progress } from '@backstage/core';
|
||||
import { SearchResult } from '@backstage/search-common';
|
||||
import { Alert } from '@material-ui/lab';
|
||||
|
||||
import { useSearch } from '../SearchContext';
|
||||
|
||||
import { EmptyState, Progress } from '@backstage/core-components';
|
||||
|
||||
type Props = {
|
||||
children: (results: { results: SearchResult[] }) => JSX.Element;
|
||||
};
|
||||
|
||||
@@ -13,12 +13,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { SidebarSearchField, useRouteRef } from '@backstage/core';
|
||||
import qs from 'qs';
|
||||
import React, { useCallback } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { rootRouteRef } from '../../plugin';
|
||||
|
||||
import { SidebarSearchField } from '@backstage/core-components';
|
||||
import { useRouteRef } from '@backstage/core-plugin-api';
|
||||
|
||||
export const SidebarSearch = () => {
|
||||
const searchRoute = useRouteRef(rootRouteRef);
|
||||
const navigate = useNavigate();
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { SearchClient, searchApiRef } from './apis';
|
||||
import {
|
||||
createApiFactory,
|
||||
createPlugin,
|
||||
@@ -21,8 +23,7 @@ import {
|
||||
discoveryApiRef,
|
||||
createComponentExtension,
|
||||
identityApiRef,
|
||||
} from '@backstage/core';
|
||||
import { SearchClient, searchApiRef } from './apis';
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
export const rootRouteRef = createRouteRef({
|
||||
path: '/search',
|
||||
|
||||
Reference in New Issue
Block a user