master
into feature-ingest
+
+
+
+
Successfully installed {name}
; + + notifications.toasts.addSuccess({ + title: `Installed ${title} package`, + text: toMountPoint(SuccessMsg), + }); + + // TODO: this should probably live somewhere else and useSuccessfully deleted {title}
; + + notifications.toasts.addSuccess({ + title: `Deleted ${title} package`, + text: toMountPoint(SuccessMsg), + }); + + const packageUrl = toDetailView({ name, version }); + const dataSourcesUrl = toDetailView({ + name, + version, + panel: 'data-sources', + }); + if (window.location.href.includes(packageUrl)) window.location.href = dataSourcesUrl; + } + }, + [notifications.toasts, setPackageInstallStatus, toDetailView] + ); + + return { + packages, + installPackage, + setPackageInstallStatus, + getPackageInstallStatus, + deletePackage, + }; +} + +export const [ + PackageInstallProvider, + useInstallPackage, + useSetPackageInstallStatus, + useGetPackageInstallStatus, + useDeletePackage, +] = createContainer( + usePackageInstall, + value => value.installPackage, + value => value.setPackageInstallStatus, + value => value.getPackageInstallStatus, + value => value.deletePackage +); 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 777c2353226c4..b8dd08eb46a54 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 @@ -5,74 +5,28 @@ */ import React from 'react'; -import styled from 'styled-components'; -import { EuiFlexGroup, EuiFlexItem, EuiText, EuiImage } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { PLUGIN_ID } from '../../constants'; -import { WithHeaderLayout } from '../../layouts'; -import { useConfig, useCore } from '../../hooks'; - -const ImageWrapper = styled.div` - margin-bottom: -62px; -`; +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 { Detail } from './screens/detail'; export const EPMApp: React.FunctionComponent = () => { const { epm } = useConfig(); - const { http } = useCore(); - - if (!epm.enabled) { - return null; - } - return ( -
-
+ and will only be accessible to users who have permission to view this Space. Elasticsearch + assets are installed globally and will be accessible to all Kibana users. +
+
+
+
+
+
{payload && JSON.stringify(payload, null, 2)}
+
+ ),
+ },
+ ];
+
+ const onClickRefresh = () => {
+ refresh();
+ };
+
+ const onChange = ({ page }: { page: { index: number; size: number } }) => {
+ const newPagination = {
+ ...pagination,
+ currentPage: page.index + 1,
+ pageSize: page.size,
+ };
+
+ setPagination(newPagination);
+ };
+
+ return (
+ <>
+
+
+
{event.message}
+ ))} + > + ) : ( +
+
+
+
-