From b62dcf25d6d35625ac1f6b8683a21bc049d14d21 Mon Sep 17 00:00:00 2001 From: Oleksandr Dubenko Date: Wed, 26 Jun 2024 13:57:56 +0200 Subject: [PATCH] frontend: Fix table search when some values are undefined Signed-off-by: Oleksandr Dubenko --- frontend/src/components/common/Resource/ResourceTable.tsx | 2 +- .../ingress/__snapshots__/List.Items.stories.storyshot | 4 ++-- .../node/__snapshots__/List.Nodes.stories.storyshot | 4 ++-- .../storage/__snapshots__/ClassList.Items.stories.storyshot | 4 ++-- .../storage/__snapshots__/VolumeList.Items.stories.storyshot | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/common/Resource/ResourceTable.tsx b/frontend/src/components/common/Resource/ResourceTable.tsx index 28b96112f8..2f5d8b5532 100644 --- a/frontend/src/components/common/Resource/ResourceTable.tsx +++ b/frontend/src/components/common/Resource/ResourceTable.tsx @@ -272,7 +272,7 @@ function ResourceTableContent(props: ResourceTableProps) { }; if ('getValue' in column) { - mrtColumn.accessorFn = column.getValue; + mrtColumn.accessorFn = item => column.getValue?.(item) ?? ''; } else if ('getter' in column) { mrtColumn.accessorFn = column.getter; } else { diff --git a/frontend/src/components/ingress/__snapshots__/List.Items.stories.storyshot b/frontend/src/components/ingress/__snapshots__/List.Items.stories.storyshot index e3b3bf6521..ade1547a66 100644 --- a/frontend/src/components/ingress/__snapshots__/List.Items.stories.storyshot +++ b/frontend/src/components/ingress/__snapshots__/List.Items.stories.storyshot @@ -414,12 +414,12 @@ Class Name