Skip to content
Snippets Groups Projects
Commit 107799e1 authored by Dennis Collaris's avatar Dennis Collaris Committed by Leonardo Christino
Browse files

fix: prevent nodelink crash when selecting a node

parent 4d8c6d1b
No related branches found
No related tags found
1 merge request!323fix: prevent nodelink crash when selecting a node
Pipeline #141668 passed
...@@ -11,7 +11,7 @@ export const SelectionConfig = () => { ...@@ -11,7 +11,7 @@ export const SelectionConfig = () => {
if (!selection) return null; if (!selection) return null;
return ( return (
<div className="border-b py-2"> <div className="border-b py-2 overflow-auto">
<div className="flex justify-between items-center px-4 py-2"> <div className="flex justify-between items-center px-4 py-2">
<span className="text-xs font-bold">Selection</span> <span className="text-xs font-bold">Selection</span>
<Button <Button
...@@ -27,19 +27,19 @@ export const SelectionConfig = () => { ...@@ -27,19 +27,19 @@ export const SelectionConfig = () => {
{selection.content.map((item, index) => ( {selection.content.map((item, index) => (
<React.Fragment key={index + 'id'}> <React.Fragment key={index + 'id'}>
<div className="flex justify-between items-center px-4 py-1 gap-1"> <div className="flex justify-between items-center px-4 py-1 gap-1">
<span className="text-xs font-normal">ID</span> <span className="text-xs font-semibold pr-2">ID</span>
<span className="text-xs">{item._id}</span> <span className="text-xs">{item._id}</span>
</div> </div>
<div key={index + 'label'} className="flex justify-between items-center px-4 py-1 gap-1"> <div key={index + 'label'} className="flex justify-between items-center px-4 py-1 gap-1">
<span className="text-xs font-normal">Label</span> <span className="text-xs font-semibold pr-2">Label</span>
<EntityPill title={item.attributes['labels'] as string}></EntityPill> <EntityPill title={item.attributes['labels'] as string}></EntityPill>
</div> </div>
{Object.entries(item.attributes).map(([key, value]) => { {Object.entries(item.attributes).map(([key, value]) => {
if (key === 'labels' || key === '_id') return null; if (key === 'labels' || key === '_id' || value instanceof Object) return null;
return ( return (
<div key={index + key} className="flex justify-between items-center px-4 py-1 gap-1"> <div key={index + key} className="flex justify-between items-center px-4 py-1 gap-1">
<span className="text-xs font-normal break-all max-w-[6rem]">{String(key)}</span> <span className="text-xs font-semibold pr-2 whitespace-nowrap max-w-[6rem]">{String(key)}</span>
<span className="text-xs break-all">{value as string}</span> <span className="text-xs break-all">{String(value)}</span>
</div> </div>
); );
})} })}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment