From 8a2b8b90a46b2fa497a4e41c9223e5339191b1d1 Mon Sep 17 00:00:00 2001 From: arpitnath Date: Tue, 10 May 2022 20:55:14 +0530 Subject: [PATCH] followup to: 2789 --- frontend/src/_styles/theme.scss | 1 + frontend/src/_ui/JSONTreeViewer/JSONNode.jsx | 4 ++-- frontend/src/_ui/JSONTreeViewer/JSONNodeValue.jsx | 7 ++++++- frontend/src/_ui/JSONTreeViewer/JSONTreeViewer.jsx | 5 ++++- package-lock.json | 2 +- plugins/package-lock.json | 1 + server/package-lock.json | 4 ++++ 7 files changed, 19 insertions(+), 5 deletions(-) diff --git a/frontend/src/_styles/theme.scss b/frontend/src/_styles/theme.scss index 88d19298f9..2b8cfb6386 100644 --- a/frontend/src/_styles/theme.scss +++ b/frontend/src/_styles/theme.scss @@ -4964,6 +4964,7 @@ div#driver-page-overlay { .json-tree-valuetype { font-size: 10px; padding-top: 2px; + width: fit-content !important; } .node-length-color { color: #3650AF; diff --git a/frontend/src/_ui/JSONTreeViewer/JSONNode.jsx b/frontend/src/_ui/JSONTreeViewer/JSONNode.jsx index 97f348e6cd..973ee9b7a3 100644 --- a/frontend/src/_ui/JSONTreeViewer/JSONNode.jsx +++ b/frontend/src/_ui/JSONTreeViewer/JSONNode.jsx @@ -325,12 +325,12 @@ export const JSONNode = ({ data, ...restProps }) => {
updateHoveredNode(currentNode, currentNodePath)} + onMouseLeave={() => updateHoveredNode(null)} style={{ width: 'inherit' }} className={`${shouldDisplayIntendedBlock && 'group-border'} ${applySelectedNodeStyles && 'selected-node'}`} >
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..3a44331725 100644 --- a/frontend/src/_ui/JSONTreeViewer/JSONNodeValue.jsx +++ b/frontend/src/_ui/JSONTreeViewer/JSONNodeValue.jsx @@ -15,7 +15,12 @@ const JSONTreeValueNode = ({ data, type }) => { ); } - const value = type === 'String' ? `"${data}"` : String(data); + let value = type === 'String' ? `"${data}"` : String(data); + + if (value.length > 60) { + value = `${value.substring(0, 60)} ... "`; + } + const clsForUndefinedOrNull = (type === 'Undefined' || type === 'Null') && 'badge badge-secondary'; return (