From ea1b9bc81b47742a36708009eefe2c266696775e Mon Sep 17 00:00:00 2001 From: Oliver Gupte Date: Wed, 31 Oct 2018 00:11:34 -0700 Subject: [PATCH] [APM] fixes #24563 by de-duping the column field id 'sample' (#24690) (#24877) * [APM] fixes #24563 by replacing de-duping the twice-used column field id * [APM] fixed issue with service column not sorting in ManagedTable * [APM] make render field on ITableColumn optional and allowing it to use EUI's default value --- .../components/app/TraceOverview/TraceList.tsx | 16 +++++++--------- .../components/shared/ManagedTable/index.tsx | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/x-pack/plugins/apm/public/components/app/TraceOverview/TraceList.tsx b/x-pack/plugins/apm/public/components/app/TraceOverview/TraceList.tsx index f9f674d39b519..65f3f93bc5437 100644 --- a/x-pack/plugins/apm/public/components/app/TraceOverview/TraceList.tsx +++ b/x-pack/plugins/apm/public/components/app/TraceOverview/TraceList.tsx @@ -6,7 +6,6 @@ import React from 'react'; import styled from 'styled-components'; -import { Transaction } from '../../../../typings/Transaction'; import { ITransactionGroup } from '../../../../typings/TransactionGroup'; import { fontSizes, truncate } from '../../../style/variables'; // @ts-ignore @@ -30,23 +29,22 @@ interface Props { const traceListColumns: ITableColumn[] = [ { - field: 'sample', + field: 'name', name: 'Name', width: '40%', sortable: true, - render: (transaction: Transaction) => ( - - - {transaction.transaction.name} + render: (name, group: ITransactionGroup) => ( + + + {name} ) }, { - field: 'sample', + field: 'sample.context.service.name', name: 'Originating service', - sortable: true, - render: (transaction: Transaction) => transaction.context.service.name + sortable: true }, { field: 'averageResponseTime', diff --git a/x-pack/plugins/apm/public/components/shared/ManagedTable/index.tsx b/x-pack/plugins/apm/public/components/shared/ManagedTable/index.tsx index c963a0b458554..1b426121fce63 100644 --- a/x-pack/plugins/apm/public/components/shared/ManagedTable/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/ManagedTable/index.tsx @@ -18,7 +18,7 @@ export interface ITableColumn { align?: string; width?: string; sortable?: boolean; - render: (value: any, item?: any) => any; + render?: (value: any, item?: any) => any; } export interface IManagedTableProps {