From eeafdc8bc14284c512dd4f380e72d3a4e93b5f7e Mon Sep 17 00:00:00 2001 From: Wylie Conlon Date: Mon, 22 Feb 2021 12:58:36 -0500 Subject: [PATCH] [Discover] Always show the "hide missing fields" toggle (#91889) (#92212) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../components/sidebar/discover_field_search.test.tsx | 7 +++++++ .../components/sidebar/discover_field_search.tsx | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_search.test.tsx b/src/plugins/discover/public/application/components/sidebar/discover_field_search.test.tsx index 04562cbd26520..ec680b062c9ba 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_search.test.tsx +++ b/src/plugins/discover/public/application/components/sidebar/discover_field_search.test.tsx @@ -99,6 +99,13 @@ describe('DiscoverFieldSearch', () => { expect(badge.text()).toEqual('0'); }); + test('missing switch appears with new fields api', () => { + const component = mountComponent({ ...defaultProps, useNewFieldsApi: true }); + const btn = findTestSubject(component, 'toggleFieldFilterButton'); + btn.simulate('click'); + expect(findTestSubject(component, 'missingSwitch').exists()).toBeTruthy(); + }); + test('change in filters triggers onChange', () => { const onChange = jest.fn(); const component = mountComponent({ ...defaultProps, ...{ onChange } }); diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx b/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx index 1e99959d77134..67dda6dd0e9a8 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx +++ b/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx @@ -232,9 +232,6 @@ export function DiscoverFieldSearch({ onChange, value, types, useNewFieldsApi }: }; const footer = () => { - if (useNewFieldsApi) { - return null; - } return (