Skip to content

Commit

Permalink
[8.x] [APM]Refactor ServiceTabEmptyState to use AddDataPanel (#197578) (
Browse files Browse the repository at this point in the history
#197666)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[APM]Refactor ServiceTabEmptyState to use AddDataPanel
(#197578)](#197578)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Irene
Blanco","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-24T14:34:55Z","message":"[APM]Refactor
ServiceTabEmptyState to use AddDataPanel (#197578)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195876\r\n\r\nThis PR refactors
the ServiceTabEmptyState component to use the newly\r\ncreated generic
AddDataPanel component, which was derived from it.\r\n\r\nThe
functionality remains the same.\r\n\r\n###
Tabs\r\n\r\n|Light|Dark|\r\n|-|-|\r\n\r\n|![callout_light](https://github.com/user-attachments/assets/46c7d14b-c4f4-44e4-a753-099abec378e4)|![callout_dark](https://github.com/user-attachments/assets/298386bf-eb76-4b23-9952-df6576032f86)|\r\n\r\n###
Actions\r\n\r\n![callout_actions](https://github.com/user-attachments/assets/08c4364c-c3cb-45af-b02e-5012cbf86536)\r\n\r\n###
Dismiss\r\n\r\n![callout_dismissable](https://github.com/user-attachments/assets/a0276001-98a9-47b3-83c9-aaa0685c7418)","sha":"42de8c858995b190f35858b2798f7ea4dfcb2439","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","apm","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services","v8.16.0","v8.17.0"],"title":"[APM]Refactor
ServiceTabEmptyState to use
AddDataPanel","number":197578,"url":"https://github.com/elastic/kibana/pull/197578","mergeCommit":{"message":"[APM]Refactor
ServiceTabEmptyState to use AddDataPanel (#197578)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195876\r\n\r\nThis PR refactors
the ServiceTabEmptyState component to use the newly\r\ncreated generic
AddDataPanel component, which was derived from it.\r\n\r\nThe
functionality remains the same.\r\n\r\n###
Tabs\r\n\r\n|Light|Dark|\r\n|-|-|\r\n\r\n|![callout_light](https://github.com/user-attachments/assets/46c7d14b-c4f4-44e4-a753-099abec378e4)|![callout_dark](https://github.com/user-attachments/assets/298386bf-eb76-4b23-9952-df6576032f86)|\r\n\r\n###
Actions\r\n\r\n![callout_actions](https://github.com/user-attachments/assets/08c4364c-c3cb-45af-b02e-5012cbf86536)\r\n\r\n###
Dismiss\r\n\r\n![callout_dismissable](https://github.com/user-attachments/assets/a0276001-98a9-47b3-83c9-aaa0685c7418)","sha":"42de8c858995b190f35858b2798f7ea4dfcb2439"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197578","number":197578,"mergeCommit":{"message":"[APM]Refactor
ServiceTabEmptyState to use AddDataPanel (#197578)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195876\r\n\r\nThis PR refactors
the ServiceTabEmptyState component to use the newly\r\ncreated generic
AddDataPanel component, which was derived from it.\r\n\r\nThe
functionality remains the same.\r\n\r\n###
Tabs\r\n\r\n|Light|Dark|\r\n|-|-|\r\n\r\n|![callout_light](https://github.com/user-attachments/assets/46c7d14b-c4f4-44e4-a753-099abec378e4)|![callout_dark](https://github.com/user-attachments/assets/298386bf-eb76-4b23-9952-df6576032f86)|\r\n\r\n###
Actions\r\n\r\n![callout_actions](https://github.com/user-attachments/assets/08c4364c-c3cb-45af-b02e-5012cbf86536)\r\n\r\n###
Dismiss\r\n\r\n![callout_dismissable](https://github.com/user-attachments/assets/a0276001-98a9-47b3-83c9-aaa0685c7418)","sha":"42de8c858995b190f35858b2798f7ea4dfcb2439"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Irene Blanco <[email protected]>
  • Loading branch information
kibanamachine and iblancof authored Oct 24, 2024
1 parent 4db8d58 commit 9c788b3
Show file tree
Hide file tree
Showing 8 changed files with 196 additions and 219 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function ServiceOverview() {
<EuiFlexItem>
<ServiceTabEmptyState
id="serviceOverview"
onDissmiss={() => setDismissedLogsOnlyEmptyState(true)}
onDismiss={() => setDismissedLogsOnlyEmptyState(true)}
/>
</EuiFlexItem>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
* 2.0.
*/

import type { ObservabilityOnboardingLocatorParams } from '@kbn/deeplinks-observability';
import { i18n } from '@kbn/i18n';
import type { AddDataPanelProps } from '@kbn/observability-shared-plugin/public';
import type { LocatorPublic } from '@kbn/share-plugin/common';

export type EmptyStateKey =
export type AddAPMCalloutKeys =
| 'serviceOverview'
| 'serviceDependencies'
| 'infraOverview'
Expand All @@ -16,80 +19,154 @@ export type EmptyStateKey =
| 'metrics'
| 'errorGroupOverview';

interface EmptyStateContent {
title: string;
content: string;
imgName?: string;
}
const defaultActions = (
locator: LocatorPublic<ObservabilityOnboardingLocatorParams> | undefined
) => {
return {
actions: {
primary: {
href: locator?.getRedirectUrl({ category: 'application' }),
label: i18n.translate('xpack.apm.serviceTabEmptyState.defaultPrimaryActionLabel', {
defaultMessage: 'Add APM',
}),
},
secondary: {
href: 'https://ela.st/demo-apm-try-it',
},
link: {
href: 'https://www.elastic.co/observability/application-performance-monitoring',
},
},
};
};

export const emptyStateDefinitions: Record<EmptyStateKey, EmptyStateContent> = {
serviceOverview: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.overviewTitle', {
defaultMessage: 'Detect and resolve issues faster with deep visibility into your application',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.overviewContent', {
defaultMessage:
'Understanding your application performance, relationships and dependencies by instrumenting with APM.',
}),
},
serviceDependencies: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.dependenciesTitle', {
defaultMessage: 'Understand the dependencies for your service',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.dependenciesContent', {
defaultMessage:
"See your service's dependencies on both internal and third-party services by instrumenting with APM.",
}),
imgName: 'service_tab_empty_state_dependencies.png',
},
infraOverview: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.infrastructureTitle', {
defaultMessage: 'Understand what your service is running on',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.infrastructureContent', {
defaultMessage:
'Troubleshoot service problems by seeing the infrastructure your service is running on.',
}),
imgName: 'service_tab_empty_state_infrastructure.png',
},
serviceMap: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.serviceMapTitle', {
defaultMessage: 'Visualise the dependencies between your services',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.serviceMapContent', {
defaultMessage:
'See your services dependencies at a glance to help identify dependencies that may be affecting your service.',
}),
imgName: 'service_tab_empty_state_service_map.png',
},
transactionOverview: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.transactionsTitle', {
defaultMessage: 'Troubleshoot latency, throughput and errors',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.transactionsContent', {
defaultMessage:
"Troubleshoot your service's performance by analysing latency, throughput and errors down to the specific transaction.",
}),
imgName: 'service_tab_empty_state_transactions.png',
},
metrics: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.metricsTitle', {
defaultMessage: 'View core metrics for your application',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.metricsContent', {
defaultMessage:
'View metric trends for the instances of your service to identify performance bottlenecks that could be affecting your users.',
}),
imgName: 'service_tab_empty_state_metrics.png',
},
errorGroupOverview: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.errorGroupOverviewTitle', {
defaultMessage: 'Identify transaction errors with your applications',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.errorGroupOverviewContent', {
defaultMessage:
'Analyse errors down to the specific transaction to pin-point specific errors within your service.',
}),
imgName: 'service_tab_empty_state_errors.png',
},
export const addAPMCalloutDefinitions = (
baseFolderPath: string,
locator: LocatorPublic<ObservabilityOnboardingLocatorParams> | undefined
): Record<
AddAPMCalloutKeys,
Omit<AddDataPanelProps, 'onDismiss' | 'onAddData' | 'onLearnMore' | 'onTryIt'>
> => {
return {
serviceOverview: {
content: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.overviewTitle', {
defaultMessage:
'Detect and resolve issues faster with deep visibility into your application',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.overviewContent', {
defaultMessage:
'Understanding your application performance, relationships and dependencies by instrumenting with APM.',
}),
img: {
name: 'service_tab_empty_state_overview.png',
baseFolderPath,
position: 'inside',
},
},
...defaultActions(locator),
},
serviceDependencies: {
content: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.dependenciesTitle', {
defaultMessage: 'Understand the dependencies for your service',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.dependenciesContent', {
defaultMessage:
"See your service's dependencies on both internal and third-party services by instrumenting with APM.",
}),
img: {
name: 'service_tab_empty_state_dependencies.png',
baseFolderPath,
position: 'below',
},
},
...defaultActions(locator),
},
infraOverview: {
content: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.infrastructureTitle', {
defaultMessage: 'Understand what your service is running on',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.infrastructureContent', {
defaultMessage:
'Troubleshoot service problems by seeing the infrastructure your service is running on.',
}),
img: {
name: 'service_tab_empty_state_infrastructure.png',
baseFolderPath,
position: 'below',
},
},
...defaultActions(locator),
},
serviceMap: {
content: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.serviceMapTitle', {
defaultMessage: 'Visualise the dependencies between your services',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.serviceMapContent', {
defaultMessage:
'See your services dependencies at a glance to help identify dependencies that may be affecting your service.',
}),
img: {
name: 'service_tab_empty_state_service_map.png',
baseFolderPath,
position: 'below',
},
},
...defaultActions(locator),
},
transactionOverview: {
content: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.transactionsTitle', {
defaultMessage: 'Troubleshoot latency, throughput and errors',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.transactionsContent', {
defaultMessage:
"Troubleshoot your service's performance by analysing latency, throughput and errors down to the specific transaction.",
}),
img: {
name: 'service_tab_empty_state_transactions.png',
baseFolderPath,
position: 'below',
},
},
...defaultActions(locator),
},
metrics: {
content: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.metricsTitle', {
defaultMessage: 'View core metrics for your application',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.metricsContent', {
defaultMessage:
'View metric trends for the instances of your service to identify performance bottlenecks that could be affecting your users.',
}),
img: {
name: 'service_tab_empty_state_metrics.png',
baseFolderPath,
position: 'below',
},
},
...defaultActions(locator),
},
errorGroupOverview: {
content: {
title: i18n.translate('xpack.apm.serviceTabEmptyState.errorGroupOverviewTitle', {
defaultMessage: 'Identify transaction errors with your applications',
}),
content: i18n.translate('xpack.apm.serviceTabEmptyState.errorGroupOverviewContent', {
defaultMessage:
'Analyse errors down to the specific transaction to pin-point specific errors within your service.',
}),
img: {
name: 'service_tab_empty_state_errors.png',
baseFolderPath,
position: 'below',
},
},
...defaultActions(locator),
},
};
};
Loading

0 comments on commit 9c788b3

Please sign in to comment.