Skip to content

Commit

Permalink
Remove invalid leftover
Browse files Browse the repository at this point in the history
  • Loading branch information
majagrubic committed Jul 28, 2021
1 parent 3f4438f commit 2ad5f68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,23 +482,4 @@ describe('DocViewTable at Discover Doc with Fields API', () => {

expect(findTestSubject(component, 'tableDocViewRow-city.raw').length).toBe(1);
});

it('renders multifield rows if showMultiFields flag is not set and searchFieldsFromSource is set', () => {
(getServices as jest.Mock).mockImplementationOnce(() => ({
uiSettings: {
get: (key: string) => {
return key === 'discover:searchFieldsFromSource';
},
},
}));
const component = mountComponent(props);

const categoryKeywordRow = findTestSubject(component, 'tableDocViewRow-category.keyword');
expect(categoryKeywordRow.length).toBe(1);

expect(
findTestSubject(component, 'tableDocViewRow-customer_first_name.keyword-multifieldBadge')
.length
).toBe(1);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import React, { useCallback, useMemo, useState } from 'react';
import { EuiInMemoryTable } from '@elastic/eui';
import { IndexPattern, IndexPatternField } from '../../../../../data/public';
import { SEARCH_FIELDS_FROM_SOURCE, SHOW_MULTIFIELDS } from '../../../../common';
import { SHOW_MULTIFIELDS } from '../../../../common';
import { getServices } from '../../../kibana_services';
import { isNestedFieldParent } from '../../apps/main/utils/nested_fields';
import {
Expand Down Expand Up @@ -54,9 +54,7 @@ export const DocViewerTable = ({
onAddColumn,
onRemoveColumn,
}: DocViewRenderProps) => {
const { uiSettings } = getServices();
const showMultiFields =
uiSettings.get(SHOW_MULTIFIELDS) || uiSettings.get(SEARCH_FIELDS_FROM_SOURCE);
const showMultiFields = uiSettings.get(SHOW_MULTIFIELDS);

const mapping = useCallback((name) => indexPattern?.fields.getByName(name), [
indexPattern?.fields,
Expand Down

0 comments on commit 2ad5f68

Please sign in to comment.