forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Integrations UI] Add support for custom asset definitions in Integra…
…tion assets tab (elastic#103554) * Add UI extension logic for assets + set up custom log views * Add endpoint security UI extension * Add synthetics ui extension * Address PR feedback - Remove default filter for log stream url - Fix missing basePath prepend on asset urls - Expand accordion by default on assetless integrations * Fix type errors * Add initial APM extension setup * Fix missing ExtensionWrapper for enrollment extension * Fix custom logs asset extension * Fix type errors * Add new hook for enrollment flyout ui extensions * Address PR review + refactor UI extension usage for flyout * Update limits.yml via script * Fix type errors * Add tests for custom assets UI extensions * Update tests for flyout * Remove unused import * Fix type errors in ui extension tests * Skip view data tests and link to issue * Use RedirectAppLinks + fix synthetics link * Use constants for app ID's where possible * Revert limits.yml * Fix lazy imports for custom asset components * Update endpoint custom assets link + description * Add translation for custom assets UI * Address PR review in APM Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
1c82ad2
commit 059ed08
Showing
39 changed files
with
669 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
x-pack/plugins/apm/public/components/fleet_integration/apm_custom_assets_extension.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* 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 from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
import { | ||
CustomAssetsAccordionProps, | ||
CustomAssetsAccordion, | ||
} from '../../../../fleet/public'; | ||
import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; | ||
import { ApmPluginStartDeps } from '../../plugin'; | ||
|
||
export function ApmCustomAssetsExtension() { | ||
const { http } = useKibana<ApmPluginStartDeps>().services; | ||
const basePath = http?.basePath.get(); | ||
|
||
const views: CustomAssetsAccordionProps['views'] = [ | ||
{ | ||
name: i18n.translate('xpack.apm.fleetIntegration.assets.name', { | ||
defaultMessage: 'Services', | ||
}), | ||
url: `${basePath}/app/apm`, | ||
description: i18n.translate( | ||
'xpack.apm.fleetIntegration.assets.description', | ||
{ defaultMessage: 'View application traces and service maps in APM' } | ||
), | ||
}, | ||
]; | ||
|
||
return <CustomAssetsAccordion views={views} initialIsOpen />; | ||
} |
58 changes: 58 additions & 0 deletions
58
x-pack/plugins/apm/public/components/fleet_integration/apm_enrollment_flyout_extension.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* 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 from 'react'; | ||
import { EuiButton, EuiText, EuiSpacer } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
import { AgentEnrollmentFlyoutFinalStepExtension } from '../../../../fleet/public'; | ||
import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; | ||
import { ApmPluginStartDeps } from '../../plugin'; | ||
|
||
function StepComponent() { | ||
const { http } = useKibana<ApmPluginStartDeps>().services; | ||
const installApmAgentLink = http?.basePath.prepend('/app/home#/tutorial/apm'); | ||
|
||
return ( | ||
<> | ||
<EuiText> | ||
<p> | ||
{i18n.translate( | ||
'xpack.apm.fleetIntegration.enrollmentFlyout.installApmAgentDescription', | ||
{ | ||
defaultMessage: | ||
'After the agent starts, you can install APM agents on your hosts to collect data from your applications and services.', | ||
} | ||
)} | ||
</p> | ||
</EuiText> | ||
<EuiSpacer size="m" /> | ||
|
||
<EuiButton fill href={installApmAgentLink}> | ||
{i18n.translate( | ||
'xpack.apm.fleetIntegration.enrollmentFlyout.installApmAgentButtonText', | ||
{ defaultMessage: 'Install APM Agent' } | ||
)} | ||
</EuiButton> | ||
</> | ||
); | ||
} | ||
|
||
export function getApmEnrollmentFlyoutData(): Pick< | ||
AgentEnrollmentFlyoutFinalStepExtension, | ||
'title' | 'Component' | ||
> { | ||
return { | ||
title: i18n.translate( | ||
'xpack.apm.fleetIntegration.enrollmentFlyout.installApmAgentTitle', | ||
{ | ||
defaultMessage: 'Install APM Agent', | ||
} | ||
), | ||
Component: StepComponent, | ||
}; | ||
} |
9 changes: 9 additions & 0 deletions
9
x-pack/plugins/apm/public/components/fleet_integration/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export * from './apm_enrollment_flyout_extension'; | ||
export * from './lazy_apm_custom_assets_extension'; |
18 changes: 18 additions & 0 deletions
18
x-pack/plugins/apm/public/components/fleet_integration/lazy_apm_custom_assets_extension.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* 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 { lazy } from 'react'; | ||
|
||
export const LazyApmCustomAssetsExtension = lazy(async () => { | ||
const { ApmCustomAssetsExtension } = await import( | ||
'./apm_custom_assets_extension' | ||
); | ||
|
||
return { | ||
default: ApmCustomAssetsExtension, | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.