From c40ce1e66f63cee7f40d89d3d627a1bf908d7206 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 21 Feb 2023 08:22:02 -0500 Subject: [PATCH] [8.7] [APM] Display numeric labels at the top of metadata section (#151575) (#151694) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Backport This will backport the following commits from `main` to `8.7`: - [[APM] Display numeric labels at the top of metadata section (#151575)](https://github.com/elastic/kibana/pull/151575) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Søren Louv-Jansen --- .../apm/public/components/shared/metadata_table/helper.ts | 2 +- .../components/shared/metadata_table/metadata_table.test.tsx | 4 +--- .../apm/public/components/shared/metadata_table/types.ts | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/apm/public/components/shared/metadata_table/helper.ts b/x-pack/plugins/apm/public/components/shared/metadata_table/helper.ts index c9e0f2aa66745..67e2d2b85500b 100644 --- a/x-pack/plugins/apm/public/components/shared/metadata_table/helper.ts +++ b/x-pack/plugins/apm/public/components/shared/metadata_table/helper.ts @@ -43,7 +43,7 @@ export const getSectionsFromFields = (fields: Record) => { const [labelSections, otherSections] = partition( sections, - (section) => section.key === 'labels' + (section) => section.key === 'labels' || section.key === 'numeric_labels' ); return [...labelSections, ...otherSections]; diff --git a/x-pack/plugins/apm/public/components/shared/metadata_table/metadata_table.test.tsx b/x-pack/plugins/apm/public/components/shared/metadata_table/metadata_table.test.tsx index 084729a08146d..f973879c7029f 100644 --- a/x-pack/plugins/apm/public/components/shared/metadata_table/metadata_table.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/metadata_table/metadata_table.test.tsx @@ -28,11 +28,10 @@ const renderOptions = { describe('MetadataTable', () => { it('shows sections', () => { const sections: SectionDescriptor[] = [ - { key: 'foo', label: 'Foo', required: true, properties: [] }, + { key: 'foo', label: 'Foo', properties: [] }, { key: 'bar', label: 'Bar', - required: false, properties: [ { field: 'props.A', value: ['A'] }, { field: 'props.B', value: ['B'] }, @@ -59,7 +58,6 @@ describe('MetadataTable', () => { { key: 'foo', label: 'Foo', - required: true, properties: [], }, ]; diff --git a/x-pack/plugins/apm/public/components/shared/metadata_table/types.ts b/x-pack/plugins/apm/public/components/shared/metadata_table/types.ts index 3ce7698460f30..fc08f3de24614 100644 --- a/x-pack/plugins/apm/public/components/shared/metadata_table/types.ts +++ b/x-pack/plugins/apm/public/components/shared/metadata_table/types.ts @@ -8,6 +8,5 @@ export interface SectionDescriptor { key: string; label: string; - required?: boolean; properties: Array<{ field: string; value: string[] | number[] }>; }