From 0c064da31255f09ac21473797159b210bd5dc9ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Tue, 7 Jul 2020 20:26:26 +0200 Subject: [PATCH] [APM] Quote trace id to ensure a word is searched (#69500) (#69504) (#70977) * [APM] Quote trace id to ensure a word is searched (#69500) Signed-off-by: Mathis Raguin * [APM] Fix TransactionActionMenu tests (one test was not updated) Co-authored-by: Elastic Machine Co-authored-by: Mathis Co-authored-by: Elastic Machine --- .../__test__/TransactionActionMenu.test.tsx | 2 +- .../shared/TransactionActionMenu/__test__/sections.test.ts | 6 +++--- .../components/shared/TransactionActionMenu/sections.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/TransactionActionMenu.test.tsx b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/TransactionActionMenu.test.tsx index ec546b5c6280f..0a2cb90fdd5da 100644 --- a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/TransactionActionMenu.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/TransactionActionMenu.test.tsx @@ -94,7 +94,7 @@ describe('TransactionActionMenu component', () => { expect(mock.core.application.navigateToApp).toHaveBeenCalledWith('logs', { path: - 'link-to/logs?time=1545092070952&filter=trace.id:%228b60bd32ecc6e1506735a8b6cfcf175c%22%20OR%208b60bd32ecc6e1506735a8b6cfcf175c', + 'link-to/logs?time=1545092070952&filter=trace.id:%228b60bd32ecc6e1506735a8b6cfcf175c%22%20OR%20%228b60bd32ecc6e1506735a8b6cfcf175c%22', }); }); diff --git a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/sections.test.ts b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/sections.test.ts index b2adc6cdac4a6..50325e0b9d604 100644 --- a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/sections.test.ts +++ b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/sections.test.ts @@ -42,7 +42,7 @@ describe('Transaction action menu', () => { key: 'traceLogs', label: 'Trace logs', href: - 'some-basepath/app/logs/link-to/logs?time=1580986800&filter=trace.id:%22123%22%20OR%20123', + 'some-basepath/app/logs/link-to/logs?time=1580986800&filter=trace.id:%22123%22%20OR%20%22123%22', condition: true, }, ], @@ -113,7 +113,7 @@ describe('Transaction action menu', () => { key: 'traceLogs', label: 'Trace logs', href: - 'some-basepath/app/logs/link-to/logs?time=1580986800&filter=trace.id:%22123%22%20OR%20123', + 'some-basepath/app/logs/link-to/logs?time=1580986800&filter=trace.id:%22123%22%20OR%20%22123%22', condition: true, }, ], @@ -183,7 +183,7 @@ describe('Transaction action menu', () => { key: 'traceLogs', label: 'Trace logs', href: - 'some-basepath/app/logs/link-to/logs?time=1580986800&filter=trace.id:%22123%22%20OR%20123', + 'some-basepath/app/logs/link-to/logs?time=1580986800&filter=trace.id:%22123%22%20OR%20%22123%22', condition: true, }, ], diff --git a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/sections.ts b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/sections.ts index d3a9ade3925a1..5ca0285eb4eeb 100644 --- a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/sections.ts +++ b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/sections.ts @@ -180,7 +180,7 @@ export const getSections = ({ path: `/link-to/logs`, query: { time, - filter: `trace.id:"${transaction.trace.id}" OR ${transaction.trace.id}`, + filter: `trace.id:"${transaction.trace.id}" OR "${transaction.trace.id}"`, }, }), condition: true,