[inspector] followup to #2789 (#3027)

* followup to: 2789

* Revert "followup to: 2789"

This reverts commit 8a2b8b90a4.

* followup to: 2789
This commit is contained in:
Arpit 2022-05-11 15:01:12 +05:30 committed by GitHub
parent e8ca5cbc73
commit 7c7b011537
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View file

@ -327,10 +327,10 @@ export const JSONNode = ({ data, ...restProps }) => {
<div
style={{ width: 'inherit' }}
className={`${shouldDisplayIntendedBlock && 'group-border'} ${applySelectedNodeStyles && 'selected-node'}`}
onMouseEnter={() => updateHoveredNode(currentNode, currentNodePath)}
onMouseLeave={() => updateHoveredNode(null)}
>
<div
onMouseEnter={() => updateHoveredNode(currentNode, currentNodePath)}
onMouseLeave={() => updateHoveredNode(null)}
className={cx('d-flex', {
'group-object-container': shouldDisplayIntendedBlock,
'mx-2': typeofCurrentNode !== 'Object' && typeofCurrentNode !== 'Array',

View file

@ -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 (
<span

View file

@ -157,10 +157,9 @@ export class JSONTreeViewer extends React.Component {
newPath = `${path}.${key}`;
}
if (_.isObject(value) || _.isArray(value)) {
buildMap(value, newPath);
} else if (_.isFunction(value)) {
if (_.isObject(value)) {
map.set(newPath, { type: _type });
buildMap(value, newPath);
} else {
map.set(newPath, { type: _type });
}