From 7c7b011537e3dd791bf5ef31e67cfaf3d66bf131 Mon Sep 17 00:00:00 2001 From: Arpit Date: Wed, 11 May 2022 15:01:12 +0530 Subject: [PATCH] [inspector] followup to #2789 (#3027) * followup to: 2789 * Revert "followup to: 2789" This reverts commit 8a2b8b90a46b2fa497a4e41c9223e5339191b1d1. * followup to: 2789 --- frontend/src/_ui/JSONTreeViewer/JSONNode.jsx | 4 ++-- frontend/src/_ui/JSONTreeViewer/JSONNodeValue.jsx | 6 +++++- frontend/src/_ui/JSONTreeViewer/JSONTreeViewer.jsx | 5 ++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/frontend/src/_ui/JSONTreeViewer/JSONNode.jsx b/frontend/src/_ui/JSONTreeViewer/JSONNode.jsx index 97f348e6cd..99223424ab 100644 --- a/frontend/src/_ui/JSONTreeViewer/JSONNode.jsx +++ b/frontend/src/_ui/JSONTreeViewer/JSONNode.jsx @@ -327,10 +327,10 @@ export const JSONNode = ({ data, ...restProps }) => {
updateHoveredNode(currentNode, currentNodePath)} + onMouseLeave={() => updateHoveredNode(null)} >
updateHoveredNode(currentNode, currentNodePath)} - onMouseLeave={() => updateHoveredNode(null)} className={cx('d-flex', { 'group-object-container': shouldDisplayIntendedBlock, 'mx-2': typeofCurrentNode !== 'Object' && typeofCurrentNode !== 'Array', diff --git a/frontend/src/_ui/JSONTreeViewer/JSONNodeValue.jsx b/frontend/src/_ui/JSONTreeViewer/JSONNodeValue.jsx index 1596a50d83..f58ba2b2db 100644 --- a/frontend/src/_ui/JSONTreeViewer/JSONNodeValue.jsx +++ b/frontend/src/_ui/JSONTreeViewer/JSONNodeValue.jsx @@ -15,7 +15,11 @@ const JSONTreeValueNode = ({ data, type }) => { ); } - const value = type === 'String' ? `"${data}"` : String(data); + let value = type === 'String' ? `"${data}"` : String(data); + if (value.length > 65) { + value = `${value.substring(0, 65)} ... "`; + } + const clsForUndefinedOrNull = (type === 'Undefined' || type === 'Null') && 'badge badge-secondary'; return (