fix: number attributes not showing up in raw view (#4541)

This commit is contained in:
Vikrant Gupta 2024-02-14 12:22:12 +05:30 committed by GitHub
parent c75a44c620
commit 0dffd86287
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,7 +12,7 @@ import { useCopyLogLink } from 'hooks/logs/useCopyLogLink';
// hooks // hooks
import { useIsDarkMode } from 'hooks/useDarkMode'; import { useIsDarkMode } from 'hooks/useDarkMode';
import { FlatLogData } from 'lib/logs/flatLogData'; import { FlatLogData } from 'lib/logs/flatLogData';
import { isEmpty, isUndefined } from 'lodash-es'; import { isEmpty, isNumber, isUndefined } from 'lodash-es';
import { import {
KeyboardEvent, KeyboardEvent,
MouseEvent, MouseEvent,
@ -73,7 +73,14 @@ function RawLogView({
const attributesValues = updatedSelecedFields const attributesValues = updatedSelecedFields
.map((field) => flattenLogData[field.name]) .map((field) => flattenLogData[field.name])
.filter((attribute) => !isUndefined(attribute) && !isEmpty(attribute)); .filter((attribute) => {
// loadash isEmpty doesnot work with numbers
if (isNumber(attribute)) {
return true;
}
return !isUndefined(attribute) && !isEmpty(attribute);
});
let attributesText = attributesValues.join(' | '); let attributesText = attributesValues.join(' | ');