diff --git a/x-pack/plugins/ingest_manager/common/types/models/agent.ts b/x-pack/plugins/ingest_manager/common/types/models/agent.ts index a0575c71d3aba..ad06e8d3c9c11 100644 --- a/x-pack/plugins/ingest_manager/common/types/models/agent.ts +++ b/x-pack/plugins/ingest_manager/common/types/models/agent.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectAttributes } from '../../../../../../src/core/public'; +import { SavedObjectAttributes } from 'src/core/public'; import { AGENT_TYPE_EPHEMERAL, AGENT_TYPE_PERMANENT, AGENT_TYPE_TEMPORARY } from '../../constants'; export type AgentType = diff --git a/x-pack/plugins/ingest_manager/common/types/models/agent_config.ts b/x-pack/plugins/ingest_manager/common/types/models/agent_config.ts index c63e496273ada..002c3784446a8 100644 --- a/x-pack/plugins/ingest_manager/common/types/models/agent_config.ts +++ b/x-pack/plugins/ingest_manager/common/types/models/agent_config.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectAttributes } from '../../../../../../src/core/public'; +import { SavedObjectAttributes } from 'src/core/public'; import { Datasource, DatasourcePackage, diff --git a/x-pack/plugins/ingest_manager/common/types/models/enrollment_api_key.ts b/x-pack/plugins/ingest_manager/common/types/models/enrollment_api_key.ts index 35cb851a72933..204ce4b15ea5b 100644 --- a/x-pack/plugins/ingest_manager/common/types/models/enrollment_api_key.ts +++ b/x-pack/plugins/ingest_manager/common/types/models/enrollment_api_key.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectAttributes } from '../../../../../../src/core/public'; +import { SavedObjectAttributes } from 'src/core/public'; export interface EnrollmentAPIKey { id: string; diff --git a/x-pack/plugins/ingest_manager/common/types/models/epm.ts b/x-pack/plugins/ingest_manager/common/types/models/epm.ts index a1a39444c3b50..6b8403b74a759 100644 --- a/x-pack/plugins/ingest_manager/common/types/models/epm.ts +++ b/x-pack/plugins/ingest_manager/common/types/models/epm.ts @@ -6,11 +6,7 @@ // Follow pattern from https://github.com/elastic/kibana/pull/52447 // TODO: Update when https://github.com/elastic/kibana/issues/53021 is closed -import { - SavedObject, - SavedObjectAttributes, - SavedObjectReference, -} from '../../../../../../src/core/public'; +import { SavedObject, SavedObjectAttributes, SavedObjectReference } from 'src/core/public'; export enum InstallationStatus { installed = 'installed', diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/header.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/header.tsx index c87a77320d3f7..e1f29fdbeb323 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/header.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/header.tsx @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; +import React, { memo } from 'react'; import styled from 'styled-components'; import { EuiFlexGroup, EuiFlexItem, EuiTabs, EuiTab, EuiSpacer } from '@elastic/eui'; import { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab'; @@ -35,13 +35,17 @@ export interface HeaderProps { tabs?: EuiTabProps[]; } +const HeaderColumns: React.FC> = memo(({ leftColumn, rightColumn }) => ( + + {leftColumn ? {leftColumn} : null} + {rightColumn ? {rightColumn} : null} + +)); + export const Header: React.FC = ({ leftColumn, rightColumn, tabs }) => ( - - {leftColumn ? {leftColumn} : null} - {rightColumn ? {rightColumn} : null} - + {tabs ? ( diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/constants/index.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/constants/index.ts index 1ac5bef629fde..b313dbf629f32 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/constants/index.ts +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/constants/index.ts @@ -7,6 +7,8 @@ export { PLUGIN_ID, EPM_API_ROUTES, AGENT_CONFIG_SAVED_OBJECT_TYPE } from '../.. export const BASE_PATH = '/app/ingestManager'; export const EPM_PATH = '/epm'; +export const EPM_LIST_ALL_PACKAGES_PATH = EPM_PATH; +export const EPM_LIST_INSTALLED_PACKAGES_PATH = `${EPM_PATH}/installed`; export const EPM_DETAIL_VIEW_PATH = `${EPM_PATH}/detail/:pkgkey/:panel?`; export const AGENT_CONFIG_PATH = '/configs'; export const AGENT_CONFIG_DETAILS_PATH = `${AGENT_CONFIG_PATH}/`; diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/use_breadcrumbs.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_breadcrumbs.tsx similarity index 76% rename from x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/use_breadcrumbs.tsx rename to x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_breadcrumbs.tsx index 6222d346432c3..ff6656e969c93 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/use_breadcrumbs.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_breadcrumbs.tsx @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ChromeBreadcrumb } from '../../../../../../../../../src/core/public'; -import { useCore } from '../../../hooks'; +import { ChromeBreadcrumb } from 'src/core/public'; +import { useCore } from './use_core'; export function useBreadcrumbs(newBreadcrumbs: ChromeBreadcrumb[]) { const { chrome } = useCore(); diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_core.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_core.ts index c6e91444d21f5..f4e9a032b925a 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_core.ts +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_core.ts @@ -5,7 +5,7 @@ */ import React, { useContext } from 'react'; -import { CoreStart } from 'kibana/public'; +import { CoreStart } from 'src/core/public'; export const CoreContext = React.createContext(null); diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/agent_config.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/agent_config.ts index fe3fb4aa32965..d44cc67e2dc4c 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/agent_config.ts +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/agent_config.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { HttpFetchQuery } from 'kibana/public'; +import { HttpFetchQuery } from 'src/core/public'; import { useRequest, sendRequest } from './use_request'; import { agentConfigRouteService } from '../../services'; import { diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/epm.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/epm.ts index 02865ffe6fb1a..128ef8de68aae 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/epm.ts +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/epm.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HttpFetchQuery } from 'kibana/public'; +import { HttpFetchQuery } from 'src/core/public'; import { useRequest, sendRequest } from './use_request'; import { epmRouteService } from '../../services'; import { diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/use_request.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/use_request.ts index 4b434bd1a149e..c63383637e792 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/use_request.ts +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/use_request.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { HttpSetup } from 'kibana/public'; +import { HttpSetup } from 'src/core/public'; import { SendRequestConfig, SendRequestResponse, diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/index.tsx index 9a85358a2a69c..f7c2805c6ea7c 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/index.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/index.tsx @@ -9,7 +9,7 @@ import { useObservable } from 'react-use'; import { HashRouter as Router, Redirect, Switch, Route, RouteProps } from 'react-router-dom'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiErrorBoundary } from '@elastic/eui'; -import { CoreStart, AppMountParameters } from 'kibana/public'; +import { CoreStart, AppMountParameters } from 'src/core/public'; import { EuiThemeProvider } from '../../../../../legacy/common/eui_styled_components'; import { IngestManagerSetupDeps, diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/components/package_list_grid.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/components/package_list_grid.tsx index 34e1763c44255..2ca49298decf9 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/components/package_list_grid.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/components/package_list_grid.tsx @@ -3,25 +3,76 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { EuiFlexGrid, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui'; -import React, { Fragment, ReactNode } from 'react'; +import React, { Fragment, ReactNode, useState } from 'react'; +import { + EuiFlexGrid, + EuiFlexGroup, + EuiFlexItem, + EuiSpacer, + EuiTitle, + // @ts-ignore + EuiSearchBar, + EuiText, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { Loading } from '../../../components'; import { PackageList } from '../../../types'; +import { useLocalSearch, searchIdField } from '../hooks'; import { BadgeProps, PackageCard } from './package_card'; type ListProps = { + isLoading?: boolean; controls?: ReactNode; title: string; list: PackageList; } & BadgeProps; -export function PackageListGrid({ controls, title, list, showInstalledBadge }: ListProps) { +export function PackageListGrid({ + isLoading, + controls, + title, + list, + showInstalledBadge, +}: ListProps) { + const [searchTerm, setSearchTerm] = useState(''); + const localSearchRef = useLocalSearch(list); + const controlsContent = ; - const gridContent = ; + let gridContent: JSX.Element; + + if (isLoading || !localSearchRef.current) { + gridContent = ; + } else { + const filteredList = searchTerm + ? list.filter(item => + (localSearchRef.current!.search(searchTerm) as PackageList) + .map(match => match[searchIdField]) + .includes(item[searchIdField]) + ) + : list; + gridContent = ; + } return ( - + {controlsContent} - {gridContent} + + { + setSearchTerm(userInput); + }} + /> + + {gridContent} + ); } @@ -34,9 +85,9 @@ interface ControlsColumnProps { function ControlsColumn({ controls, title }: ControlsColumnProps) { return ( - +

{title}

-
+ {controls} @@ -53,11 +104,24 @@ type GridColumnProps = { function GridColumn({ list }: GridColumnProps) { return ( - {list.map(item => ( - - + {list.length ? ( + list.map(item => ( + + + + )) + ) : ( + + +

+ +

+
- ))} + )}
); } diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/index.tsx index 589ce5f5dbd25..48986481b6061 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/index.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/index.tsx @@ -3,9 +3,8 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ - -// export { useBreadcrumbs } from './use_breadcrumbs'; export { useLinks } from './use_links'; +export { useLocalSearch, searchIdField } from './use_local_search'; export { PackageInstallProvider, useDeletePackage, diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/use_local_search.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/use_local_search.tsx new file mode 100644 index 0000000000000..26f1ef6a80271 --- /dev/null +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/use_local_search.tsx @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import { Search as LocalSearch } from 'js-search'; +import { useEffect, useRef } from 'react'; +import { PackageList, PackageListItem } from '../../../types'; + +export type SearchField = keyof PackageListItem; +export const searchIdField: SearchField = 'name'; +export const fieldsToSearch: SearchField[] = ['description', 'name', 'title']; + +export function useLocalSearch(packageList: PackageList) { + const localSearchRef = useRef(null); + + useEffect(() => { + if (!packageList.length) return; + + const localSearch = new LocalSearch(searchIdField); + fieldsToSearch.forEach(field => localSearch.addIndex(field)); + localSearch.addDocuments(packageList); + localSearchRef.current = localSearch; + }, [packageList]); + + return localSearchRef; +} diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/index.tsx index b8dd08eb46a54..2c8ee7ca2fcf3 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/index.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/index.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { HashRouter as Router, Switch, Route } from 'react-router-dom'; import { useConfig } from '../../hooks'; import { CreateDatasourcePage } from '../agent_config/create_datasource_page'; -import { Home } from './screens/home'; +import { EPMHomePage } from './screens/home'; import { Detail } from './screens/detail'; export const EPMApp: React.FunctionComponent = () => { @@ -23,8 +23,8 @@ export const EPMApp: React.FunctionComponent = () => { - - + + diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/detail/header.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/detail/header.tsx index 5a51515d49486..a7204dd722603 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/detail/header.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/detail/header.tsx @@ -36,8 +36,6 @@ export function Header(props: HeaderProps) { const { iconType, name, title, version } = props; const hasWriteCapabilites = useCapabilities().write; const { toListView } = useLinks(); - // useBreadcrumbs([{ text: PLUGIN.TITLE, href: toListView() }, { text: title }]); - const ADD_DATASOURCE_URI = useLink(`${EPM_PATH}/${name}-${version}/add-datasource`); return ( diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/category_facets.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/category_facets.tsx index e138f9f531a39..52730664aac05 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/category_facets.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/category_facets.tsx @@ -5,30 +5,37 @@ */ import { EuiFacetButton, EuiFacetGroup } from '@elastic/eui'; import React from 'react'; +import { Loading } from '../../../../components'; import { CategorySummaryItem, CategorySummaryList } from '../../../../types'; export function CategoryFacets({ + isLoading, categories, selectedCategory, onCategoryChange, }: { + isLoading?: boolean; categories: CategorySummaryList; selectedCategory: string; onCategoryChange: (category: CategorySummaryItem) => unknown; }) { const controls = ( - {categories.map(category => ( - onCategoryChange(category)} - > - {category.title} - - ))} + {isLoading ? ( + + ) : ( + categories.map(category => ( + onCategoryChange(category)} + > + {category.title} + + )) + )} ); diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/header.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/header.tsx index 2cb5aca39c807..4230775c04e00 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/header.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/header.tsx @@ -3,14 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ - +import React, { memo } from 'react'; +import styled from 'styled-components'; import { EuiFlexGroup, EuiFlexItem, EuiImage, EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import React from 'react'; -import styled from 'styled-components'; import { useLinks } from '../../hooks'; -export function HeroCopy() { +export const HeroCopy = memo(() => { return ( @@ -35,12 +34,12 @@ export function HeroCopy() { ); -} +}); -export function HeroImage() { +export const HeroImage = memo(() => { const { toAssets } = useLinks(); const ImageWrapper = styled.div` - margin-bottom: -38px; // revert to -62px when tabs are restored + margin-bottom: -62px; `; return ( @@ -51,4 +50,4 @@ export function HeroImage() { /> ); -} +}); diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/hooks.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/hooks.tsx deleted file mode 100644 index c3e29f723dcba..0000000000000 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/hooks.tsx +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { useEffect, useRef, useState } from 'react'; -import { PackageList } from '../../../../types'; -import { fieldsToSearch, LocalSearch, searchIdField } from './search_packages'; - -export function useAllPackages(selectedCategory: string, categoryPackages: PackageList = []) { - const [allPackages, setAllPackages] = useState([]); - - useEffect(() => { - if (!selectedCategory) setAllPackages(categoryPackages); - }, [selectedCategory, categoryPackages]); - - return [allPackages, setAllPackages] as [typeof allPackages, typeof setAllPackages]; -} - -export function useLocalSearch(allPackages: PackageList) { - const localSearchRef = useRef(null); - - useEffect(() => { - if (!allPackages.length) return; - - const localSearch = new LocalSearch(searchIdField); - fieldsToSearch.forEach(field => localSearch.addIndex(field)); - localSearch.addDocuments(allPackages); - localSearchRef.current = localSearch; - }, [allPackages]); - - return localSearchRef; -} - -export function useInstalledPackages(allPackages: PackageList) { - const [installedPackages, setInstalledPackages] = useState([]); - - useEffect(() => { - setInstalledPackages(allPackages.filter(({ status }) => status === 'installed')); - }, [allPackages]); - - return [installedPackages, setInstalledPackages] as [ - typeof installedPackages, - typeof setInstalledPackages - ]; -} diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/index.tsx index 640e4a30a40ca..5f215b7788259 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/index.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/home/index.tsx @@ -4,136 +4,152 @@ * you may not use this file except in compliance with the Elastic License. */ +import React, { useState } from 'react'; +import { useRouteMatch, Switch, Route } from 'react-router-dom'; +import { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab'; +import { i18n } from '@kbn/i18n'; import { - EuiHorizontalRule, - // @ts-ignore - EuiSearchBar, - EuiSpacer, -} from '@elastic/eui'; -import React, { Fragment, useState } from 'react'; -import { useGetCategories, useGetPackages } from '../../../../hooks'; + EPM_LIST_ALL_PACKAGES_PATH, + EPM_LIST_INSTALLED_PACKAGES_PATH, +} from '../../../../constants'; +import { useLink, useGetCategories, useGetPackages } from '../../../../hooks'; import { WithHeaderLayout } from '../../../../layouts'; -import { CategorySummaryItem, PackageList } from '../../../../types'; +import { CategorySummaryItem } from '../../../../types'; import { PackageListGrid } from '../../components/package_list_grid'; -// import { useBreadcrumbs, useLinks } from '../../hooks'; import { CategoryFacets } from './category_facets'; import { HeroCopy, HeroImage } from './header'; -import { useAllPackages, useInstalledPackages, useLocalSearch } from './hooks'; -import { SearchPackages } from './search_packages'; -export function Home() { - // useBreadcrumbs([{ text: PLUGIN.TITLE, href: toListView() }]); +export function EPMHomePage() { + const { + params: { tabId }, + } = useRouteMatch<{ tabId?: string }>(); - const state = useHomeState(); - const searchBar = ( - { - state.setSearchTerm(userInput); - }} - /> - ); - const body = state.searchTerm ? ( - - ) : ( - - {state.installedPackages.length ? ( - - - - - ) : null} - - - ); + const ALL_PACKAGES_URI = useLink(EPM_LIST_ALL_PACKAGES_PATH); + const INSTALLED_PACKAGES_URI = useLink(EPM_LIST_INSTALLED_PACKAGES_PATH); return ( } rightColumn={} - // tabs={[ - // { - // id: 'all_packages', - // name: 'All packages', - // isSelected: true, - // }, - // { - // id: 'installed_packages', - // name: 'Installed packages', - // }, - // ]} + tabs={ + ([ + { + id: 'all_packages', + name: i18n.translate('xpack.ingestManager.epmList.allPackagesTabText', { + defaultMessage: 'All packages', + }), + href: ALL_PACKAGES_URI, + isSelected: tabId !== 'installed', + }, + { + id: 'installed_packages', + name: i18n.translate('xpack.ingestManager.epmList.installedPackagesTabText', { + defaultMessage: 'Installed packages', + }), + href: INSTALLED_PACKAGES_URI, + isSelected: tabId === 'installed', + }, + ] as unknown) as EuiTabProps[] + } > - {searchBar} - - {body} + + + + + + + + ); } -type HomeState = ReturnType; - -export function useHomeState() { - const [searchTerm, setSearchTerm] = useState(''); +function InstalledPackages() { + const { data: allPackages, isLoading: isLoadingPackages } = useGetPackages(); const [selectedCategory, setSelectedCategory] = useState(''); - const { data: categoriesRes } = useGetCategories(); - const categories = categoriesRes?.response; - const { data: categoryPackagesRes } = useGetPackages({ category: selectedCategory }); - const categoryPackages = categoryPackagesRes?.response; - const [allPackages, setAllPackages] = useAllPackages(selectedCategory, categoryPackages); - const localSearchRef = useLocalSearch(allPackages); - const [installedPackages, setInstalledPackages] = useInstalledPackages(allPackages); + const packages = + allPackages && allPackages.response && selectedCategory === '' + ? allPackages.response.filter(pkg => pkg.status === 'installed') + : []; - return { - searchTerm, - setSearchTerm, - selectedCategory, - setSelectedCategory, - categories, - allPackages, - setAllPackages, - installedPackages, - localSearchRef, - setInstalledPackages, - categoryPackages, - }; -} + const title = i18n.translate('xpack.ingestManager.epmList.installedPackagesTitle', { + defaultMessage: 'Installed packages', + }); -function InstalledPackages({ list }: { list: PackageList }) { - const title = 'Your Packages'; + const categories = [ + { + id: '', + title: i18n.translate('xpack.ingestManager.epmList.allPackagesFilterLinkText', { + defaultMessage: 'All', + }), + count: packages.length, + }, + { + id: 'updates_available', + title: i18n.translate('xpack.ingestManager.epmList.updatesAvailableFilterLinkText', { + defaultMessage: 'Updates available', + }), + count: 0, // TODO: Update with real count when available + }, + ]; - return ; + const controls = ( + setSelectedCategory(id)} + /> + ); + + return ( + + ); } -function AvailablePackages({ - allPackages, - categories, - categoryPackages, - selectedCategory, - setSelectedCategory, -}: HomeState) { - const title = 'Available Packages'; - const noFilter = { - id: '', - title: 'All', - count: allPackages.length, - }; +function AvailablePackages() { + const [selectedCategory, setSelectedCategory] = useState(''); + const { data: categoryPackagesRes, isLoading: isLoadingPackages } = useGetPackages({ + category: selectedCategory, + }); + const { data: categoriesRes, isLoading: isLoadingCategories } = useGetCategories(); + const packages = + categoryPackagesRes && categoryPackagesRes.response ? categoryPackagesRes.response : []; + + const title = i18n.translate('xpack.ingestManager.epmList.allPackagesTitle', { + defaultMessage: 'All packages', + }); + + const categories = [ + { + id: '', + title: i18n.translate('xpack.ingestManager.epmList.allPackagesFilterLinkText', { + defaultMessage: 'All', + }), + count: packages.length, + }, + ...(categoriesRes ? categoriesRes.response : []), + ]; const controls = categories ? ( setSelectedCategory(id)} /> ) : null; - return ; + return ( + + ); } diff --git a/x-pack/plugins/ingest_manager/public/index.ts b/x-pack/plugins/ingest_manager/public/index.ts index a9e40a2a42302..aa1e0e79e548b 100644 --- a/x-pack/plugins/ingest_manager/public/index.ts +++ b/x-pack/plugins/ingest_manager/public/index.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { PluginInitializerContext } from 'kibana/public'; +import { PluginInitializerContext } from 'src/core/public'; import { IngestManagerPlugin } from './plugin'; export const plugin = (initializerContext: PluginInitializerContext) => { diff --git a/x-pack/plugins/ingest_manager/public/plugin.ts b/x-pack/plugins/ingest_manager/public/plugin.ts index a1dc2c057e9e5..99dcebd9bfba1 100644 --- a/x-pack/plugins/ingest_manager/public/plugin.ts +++ b/x-pack/plugins/ingest_manager/public/plugin.ts @@ -9,7 +9,7 @@ import { Plugin, PluginInitializerContext, CoreStart, -} from 'kibana/public'; +} from 'src/core/public'; import { i18n } from '@kbn/i18n'; import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/utils'; import { DataPublicPluginSetup, DataPublicPluginStart } from '../../../../src/plugins/data/public'; diff --git a/x-pack/plugins/ingest_manager/server/index.ts b/x-pack/plugins/ingest_manager/server/index.ts index b732cb8005efb..df7c3d7cf0fbf 100644 --- a/x-pack/plugins/ingest_manager/server/index.ts +++ b/x-pack/plugins/ingest_manager/server/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { schema, TypeOf } from '@kbn/config-schema'; -import { PluginInitializerContext } from 'kibana/server'; +import { PluginInitializerContext } from 'src/core/server'; import { IngestManagerPlugin } from './plugin'; export const config = { diff --git a/x-pack/plugins/ingest_manager/server/plugin.ts b/x-pack/plugins/ingest_manager/server/plugin.ts index c162ea5fadabe..67737c6fe502e 100644 --- a/x-pack/plugins/ingest_manager/server/plugin.ts +++ b/x-pack/plugins/ingest_manager/server/plugin.ts @@ -11,7 +11,7 @@ import { Plugin, PluginInitializerContext, SavedObjectsServiceStart, -} from 'kibana/server'; +} from 'src/core/server'; import { LicensingPluginSetup } from '../../licensing/server'; import { EncryptedSavedObjectsPluginStart } from '../../encrypted_saved_objects/server'; import { SecurityPluginSetup } from '../../security/server'; diff --git a/x-pack/plugins/ingest_manager/server/routes/agent/handlers.ts b/x-pack/plugins/ingest_manager/server/routes/agent/handlers.ts index cf1fd2476f310..7d991f5ad2cc2 100644 --- a/x-pack/plugins/ingest_manager/server/routes/agent/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/routes/agent/handlers.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { RequestHandler, KibanaRequest } from 'kibana/server'; +import { RequestHandler, KibanaRequest } from 'src/core/server'; import { TypeOf } from '@kbn/config-schema'; import { GetAgentsResponse, diff --git a/x-pack/plugins/ingest_manager/server/routes/agent/index.ts b/x-pack/plugins/ingest_manager/server/routes/agent/index.ts index c85629ea22ad9..414d2d79e9067 100644 --- a/x-pack/plugins/ingest_manager/server/routes/agent/index.ts +++ b/x-pack/plugins/ingest_manager/server/routes/agent/index.ts @@ -9,7 +9,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from 'kibana/server'; +import { IRouter } from 'src/core/server'; import { PLUGIN_ID, AGENT_API_ROUTES } from '../../constants'; import { GetAgentsRequestSchema, diff --git a/x-pack/plugins/ingest_manager/server/routes/agent_config/handlers.ts b/x-pack/plugins/ingest_manager/server/routes/agent_config/handlers.ts index f670a797c3fb1..67f758c2c1263 100644 --- a/x-pack/plugins/ingest_manager/server/routes/agent_config/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/routes/agent_config/handlers.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { TypeOf } from '@kbn/config-schema'; -import { RequestHandler } from 'kibana/server'; +import { RequestHandler } from 'src/core/server'; import bluebird from 'bluebird'; import { appContextService, agentConfigService, datasourceService } from '../../services'; import { listAgents } from '../../services/agents'; diff --git a/x-pack/plugins/ingest_manager/server/routes/agent_config/index.ts b/x-pack/plugins/ingest_manager/server/routes/agent_config/index.ts index c3b3c00a9574c..b8e827974ff81 100644 --- a/x-pack/plugins/ingest_manager/server/routes/agent_config/index.ts +++ b/x-pack/plugins/ingest_manager/server/routes/agent_config/index.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from 'kibana/server'; +import { IRouter } from 'src/core/server'; import { PLUGIN_ID, AGENT_CONFIG_API_ROUTES } from '../../constants'; import { GetAgentConfigsRequestSchema, diff --git a/x-pack/plugins/ingest_manager/server/routes/datasource/handlers.ts b/x-pack/plugins/ingest_manager/server/routes/datasource/handlers.ts index 349e88d8fb59d..7ae562cf130ab 100644 --- a/x-pack/plugins/ingest_manager/server/routes/datasource/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/routes/datasource/handlers.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { TypeOf } from '@kbn/config-schema'; -import { RequestHandler } from 'kibana/server'; +import { RequestHandler } from 'src/core/server'; import { appContextService, datasourceService } from '../../services'; import { ensureInstalledPackage } from '../../services/epm/packages'; import { diff --git a/x-pack/plugins/ingest_manager/server/routes/datasource/index.ts b/x-pack/plugins/ingest_manager/server/routes/datasource/index.ts index e5891cc7377e9..7217f28053cf3 100644 --- a/x-pack/plugins/ingest_manager/server/routes/datasource/index.ts +++ b/x-pack/plugins/ingest_manager/server/routes/datasource/index.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from 'kibana/server'; +import { IRouter } from 'src/core/server'; import { PLUGIN_ID, DATASOURCE_API_ROUTES } from '../../constants'; import { GetDatasourcesRequestSchema, diff --git a/x-pack/plugins/ingest_manager/server/routes/enrollment_api_key/handler.ts b/x-pack/plugins/ingest_manager/server/routes/enrollment_api_key/handler.ts index 478078a934186..9d3eb5360dbe3 100644 --- a/x-pack/plugins/ingest_manager/server/routes/enrollment_api_key/handler.ts +++ b/x-pack/plugins/ingest_manager/server/routes/enrollment_api_key/handler.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { RequestHandler } from 'kibana/server'; +import { RequestHandler } from 'src/core/server'; import { TypeOf } from '@kbn/config-schema'; import { GetEnrollmentAPIKeysRequestSchema, diff --git a/x-pack/plugins/ingest_manager/server/routes/enrollment_api_key/index.ts b/x-pack/plugins/ingest_manager/server/routes/enrollment_api_key/index.ts index 6df5299d30bd4..9d0ff65ab0b3e 100644 --- a/x-pack/plugins/ingest_manager/server/routes/enrollment_api_key/index.ts +++ b/x-pack/plugins/ingest_manager/server/routes/enrollment_api_key/index.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from 'kibana/server'; +import { IRouter } from 'src/core/server'; import { PLUGIN_ID, ENROLLMENT_API_KEY_ROUTES } from '../../constants'; import { GetEnrollmentAPIKeysRequestSchema, diff --git a/x-pack/plugins/ingest_manager/server/routes/epm/handlers.ts b/x-pack/plugins/ingest_manager/server/routes/epm/handlers.ts index 6b1dde92ec0e1..8623d02e72862 100644 --- a/x-pack/plugins/ingest_manager/server/routes/epm/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/routes/epm/handlers.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { TypeOf } from '@kbn/config-schema'; -import { RequestHandler, CustomHttpResponseOptions } from 'kibana/server'; +import { RequestHandler, CustomHttpResponseOptions } from 'src/core/server'; import { GetPackagesRequestSchema, GetFileRequestSchema, diff --git a/x-pack/plugins/ingest_manager/server/routes/epm/index.ts b/x-pack/plugins/ingest_manager/server/routes/epm/index.ts index cb9ec5cc532c4..fcf81f9894d5e 100644 --- a/x-pack/plugins/ingest_manager/server/routes/epm/index.ts +++ b/x-pack/plugins/ingest_manager/server/routes/epm/index.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from 'kibana/server'; +import { IRouter } from 'src/core/server'; import { PLUGIN_ID, EPM_API_ROUTES } from '../../constants'; import { getCategoriesHandler, diff --git a/x-pack/plugins/ingest_manager/server/routes/install_script/index.ts b/x-pack/plugins/ingest_manager/server/routes/install_script/index.ts index 5470df31adbdd..b007e61594e9d 100644 --- a/x-pack/plugins/ingest_manager/server/routes/install_script/index.ts +++ b/x-pack/plugins/ingest_manager/server/routes/install_script/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import url from 'url'; -import { IRouter, BasePath, HttpServerInfo, KibanaRequest } from 'kibana/server'; +import { IRouter, BasePath, HttpServerInfo, KibanaRequest } from 'src/core/server'; import { INSTALL_SCRIPT_API_ROUTES } from '../../constants'; import { getScript } from '../../services/install_script'; import { InstallScriptRequestSchema } from '../../types'; diff --git a/x-pack/plugins/ingest_manager/server/routes/setup/handlers.ts b/x-pack/plugins/ingest_manager/server/routes/setup/handlers.ts index 30e725bb5ad4a..38188bc76f5f4 100644 --- a/x-pack/plugins/ingest_manager/server/routes/setup/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/routes/setup/handlers.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { TypeOf } from '@kbn/config-schema'; -import { RequestHandler } from 'kibana/server'; +import { RequestHandler } from 'src/core/server'; import { outputService, agentConfigService } from '../../services'; import { CreateFleetSetupRequestSchema, CreateFleetSetupResponse } from '../../types'; import { setup } from '../../services/setup'; diff --git a/x-pack/plugins/ingest_manager/server/routes/setup/index.ts b/x-pack/plugins/ingest_manager/server/routes/setup/index.ts index 7e09d8dbef1f6..a2c641503e825 100644 --- a/x-pack/plugins/ingest_manager/server/routes/setup/index.ts +++ b/x-pack/plugins/ingest_manager/server/routes/setup/index.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from 'kibana/server'; +import { IRouter } from 'src/core/server'; import { PLUGIN_ID, FLEET_SETUP_API_ROUTES, SETUP_API_ROUTE } from '../../constants'; import { GetFleetSetupRequestSchema, CreateFleetSetupRequestSchema } from '../../types'; import { diff --git a/x-pack/plugins/ingest_manager/server/services/agent_config.ts b/x-pack/plugins/ingest_manager/server/services/agent_config.ts index e5b20de3bf911..a941494072ae3 100644 --- a/x-pack/plugins/ingest_manager/server/services/agent_config.ts +++ b/x-pack/plugins/ingest_manager/server/services/agent_config.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { uniq } from 'lodash'; -import { SavedObjectsClientContract } from 'kibana/server'; +import { SavedObjectsClientContract } from 'src/core/server'; import { AuthenticatedUser } from '../../../security/server'; import { DEFAULT_AGENT_CONFIG, AGENT_CONFIG_SAVED_OBJECT_TYPE } from '../constants'; import { diff --git a/x-pack/plugins/ingest_manager/server/services/agent_config_update.ts b/x-pack/plugins/ingest_manager/server/services/agent_config_update.ts index 38894ff321a0b..8c0e73201e1ff 100644 --- a/x-pack/plugins/ingest_manager/server/services/agent_config_update.ts +++ b/x-pack/plugins/ingest_manager/server/services/agent_config_update.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectsClientContract } from 'kibana/server'; +import { SavedObjectsClientContract } from 'src/core/server'; import { generateEnrollmentAPIKey, deleteEnrollmentApiKeyForConfigId } from './api_keys'; import { updateAgentsForConfigId, unenrollForConfigId } from './agents'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/acks.ts b/x-pack/plugins/ingest_manager/server/services/agents/acks.ts index 892d8cdbe657f..98a5f69f9d2b0 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/acks.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/acks.ts @@ -9,7 +9,7 @@ import { SavedObjectsBulkCreateObject, SavedObjectsBulkResponse, SavedObjectsClientContract, -} from 'kibana/server'; +} from 'src/core/server'; import Boom from 'boom'; import { Agent, diff --git a/x-pack/plugins/ingest_manager/server/services/agents/checkin.ts b/x-pack/plugins/ingest_manager/server/services/agents/checkin.ts index 76dfc0867fb4e..0ff4af4ffe351 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/checkin.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/checkin.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectsClientContract, SavedObjectsBulkCreateObject } from 'kibana/server'; +import { SavedObjectsClientContract, SavedObjectsBulkCreateObject } from 'src/core/server'; import uuid from 'uuid'; import { Agent, diff --git a/x-pack/plugins/ingest_manager/server/services/agents/crud.ts b/x-pack/plugins/ingest_manager/server/services/agents/crud.ts index cdbdf164e834d..41bd2476c99a1 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/crud.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/crud.ts @@ -5,7 +5,7 @@ */ import Boom from 'boom'; -import { SavedObjectsClientContract } from 'kibana/server'; +import { SavedObjectsClientContract } from 'src/core/server'; import { AGENT_SAVED_OBJECT_TYPE, AGENT_EVENT_SAVED_OBJECT_TYPE, diff --git a/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts b/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts index b48d311da4440..0f73f71817eb0 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts @@ -5,7 +5,7 @@ */ import Boom from 'boom'; -import { SavedObjectsClientContract } from 'kibana/server'; +import { SavedObjectsClientContract } from 'src/core/server'; import { AgentType, Agent, AgentSOAttributes } from '../../types'; import { savedObjectToAgent } from './saved_objects'; import { AGENT_SAVED_OBJECT_TYPE } from '../../constants'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/events.ts b/x-pack/plugins/ingest_manager/server/services/agents/events.ts index 908d289fbc4bb..707229845531c 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/events.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/events.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectsClientContract } from 'kibana/server'; +import { SavedObjectsClientContract } from 'src/core/server'; import { AGENT_EVENT_SAVED_OBJECT_TYPE } from '../../constants'; import { AgentEventSOAttributes, AgentEvent } from '../../types'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/saved_objects.ts b/x-pack/plugins/ingest_manager/server/services/agents/saved_objects.ts index adb096a444903..dbe268818713d 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/saved_objects.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/saved_objects.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObject } from 'kibana/server'; +import { SavedObject } from 'src/core/server'; import { Agent, AgentSOAttributes } from '../../types'; export function savedObjectToAgent(so: SavedObject): Agent { diff --git a/x-pack/plugins/ingest_manager/server/services/agents/status.ts b/x-pack/plugins/ingest_manager/server/services/agents/status.ts index f6477bf1c7334..21e200d701e69 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/status.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/status.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectsClientContract } from 'kibana/server'; +import { SavedObjectsClientContract } from 'src/core/server'; import { listAgents } from './crud'; import { AGENT_EVENT_SAVED_OBJECT_TYPE } from '../../constants'; import { AgentStatus, Agent } from '../../types'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/unenroll.ts b/x-pack/plugins/ingest_manager/server/services/agents/unenroll.ts index e45620c3cf588..bf6f6526be069 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/unenroll.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/unenroll.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectsClientContract } from 'kibana/server'; +import { SavedObjectsClientContract } from 'src/core/server'; import { AgentSOAttributes } from '../../types'; import { AGENT_SAVED_OBJECT_TYPE } from '../../constants'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/update.ts b/x-pack/plugins/ingest_manager/server/services/agents/update.ts index 8452c05d53a1f..9eabf0944bdc4 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/update.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/update.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectsClientContract } from 'kibana/server'; +import { SavedObjectsClientContract } from 'src/core/server'; import { listAgents } from './crud'; import { AGENT_SAVED_OBJECT_TYPE } from '../../constants'; import { unenrollAgents } from './unenroll'; diff --git a/x-pack/plugins/ingest_manager/server/services/api_keys/enrollment_api_key.ts b/x-pack/plugins/ingest_manager/server/services/api_keys/enrollment_api_key.ts index 9a1a91f9ed8a9..d81b998d5a752 100644 --- a/x-pack/plugins/ingest_manager/server/services/api_keys/enrollment_api_key.ts +++ b/x-pack/plugins/ingest_manager/server/services/api_keys/enrollment_api_key.ts @@ -5,7 +5,7 @@ */ import uuid from 'uuid'; -import { SavedObjectsClientContract, SavedObject } from 'kibana/server'; +import { SavedObjectsClientContract, SavedObject } from 'src/core/server'; import { EnrollmentAPIKey, EnrollmentAPIKeySOAttributes } from '../../types'; import { ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE } from '../../constants'; import { createAPIKey, invalidateAPIKey } from './security'; diff --git a/x-pack/plugins/ingest_manager/server/services/api_keys/index.ts b/x-pack/plugins/ingest_manager/server/services/api_keys/index.ts index a7c74f279d169..9b0182b86fc88 100644 --- a/x-pack/plugins/ingest_manager/server/services/api_keys/index.ts +++ b/x-pack/plugins/ingest_manager/server/services/api_keys/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectsClientContract, SavedObject, KibanaRequest } from 'kibana/server'; +import { SavedObjectsClientContract, SavedObject, KibanaRequest } from 'src/core/server'; import { ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE } from '../../constants'; import { EnrollmentAPIKeySOAttributes, EnrollmentAPIKey } from '../../types'; import { createAPIKey } from './security'; diff --git a/x-pack/plugins/ingest_manager/server/services/api_keys/security.ts b/x-pack/plugins/ingest_manager/server/services/api_keys/security.ts index ffc269bca94eb..dfd53d55fbbf5 100644 --- a/x-pack/plugins/ingest_manager/server/services/api_keys/security.ts +++ b/x-pack/plugins/ingest_manager/server/services/api_keys/security.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { KibanaRequest, FakeRequest, SavedObjectsClientContract } from 'kibana/server'; +import { KibanaRequest, FakeRequest, SavedObjectsClientContract } from 'src/core/server'; import { CallESAsCurrentUser } from '../../types'; import { appContextService } from '../app_context'; import { outputService } from '../output'; diff --git a/x-pack/plugins/ingest_manager/server/services/app_context.ts b/x-pack/plugins/ingest_manager/server/services/app_context.ts index c06b282389fc7..a0a7c8dd7c05a 100644 --- a/x-pack/plugins/ingest_manager/server/services/app_context.ts +++ b/x-pack/plugins/ingest_manager/server/services/app_context.ts @@ -5,7 +5,7 @@ */ import { BehaviorSubject, Observable } from 'rxjs'; import { first } from 'rxjs/operators'; -import { SavedObjectsServiceStart } from 'kibana/server'; +import { SavedObjectsServiceStart } from 'src/core/server'; import { EncryptedSavedObjectsPluginStart } from '../../../encrypted_saved_objects/server'; import { SecurityPluginSetup } from '../../../security/server'; import { IngestManagerConfigType } from '../../common'; diff --git a/x-pack/plugins/ingest_manager/server/services/datasource.ts b/x-pack/plugins/ingest_manager/server/services/datasource.ts index 444937343e31f..8fa1428f3a055 100644 --- a/x-pack/plugins/ingest_manager/server/services/datasource.ts +++ b/x-pack/plugins/ingest_manager/server/services/datasource.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectsClientContract } from 'kibana/server'; +import { SavedObjectsClientContract } from 'src/core/server'; import { AuthenticatedUser } from '../../../security/server'; import { DeleteDatasourcesResponse, packageToConfigDatasource } from '../../common'; import { DATASOURCE_SAVED_OBJECT_TYPE } from '../constants'; diff --git a/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/install.ts b/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/install.ts index 264000f9892ba..1f11136360465 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/install.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/install.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectsClientContract } from 'kibana/server'; +import { SavedObjectsClientContract } from 'src/core/server'; import { INDEX_PATTERN_SAVED_OBJECT_TYPE } from '../../../../constants'; import * as Registry from '../../registry'; import { loadFieldsFromYaml, Fields, Field } from '../../fields/field'; diff --git a/x-pack/plugins/ingest_manager/server/services/epm/packages/get.ts b/x-pack/plugins/ingest_manager/server/services/epm/packages/get.ts index 58416b7f66d2d..d655b81f8cdef 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/packages/get.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/packages/get.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectsClientContract } from 'src/core/server/'; +import { SavedObjectsClientContract } from 'src/core/server'; import { PACKAGES_SAVED_OBJECT_TYPE } from '../../../constants'; import { Installation, InstallationStatus, PackageInfo } from '../../../types'; import * as Registry from '../registry'; diff --git a/x-pack/plugins/ingest_manager/server/services/epm/packages/get_objects.ts b/x-pack/plugins/ingest_manager/server/services/epm/packages/get_objects.ts index e0424aa8a36f5..b924c045870f3 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/packages/get_objects.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/packages/get_objects.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObject, SavedObjectsBulkCreateObject } from 'src/core/server/'; +import { SavedObject, SavedObjectsBulkCreateObject } from 'src/core/server'; import { AssetType } from '../../../types'; import * as Registry from '../registry'; diff --git a/x-pack/plugins/ingest_manager/server/services/epm/packages/index.ts b/x-pack/plugins/ingest_manager/server/services/epm/packages/index.ts index 2f84ea5b6f8db..79259ce79ff41 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/packages/index.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/packages/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObject } from '../../../../../../../src/core/server'; +import { SavedObject } from 'src/core/server'; import { AssetType, Installable, diff --git a/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts b/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts index acf77998fdb3c..3cce238f582f4 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObject, SavedObjectsClientContract } from 'src/core/server/'; +import { SavedObject, SavedObjectsClientContract } from 'src/core/server'; import { PACKAGES_SAVED_OBJECT_TYPE } from '../../../constants'; import { AssetReference, diff --git a/x-pack/plugins/ingest_manager/server/services/epm/packages/remove.ts b/x-pack/plugins/ingest_manager/server/services/epm/packages/remove.ts index e57729a7ab2ba..2e73160453c2b 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/packages/remove.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/packages/remove.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectsClientContract } from 'src/core/server/'; +import { SavedObjectsClientContract } from 'src/core/server'; import { PACKAGES_SAVED_OBJECT_TYPE } from '../../../constants'; import { AssetReference, AssetType, ElasticsearchAssetType } from '../../../types'; import { CallESAsCurrentUser } from '../../../types'; diff --git a/x-pack/plugins/ingest_manager/server/services/output.ts b/x-pack/plugins/ingest_manager/server/services/output.ts index 066f8e8a316a5..8503bbb56ee84 100644 --- a/x-pack/plugins/ingest_manager/server/services/output.ts +++ b/x-pack/plugins/ingest_manager/server/services/output.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectsClientContract } from 'kibana/server'; +import { SavedObjectsClientContract } from 'src/core/server'; import { NewOutput, Output } from '../types'; import { DEFAULT_OUTPUT, OUTPUT_SAVED_OBJECT_TYPE } from '../constants'; import { appContextService } from './app_context'; diff --git a/x-pack/plugins/ingest_manager/server/services/setup.ts b/x-pack/plugins/ingest_manager/server/services/setup.ts index 4b79cd639b613..7f72cdb88463f 100644 --- a/x-pack/plugins/ingest_manager/server/services/setup.ts +++ b/x-pack/plugins/ingest_manager/server/services/setup.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectsClientContract } from 'kibana/server'; +import { SavedObjectsClientContract } from 'src/core/server'; import { CallESAsCurrentUser } from '../types'; import { agentConfigService } from './agent_config'; import { outputService } from './output'; diff --git a/x-pack/plugins/ingest_manager/server/types/index.tsx b/x-pack/plugins/ingest_manager/server/types/index.tsx index c9a4bf79f3516..59c7f152e5cbc 100644 --- a/x-pack/plugins/ingest_manager/server/types/index.tsx +++ b/x-pack/plugins/ingest_manager/server/types/index.tsx @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { ScopedClusterClient } from 'src/core/server/'; +import { ScopedClusterClient } from 'src/core/server'; export { // Object types