File tree Expand file tree Collapse file tree
src/plugins/discover/public/services/doc_views/components/doc_viewer_table Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import {
2727import { i18n } from '@kbn/i18n' ;
2828import { FormattedMessage } from '@kbn/i18n-react' ;
2929import { debounce } from 'lodash' ;
30+ import { getTypeForFieldIcon } from '../../../../application/main/components/sidebar/discover_field' ;
3031import { useDiscoverServices } from '../../../../utils/use_discover_services' ;
3132import { Storage } from '../../../../../../kibana_utils/public' ;
3233import { usePager } from '../../../../utils/use_pager' ;
@@ -153,11 +154,19 @@ export const DocViewerTable = ({
153154 [ currentDataViewId , pinnedFields , storage ]
154155 ) ;
155156
157+ // const getTypeForFieldIcon = (field: DataViewField) =>
158+ // field.type === 'string' && field.esTypes ? field.esTypes[0] : field.type;
159+
156160 const fieldToItem = useCallback (
157161 ( field : string ) => {
158162 const fieldMapping = mapping ( field ) ;
159163 const displayName = fieldMapping ?. displayName ?? field ;
160- const fieldType = isNestedFieldParent ( field , dataView ) ? 'nested' : fieldMapping ?. type ;
164+ // const fieldType = isNestedFieldParent(field, dataView) ? 'nested' : fieldMapping?.type;
165+ const fieldType = isNestedFieldParent ( field , dataView )
166+ ? 'nested'
167+ : fieldMapping
168+ ? getTypeForFieldIcon ( fieldMapping )
169+ : undefined ;
161170
162171 const ignored = getIgnoredReason ( fieldMapping ?? field , hit . _ignored ) ;
163172
You can’t perform that action at this time.
0 commit comments