Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ interface Props {
fieldIconProps?: Omit<FieldIconProps, 'type'>;
scripted?: boolean;
highlight?: string;
disableMultiFieldBadge?: boolean;
}

export function FieldName({
Expand All @@ -35,6 +36,7 @@ export function FieldName({
displayNameOverride,
scripted = false,
highlight = '',
disableMultiFieldBadge = false,
}: Props) {
const typeName = getFieldTypeName(fieldType);
const fieldMappingDisplayName = fieldMapping?.displayName ? fieldMapping.displayName : fieldName;
Expand Down Expand Up @@ -78,7 +80,7 @@ export function FieldName({
</EuiToolTip>
</EuiFlexItem>

{isMultiField && (
{isMultiField && !disableMultiFieldBadge && (
<EuiToolTip
position="top"
delay="long"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ export const DocViewerTable = ({

const flattened = hit.flattened;
const shouldShowFieldHandler = useMemo(
() => getShouldShowFieldHandler(Object.keys(flattened), dataView, showMultiFields),
[flattened, dataView, showMultiFields]
() =>
getShouldShowFieldHandler(Object.keys(flattened), dataView, isEsqlMode || showMultiFields),
[flattened, dataView, isEsqlMode, showMultiFields]
);

const mapping = useCallback((name: string) => dataView.fields.getByName(name), [dataView.fields]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ interface TableCellProps {
rowIndex: number;
columnId: string;
isDetails: boolean;
isESQLMode: boolean;
onFindSearchTermMatch?: UseTableFiltersReturn['onFindSearchTermMatch'];
}

export const TableCell: React.FC<TableCellProps> = React.memo(
({ searchTerm, rows, rowIndex, columnId, isDetails, onFindSearchTermMatch }) => {
({ searchTerm, rows, rowIndex, columnId, isDetails, isESQLMode, onFindSearchTermMatch }) => {
const { fieldsMetadata } = getUnifiedDocViewerServices();

const row = rows[rowIndex];
Expand Down Expand Up @@ -62,6 +63,7 @@ export const TableCell: React.FC<TableCellProps> = React.memo(
fieldMapping={dataViewField}
scripted={dataViewField?.scripted}
highlight={nameHighlight}
disableMultiFieldBadge={isESQLMode}
/>

{isDetails && !!dataViewField ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,12 @@ export function TableGrid({
rowIndex={rowIndex}
columnId={columnId}
isDetails={isDetails}
isESQLMode={isEsqlMode}
onFindSearchTermMatch={onFindSearchTermMatch}
/>
);
},
[searchTerm, rows, onFindSearchTermMatch]
[searchTerm, rows, isEsqlMode, onFindSearchTermMatch]
);

const renderCellPopover = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ export function AttributesOverview({
const flattened = hit.flattened;

const shouldShowFieldHandler = useMemo(
() => getShouldShowFieldHandler(Object.keys(flattened), dataView, showMultiFields),
[flattened, dataView, showMultiFields]
() =>
getShouldShowFieldHandler(Object.keys(flattened), dataView, isEsqlMode || showMultiFields),
[flattened, dataView, isEsqlMode, showMultiFields]
);

const attributesTitle = getAttributesTitle(hit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export const AttributesTable = ({
rowIndex={rowIndex}
columnId={columnId}
isDetails={false}
isESQLMode={isEsqlMode}
/>
)}
columnVisibility={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

expect(await findFirstDocViewerTokens()).to.eql([
'Text',
'Keyword',
'Text',
'Keyword',
'Date',
'Text',
'Keyword',
'Number',
'IP address',
'Text',
'Geo point',
'Keyword',
'Keyword',
]);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const fieldNames = await Promise.all(fieldNameCells.map((cell) => cell.getVisibleText()));

expect(
fieldNames.join(',').startsWith('@message,@tags,@timestamp,agent,bytes,clientip')
fieldNames.join(',').startsWith('@message,@message.raw,@tags,@tags.raw,@timestamp,agent')
).to.be(true);
});

Expand Down Expand Up @@ -319,7 +319,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
let fieldNames = await Promise.all(fieldNameCells.map((cell) => cell.getVisibleText()));

expect(
fieldNames.join(',').startsWith('@message,@tags,@timestamp,agent,bytes,clientip')
fieldNames.join(',').startsWith('@message,@message.raw,@tags,@tags.raw,@timestamp,agent')
).to.be(true);

await showOnlySelectedFieldsSwitch.click();
Expand All @@ -343,7 +343,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await retry.waitFor('updates after switching from showing only selected', async () => {
fieldNameCells = await find.allByCssSelector('.kbnDocViewer__fieldName');
fieldNames = await Promise.all(fieldNameCells.map((cell) => cell.getVisibleText()));
return fieldNames.join(',').startsWith('agent,@message,@tags');
return fieldNames.join(',').startsWith('agent,@message,@message.raw');
});
});
});
Expand Down