Skip to content

Commit 69dac8d

Browse files
[9.0] [APM] Optional chaining to prevent undefined error in custom_link_flyout.tsx (#219668) (#219701)
# Backport This will backport the following commits from `main` to `9.0`: - [[APM] Optional chaining to prevent undefined error in `custom_link_flyout.tsx` (#219668)](#219668) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Milosz Marcinkowski","email":"38698566+miloszmarcinkowski@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-04-30T11:06:01Z","message":"[APM] Optional chaining to prevent undefined error in `custom_link_flyout.tsx` (#219668)\n\n## Summary\n\nPrevent `TypeError: Cannot read properties of undefined (reading\n'name')` in `custom_link_flyout.tsx`.\n\nBefore:\n\n\nhttps://github.com/user-attachments/assets/385228fe-1421-46fb-bfee-da1efe829fcb\n\nAfter:\n\n\nhttps://github.com/user-attachments/assets/76da5646-962f-4a6f-9eb5-f7632444e795\n\n### How to test:\n1. Mock empty `transaction.name` property in `CustomLinkFlyout`\ncomponent\n2. Visit Service -> Transaction -> Check for `Investigate` dropdown in\ntrace waterfall","sha":"f5a226fcacf08f0b9654adc15d85c8ffa61d25b4","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:obs-ux-infra_services","backport:version","v9.1.0","v8.19.0","v8.18.1","v9.0.1","v8.17.6"],"title":"[APM] Optional chaining to prevent undefined error in `custom_link_flyout.tsx`","number":219668,"url":"https://github.com/elastic/kibana/pull/219668","mergeCommit":{"message":"[APM] Optional chaining to prevent undefined error in `custom_link_flyout.tsx` (#219668)\n\n## Summary\n\nPrevent `TypeError: Cannot read properties of undefined (reading\n'name')` in `custom_link_flyout.tsx`.\n\nBefore:\n\n\nhttps://github.com/user-attachments/assets/385228fe-1421-46fb-bfee-da1efe829fcb\n\nAfter:\n\n\nhttps://github.com/user-attachments/assets/76da5646-962f-4a6f-9eb5-f7632444e795\n\n### How to test:\n1. Mock empty `transaction.name` property in `CustomLinkFlyout`\ncomponent\n2. Visit Service -> Transaction -> Check for `Investigate` dropdown in\ntrace waterfall","sha":"f5a226fcacf08f0b9654adc15d85c8ffa61d25b4"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0","8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219668","number":219668,"mergeCommit":{"message":"[APM] Optional chaining to prevent undefined error in `custom_link_flyout.tsx` (#219668)\n\n## Summary\n\nPrevent `TypeError: Cannot read properties of undefined (reading\n'name')` in `custom_link_flyout.tsx`.\n\nBefore:\n\n\nhttps://github.com/user-attachments/assets/385228fe-1421-46fb-bfee-da1efe829fcb\n\nAfter:\n\n\nhttps://github.com/user-attachments/assets/76da5646-962f-4a6f-9eb5-f7632444e795\n\n### How to test:\n1. Mock empty `transaction.name` property in `CustomLinkFlyout`\ncomponent\n2. Visit Service -> Transaction -> Check for `Investigate` dropdown in\ntrace waterfall","sha":"f5a226fcacf08f0b9654adc15d85c8ffa61d25b4"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Milosz Marcinkowski <38698566+miloszmarcinkowski@users.noreply.github.com>
1 parent 5b416cd commit 69dac8d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • x-pack/solutions/observability/plugins/apm/public/components/shared/transaction_action_menu

x-pack/solutions/observability/plugins/apm/public/components/shared/transaction_action_menu/custom_link_flyout.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export function CustomLinkFlyout({
2525
const filters = useMemo(
2626
() =>
2727
[
28-
{ key: 'service.name', value: transaction?.service.name },
29-
{ key: 'service.environment', value: transaction?.service.environment },
30-
{ key: 'transaction.name', value: transaction?.transaction.name },
31-
{ key: 'transaction.type', value: transaction?.transaction.type },
28+
{ key: 'service.name', value: transaction?.service?.name },
29+
{ key: 'service.environment', value: transaction?.service?.environment },
30+
{ key: 'transaction.name', value: transaction?.transaction?.name },
31+
{ key: 'transaction.type', value: transaction?.transaction?.type },
3232
].filter((filter): filter is Filter => typeof filter.value === 'string'),
3333
[transaction]
3434
);

0 commit comments

Comments
 (0)