Logs: Fix shouldRemoveField (#71882)

This commit is contained in:
Ivana Huckova 2023-07-18 19:12:25 +02:00 committed by GitHub
parent dfb94ff396
commit 72c92ca187
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,6 +92,11 @@ export function shouldRemoveField(
shouldRemoveLine = true,
shouldRemoveTime = true
) {
// field that has empty value (we want to keep 0 or empty string)
if (field.values[row.rowIndex] == null) {
return true;
}
// hidden field, remove
if (field.config.custom?.hidden) {
return true;
@ -101,12 +106,6 @@ export function shouldRemoveField(
if ((field.config.links ?? []).length > 0) {
return false;
}
// field that has empty value (we want to keep 0 or empty string)
if (field.values[row.rowIndex] == null) {
return true;
}
// the remaining checks use knowledge of how we parse logs-dataframes
// Remove field if it is: