s1seven / schema-tools

Tools to create, validate and render certificates using Material Identity JSON schemas
https://materialidentity.org/
Apache License 2.0
1 stars 1 forks source link

bug: unit not render in PDF for `OtherMechanicalTests` #198

Closed stiebitzhofer closed 1 year ago

stiebitzhofer commented 1 year ago

Description

What keywords did you search in schema-tools issues before filing this one ?

Is this a BUG REPORT or FEATURE REQUEST ? BUG

Environment: EN 10168 Schema version 0.4.1 on https://app.s1seven.com

What you expected to happen: The unit given for key-value objects in the object OtherMechanicalTests is not rendered in PDFs. It is rendered correctly in HTML.

"OtherMechanicalTests": {
  "C50": {
    "Key": "Verfestigungsversuch",
    "Value": "0.223",
    "Unit": "n-Wert",
    "Type": "number"
  }
}

Rendering HTML:

Bildschirm­foto 2023-02-23 um 14 57 02

Rendering PDF:

Bildschirm­foto 2023-02-23 um 14 56 15

How to reproduce it: The used JSON can be shared private on request.

getlarge commented 1 year ago

The OtherMechanicalTests properties are rendered in renderOtherMechanicalTests and obviously the units are missing.

We could refactor the renderKVObjectTests function to make it usable in renderOtherMechanicalTests as well.