@measurequick/measurequick-report-generator 1.5.140 → 1.5.141

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measurequick/measurequick-report-generator",
3
- "version": "1.5.140",
3
+ "version": "1.5.141",
4
4
  "description": "Generates PDF documents for various measureQuick applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -412,17 +412,29 @@ export async function getReport(payload, _test) {
412
412
  pfLabels.splice(3, 1);
413
413
  }
414
414
  for (let i = 0; i < passFails.length; i++) {
415
- let meas = test.testInfo[passFails[i]];
416
- let icon = meas
417
- ? meas == "Pass" || meas == "High" || meas == "Mid"
418
- ? iconRangeGreen
419
- : iconRangeRed
420
- : undefined;
421
- if (meas == "Caution") icon = iconRangeYellow;
422
- if (passFails[i] == "heating_efficiency_pass_fail")
415
+ const meas = test.testInfo[passFails[i]];
416
+
417
+ // If no value provided, hide the label (set empty) and skip icon
418
+ if (meas === undefined || meas === null || meas === "") {
419
+ safeSetText(form, `SSR${i + 1}`, "");
420
+ continue;
421
+ }
422
+
423
+ // Choose icon based on value
424
+ let icon;
425
+ if (meas === "Caution") {
426
+ icon = iconRangeYellow;
427
+ } else if (meas === "Pass" || meas === "High" || meas === "Mid") {
428
+ icon = iconRangeGreen;
429
+ } else {
430
+ icon = iconRangeRed;
431
+ }
432
+ if (passFails[i] === "heating_efficiency_pass_fail")
423
433
  icon = iconRangeGreen;
434
+
424
435
  safeSetImage(form, `ImageSubsystem${i + 1}_af_image`, icon);
425
- let suffix = test.testInfo[passFails[i] + "_override"] ? " *" : "";
436
+
437
+ const suffix = test.testInfo[passFails[i] + "_override"] ? " *" : "";
426
438
  safeSetText(form, `SSR${i + 1}`, pfLabels[i] + suffix);
427
439
  }
428
440
  } else safeSetText(form, `SSR1`, "Not yet reviewed");