Skip to content

fix(calm-hub-ui): render object property values as JSON in node sidebar#2747

Merged
jpgough-ms merged 1 commit into
finos:mainfrom
jpgough-ms:issue-2745-calmhub-ui-interface-properties-with-non-primitive
Jun 25, 2026
Merged

fix(calm-hub-ui): render object property values as JSON in node sidebar#2747
jpgough-ms merged 1 commit into
finos:mainfrom
jpgough-ms:issue-2745-calmhub-ui-interface-properties-with-non-primitive

Conversation

@jpgough-ms

Copy link
Copy Markdown
Member

Description

Fixes #2745. Interface properties fields whose values are nested objects rendered as [object Object] in the visualizer node/interface sidebar because String({...}) was used to coerce all values to a display string.

Introduces a PropertyValue component that pretty-prints objects and arrays as indented JSON in a <pre> block, while preserving existing String() behaviour for primitives and null.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✅ Test additions or updates

Affected Components

  • CALM Hub UI (calm-hub-ui/)

Commit Message Format ✅

fix(calm-hub-ui): render object property values as JSON in node sidebar

Testing

  • I have tested my changes locally
  • I have added/updated unit tests
  • All existing tests pass

Regression tests added to detail-components.test.tsx:

  • PropertiesSection — nested object renders as JSON (not [object Object])
  • PropertiesSection — array value renders as JSON
  • PropertiesSectionnull value still renders as "null"
  • InterfacesSection — exact rate-limit shape from the issue renders as JSON

Checklist

  • My commits follow the conventional commit format
  • I have updated documentation if necessary
  • I have added tests for my changes (if applicable)
  • My changes follow the project's coding standards

Code review notes

Two findings from pre-PR review worth tracking:

  • JSON.stringify has no try/catch — circular refs would crash the sidebar; CALM data from the REST API is always JSON-safe but a defensive guard could be added as follow-up.
  • <pre> blocks in the flex justify-between interface card rows will expand the row height for object values — intentional given the chosen pretty-print style, but worth a visual check on narrow viewports.

String(value) on a nested object yields [object Object]; use a PropertyValue
component that pretty-prints objects/arrays with JSON.stringify.
@github-actions github-actions Bot added the calm-hub-ui Affects `calm-hub-ui` label Jun 25, 2026
@jpgough-ms jpgough-ms marked this pull request as ready for review June 25, 2026 06:28
@jpgough-ms jpgough-ms requested a review from a team as a code owner June 25, 2026 06:28
@jpgough-ms jpgough-ms merged commit c44120a into finos:main Jun 25, 2026
17 checks passed
@jpgough-ms jpgough-ms deleted the issue-2745-calmhub-ui-interface-properties-with-non-primitive branch June 25, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

calm-hub-ui Affects `calm-hub-ui`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CalmHub UI: interface properties with non-primitive values render as [object Object]

2 participants