Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GenAI] Integration assistant UI #184546

Closed
wants to merge 151 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
f1452a5
stashing changes
P1llus May 24, 2024
071b330
remove unecessary api code and update placeholder services
P1llus May 24, 2024
d102b28
update types, remove more code that is not needed anymore
P1llus May 24, 2024
b89cf96
cleaning up a lot of old code, reformat for kibana etc
P1llus May 24, 2024
84c58d4
fixing import paths
P1llus May 24, 2024
4e6a6bb
adding license headers and fixing last type paths
P1llus May 24, 2024
1da8c88
adding template files and more cleanup
P1llus May 25, 2024
9bc9dbf
adding templates, removing pages, adding some test buttons
P1llus May 25, 2024
813e342
stashing changes
P1llus May 25, 2024
540882c
stashing many changes with a non-descriptive commit message :)
P1llus May 26, 2024
58ad9f5
adding some fix to build integration api, starting on tests
P1llus May 27, 2024
eeb253d
adding some basic styling and conditions to test UI buttons
P1llus May 27, 2024
a4057b0
adding some small fixes
P1llus May 27, 2024
49f9db3
adding some initial jest tests
P1llus May 27, 2024
6659c9f
typo
patrykkopycinski May 27, 2024
83c6ee2
adding tests for ecs graph
P1llus May 27, 2024
0dd0851
split handleValidatePipeline to new file for mocks, added initial tes…
P1llus May 29, 2024
9e5fa1d
updating existing and adding new tests for backend, add esclient from…
P1llus May 29, 2024
2c54358
added context to related routes
P1llus May 29, 2024
6aefd4f
disable config by default
semd May 30, 2024
8e641b4
log debug
semd May 30, 2024
7c1ca51
Merge branch 'main' into integration_assistant
kibanamachine May 30, 2024
819374b
Add testpipeline API, update testPipeline to allow passing client as …
P1llus May 30, 2024
2bc589d
remove yarn.lock created by accident, add support for testing/updatin…
P1llus May 30, 2024
88a61bc
use actionsclient
patrykkopycinski May 30, 2024
24efa82
Merge branch 'integration_assistant' of github.com:P1llus/kibana into…
patrykkopycinski May 30, 2024
e1acc69
initial implementation integrations assistant ui
semd May 30, 2024
d099036
progress improved
semd May 30, 2024
37815f3
removing the public folder and disable UI, will provide in separate PR
P1llus May 31, 2024
4d127ee
Merge branch 'main' into integration_assistant
kibanamachine May 31, 2024
98d22d5
add isGenerating flag
semd May 31, 2024
f576253
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 31, 2024
ca5ca42
Adding some minor route argument changes
P1llus May 31, 2024
696b170
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine May 31, 2024
044ca8a
update readme
P1llus May 31, 2024
ba3b3e5
Update file operations to be sync rather than async as they have to b…
P1llus May 31, 2024
2985be8
Merge branch 'main' into integration_assistant
kibanamachine May 31, 2024
b78e00a
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine May 31, 2024
728a3d9
removing reference to local bedrock model in tests
P1llus May 31, 2024
f259e24
solve conflicts
semd May 31, 2024
e983f9a
Merge remote-tracking branch 'P1llus/integration_assistant' into new_…
semd May 31, 2024
1e005ef
Merge branch 'integration_assistant' of github.com:P1llus/kibana into…
P1llus May 31, 2024
1461631
Merge branch 'main' into integration_assistant
kibanamachine May 31, 2024
a3da613
fix create router type for backend
P1llus May 31, 2024
71725fd
renamed all template files to pass linter checks
P1llus May 31, 2024
1351f97
Merge branch 'main' into integration_assistant
P1llus May 31, 2024
4242078
revert commented out request validation
P1llus May 31, 2024
343c288
fix connector config
semd May 31, 2024
62668fe
fix sending object instead of string to missing keys prompt
P1llus May 31, 2024
d238614
Skip fields_to_remove if an empty array
bhapas Jun 3, 2024
fbff53c
Merge remote-tracking branch 'P1llus/integration_assistant' into new_…
semd Jun 3, 2024
ee12e81
Merge remote-tracking branch 'upstream/main' into integration_assistant
bhapas Jun 3, 2024
fe64617
fields table
semd Jun 3, 2024
049365b
Merge remote-tracking branch 'P1llus/integration_assistant' into new_…
semd Jun 3, 2024
8dd980d
remove navigation dependency
semd Jun 3, 2024
be0289c
conflicts solved
semd Jun 3, 2024
4315687
Merge remote-tracking branch 'P1llus/integration_assistant' into new_…
semd Jun 3, 2024
4338c97
Merge branch 'main' into integration_assistant
kibanamachine Jun 3, 2024
c2332dd
Merge branch 'main' into integration_assistant
patrykkopycinski Jun 3, 2024
a568780
fix
patrykkopycinski Jun 3, 2024
c3ab152
Merge branch 'integration_assistant' of github.com:P1llus/kibana into…
patrykkopycinski Jun 3, 2024
b79d05c
Update docs
bhapas Jun 4, 2024
abb17ce
Merge branch 'integration_assistant' of github.com:P1llus/kibana into…
bhapas Jun 4, 2024
bbd749e
Merge branch 'main' into integration_assistant
bhapas Jun 4, 2024
ead0fd6
Update yarn.lock
bhapas Jun 4, 2024
3d518bd
Merge branch 'main' into integration_assistant
bhapas Jun 4, 2024
378e17b
Merge branch 'main' into integration_assistant
bhapas Jun 4, 2024
9fa57d2
fix changed FakeListLLM to FakeStreamingLLM
bhapas Jun 4, 2024
0ef31c4
Merge branch 'main' into integration_assistant
kibanamachine Jun 4, 2024
687bd94
Merge branch 'integration_assistant' of github.com:P1llus/kibana into…
bhapas Jun 4, 2024
498556e
Merge branch 'main' into integration_assistant
bhapas Jun 4, 2024
d1f0667
Merge branch 'main' into integration_assistant
bhapas Jun 4, 2024
a3aac1f
Add integration_assistant to eslint
bhapas Jun 4, 2024
a337e06
Merge branch 'main' into integration_assistant
bhapas Jun 4, 2024
1b23cd2
Fix files with eslint issues
bhapas Jun 4, 2024
34e66c3
integration installation implemented
semd Jun 4, 2024
2efaa5b
branch sync
semd Jun 4, 2024
0b6131c
clean duplicated prop
semd Jun 4, 2024
7cb7799
Use SimpleChatModel
patrykkopycinski Jun 4, 2024
9aac53e
Merge branch 'integration_assistant' of github.com:P1llus/kibana into…
patrykkopycinski Jun 4, 2024
e32fc9d
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jun 4, 2024
c5678e3
[CI] Auto-commit changed files from 'yarn openapi:generate'
kibanamachine Jun 4, 2024
bce115d
fix
patrykkopycinski Jun 4, 2024
d42f6fd
fix eslint issue
bhapas Jun 5, 2024
8e6d180
Merge branch 'main' into integration_assistant
bhapas Jun 5, 2024
a5db6d2
Merge branch 'main' into integration_assistant
bhapas Jun 5, 2024
1febbe3
create integration button
semd Jun 5, 2024
c37f53e
adapt design button and landing
semd Jun 5, 2024
4488364
Merge branch 'main' into integration_assistant
bhapas Jun 5, 2024
e0b9cd8
Add versioned routes and make the APIs internal
bhapas Jun 7, 2024
6d8a9a4
Merge branch 'main' into integration_assistant
bhapas Jun 7, 2024
3b8aed0
hash navigation
semd Jun 7, 2024
2367be8
Remove unnecessary addition in package.json
bhapas Jun 7, 2024
7435e00
solve conflicts
semd Jun 7, 2024
43eadd6
Merge remote-tracking branch 'P1llus/integration_assistant' into new_…
semd Jun 7, 2024
0cadcc0
update yarn.lock
bhapas Jun 7, 2024
b930406
Merge branch 'main' into integration_assistant
bhapas Jun 7, 2024
5b8c1ef
consolidate reusable success page
semd Jun 7, 2024
8bc33a1
adapt assistant design steps 1 and 2
semd Jun 7, 2024
317db28
Merge branch 'main' into integration_assistant
bhapas Jun 10, 2024
374984e
add logo to integration
semd Jun 10, 2024
bf350c5
Merge remote-tracking branch 'P1llus/integration_assistant' into new_…
semd Jun 10, 2024
32ebbf1
Merge remote-tracking branch 'upstream/main' into integration_assistant
bhapas Jun 10, 2024
4ce2877
Revert unnecessary changes
bhapas Jun 10, 2024
ecd4593
Merge branch 'main' into integration_assistant
bhapas Jun 10, 2024
4e4779c
[CI] Auto-commit changed files from 'yarn openapi:generate'
kibanamachine Jun 10, 2024
e1df3e6
Merge branch 'main' into integration_assistant
kibanamachine Jun 10, 2024
b37688f
Revert eslint changes
bhapas Jun 10, 2024
b2ae8fe
Merge branch 'main' into integration_assistant
kibanamachine Jun 10, 2024
24c64fd
adapt integrations assistant step 3 to design
semd Jun 10, 2024
8491d26
adapt integrations assistant design step 4
semd Jun 10, 2024
980995a
Merge branch 'main' into integration_assistant
bhapas Jun 11, 2024
6160ba6
Merge branch 'main' into integration_assistant
kibanamachine Jun 11, 2024
40408ff
Use SimpleChatModel
bhapas Jun 11, 2024
ad8417f
Update yarn.lock
bhapas Jun 11, 2024
bc0ddfc
finish first design adaptation
semd Jun 11, 2024
6e02389
small some fixes
semd Jun 11, 2024
7a7c9b8
dedup package names in the form
semd Jun 11, 2024
efda02f
tsconfig
semd Jun 11, 2024
9bf823d
tsconfig
semd Jun 11, 2024
f442d37
improve invalid values state
semd Jun 12, 2024
3b3d999
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jun 12, 2024
454b0b7
adapt design changes landing page
semd Jun 12, 2024
ffd04d7
merge upstream
semd Jun 12, 2024
e633877
add integrationAssistant to the limits.yml
semd Jun 12, 2024
f67cffa
Merge branch 'main' into integration_assistant
kibanamachine Jun 12, 2024
a10dce0
Disable the feature by default
bhapas Jun 12, 2024
7131ec8
add i18n config
semd Jun 12, 2024
499b424
Merge branch 'main' into integration_assistant
kibanamachine Jun 12, 2024
e82a851
navigation using full url instead of hash
semd Jun 12, 2024
8593f91
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jun 12, 2024
df8dbc5
test
patrykkopycinski Jun 12, 2024
fc15ed1
fix
patrykkopycinski Jun 12, 2024
efcb60a
Merge branch 'main' into integration_assistant
kibanamachine Jun 13, 2024
3a14e2a
update tsconfig
semd Jun 13, 2024
3a71031
use resolve path instead of join
semd Jun 13, 2024
939a908
esModuleInterop: true
semd Jun 13, 2024
5cb9265
add test route
semd Jun 13, 2024
6dc6ae7
test more directories
semd Jun 13, 2024
f5b7853
Ignore building system tests for custom packages
bhapas Jun 13, 2024
c5d827a
Merge branch 'main' into integration_assistant
kibanamachine Jun 13, 2024
9d8d884
rename readme.md.njk
semd Jun 13, 2024
71d0615
merge api changes
semd Jun 13, 2024
77214b0
bump langgraph
patrykkopycinski Jun 13, 2024
3492c88
revert
patrykkopycinski Jun 13, 2024
360f840
Merge branch 'main' into integration_assistant
kibanamachine Jun 13, 2024
d3bd19d
update docs link
semd Jun 17, 2024
050ad3b
enable plugin for PR deployment
semd Jun 17, 2024
96058af
Merge remote-tracking branch 'P1llus/integration_assistant' into new_…
semd Jun 17, 2024
3e55686
merge main
semd Jun 17, 2024
4eb58f2
tsconfig public
semd Jun 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
const ELASTICSEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/`;
const KIBANA_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/`;
const FLEET_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/fleet/${DOC_LINK_VERSION}/`;
const INTEGRATIONS_DEV_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/integrations-developer/${DOC_LINK_VERSION}/`;
const PLUGIN_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/plugins/${DOC_LINK_VERSION}/`;
const OBSERVABILITY_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/`;
const APM_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/apm/`;
Expand Down Expand Up @@ -861,6 +862,9 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
roleAndPrivileges: `${FLEET_DOCS}fleet-roles-and-privileges.html`,
proxiesSettings: `${FLEET_DOCS}fleet-agent-proxy-support.html`,
},
integrationDeveloper: {
upload: `${INTEGRATIONS_DEV_DOCS}upload-a-new-integration.html`,
},
ecs: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/ecs/${ECS_VERSION}/index.html`,
dataStreams: `${ELASTIC_WEBSITE_URL}guide/en/ecs/${ECS_VERSION}/ecs-data_stream.html`,
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,9 @@ export interface DocLinks {
roleAndPrivileges: string;
proxiesSettings: string;
}>;
readonly integrationDeveloper: {
upload: string;
};
readonly ecs: {
readonly guide: string;
readonly dataStreams: string;
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ pageLoadAssetSize:
ingestPipelines: 58003
inputControlVis: 172675
inspector: 148711
integrationAssistant: 20927
interactiveSetup: 80000
investigate: 17970
kibanaOverview: 56279
Expand Down
1 change: 1 addition & 0 deletions x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"xpack.logsShared": "plugins/observability_solution/logs_shared",
"xpack.fleet": "plugins/fleet",
"xpack.ingestPipelines": "plugins/ingest_pipelines",
"xpack.integrationAssistant": "plugins/integration_assistant",
"xpack.investigate": "plugins/observability_solution/investigate",
"xpack.kubernetesSecurity": "plugins/kubernetes_security",
"xpack.lens": "plugins/lens",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import { KnowledgeBaseConfig } from '../assistant/types';

export const INTEGRATIONS_ASSISTANT_STORAGE_KEY = 'attackDiscovery';
export const ATTACK_DISCOVERY_STORAGE_KEY = 'attackDiscovery';
export const DEFAULT_ASSISTANT_NAMESPACE = 'elasticAssistantDefault';
export const QUICK_PROMPT_LOCAL_STORAGE_KEY = 'quickPrompts';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const ConnectorButtonWrapper = styled.div`
export interface ConnectorSetupProps {
conversation?: Conversation;
isFlyoutMode?: boolean;
actionTypeIds?: string[];
onSetupComplete?: () => void;
onConversationUpdate: ({ cId, cTitle }: { cId: string; cTitle: string }) => Promise<void>;
updateConversationsOnSaveConnector?: boolean;
Expand All @@ -42,6 +43,7 @@ export interface ConnectorSetupProps {
export const useConnectorSetup = ({
conversation: defaultConversation,
isFlyoutMode,
actionTypeIds,
onSetupComplete,
onConversationUpdate,
updateConversationsOnSaveConnector = true,
Expand Down Expand Up @@ -74,7 +76,7 @@ export const useConnectorSetup = ({
// If no presentation data on messages, default to showing add connector button so it doesn't delay render and flash on screen
return conversationHasNoPresentationData(conversation);
});
const { data: actionTypes } = useLoadActionTypes({ http });
const { data: actionTypes } = useLoadActionTypes({ http, actionTypeIds });

const [selectedActionType, setSelectedActionType] = useState<ActionType | null>(null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ export const QUERY_KEY = ['elastic-assistant, load-action-types'];
export interface Props {
http: HttpSetup;
toasts?: IToasts;
actionTypeIds?: string[];
}

export const useLoadActionTypes = ({
http,
toasts,
actionTypeIds,
}: Props): UseQueryResult<ActionType[], IHttpFetchError> => {
return useQuery(
QUERY_KEY,
Expand All @@ -42,8 +44,10 @@ export const useLoadActionTypes = ({
featureId: GenerativeAIForSecurityConnectorFeatureId,
});
const sortedData = queryResult.sort((a, b) => a.name.localeCompare(b.name));

return sortedData;
if (!actionTypeIds) {
return sortedData;
}
return sortedData.filter((actionType) => actionTypeIds.includes(actionType.id));
},
{
retry: false,
Expand Down
1 change: 1 addition & 0 deletions x-pack/packages/kbn-elastic-assistant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export {
DEFAULT_ASSISTANT_NAMESPACE,
DEFAULT_LATEST_ALERTS,
KNOWLEDGE_BASE_LOCAL_STORAGE_KEY,
INTEGRATIONS_ASSISTANT_STORAGE_KEY,
} from './impl/assistant_context/constants';

export { useLoadConnectors } from './impl/connectorland/use_load_connectors';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ export enum ProductFeatureSecurityKey {
* enables all rule actions
*/
externalRuleActions = 'external_rule_actions',

/**
* enables the assistant for external integrations
*/
integrationsAssistant = 'integrations_assistant',
}

export enum ProductFeatureCasesKey {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ export const securityDefaultProductFeaturesConfig: DefaultSecurityProductFeature
],
},

// Product features without RBAC
// Product features without privileges
[ProductFeatureSecurityKey.osqueryAutomatedResponseActions]: {},
[ProductFeatureSecurityKey.endpointProtectionUpdates]: {},
[ProductFeatureSecurityKey.endpointAgentTamperProtection]: {},
[ProductFeatureSecurityKey.externalRuleActions]: {},
[ProductFeatureSecurityKey.integrationsAssistant]: {},
};
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export async function get({
id,
actionTypeId: foundInMemoryConnector.actionTypeId,
name: foundInMemoryConnector.name,
config: foundInMemoryConnector.config,
isPreconfigured: foundInMemoryConnector.isPreconfigured,
isSystemAction: foundInMemoryConnector.isSystemAction,
isDeprecated: isConnectorDeprecated(foundInMemoryConnector),
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/fleet/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"ingestPipelines",
"spaces",
"guidedOnboarding",
"integrationAssistant",
],
"requiredBundles": [
"kibanaReact",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ const breadcrumbGetters: {
}),
},
],
integration_create: () => [
BASE_BREADCRUMB,
{
text: i18n.translate('xpack.fleet.breadcrumbs.createIntegrationPageTitle', {
defaultMessage: 'Create integration',
}),
},
],
integration_details_overview: ({ pkgTitle }) => [BASE_BREADCRUMB, { text: pkgTitle }],
integration_policy_edit: ({ pkgTitle, pkgkey, policyName }) => [
BASE_BREADCRUMB,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, { memo } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText, EuiNotificationBadge } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';

import { useLink } from '../../../hooks';
import { useLink, useStartServices } from '../../../hooks';
import type { Section } from '../sections';

import { WithHeaderLayout } from '.';
Expand All @@ -21,6 +21,7 @@ interface Props {

export const DefaultLayout: React.FC<Props> = memo(
({ section, children, notificationsBySection }) => {
const { integrationAssistant } = useStartServices();
const { getHref } = useLink();
const tabs = [
{
Expand Down Expand Up @@ -48,30 +49,46 @@ export const DefaultLayout: React.FC<Props> = memo(
return (
<WithHeaderLayout
leftColumn={
<EuiFlexGroup direction="column" gutterSize="none" justifyContent="center">
<EuiText>
<h1>
<FormattedMessage
id="xpack.fleet.integrationsHeaderTitle"
defaultMessage="Integrations"
/>
</h1>
</EuiText>

<EuiSpacer size="s" />

<EuiFlexItem grow={false}>
<EuiText size="s" color="subdued">
<p>
<EuiFlexGroup direction="row" gutterSize="none" justifyContent="center">
<EuiFlexGroup direction="column" gutterSize="none" justifyContent="center">
<EuiText>
<h1>
<FormattedMessage
id="xpack.fleet.epm.pageSubtitle"
defaultMessage="Choose an integration to start collecting and analyzing your data."
id="xpack.fleet.integrationsHeaderTitle"
defaultMessage="Integrations"
/>
</p>
</h1>
</EuiText>
</EuiFlexItem>

<EuiSpacer size="s" />

<EuiFlexItem grow={false}>
<EuiText size="s" color="subdued">
<p>
<FormattedMessage
id="xpack.fleet.epm.pageSubtitle"
defaultMessage="Choose an integration to start collecting and analyzing your data."
/>
</p>
</EuiText>
</EuiFlexItem>

<EuiSpacer size="s" />
</EuiFlexGroup>
</EuiFlexGroup>
}
rightColumnGrow={false}
rightColumn={
<>
{integrationAssistant && (
<EuiFlexItem grow={false}>
<integrationAssistant.CreateIntegrationCardButton
href={getHref('integration_create')}
/>
</EuiFlexItem>
)}
</>
}
tabs={tabs.map((tab) => {
const notificationCount = notificationsBySection?.[tab.section];
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ import { Routes, Route } from '@kbn/shared-ux-router';
import { EuiSkeletonText } from '@elastic/eui';

import { INTEGRATIONS_ROUTING_PATHS } from '../../constants';
import { IntegrationsStateContextProvider, useBreadcrumbs } from '../../hooks';
import { IntegrationsStateContextProvider, useBreadcrumbs, useStartServices } from '../../hooks';

import { EPMHomePage } from './screens/home';
import { Detail } from './screens/detail';
import { Policy } from './screens/policy';
import { CreateIntegration } from './screens/create';
import { CustomLanguagesOverview } from './screens/detail/custom_languages_overview';

export const EPMApp: React.FunctionComponent = () => {
const { integrationAssistant } = useStartServices();
useBreadcrumbs('integrations');

return (
Expand All @@ -38,6 +40,11 @@ export const EPMApp: React.FunctionComponent = () => {
</React.Suspense>
</IntegrationsStateContextProvider>
</Route>
{integrationAssistant && (
<Route path={INTEGRATIONS_ROUTING_PATHS.integrations_create}>
<CreateIntegration />
</Route>
)}
<Route path={INTEGRATIONS_ROUTING_PATHS.integrations}>
<EPMHomePage />
</Route>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React, { useMemo } from 'react';

import { useStartServices, useBreadcrumbs } from '../../../../hooks';

export const CreateIntegration = React.memo(() => {
const { integrationAssistant } = useStartServices();
useBreadcrumbs('integration_create');

const CreateIntegrationAssistant = useMemo(
() => integrationAssistant?.CreateIntegration,
[integrationAssistant]
);

return CreateIntegrationAssistant ? <CreateIntegrationAssistant /> : null;
});
1 change: 0 additions & 1 deletion x-pack/plugins/fleet/public/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export const Header: React.FC<HeaderProps> = ({
<EuiFlexGroup>
{tabs ? (
<EuiFlexItem>
<EuiSpacer size="s" />
<Tabs className={tabsClassName}>
{tabs.map((props, index) => (
<EuiTab {...(props as EuiTabProps)} key={`${props.id}-${index}`}>
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/fleet/public/constants/page_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type StaticPage =
| 'base'
| 'overview'
| 'integrations'
| 'integration_create'
| 'policies'
| 'policies_list'
| 'enrollment_tokens'
Expand Down Expand Up @@ -97,6 +98,7 @@ export const INTEGRATIONS_ROUTING_PATHS = {
integrations_all: '/browse/:category?/:subcategory?',
integrations_installed: '/installed/:category?',
integrations_installed_updates_available: '/installed/updates_available/:category?',
integrations_create: '/create',
integration_details: '/detail/:pkgkey/:panel?',
integration_details_overview: '/detail/:pkgkey/overview',
integration_details_policies: '/detail/:pkgkey/policies',
Expand Down Expand Up @@ -152,6 +154,7 @@ export const pagePathGetters: {
const queryParams = query ? `?${INTEGRATIONS_SEARCH_QUERYPARAM}=${query}` : ``;
return [INTEGRATIONS_BASE_PATH, `/installed/updates_available${categoryPath}${queryParams}`];
},
integration_create: () => [INTEGRATIONS_BASE_PATH, `/create`],
integration_details_overview: ({ pkgkey, integration }) => [
INTEGRATIONS_BASE_PATH,
`/detail/${pkgkey}/overview${integration ? `?integration=${integration}` : ''}`,
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/fleet/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { DEFAULT_APP_CATEGORIES } from '@kbn/core/public';
import { i18n } from '@kbn/i18n';

import type { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public';
import type { IntegrationAssistantPluginStart } from '@kbn/integration-assistant-plugin/public';
import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common';

import type {
Expand Down Expand Up @@ -130,6 +131,7 @@ export interface FleetStartDeps {
navigation: NavigationPublicPluginStart;
customIntegrations: CustomIntegrationsStart;
share: SharePluginStart;
integrationAssistant?: IntegrationAssistantPluginStart;
cloud?: CloudStart;
usageCollection?: UsageCollectionStart;
guidedOnboarding?: GuidedOnboardingPluginStart;
Expand All @@ -139,6 +141,7 @@ export interface FleetStartServices extends CoreStart, Exclude<FleetStartDeps, '
storage: Storage;
share: SharePluginStart;
dashboard: DashboardStart;
integrationAssistant?: IntegrationAssistantPluginStart;
cloud?: CloudSetup & CloudStart;
discover?: DiscoverStart;
spaces?: SpacesPluginStart;
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/fleet/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,6 @@
"@kbn/fields-metadata-plugin",
"@kbn/test-jest-helpers",
"@kbn/core-saved-objects-utils-server",
"@kbn/integration-assistant-plugin",
]
}
4 changes: 3 additions & 1 deletion x-pack/plugins/integration_assistant/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ export const INTEGRATION_ASSISTANT_APP_ROUTE = '/app/integration_assistant';

// Server API Routes
export const INTEGRATION_ASSISTANT_BASE_PATH = '/api/integration_assistant';

export const ECS_GRAPH_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/ecs`;
export const CATEGORIZATION_GRAPH_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/categorization`;
export const RELATED_GRAPH_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/related`;
export const CHECK_PIPELINE_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/pipeline`;
export const INTEGRATION_BUILDER_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/build`;
export const TEST_PIPELINE_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/pipeline`;
export const FLEET_PACKAGES_PATH = `/api/fleet/epm/packages`;
Loading