From ff985a0e8ecfc597ae05eb98279a110d6d55d847 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Wed, 5 Feb 2025 08:41:20 -0700 Subject: [PATCH 01/34] 254 : Added value, type and decimalPlaces to label_value_wrapper and label_value. --- src/components/label_value.tsx | 4 +++- src/components/label_value_wrapper.tsx | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/components/label_value.tsx b/src/components/label_value.tsx index bf9d868c..d36a6776 100644 --- a/src/components/label_value.tsx +++ b/src/components/label_value.tsx @@ -10,10 +10,12 @@ import React from 'react' */ interface LabelValueProps { label?: string - value: string + value?: string | number | boolean required?: boolean prefix?: string suffix?: string + type: 'string' | 'number' | 'date' | 'boolean' + decimalPlaces?: number } /** diff --git a/src/components/label_value_wrapper.tsx b/src/components/label_value_wrapper.tsx index df888697..51ee9a97 100644 --- a/src/components/label_value_wrapper.tsx +++ b/src/components/label_value_wrapper.tsx @@ -4,14 +4,25 @@ import { get } from 'lodash' import LabelValue from './label_value' interface LabelValueWrapperProps { - label: string - path: string + label?: string + path?: string prefix?: string suffix?: string required?: boolean parent?: any + value?: string | number | boolean + type: 'string' | 'number' | 'date' | 'boolean' + decimalPlaces?: number } +// value (optional): The data to be displayed. +// type (required): The type of the data (string, number, date, or boolean). +// label (optional): A label to display alongside the value. +// path (optional): The path in the data object (from DB) where the value can be found. +// decimalPlaces (optional, default: 1): The number of decimal places to use when formatting numeric values. +// prefix (optional): A string to prepend to the value (e.g., a currency symbol). +// suffix (optional): A string to append to the value (e.g., a percentage symbol). + /** * `LabelValueWrapper` is a React functional component that renders a label-value pair, * where the value is retrieved from a context (`StoreContext`) or an optional parent object based on the provided `path`. @@ -40,6 +51,8 @@ const LabelValueWrapper: React.FC = ({ suffix, parent = null, required = false, + decimalPlaces = 1, + type, }: LabelValueWrapperProps): JSX.Element | null => { const [parentData, _] = useState(parent?.data_) return ( @@ -55,6 +68,8 @@ const LabelValueWrapper: React.FC = ({ required={required} prefix={prefix} suffix={suffix} + decimalPlaces={decimalPlaces} + type={type} /> ) }} From 784d7d96b6c4d13dd05793d9796c591ec7b56652 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Wed, 5 Feb 2025 09:38:31 -0700 Subject: [PATCH 02/34] 254 : Added a test area for LabelValues --- src/App.css | 5 +++++ src/components/label_value.tsx | 1 + ...ira_doe_workflow_electric_cooking_appliance.mdx | 14 ++++++++++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/App.css b/src/App.css index eb08d787..29b0a086 100644 --- a/src/App.css +++ b/src/App.css @@ -1,3 +1,8 @@ +.test-label-section { + background-color: pink; + margin: 10px; + padding: 20px; +} .App { text-align: center; } diff --git a/src/components/label_value.tsx b/src/components/label_value.tsx index d36a6776..e2a439b1 100644 --- a/src/components/label_value.tsx +++ b/src/components/label_value.tsx @@ -38,6 +38,7 @@ const LabelValue: React.FC = ({ required = false, prefix = '', suffix = '', + type, }: LabelValueProps): JSX.Element | null => { return required || value ? ( label ? ( diff --git a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx index b60ecdf0..8ef4cd24 100644 --- a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx +++ b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx @@ -1,3 +1,8 @@ +
+

This is a test section

+

LabelValue with no props:

+ +
## Existing Conditions @@ -7,7 +12,7 @@ - Please take a photo of the nameplate of the electric cooking appliance showing the model number and serial number. + Please take a photo of the nameplate of the electric cooking appliance showing the model number and serial number. Please take a picture of the circuit breaker that powers the electric cooling appliance. @@ -37,12 +42,12 @@ ## Installation - Photo of the nameplate of the electric cooking appliance showing the model number and serial number + Photo of the nameplate of the electric cooking appliance showing the model number and serial number Photo of the circuit breaker that powers the electric cooling appliance - + Photo of the gas pipe showing it is off and capped @@ -54,5 +59,6 @@

What is the fuel type of the new stovetop/oven/range?

+
-
\ No newline at end of file + From 68232e7ac649e3c7f5930bf5e3673c67daf04e6c Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Wed, 5 Feb 2025 10:21:32 -0700 Subject: [PATCH 03/34] 254 : Added some styling to the test area and an error message about the type prop being undefined. --- src/App.css | 11 +++++++ src/components/label_value_wrapper.tsx | 3 ++ ...oe_workflow_electric_cooking_appliance.mdx | 29 ++++++++++++++++++- 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/App.css b/src/App.css index 29b0a086..3abe9eb1 100644 --- a/src/App.css +++ b/src/App.css @@ -3,6 +3,17 @@ margin: 10px; padding: 20px; } + +.test-label-section > h1, +.test-label-section > h2 { + text-align: left; + justify-self: unset; +} + +.test-label-section .label-value-container { + border: 1px solid black; + padding: 10px; +} .App { text-align: center; } diff --git a/src/components/label_value_wrapper.tsx b/src/components/label_value_wrapper.tsx index 51ee9a97..78f620f7 100644 --- a/src/components/label_value_wrapper.tsx +++ b/src/components/label_value_wrapper.tsx @@ -54,6 +54,9 @@ const LabelValueWrapper: React.FC = ({ decimalPlaces = 1, type, }: LabelValueWrapperProps): JSX.Element | null => { + if (type == undefined) { + console.error('Type must be defined in in MDX file.') + } const [parentData, _] = useState(parent?.data_) return ( diff --git a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx index 8ef4cd24..4871242c 100644 --- a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx +++ b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx @@ -1,7 +1,34 @@

This is a test section

+ +

Enter a value to be retrieved by the LabelValues below

+ + +

LabelValue with no props:

- + + `` + +
+ +
+ +

LabelValue with path prop:

+ + `` + +
+ +
+ +

LabelValue with number type prop:

+ + `` + +
+ +
+
From edcb827ebf8b67cc1220a979564fa313fa885d7e Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Thu, 6 Feb 2025 16:51:34 -0700 Subject: [PATCH 04/34] 254 : Added some examples of number values and number values being rounded. Wrote in some error checks. --- src/components/label_value.tsx | 28 ++++++++++++++- src/components/label_value_wrapper.tsx | 7 ++-- ...oe_workflow_electric_cooking_appliance.mdx | 35 ++++++++++++++++--- 3 files changed, 61 insertions(+), 9 deletions(-) diff --git a/src/components/label_value.tsx b/src/components/label_value.tsx index e2a439b1..410c67bf 100644 --- a/src/components/label_value.tsx +++ b/src/components/label_value.tsx @@ -38,8 +38,34 @@ const LabelValue: React.FC = ({ required = false, prefix = '', suffix = '', - type, + decimalPlaces = 1, + type = 'string', }: LabelValueProps): JSX.Element | null => { + //If type is "number" and decimalPlaces, round the value + if (type === 'number' && typeof value === 'number') { + // debugger + //check that value is actually a number + //Need to do this because TS can't do its job in MDX files and there's a chance that + //someone could pass bad values in via props + + if ( + typeof value === 'number' && + !isNaN(value) && + typeof decimalPlaces === 'number' && + !isNaN(decimalPlaces) + ) { + value = value.toFixed(decimalPlaces) + } else { + console.log( + 'Make sure that your value and decimalPlaces params are actually numbers.', + ) + } + } else if (type === 'number' && typeof value !== 'number') { + console.log( + `You are trying to set the type of a non-number value to 'number'. Value is : ${value} and typeof value is: ${typeof value}`, + ) + } + return required || value ? ( label ? (
diff --git a/src/components/label_value_wrapper.tsx b/src/components/label_value_wrapper.tsx index 78f620f7..ef9da4b0 100644 --- a/src/components/label_value_wrapper.tsx +++ b/src/components/label_value_wrapper.tsx @@ -11,7 +11,7 @@ interface LabelValueWrapperProps { required?: boolean parent?: any value?: string | number | boolean - type: 'string' | 'number' | 'date' | 'boolean' + type?: 'string' | 'number' | 'date' | 'boolean' decimalPlaces?: number } @@ -51,8 +51,8 @@ const LabelValueWrapper: React.FC = ({ suffix, parent = null, required = false, - decimalPlaces = 1, - type, + decimalPlaces, + type = 'string', }: LabelValueWrapperProps): JSX.Element | null => { if (type == undefined) { console.error('Type must be defined in in MDX file.') @@ -64,6 +64,7 @@ const LabelValueWrapper: React.FC = ({ const data_object = parent ? parentData : data const key = path == null ? '' : path const value = get(data_object, key) + // debugger return (

This is a test section

-

Enter a value to be retrieved by the LabelValues below

+

Enter a text value to be retrieved by the LabelValues below

- + + +

Enter a number value to be retrieved by the LabelValues below

+ +

LabelValue with no props:

@@ -15,7 +19,7 @@

LabelValue with path prop:

- `` + ``
@@ -23,10 +27,31 @@

LabelValue with number type prop:

- `` + `` + +
+ +
+ +

+ LabelValue with number type prop and string value (Will console.log an error + message) +

+ + + +
- +
From 379e9f20d960bba931afb2e1f2085b0d2fa28da6 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Tue, 11 Feb 2025 08:48:52 -0700 Subject: [PATCH 05/34] 254 : Text, number, suffix, prefix, decimal places all working. --- ...oe_workflow_electric_cooking_appliance.mdx | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx index 538e223a..a4035ea7 100644 --- a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx +++ b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx @@ -33,17 +33,43 @@
+

LabelValue with number type prop + decimal places:

+ + `` + +
+ +
+ +

LabelValue with number type prop + decimal places:

+ + `` + +
+ +
+

LabelValue with number type prop and string value (Will console.log an error message)

- + />`
From eb550b5777719c5c2464ccb58faa76e6379dea69 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Wed, 12 Feb 2025 08:54:07 -0700 Subject: [PATCH 06/34] 254 : Added a date example and capability. --- public/print.css | 537 ++++++++++-------- src/components/label_value.tsx | 19 +- ...oe_workflow_electric_cooking_appliance.mdx | 22 +- 3 files changed, 316 insertions(+), 262 deletions(-) diff --git a/public/print.css b/public/print.css index 37f08c59..3abe9eb1 100644 --- a/public/print.css +++ b/public/print.css @@ -1,443 +1,464 @@ +.test-label-section { + background-color: pink; + margin: 10px; + padding: 20px; +} + +.test-label-section > h1, +.test-label-section > h2 { + text-align: left; + justify-self: unset; +} + +.test-label-section .label-value-container { + border: 1px solid black; + padding: 10px; +} .App { - text-align: center; + text-align: center; } .App-logo { - height: 40vmin; - pointer-events: none; + height: 40vmin; + pointer-events: none; } @media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } + .App-logo { + animation: App-logo-spin infinite 20s linear; + } } -.align-right{ - text-align: right; +.align-right { + text-align: right; } .App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; } .App-link { - color: #61dafb; + color: #61dafb; } @keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } } /* Code below are added by PNNL */ /*Headings*/ h1 { - font-size: 1.5rem; - text-align: center; - break-after: avoid-page; - justify-self: center; + font-size: 1.5rem; + text-align: center; + break-after: avoid-page; + justify-self: center; } h2 { - break-after: avoid-page; - font-size: 1.25rem; + break-after: avoid-page; + font-size: 1.25rem; } -h2:not(.accordion-header, h1+h2) { - margin-top: 30px; +h2:not(.accordion-header, h1 + h2) { + margin-top: 30px; } h3 { - font-size: 1rem; - break-after: avoid-page; + font-size: 1rem; + break-after: avoid-page; } /* used in all templates - for report title */ h1 + h2 { - text-align: center; + text-align: center; } /* used in mdx_project_details_view.tsx */ h1 + h3 { - text-align: center; + text-align: center; } /* used in workflows_view.tsx, mdx_template_view.tsx, job_view.tsx */ -.address -{ - text-align: center; +.address { + text-align: center; } /* used in home.tsx */ .flex-container { - display: flex; - flex-direction: row; - gap: 10px; - align-items: flex-start; - align-content: center; - justify-content: space-around; + display: flex; + flex-direction: row; + gap: 10px; + align-items: flex-start; + align-content: center; + justify-content: space-around; } .flex-child { - flex: 1; - align-self: top; + flex: 1; + align-self: top; } /* used in jobs_view.tsx */ .icon-container { - float: right; - vertical-align: top; + float: right; + vertical-align: top; } .button-container-right { - padding-left: 0.75rem; - padding-right: 0.75rem; - float: right; + padding-left: 0.75rem; + padding-right: 0.75rem; + float: right; } .button-container-center { - float: center; - padding-left: 0.75rem; - padding-right: 0.75rem; + float: center; + padding-left: 0.75rem; + padding-right: 0.75rem; } - - .menu-container { - float: right; - vertical-align: top; + float: right; + vertical-align: top; } - .img-thumbnail { - object-fit: contain; - max-height: 500px; + object-fit: contain; + max-height: 500px; } /* jobs_view.tsx & collapsible.tsx */ .bottom-margin { - margin-bottom: 10px; + margin-bottom: 10px; } +.string-input-modal { + .error { + color: red; + font-style: italic; + } +} -.string-input-modal{ - .error{ +.error { color: red; font-style: italic; - } } -.error{ - color: red; - font-style: italic; -} - - /* root_layout.tsx */ #root-flex-layout { - display: flex; - align-items: center; - justify-content: center; + display: flex; + align-items: center; + justify-content: center; } #root-background { - margin-left: auto; - margin-right: auto; - max-width: 800px; - background-color: rgba(231, 231, 231); - min-height: 100vh; + margin-left: auto; + margin-right: auto; + max-width: 800px; + background-color: rgba(231, 231, 231); + min-height: 100vh; } #root-banner { - background-color: #006100; + background-color: #006100; } #root-title { - color: gold; - font-size: 2rem; + color: gold; + font-size: 2rem; } #root-body { - padding-top: 1rem; - padding-bottom: 1rem; + padding-top: 1rem; + padding-bottom: 1rem; } #back-button-logo { - color: white; - height: 100%; + color: white; + height: 100%; } #back-button { - padding: 1rem; - background-color: #006100; + padding: 1rem; + background-color: #006100; } #back-button-link { - text-decoration: none; + text-decoration: none; } #back-button-container { - margin-left: 0.5rem; - margin-right: 0.5rem; + margin-left: 0.5rem; + margin-right: 0.5rem; } /* editor-flexbox.tsx */ -.editor-textarea{ - height: auto; - min-height: 700px; - resize: none; +.editor-textarea { + height: auto; + min-height: 700px; + resize: none; } /* photo_input.tsx */ .input-card { - page-break-before: always; - margin-bottom: 1rem; + page-break-before: always; + margin-bottom: 1rem; } /*also in radio.tsx*/ /* stylizes the hidden input for photo upload*/ .photo-upload-input { - display: none; + display: none; } /* photo.tsx */ .photo-card { - break-inside: avoid; - margin-bottom: 1rem; - margin-top: 1rem; + break-inside: avoid; + margin-bottom: 1rem; + margin-top: 1rem; +} + +.photo-card > .card-body > div { + margin-bottom: 1rem; } .photo-row { - display: grid; - grid-template-columns: 1fr 1fr; /* Forces two columns */ - gap: 1rem; + display: grid; + grid-template-columns: 1fr 1fr; /* Forces two columns */ + gap: 1rem; +} + +.photo-notes h3 { + font-weight: bold; +} + +.photo-notes .photo-note-string { + margin-bottom: unset; } /* stylizes tab component here to avoid putting styles in editor*/ .tab-content { - margin-top: 1rem; + margin-top: 1rem; } /* styling for PDFRenderer component */ -.react-pdf__Page__textContent{ +.react-pdf__Page__textContent { display: none; - } +} /* 'hint' styling - the input components */ -.form-text{ - margin-left:.50rem; - margin-top:.25rem; - font-size:.875rem; - color:var(--bs-secondary-color); - font-style: italic; +.form-text { + margin-left: 0.5rem; + margin-top: 0.25rem; + font-size: 0.875rem; + color: var(--bs-secondary-color); + font-style: italic; } /* label styling for the Radio component */ .custom-label { - color: gray; - font-size: .9rem; + color: gray; + font-size: 0.9rem; } - /* BETA version text - styling for new templates - temperary */ .beta-text { - color: red; - padding-left: .75rem; - font-size: 0.9rem; + color: red; + padding-left: 0.75rem; + font-size: 0.9rem; } /* used in home.tsx */ .padding { - padding: 5px 10px 5px 10px; /* top right bottom left*/ + padding: 5px 10px 5px 10px; /* top right bottom left*/ } -.top-bottom-padding -{ - padding: 5px 0 5px 0; +.top-bottom-padding { + padding: 5px 0 5px 0; } /* disclaimer text */ .disclaimer-text { - padding-left: .75rem; - padding-right: .75rem; - font-size: 0.9rem; - font-weight: bold; + padding-left: 0.75rem; + padding-right: 0.75rem; + font-size: 0.9rem; + font-weight: bold; } .combustion_tests { - padding: 5px 10px 5px 10px; - background-color: white; + padding: 5px 10px 5px 10px; + background-color: white; } .align_justify { - justify-content: center; - text-align: justify; + justify-content: center; + text-align: justify; } .margin-left { - margin-left: 2em + margin-left: 2em; } - /* Primary Button - with background color */ .btn-primary { - color: #fff; /* Text color */ - background-color: #006100; /* Base background color */ - border: 2px solid #006100; - cursor: pointer; - text-align: center; - text-decoration: none; - display: inline-block; - transition: background-color 0.3s ease, border-color 0.3s ease; - outline: none; -} - -.btn-primary:hover, -.btn-primary:active, -.btn-primary:focus, -.btn-primary:focus-visible, + color: #fff; /* Text color */ + background-color: #006100; /* Base background color */ + border: 2px solid #006100; + cursor: pointer; + text-align: center; + text-decoration: none; + display: inline-block; + transition: + background-color 0.3s ease, + border-color 0.3s ease; + outline: none; +} + +.btn-primary:hover, +.btn-primary:active, +.btn-primary:focus, +.btn-primary:focus-visible, .btn-primary:focus-within { - background-color: #004d00; - border-color: #004d00; + background-color: #004d00; + border-color: #004d00; } .btn-primary:disabled { - background-color: #4caf50; - border-color: #4caf50; - cursor: not-allowed; /* Not-allowed cursor on disabled */ - opacity: 0.6; + background-color: #4caf50; + border-color: #4caf50; + cursor: not-allowed; /* Not-allowed cursor on disabled */ + opacity: 0.6; } /* Outline Primary Button - only outline */ .btn-outline-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active, .show > .btn-primary.dropdown-toggle { - color: #fff; - background-color: #005f00; - border-color: #005f00; + color: #fff; + background-color: #005f00; + border-color: #005f00; } .btn-outline-primary:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-primary.dropdown-toggle:focus { - box-shadow: none + box-shadow: none; } -.btn-outline-primary{ - background-color: transparent; - cursor: pointer; - border: 2px solid #006100; - color: #006100; - +.btn-outline-primary { + background-color: transparent; + cursor: pointer; + border: 2px solid #006100; + color: #006100; } -.btn-outline-primary:hover{ - background-color: transparent; - color: #006100; - border-color: #006100; +.btn-outline-primary:hover { + background-color: transparent; + color: #006100; + border-color: #006100; } - /* Light Button - for Icons */ .btn-light { - background-color: transparent; - border-color: transparent; - color: #000000; + background-color: transparent; + border-color: transparent; + color: #000000; } btn-light:active, btn-light:hover { - box-shadow: none; + box-shadow: none; } .welcome-header { - padding-left: 1rem; - padding-right: 1rem; - color: #006100; - font-size: 28px; - font-weight: bold; + padding-left: 1rem; + padding-right: 1rem; + color: #006100; + font-size: 28px; + font-weight: bold; } .welcome-content { - padding-left: 1.5rem; - padding-right: 1.5rem; - color: #000000; - font-size: 14px; - font-weight: bold; -} - -@media (max-width: 480px) { - .welcome-content { padding-left: 1.5rem; padding-right: 1.5rem; color: #000000; - font-size: 12px; + font-size: 14px; font-weight: bold; - } } +@media (max-width: 480px) { + .welcome-content { + padding-left: 1.5rem; + padding-right: 1.5rem; + color: #000000; + font-size: 12px; + font-weight: bold; + } +} .loader { - border: 8px solid #f3f3f3; /* Light gray */ - border-top: 8px solid #3498db; /* Blue */ - border-radius: 50%; - width: 30px; /* Size of the loader */ - height: 30px; /* Size of the loader */ - animation: spin 1s linear infinite; /* Animation */ - background-color: white; + border: 8px solid #f3f3f3; /* Light gray */ + border-top: 8px solid #3498db; /* Blue */ + border-radius: 50%; + width: 30px; /* Size of the loader */ + height: 30px; /* Size of the loader */ + animation: spin 1s linear infinite; /* Animation */ + background-color: white; } @keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } } - /* used in photo-input and photo component */ .photo-container { - width: auto; /* Allow width to adjust based on content */ - max-width: 500px; /* Maximum width */ - overflow: visible; /* Hide overflow */ - height: auto; /* Allow height to adjust based on content */ - max-height: 600px; /* Maximum height */ - margin-bottom: 5px; /* Margin at the bottom */ - position: relative; /* Relative positioning for overlay elements */ - display: inline-block; /* Display inline-block to shrink to content size */ + width: auto; /* Allow width to adjust based on content */ + max-width: 500px; /* Maximum width */ + overflow: visible; /* Hide overflow */ + height: auto; /* Allow height to adjust based on content */ + max-height: 600px; /* Maximum height */ + margin-bottom: 5px; /* Margin at the bottom */ + position: relative; /* Relative positioning for overlay elements */ + display: inline-block; /* Display inline-block to shrink to content size */ } .photo-report-container { - width: auto; /* Allow width to adjust based on content */ - max-width: 500px; /* Maximum width */ - overflow: hidden; /* Hide overflow */ - height: auto; /* Allow height to adjust based on content */ - max-height: 600px; /* Maximum height */ - position: relative; /* Relative positioning for overlay elements */ - display: inline-block; /* Display inline-block to shrink to content size */ + width: auto; /* Allow width to adjust based on content */ + max-width: 500px; /* Maximum width */ + overflow: hidden; /* Hide overflow */ + height: auto; /* Allow height to adjust based on content */ + max-height: 600px; /* Maximum height */ + position: relative; /* Relative positioning for overlay elements */ + display: inline-block; /* Display inline-block to shrink to content size */ } /* used in photo-input component */ .photo-delete-button { - position: absolute; - top: 15px; - right: 15px; - border-radius: 50%; - padding: 5px; - z-index: 5; /* Ensures the button stays on top */ - cursor: pointer; - transform: scale(1.2); /* Increase icon size */ - stroke-width: 2; + position: absolute; + top: 15px; + right: 15px; + border-radius: 50%; + padding: 5px; + z-index: 5; /* Ensures the button stays on top */ + cursor: pointer; + transform: scale(1.2); /* Increase icon size */ + stroke-width: 2; } /* used in photo-input component */ -.image-tag { - width: '400px'; /* Fixed width */ - height: '400px'; /* Fixed height */ - object-fit: 'cover'; /* Ensure the image covers the area (cropped if necessary) */ - border-radius: '8px'; /*Optional: adds rounded corners to the image */ +.image-tag { + width: '400px'; /* Fixed width */ + height: '400px'; /* Fixed height */ + object-fit: 'cover'; /* Ensure the image covers the area (cropped if necessary) */ + border-radius: '8px'; /*Optional: adds rounded corners to the image */ } /* used in photo-input component */ @@ -451,41 +472,53 @@ btn-light:hover { /* used in photo-input component */ .custom-modal { - max-width: 300px; - margin: auto; + max-width: 300px; + margin: auto; +} + +/* Used in text_input component */ +.label-hidden.form-floating > label { + visibility: hidden; +} + +.label-hidden.form-floating > textarea { + padding: 1rem 0.75rem !important; +} + +.text-area-expanded.form-floating > textarea { + height: 100px; } /* Default font size */ .modal-body-text { - font-size: 18px; /* Adjust the default font size */ + font-size: 18px; /* Adjust the default font size */ } /* Common font size for medium, small, and extra small devices */ @media (max-width: 991.98px) { - .modal-body-text { - font-size: 14px; /* Adjust font size for all specified devices */ - } + .modal-body-text { + font-size: 14px; /* Adjust font size for all specified devices */ + } } .safari-print-header { -visibility: hidden;} + visibility: hidden; +} @media print { - /* Adjusts the margin for printing */ - @page { - margin-top: 4rem; - margin-bottom: 4rem; - } - - - .safari-print-header { - text-align: center; - font-size: 10px; - font-weight: bold; - visibility: visible; - margin-bottom: 10px; - display: block; - page-break-before: always; - } - + /* Adjusts the margin for printing */ + @page { + margin-top: 4rem; + margin-bottom: 4rem; + } + + .safari-print-header { + text-align: center; + font-size: 10px; + font-weight: bold; + visibility: visible; + margin-bottom: 10px; + display: block; + page-break-before: always; + } } diff --git a/src/components/label_value.tsx b/src/components/label_value.tsx index 410c67bf..23e0f148 100644 --- a/src/components/label_value.tsx +++ b/src/components/label_value.tsx @@ -1,4 +1,5 @@ import React from 'react' +import DateStr from './date_str' /** * LabelValueProps defines the props for the LabelValue component. @@ -66,6 +67,18 @@ const LabelValue: React.FC = ({ ) } + if (type === 'boolean' && typeof value === 'boolean') { + if (value) { + value = 'YES' + } else { + value = 'NO' + } + } else if (type === 'boolean' && typeof value !== 'boolean') { + console.log( + `You are trying to set the type of a non-boolean value to 'yes' or 'no'. Value is : ${value} and typeof value is: ${typeof value}`, + ) + } + return required || value ? ( label ? (
@@ -75,7 +88,11 @@ const LabelValue: React.FC = ({ ) : ( <> {prefix} - {value} + {type === 'date' && typeof value === 'string' ? ( + + ) : ( + value + )} {suffix} ) diff --git a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx index a4035ea7..ba26d0e3 100644 --- a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx +++ b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx @@ -59,24 +59,28 @@ />
-

+{/*

LabelValue with number type prop and string value (Will console.log an error message)

- - - ``` +
+ ` + /> +
*/} -
+ +

+ LabelValue with date type +

+``
From 88dd71e01e45ecb31d682c7e83de8754f85d3fc7 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Wed, 12 Feb 2025 13:04:33 -0700 Subject: [PATCH 07/34] 254 : Added some sandbox stuff. --- src/App.tsx | 12 ++ src/components/label_value_wrapper.tsx | 1 - src/components/sandbox.tsx | 157 ++++++++++++++++++ src/components/store.tsx | 1 + src/components/text_input.tsx | 2 + src/components/text_input_wrapper.tsx | 5 +- ...oe_workflow_electric_cooking_appliance.mdx | 86 ---------- 7 files changed, 176 insertions(+), 88 deletions(-) create mode 100644 src/components/sandbox.tsx diff --git a/src/App.tsx b/src/App.tsx index 4705ea21..da54527a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,6 +2,7 @@ import 'bootstrap/dist/css/bootstrap.css' import { createBrowserRouter, RouterProvider } from 'react-router-dom' import './App.css' import React, { Suspense, lazy } from 'react' +import { Sandbox } from './components/sandbox' // Lazily initializes the views, rendering them only when requested. const RootLayout = lazy(() => import('./components/root_layout')) @@ -100,6 +101,17 @@ const routes = [ ), }, + { + path: `/sandbox/:projectId/:workflowName/:jobId`, + // Jobs View: Gathering and displaying information pertinent to individual installations + element: ( + Loading...
}> + + + + + ), + }, // TODO: This route will be revisited and revised in the future // { // path: `/app/:projectId/:workflowName/:jobId/json`, diff --git a/src/components/label_value_wrapper.tsx b/src/components/label_value_wrapper.tsx index ef9da4b0..7f1fb124 100644 --- a/src/components/label_value_wrapper.tsx +++ b/src/components/label_value_wrapper.tsx @@ -64,7 +64,6 @@ const LabelValueWrapper: React.FC = ({ const data_object = parent ? parentData : data const key = path == null ? '' : path const value = get(data_object, key) - // debugger return ( + + {({ data }) => { + // debugger + return
Test
+ }} +
+ + ) +} + +{ + /*
+

This is a test section

+ +

+ {' '} + Enter a text value to be retrieved by the LabelValues below +

+ + + +

+ {' '} + Enter a number value to be retrieved by the LabelValues + below +

+ + + +

LabelValue with no props:

+ + `` + +
+ +
+ +

LabelValue with path prop:

+ + `` + +
+ +
+ +

LabelValue with number type prop:

+ + ` + + ` + +
+ +
+ +

LabelValue with number type prop + decimal places:

+ + ` + + ` + +
+ +
+ +

LabelValue with number type prop + decimal places:

+ + ` + + ` + +
+ +
+ +

+LabelValue with number type prop and string value (Will console.log an error +message) +

+`` +
+ +
+ + +

LabelValue with date type

+ + ` + + ` + +
+ +
+
*/ +} diff --git a/src/components/store.tsx b/src/components/store.tsx index 84ca3d77..cd5439fe 100644 --- a/src/components/store.tsx +++ b/src/components/store.tsx @@ -297,6 +297,7 @@ export const StoreProvider: FC = ({ * @param value The value that is to be updated/inserted */ const upsertData: UpsertData = (pathStr, value) => { + debugger pathStr = 'data_.' + pathStr upsertDoc(pathStr, value) } diff --git a/src/components/text_input.tsx b/src/components/text_input.tsx index 832ab31f..b95e66e2 100644 --- a/src/components/text_input.tsx +++ b/src/components/text_input.tsx @@ -33,6 +33,7 @@ const TextInput: FC = ({ max, regexp, }) => { + console.log('Regexp:', regexp) const [floatingLabelClasses, setFloatingLabelClasses] = useState('mb-3') @@ -41,6 +42,7 @@ const TextInput: FC = ({ const [error, setError] = useState('') const handleChange = (inputValue: string) => { + console.log('Regexp:', regexp) if (typeof inputValue !== 'string') { setError('Input must be a string') } else if (inputValue.length < min) { diff --git a/src/components/text_input_wrapper.tsx b/src/components/text_input_wrapper.tsx index f5dd2d87..a860b569 100644 --- a/src/components/text_input_wrapper.tsx +++ b/src/components/text_input_wrapper.tsx @@ -40,7 +40,10 @@ const TextInputWrapper: FC = ({ upsertData(path, value)} + updateValue={(value: any) => { + debugger + upsertData(path, value) + }} value={get(data, path)} min={min} max={max} diff --git a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx index ba26d0e3..6fdba8a6 100644 --- a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx +++ b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx @@ -1,90 +1,4 @@ -
-

This is a test section

-

Enter a text value to be retrieved by the LabelValues below

- - - -

Enter a number value to be retrieved by the LabelValues below

- - - -

LabelValue with no props:

- - `` - -
- -
- -

LabelValue with path prop:

- - `` - -
- -
- -

LabelValue with number type prop:

- - `` - -
- -
- -

LabelValue with number type prop + decimal places:

- - `` - -
- -
- -

LabelValue with number type prop + decimal places:

- - `` - -
- -
- -{/*

- LabelValue with number type prop and string value (Will console.log an error - message) -

-`` -
- -
*/} - - -

- LabelValue with date type -

-`` -
- -
- -
## Existing Conditions From 677491e9e06aea1a5d2a698cfc86332488d3cf2f Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Wed, 12 Feb 2025 14:39:29 -0700 Subject: [PATCH 08/34] Revert "254 : Added some sandbox stuff." This reverts commit 88dd71e01e45ecb31d682c7e83de8754f85d3fc7. --- src/App.tsx | 12 -- src/components/label_value_wrapper.tsx | 1 + src/components/sandbox.tsx | 157 ------------------ src/components/store.tsx | 1 - src/components/text_input.tsx | 2 - src/components/text_input_wrapper.tsx | 5 +- ...oe_workflow_electric_cooking_appliance.mdx | 86 ++++++++++ 7 files changed, 88 insertions(+), 176 deletions(-) delete mode 100644 src/components/sandbox.tsx diff --git a/src/App.tsx b/src/App.tsx index da54527a..4705ea21 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,7 +2,6 @@ import 'bootstrap/dist/css/bootstrap.css' import { createBrowserRouter, RouterProvider } from 'react-router-dom' import './App.css' import React, { Suspense, lazy } from 'react' -import { Sandbox } from './components/sandbox' // Lazily initializes the views, rendering them only when requested. const RootLayout = lazy(() => import('./components/root_layout')) @@ -101,17 +100,6 @@ const routes = [ ), }, - { - path: `/sandbox/:projectId/:workflowName/:jobId`, - // Jobs View: Gathering and displaying information pertinent to individual installations - element: ( - Loading...}> - - - - - ), - }, // TODO: This route will be revisited and revised in the future // { // path: `/app/:projectId/:workflowName/:jobId/json`, diff --git a/src/components/label_value_wrapper.tsx b/src/components/label_value_wrapper.tsx index 7f1fb124..ef9da4b0 100644 --- a/src/components/label_value_wrapper.tsx +++ b/src/components/label_value_wrapper.tsx @@ -64,6 +64,7 @@ const LabelValueWrapper: React.FC = ({ const data_object = parent ? parentData : data const key = path == null ? '' : path const value = get(data_object, key) + // debugger return ( - - {({ data }) => { - // debugger - return
Test
- }} -
- - ) -} - -{ - /*
-

This is a test section

- -

- {' '} - Enter a text value to be retrieved by the LabelValues below -

- - - -

- {' '} - Enter a number value to be retrieved by the LabelValues - below -

- - - -

LabelValue with no props:

- - `` - -
- -
- -

LabelValue with path prop:

- - `` - -
- -
- -

LabelValue with number type prop:

- - ` - - ` - -
- -
- -

LabelValue with number type prop + decimal places:

- - ` - - ` - -
- -
- -

LabelValue with number type prop + decimal places:

- - ` - - ` - -
- -
- -

-LabelValue with number type prop and string value (Will console.log an error -message) -

-`` -
- -
- - -

LabelValue with date type

- - ` - - ` - -
- -
-
*/ -} diff --git a/src/components/store.tsx b/src/components/store.tsx index cd5439fe..84ca3d77 100644 --- a/src/components/store.tsx +++ b/src/components/store.tsx @@ -297,7 +297,6 @@ export const StoreProvider: FC = ({ * @param value The value that is to be updated/inserted */ const upsertData: UpsertData = (pathStr, value) => { - debugger pathStr = 'data_.' + pathStr upsertDoc(pathStr, value) } diff --git a/src/components/text_input.tsx b/src/components/text_input.tsx index b95e66e2..832ab31f 100644 --- a/src/components/text_input.tsx +++ b/src/components/text_input.tsx @@ -33,7 +33,6 @@ const TextInput: FC = ({ max, regexp, }) => { - console.log('Regexp:', regexp) const [floatingLabelClasses, setFloatingLabelClasses] = useState('mb-3') @@ -42,7 +41,6 @@ const TextInput: FC = ({ const [error, setError] = useState('') const handleChange = (inputValue: string) => { - console.log('Regexp:', regexp) if (typeof inputValue !== 'string') { setError('Input must be a string') } else if (inputValue.length < min) { diff --git a/src/components/text_input_wrapper.tsx b/src/components/text_input_wrapper.tsx index a860b569..f5dd2d87 100644 --- a/src/components/text_input_wrapper.tsx +++ b/src/components/text_input_wrapper.tsx @@ -40,10 +40,7 @@ const TextInputWrapper: FC = ({ { - debugger - upsertData(path, value) - }} + updateValue={(value: any) => upsertData(path, value)} value={get(data, path)} min={min} max={max} diff --git a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx index 6fdba8a6..ba26d0e3 100644 --- a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx +++ b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx @@ -1,4 +1,90 @@ +
+

This is a test section

+

Enter a text value to be retrieved by the LabelValues below

+ + + +

Enter a number value to be retrieved by the LabelValues below

+ + + +

LabelValue with no props:

+ + `` + +
+ +
+ +

LabelValue with path prop:

+ + `` + +
+ +
+ +

LabelValue with number type prop:

+ + `` + +
+ +
+ +

LabelValue with number type prop + decimal places:

+ + `` + +
+ +
+ +

LabelValue with number type prop + decimal places:

+ + `` + +
+ +
+ +{/*

+ LabelValue with number type prop and string value (Will console.log an error + message) +

+`` +
+ +
*/} + + +

+ LabelValue with date type +

+`` +
+ +
+ +
## Existing Conditions From f440a54bb4322c52545df8cfbc5ffae05f8cf35f Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Thu, 13 Feb 2025 08:00:09 -0700 Subject: [PATCH 09/34] 254 : Added navigation to the LabelValues examples. --- .../LabelValueExamplesStyles.css | 16 ++++ .../LabelValueExamples/NumberLabelValues.mdx | 91 +++++++++++++++++++ .../LabelValueExamples/TextLabelValues.mdx | 91 +++++++++++++++++++ ...oe_workflow_electric_cooking_appliance.mdx | 86 ------------------ src/templates/playground.mdx | 26 +++++- src/templates/templates_config.ts | 6 +- 6 files changed, 227 insertions(+), 89 deletions(-) create mode 100644 src/templates/LabelValueExamples/LabelValueExamplesStyles.css create mode 100644 src/templates/LabelValueExamples/NumberLabelValues.mdx create mode 100644 src/templates/LabelValueExamples/TextLabelValues.mdx diff --git a/src/templates/LabelValueExamples/LabelValueExamplesStyles.css b/src/templates/LabelValueExamples/LabelValueExamplesStyles.css new file mode 100644 index 00000000..79d6dc81 --- /dev/null +++ b/src/templates/LabelValueExamples/LabelValueExamplesStyles.css @@ -0,0 +1,16 @@ +.label-value-section { + position: relative; +} + +.label-value-section nav { + position: sticky; + top: 0; + background-color: rgba(231, 231, 231); + z-index: 1; + padding: 10px 0px; +} + +.label-value-section ul { + display: flex; + flex-direction: column; +} diff --git a/src/templates/LabelValueExamples/NumberLabelValues.mdx b/src/templates/LabelValueExamples/NumberLabelValues.mdx new file mode 100644 index 00000000..7f202398 --- /dev/null +++ b/src/templates/LabelValueExamples/NumberLabelValues.mdx @@ -0,0 +1,91 @@ +import DateInput from './../../components/date_input_wrapper' +import LabelValue from './../../components/label_value_wrapper' +import NumberInput from './../../components/number_input_wrapper' +import TextInput from './../../components/text_input_wrapper' + +
+

Text Values

+ +

Enter a text value to be retrieved by the LabelValue components below

+ + + +

LabelValue with no props:

+ + `` + +
+ +
+ +

LabelValue with path prop:

+ + `` + +
+ +
+ +

Enter a number value to be retrieved by the LabelValues below

+ + + +

LabelValue with number type prop:

+ + `` + +
+ +
+ +

LabelValue with number type prop + decimal places:

+ + `` + +
+ +
+ +

LabelValue with number type prop + decimal places:

+ + `` + +
+ +
+ + {/*

+ LabelValue with number type prop and string value (Will console.log an error + message) +

+ `` +
+ +
*/} + + +

+ LabelValue with date type +

+ `` +
+ +
+
\ No newline at end of file diff --git a/src/templates/LabelValueExamples/TextLabelValues.mdx b/src/templates/LabelValueExamples/TextLabelValues.mdx new file mode 100644 index 00000000..5f971a03 --- /dev/null +++ b/src/templates/LabelValueExamples/TextLabelValues.mdx @@ -0,0 +1,91 @@ +import DateInput from '../../components/date_input_wrapper' +import LabelValue from '../../components/label_value_wrapper' +import NumberInput from '../../components/number_input_wrapper' +import TextInput from '../../components/text_input_wrapper' + +
+

Text Values

+ +

Enter a text value to be retrieved by the LabelValue components below

+ + + +

LabelValue with no props:

+ + `` + +
+ +
+ +

LabelValue with path prop:

+ + `` + +
+ +
+ +

Enter a number value to be retrieved by the LabelValues below

+ + + +

LabelValue with number type prop:

+ + `` + +
+ +
+ +

LabelValue with number type prop + decimal places:

+ + `` + +
+ +
+ +

LabelValue with number type prop + decimal places:

+ + `` + +
+ +
+ + {/*

+ LabelValue with number type prop and string value (Will console.log an error + message) +

+ `` +
+ +
*/} + + +

+ LabelValue with date type +

+ `` +
+ +
+
\ No newline at end of file diff --git a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx index ba26d0e3..6fdba8a6 100644 --- a/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx +++ b/src/templates/ira_doe_workflow_electric_cooking_appliance.mdx @@ -1,90 +1,4 @@ -
-

This is a test section

-

Enter a text value to be retrieved by the LabelValues below

- - - -

Enter a number value to be retrieved by the LabelValues below

- - - -

LabelValue with no props:

- - `` - -
- -
- -

LabelValue with path prop:

- - `` - -
- -
- -

LabelValue with number type prop:

- - `` - -
- -
- -

LabelValue with number type prop + decimal places:

- - `` - -
- -
- -

LabelValue with number type prop + decimal places:

- - `` - -
- -
- -{/*

- LabelValue with number type prop and string value (Will console.log an error - message) -

-`` -
- -
*/} - - -

- LabelValue with date type -

-`` -
- -
- -
## Existing Conditions diff --git a/src/templates/playground.mdx b/src/templates/playground.mdx index 575a6908..27bbaa7a 100644 --- a/src/templates/playground.mdx +++ b/src/templates/playground.mdx @@ -1,6 +1,28 @@ +import TextLabelValues from './LabelValueExamples/TextLabelValues.mdx' +import NumberLabelValues from './LabelValueExamples/NumberLabelValues.mdx' +import LabelValueExamplesStyles from './LabelValueExamples/LabelValueExamplesStyles.css' # Playground - + + + + + + + -Grade: {props.doc.student.grade} diff --git a/src/templates/templates_config.ts b/src/templates/templates_config.ts index 334003e9..40501e31 100644 --- a/src/templates/templates_config.ts +++ b/src/templates/templates_config.ts @@ -19,7 +19,7 @@ import DOEWorkflowWallAirSealingAndInsulation from './ira_doe_workflow_wall_air_ import DOEWorkflowAtticAirSealingAndInsulation from './ira_doe_workflow_attic_air_sealing_and_insulation.mdx' import IRADOEWorkflowLimitedAssessment from './ira_doe_workflow_limited_assessment.mdx' import DOECombustionApplianceSafetyTests from './doe_workflow_combustion_appliance_safety_tests.mdx' - +import Playground from './playground.mdx' import { MDXProps } from 'mdx/types' interface TemplatesConfig { @@ -117,6 +117,10 @@ const templatesConfig: TemplatesConfig = { title: 'IRA Limited Assessment', template: IRADOEWorkflowLimitedAssessment, }, + playground: { + title: 'Playground', + template: Playground, + }, } // Assuming TemplatesConfig is defined somewhere as a type or interface From 5f23927b5245c6190f68e77d308aed50ea19f7fb Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Thu, 13 Feb 2025 08:57:21 -0700 Subject: [PATCH 10/34] 254: Added examples for numbers, text date and other. Styled a bit. --- src/App.css | 10 +-- .../LabelValueExamples/DateLabelValues.mdx | 32 ++++++++ .../LabelValueExamples/NumberLabelValues.mdx | 75 +++---------------- .../LabelValueExamples/OtherExamples.mdx | 55 ++++++++++++++ .../LabelValueExamples/TextLabelValues.mdx | 73 +----------------- src/templates/playground.mdx | 10 +++ 6 files changed, 115 insertions(+), 140 deletions(-) create mode 100644 src/templates/LabelValueExamples/DateLabelValues.mdx create mode 100644 src/templates/LabelValueExamples/OtherExamples.mdx diff --git a/src/App.css b/src/App.css index 3abe9eb1..87bfdef5 100644 --- a/src/App.css +++ b/src/App.css @@ -1,16 +1,16 @@ -.test-label-section { - background-color: pink; +.playground-section { + background-color: lightgrey; margin: 10px; padding: 20px; } -.test-label-section > h1, -.test-label-section > h2 { +.playground-section > h1, +.playground-section > h2 { text-align: left; justify-self: unset; } -.test-label-section .label-value-container { +.playground-section .label-value-container { border: 1px solid black; padding: 10px; } diff --git a/src/templates/LabelValueExamples/DateLabelValues.mdx b/src/templates/LabelValueExamples/DateLabelValues.mdx new file mode 100644 index 00000000..a0f123a6 --- /dev/null +++ b/src/templates/LabelValueExamples/DateLabelValues.mdx @@ -0,0 +1,32 @@ +import DateInput from '../../components/date_input_wrapper' +import LabelValue from '../../components/label_value_wrapper' + +
+

Date Value Examples

+

Enter a date value to be retrieved by the LabelValues below

+ + + +

LabelValue with date type prop:

+

Default is to round to 1 decimal place.

+ + `` + +
+ +
+ +

LabelValue with date type prop + decimal places + prefix + suffix:

+ + `` + +
+ +
+
\ No newline at end of file diff --git a/src/templates/LabelValueExamples/NumberLabelValues.mdx b/src/templates/LabelValueExamples/NumberLabelValues.mdx index 7f202398..c02b5cee 100644 --- a/src/templates/LabelValueExamples/NumberLabelValues.mdx +++ b/src/templates/LabelValueExamples/NumberLabelValues.mdx @@ -1,36 +1,16 @@ -import DateInput from './../../components/date_input_wrapper' -import LabelValue from './../../components/label_value_wrapper' -import NumberInput from './../../components/number_input_wrapper' -import TextInput from './../../components/text_input_wrapper' - -
-

Text Values

- -

Enter a text value to be retrieved by the LabelValue components below

- - - -

LabelValue with no props:

- - `` - -
- -
- -

LabelValue with path prop:

- - `` - -
- -
+import DateInput from '../../components/date_input_wrapper' +import LabelValue from '../../components/label_value_wrapper' +import NumberInput from '../../components/number_input_wrapper' +import TextInput from '../../components/text_input_wrapper' +
+

Number Value Examples

Enter a number value to be retrieved by the LabelValues below

- +

LabelValue with number type prop:

+

Default is to round to 1 decimal place.

`` @@ -38,7 +18,7 @@ import TextInput from './../../components/text_input_wrapper'
-

LabelValue with number type prop + decimal places:

+

LabelValue with number type prop + decimal places + prefix + suffix:

`` @@ -51,41 +31,4 @@ import TextInput from './../../components/text_input_wrapper' suffix= " per day" />
- -

LabelValue with number type prop + decimal places:

- - `` - -
- -
- - {/*

- LabelValue with number type prop and string value (Will console.log an error - message) -

- `` -
- -
*/} - - -

- LabelValue with date type -

- `` -
- -
\ No newline at end of file diff --git a/src/templates/LabelValueExamples/OtherExamples.mdx b/src/templates/LabelValueExamples/OtherExamples.mdx new file mode 100644 index 00000000..dc31aa0d --- /dev/null +++ b/src/templates/LabelValueExamples/OtherExamples.mdx @@ -0,0 +1,55 @@ +import DateInput from '../../components/date_input_wrapper' +import LabelValue from '../../components/label_value_wrapper' +import NumberInput from '../../components/number_input_wrapper' +import TextInput from '../../components/text_input_wrapper' + +
+

Other Examples

+ +

Enter a text value to be retrieved by the LabelValue components below

+ + + +

LabelValue with no props:

+ + `` + +
+ +
+ +

+ LabelValue with number type prop and string value (Will console.log an error + message) +

+ + `` + +
+ +
+ +

Enter a number value to be retrieved by the LabelValues below

+ + +

+ LabelValue with string type prop and number value (Will show the string value of number with no rounding) +

+ + `` + +
+ +
+ + + +
\ No newline at end of file diff --git a/src/templates/LabelValueExamples/TextLabelValues.mdx b/src/templates/LabelValueExamples/TextLabelValues.mdx index 5f971a03..841bcb69 100644 --- a/src/templates/LabelValueExamples/TextLabelValues.mdx +++ b/src/templates/LabelValueExamples/TextLabelValues.mdx @@ -3,11 +3,9 @@ import LabelValue from '../../components/label_value_wrapper' import NumberInput from '../../components/number_input_wrapper' import TextInput from '../../components/text_input_wrapper' -
-

Text Values

- +
+

Text Value Examples

Enter a text value to be retrieved by the LabelValue components below

-

LabelValue with no props:

@@ -20,72 +18,9 @@ import TextInput from '../../components/text_input_wrapper'

LabelValue with path prop:

- `` - -
- -
- -

Enter a number value to be retrieved by the LabelValues below

- - - -

LabelValue with number type prop:

- - `` - -
- -
- -

LabelValue with number type prop + decimal places:

- - `` - -
- -
- -

LabelValue with number type prop + decimal places:

- - `` + ``
- -
- - {/*

- LabelValue with number type prop and string value (Will console.log an error - message) -

- `` -
- -
*/} - - -

- LabelValue with date type -

- `` -
- +
\ No newline at end of file diff --git a/src/templates/playground.mdx b/src/templates/playground.mdx index 27bbaa7a..a6a2929e 100644 --- a/src/templates/playground.mdx +++ b/src/templates/playground.mdx @@ -1,5 +1,7 @@ import TextLabelValues from './LabelValueExamples/TextLabelValues.mdx' import NumberLabelValues from './LabelValueExamples/NumberLabelValues.mdx' +import OtherExamples from './LabelValueExamples/OtherExamples.mdx' +import DateLabelValues from './LabelValueExamples/DateLabelValues.mdx' import LabelValueExamplesStyles from './LabelValueExamples/LabelValueExamplesStyles.css' # Playground @@ -12,6 +14,8 @@ import LabelValueExamplesStyles from './LabelValueExamples/LabelValueExamplesSty @@ -21,6 +25,12 @@ import LabelValueExamplesStyles from './LabelValueExamples/LabelValueExamplesSty
+
+ +
+
+ +
From 0c3e4db82e6f26da7ed6a009fce1b235d7b1c4cc Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Thu, 13 Feb 2025 09:26:45 -0700 Subject: [PATCH 11/34] 254 : Wrote a test suite for LabelValue. --- src/__tests__/labelValue.test.tsx | 108 ++++++++++++++++++ src/components/label_value.tsx | 12 +- .../LabelValueExamples/DateLabelValues.mdx | 3 - .../LabelValueExamples/TextLabelValues.mdx | 15 +-- src/templates/playground.mdx | 3 - 5 files changed, 121 insertions(+), 20 deletions(-) create mode 100644 src/__tests__/labelValue.test.tsx diff --git a/src/__tests__/labelValue.test.tsx b/src/__tests__/labelValue.test.tsx new file mode 100644 index 00000000..0a2c693e --- /dev/null +++ b/src/__tests__/labelValue.test.tsx @@ -0,0 +1,108 @@ +// src/LabelValue.test.tsx +import React from 'react' +import { render, screen } from '@testing-library/react' +import { StoreContext } from '../components/store' +import LabelValue, { LabelValueProps } from '../components/label_value' + +// Mock StoreContext data +const mockStoreContext = { + docId: 'TestDocID123', + attachments: {}, + data: { location: { state: 'WA', zip_code: '99354' } }, + metadata: {}, +} + +describe('LabelValue Component', () => { + // Helper function to render the component with StoreContext provider + const renderWithContext = ({ + label, + value, + required = false, + prefix = '', + suffix = '', + decimalPlaces = 1, + type = 'string', + }: LabelValueProps) => { + return render( + + + , + ) + } + + test('Label is rendered when label param is present', () => { + renderWithContext({ + label: 'Label Text', + type: 'string', + value: 'test this value', + }) + expect(screen.getByText(/label text/i)).toBeInTheDocument() + }) + + test('Value is rendered when value param is present', () => { + renderWithContext({ + label: 'Label Text', + type: 'string', + value: 'test this value', + }) + expect(screen.getByText(/test this value/i)).toBeInTheDocument() + }) + + test('Number value is rendered correctly with decimal places', () => { + renderWithContext({ + label: 'Label Numeric', + type: 'number', + value: 123.456, + decimalPlaces: 2, + }) + expect(screen.getByText(/123.46/i)).toBeInTheDocument() + }) + + test('Value with prefix and suffix is rendered correctly', () => { + renderWithContext({ + label: 'Label with Prefix and Suffix', + type: 'string', + value: '50', + prefix: '$', + suffix: ' USD', + }) + expect(screen.getByText(/\$50 USD/i)).toBeInTheDocument() + }) + + test('Should render date value correctly', () => { + renderWithContext({ + label: 'Label Date', + type: 'date', + value: '2025-02-14', + }) + expect(screen.getByText(/february 14, 2025/i)).toBeInTheDocument() + }) + + test('Should not render when required is false and value is empty', () => { + const { container } = renderWithContext({ + label: 'Label Text', + type: 'string', + value: '', + required: false, + }) + expect(container.firstChild).toBeNull() + }) + + test('Should render when required is true and value is empty', () => { + renderWithContext({ + label: 'Label Text', + type: 'string', + value: '', + required: true, + }) + expect(screen.getByText(/label text/i)).toBeInTheDocument() + }) +}) diff --git a/src/components/label_value.tsx b/src/components/label_value.tsx index 23e0f148..a0dc5304 100644 --- a/src/components/label_value.tsx +++ b/src/components/label_value.tsx @@ -9,7 +9,7 @@ import DateStr from './date_str' * @property {string} value - The value to display. * @property {boolean} [required=false] - A flag to determine if the label-value pair should be rendered. */ -interface LabelValueProps { +export interface LabelValueProps { label?: string value?: string | number | boolean required?: boolean @@ -83,7 +83,15 @@ const LabelValue: React.FC = ({ label ? (
{label}: - {value} + + {prefix} + {type === 'date' && typeof value === 'string' ? ( + + ) : ( + value + )} + {suffix} +
) : ( <> diff --git a/src/templates/LabelValueExamples/DateLabelValues.mdx b/src/templates/LabelValueExamples/DateLabelValues.mdx index a0f123a6..b1fbc817 100644 --- a/src/templates/LabelValueExamples/DateLabelValues.mdx +++ b/src/templates/LabelValueExamples/DateLabelValues.mdx @@ -24,9 +24,6 @@ import LabelValue from '../../components/label_value_wrapper' \ No newline at end of file diff --git a/src/templates/LabelValueExamples/TextLabelValues.mdx b/src/templates/LabelValueExamples/TextLabelValues.mdx index 841bcb69..9e411218 100644 --- a/src/templates/LabelValueExamples/TextLabelValues.mdx +++ b/src/templates/LabelValueExamples/TextLabelValues.mdx @@ -7,20 +7,11 @@ import TextInput from '../../components/text_input_wrapper'

Text Value Examples

Enter a text value to be retrieved by the LabelValue components below

- -

LabelValue with no props:

- - `` - -
- -
- -

LabelValue with path prop:

+

Text LabelValue:

- `` + ``
- +
\ No newline at end of file diff --git a/src/templates/playground.mdx b/src/templates/playground.mdx index a6a2929e..5bb2178f 100644 --- a/src/templates/playground.mdx +++ b/src/templates/playground.mdx @@ -4,10 +4,7 @@ import OtherExamples from './LabelValueExamples/OtherExamples.mdx' import DateLabelValues from './LabelValueExamples/DateLabelValues.mdx' import LabelValueExamplesStyles from './LabelValueExamples/LabelValueExamplesStyles.css' -# Playground - -
+ diff --git a/src/templates/LabelValueExamples/NumberLabelValues.mdx b/src/templates/LabelValueExamples/NumberLabelValues.mdx index c02b5cee..0b165586 100644 --- a/src/templates/LabelValueExamples/NumberLabelValues.mdx +++ b/src/templates/LabelValueExamples/NumberLabelValues.mdx @@ -1,34 +1,32 @@ -import DateInput from '../../components/date_input_wrapper' -import LabelValue from '../../components/label_value_wrapper' -import NumberInput from '../../components/number_input_wrapper' -import TextInput from '../../components/text_input_wrapper' +import NumberInput from '../../components/number_input_wrapper'; +import LabelValue from '../../components/label_value_wrapper';

Number Value Examples

Enter a number value to be retrieved by the LabelValues below

-

LabelValue with number type prop:

Default is to round to 1 decimal place.

- `` + ``
- +

LabelValue with number type prop + decimal places + prefix + suffix:

- `` + ``
-
\ No newline at end of file + diff --git a/src/templates/LabelValueExamples/OtherExamples.mdx b/src/templates/LabelValueExamples/OtherExamples.mdx index dc31aa0d..3bae88df 100644 --- a/src/templates/LabelValueExamples/OtherExamples.mdx +++ b/src/templates/LabelValueExamples/OtherExamples.mdx @@ -1,7 +1,6 @@ -import DateInput from '../../components/date_input_wrapper' -import LabelValue from '../../components/label_value_wrapper' -import NumberInput from '../../components/number_input_wrapper' -import TextInput from '../../components/text_input_wrapper' +import LabelValue from '../../components/label_value_wrapper'; +import NumberInput from '../../components/number_input_wrapper'; +import TextInput from '../../components/text_input_wrapper';

Other Examples

@@ -23,33 +22,35 @@ import TextInput from '../../components/text_input_wrapper' message) - `` + ``
-

Enter a number value to be retrieved by the LabelValues below

+

+ Enter a number value to be retrieved by the LabelValues below +

+

LabelValue with string type prop and number value (Will show the string value of number with no rounding)

- `` + ``
- - - -
\ No newline at end of file + diff --git a/src/templates/LabelValueExamples/TextLabelValues.mdx b/src/templates/LabelValueExamples/TextLabelValues.mdx index 9e411218..21f18c99 100644 --- a/src/templates/LabelValueExamples/TextLabelValues.mdx +++ b/src/templates/LabelValueExamples/TextLabelValues.mdx @@ -1,13 +1,12 @@ -import DateInput from '../../components/date_input_wrapper' import LabelValue from '../../components/label_value_wrapper' -import NumberInput from '../../components/number_input_wrapper' import TextInput from '../../components/text_input_wrapper'

Text Value Examples

-

Enter a text value to be retrieved by the LabelValue components below

+

Enter a text value to be retrieved by the LabelValue components below:

Text LabelValue:

+

The default type is "string" so it does not need to be provided.

`` From 2ab13e674ac61cca4a697d38759dde3c6a4906bb Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Thu, 13 Feb 2025 11:02:49 -0700 Subject: [PATCH 13/34] 254 : Commented out Playground. --- src/templates/templates_config.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/templates/templates_config.ts b/src/templates/templates_config.ts index 40501e31..a3df9582 100644 --- a/src/templates/templates_config.ts +++ b/src/templates/templates_config.ts @@ -117,10 +117,10 @@ const templatesConfig: TemplatesConfig = { title: 'IRA Limited Assessment', template: IRADOEWorkflowLimitedAssessment, }, - playground: { - title: 'Playground', - template: Playground, - }, + // playground: { + // title: 'Playground', + // template: Playground, + // }, } // Assuming TemplatesConfig is defined somewhere as a type or interface From 6c3d7138fd7d49b17cb58ad01a1740fc813d66fb Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Thu, 13 Feb 2025 12:02:00 -0700 Subject: [PATCH 14/34] 254 : Replaced with . --- .../doe_workflow_combustion_appliance_safety_tests.mdx | 2 +- src/templates/ira_doe_workflow_limited_assessment.mdx | 2 +- src/templates/reusable/project_info_report.mdx | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx b/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx index 4a88e165..96fd77e5 100644 --- a/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx +++ b/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx @@ -201,7 +201,7 @@ --- # Combustion Appliance Safety Testing ## Photo Report - **Assessment Date:**  + diff --git a/src/templates/ira_doe_workflow_limited_assessment.mdx b/src/templates/ira_doe_workflow_limited_assessment.mdx index 889d38bd..a24c8ac5 100644 --- a/src/templates/ira_doe_workflow_limited_assessment.mdx +++ b/src/templates/ira_doe_workflow_limited_assessment.mdx @@ -195,7 +195,7 @@ {props.project.data_.installer?.name ?     {props.project.data_.installer?.name} : null} {props.project.data_.installer?.name ?
: null} {props.project.data_.installer?.company_name ?     {props.project.data_.installer?.company_name} : null}{props.project.data_.installer?.company_name ?
: null} - **Assessment Date:** + **Assessment For:** {props.data.assessment_for} diff --git a/src/templates/reusable/project_info_report.mdx b/src/templates/reusable/project_info_report.mdx index 87894d12..7a0c507e 100644 --- a/src/templates/reusable/project_info_report.mdx +++ b/src/templates/reusable/project_info_report.mdx @@ -17,7 +17,8 @@

<> - Installation Date:  + { /* This will be removed in ticket #249 */} + Installation Date:  From c4ab848a5963cbf1a021edb2ac965271b6af8367 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Thu, 13 Feb 2025 12:05:53 -0700 Subject: [PATCH 15/34] 254 : Added a 'no value' test. --- src/__tests__/labelValue.test.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/__tests__/labelValue.test.tsx b/src/__tests__/labelValue.test.tsx index dd8cddb4..d8a65937 100644 --- a/src/__tests__/labelValue.test.tsx +++ b/src/__tests__/labelValue.test.tsx @@ -96,6 +96,14 @@ describe('LabelValue Component', () => { expect(container.firstChild).toBeNull() }) + test('Should not render when value is empty', () => { + const { container } = renderWithContext({ + label: 'Label Text', + type: 'string', + }) + expect(container.firstChild).toBeNull() + }) + test('Should render when required is true and value is empty', () => { renderWithContext({ label: 'Label Text', From cb5484b88f00eda210a6d0199f6ed82fd4f57944 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Thu, 13 Feb 2025 12:13:54 -0700 Subject: [PATCH 16/34] 254 : Changed types to date in the replaced DateStr instances. --- .../doe_workflow_combustion_appliance_safety_tests.mdx | 2 +- src/templates/ira_doe_workflow_limited_assessment.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx b/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx index 96fd77e5..de0d423f 100644 --- a/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx +++ b/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx @@ -201,7 +201,7 @@ --- # Combustion Appliance Safety Testing ## Photo Report - + diff --git a/src/templates/ira_doe_workflow_limited_assessment.mdx b/src/templates/ira_doe_workflow_limited_assessment.mdx index a24c8ac5..326a7ed0 100644 --- a/src/templates/ira_doe_workflow_limited_assessment.mdx +++ b/src/templates/ira_doe_workflow_limited_assessment.mdx @@ -195,7 +195,7 @@ {props.project.data_.installer?.name ?     {props.project.data_.installer?.name} : null} {props.project.data_.installer?.name ?
: null} {props.project.data_.installer?.company_name ?     {props.project.data_.installer?.company_name} : null}{props.project.data_.installer?.company_name ?
: null} - + **Assessment For:** {props.data.assessment_for} From a86687c550d69319ec318c3a23981216d3417cc1 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Thu, 13 Feb 2025 12:57:13 -0700 Subject: [PATCH 17/34] 254: Added Date options. --- src/components/label_value.tsx | 6 ++++-- src/components/label_value_wrapper.tsx | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/label_value.tsx b/src/components/label_value.tsx index 9bb9cd1c..e876f4d5 100644 --- a/src/components/label_value.tsx +++ b/src/components/label_value.tsx @@ -17,6 +17,7 @@ export interface LabelValueProps { suffix?: string type: 'string' | 'number' | 'date' decimalPlaces?: number + dateOptions?: Intl.DateTimeFormatOptions } /** @@ -41,6 +42,7 @@ const LabelValue: React.FC = ({ suffix = '', decimalPlaces = 1, type = 'string', + dateOptions, }: LabelValueProps): JSX.Element | null => { //If type is "number" and decimalPlaces, round the value if (type === 'number' && typeof value === 'number') { @@ -72,7 +74,7 @@ const LabelValue: React.FC = ({ {prefix} {type === 'date' && typeof value === 'string' ? ( - + ) : ( value )} @@ -83,7 +85,7 @@ const LabelValue: React.FC = ({ <> {prefix} {type === 'date' && typeof value === 'string' ? ( - + ) : ( value )} diff --git a/src/components/label_value_wrapper.tsx b/src/components/label_value_wrapper.tsx index 35168b59..539741d4 100644 --- a/src/components/label_value_wrapper.tsx +++ b/src/components/label_value_wrapper.tsx @@ -13,6 +13,7 @@ interface LabelValueWrapperProps { value?: string | number | boolean type?: 'string' | 'number' | 'date' decimalPlaces?: number + dateOptions?: Intl.DateTimeFormatOptions } /** @@ -45,6 +46,7 @@ const LabelValueWrapper: React.FC = ({ required = false, decimalPlaces, type = 'string', + dateOptions, }: LabelValueWrapperProps): JSX.Element | null => { const [parentData, _] = useState(parent?.data_) return ( @@ -62,6 +64,7 @@ const LabelValueWrapper: React.FC = ({ suffix={suffix} decimalPlaces={decimalPlaces} type={type} + dateOptions={dateOptions} /> ) }} From c07b9f3a4e1766065a3c961c3647629fa250fd69 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Tue, 25 Feb 2025 08:09:52 -0700 Subject: [PATCH 18/34] 254 : Updated the JSDoc comments. --- src/components/label_value.tsx | 9 +++++++-- src/components/label_value_wrapper.tsx | 10 ++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/label_value.tsx b/src/components/label_value.tsx index e876f4d5..d4ecf015 100644 --- a/src/components/label_value.tsx +++ b/src/components/label_value.tsx @@ -5,9 +5,14 @@ import DateStr from './date_str' * LabelValueProps defines the props for the LabelValue component. * * @interface LabelValueProps - * @property {string} label - The label to display next to the value. - * @property {string} value - The value to display. + * @property {string} [label] - The label to display next to the value. + * @property {string} [value] - The value to display. * @property {boolean} [required=false] - A flag to determine if the label-value pair should be rendered. + * @property {string} [prefix] - A prefix to display before the value. + * @property {string} [suffix] - A suffix to display after the value. + * @property {'string' | 'number' | 'date'} type - The type of value to display. + * @property {number} [decimalPlaces] - Number of decimal places to round the value if type is 'number'. + * @property {Intl.DateTimeFormatOptions} [dateOptions] - Options for date formatting if type is 'date'. */ export interface LabelValueProps { label?: string diff --git a/src/components/label_value_wrapper.tsx b/src/components/label_value_wrapper.tsx index 539741d4..10bc78a1 100644 --- a/src/components/label_value_wrapper.tsx +++ b/src/components/label_value_wrapper.tsx @@ -22,10 +22,16 @@ interface LabelValueWrapperProps { * The component conditionally renders the label-value pair based on the `required` prop. * * @param {LabelValueWrapperProps} props - The props for the `LabelValueWrapper` component. - * @param {string} props.label - The label to display next to the value. - * @param {string} props.path - The path in the data where the value can be found. + * @param {string} [props.label] - The label to display next to the value. + * @param {string} [props.path] - The path in the data where the value can be found. + * @param {string} [props.prefix] - A prefix to display before the value. + * @param {string} [props.suffix] - A suffix to display after the value. * @param {boolean} [props.required=false] - A flag to determine if the label-value pair should be rendered. * @param {any} [props.parent=null] - Optional. A custom parent object to retrieve the data from, instead of the global store context. + * @param {string | number | boolean} [props.value] - The value to display. + * @param {'string' | 'number' | 'date'} [props.type='string'] - The type of value to display. + * @param {number} [props.decimalPlaces] - Number of decimal places to round the value if type is 'number'. + * @param {Intl.DateTimeFormatOptions} [props.dateOptions] - Options for date formatting if type is 'date'. * * @returns {JSX.Element | null} - A JSX element containing the label and value if `required` is true, or null if `required` is false. * From c776e4ddf599287152bd026aea5be31b5d2cc90f Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Fri, 28 Feb 2025 10:31:53 -0700 Subject: [PATCH 19/34] Revert "254 : Replaced with ." This reverts commit 6c3d7138fd7d49b17cb58ad01a1740fc813d66fb. --- .../doe_workflow_combustion_appliance_safety_tests.mdx | 2 +- src/templates/ira_doe_workflow_limited_assessment.mdx | 2 +- src/templates/reusable/project_info_report.mdx | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx b/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx index de0d423f..4a88e165 100644 --- a/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx +++ b/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx @@ -201,7 +201,7 @@ --- # Combustion Appliance Safety Testing ## Photo Report - + **Assessment Date:**  diff --git a/src/templates/ira_doe_workflow_limited_assessment.mdx b/src/templates/ira_doe_workflow_limited_assessment.mdx index 326a7ed0..889d38bd 100644 --- a/src/templates/ira_doe_workflow_limited_assessment.mdx +++ b/src/templates/ira_doe_workflow_limited_assessment.mdx @@ -195,7 +195,7 @@ {props.project.data_.installer?.name ?     {props.project.data_.installer?.name} : null} {props.project.data_.installer?.name ?
: null} {props.project.data_.installer?.company_name ?     {props.project.data_.installer?.company_name} : null}{props.project.data_.installer?.company_name ?
: null} - + **Assessment Date:** **Assessment For:** {props.data.assessment_for} diff --git a/src/templates/reusable/project_info_report.mdx b/src/templates/reusable/project_info_report.mdx index 7a0c507e..87894d12 100644 --- a/src/templates/reusable/project_info_report.mdx +++ b/src/templates/reusable/project_info_report.mdx @@ -17,8 +17,7 @@

<> - { /* This will be removed in ticket #249 */} - Installation Date:  + Installation Date:  From e985c7567325f24a5eb7ca66a05da530361407fc Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Tue, 4 Mar 2025 13:43:34 -0700 Subject: [PATCH 20/34] 254 : Switched the bolding of label and value. --- src/components/label_value.tsx | 20 ++++++++++---------- src/templates/templates_config.ts | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/label_value.tsx b/src/components/label_value.tsx index d4ecf015..21a94428 100644 --- a/src/components/label_value.tsx +++ b/src/components/label_value.tsx @@ -75,16 +75,16 @@ const LabelValue: React.FC = ({ return required || value ? ( label ? (
- {label}: - - {prefix} - {type === 'date' && typeof value === 'string' ? ( - - ) : ( - value - )} - {suffix} - + + {label}: + + {prefix} + {type === 'date' && typeof value === 'string' ? ( + + ) : ( + value + )} + {suffix}
) : ( <> diff --git a/src/templates/templates_config.ts b/src/templates/templates_config.ts index a3df9582..40501e31 100644 --- a/src/templates/templates_config.ts +++ b/src/templates/templates_config.ts @@ -117,10 +117,10 @@ const templatesConfig: TemplatesConfig = { title: 'IRA Limited Assessment', template: IRADOEWorkflowLimitedAssessment, }, - // playground: { - // title: 'Playground', - // template: Playground, - // }, + playground: { + title: 'Playground', + template: Playground, + }, } // Assuming TemplatesConfig is defined somewhere as a type or interface From c418b3398350ffc75c72171f29dd0590b9406214 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Tue, 4 Mar 2025 13:51:35 -0700 Subject: [PATCH 21/34] Revert "Revert "254 : Replaced with ."" This reverts commit c776e4ddf599287152bd026aea5be31b5d2cc90f. --- .../doe_workflow_combustion_appliance_safety_tests.mdx | 2 +- src/templates/ira_doe_workflow_limited_assessment.mdx | 2 +- src/templates/reusable/project_info_report.mdx | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx b/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx index 4a88e165..de0d423f 100644 --- a/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx +++ b/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx @@ -201,7 +201,7 @@ --- # Combustion Appliance Safety Testing ## Photo Report - **Assessment Date:**  + diff --git a/src/templates/ira_doe_workflow_limited_assessment.mdx b/src/templates/ira_doe_workflow_limited_assessment.mdx index 889d38bd..326a7ed0 100644 --- a/src/templates/ira_doe_workflow_limited_assessment.mdx +++ b/src/templates/ira_doe_workflow_limited_assessment.mdx @@ -195,7 +195,7 @@ {props.project.data_.installer?.name ?     {props.project.data_.installer?.name} : null} {props.project.data_.installer?.name ?
: null} {props.project.data_.installer?.company_name ?     {props.project.data_.installer?.company_name} : null}{props.project.data_.installer?.company_name ?
: null} - **Assessment Date:** + **Assessment For:** {props.data.assessment_for} diff --git a/src/templates/reusable/project_info_report.mdx b/src/templates/reusable/project_info_report.mdx index 87894d12..7a0c507e 100644 --- a/src/templates/reusable/project_info_report.mdx +++ b/src/templates/reusable/project_info_report.mdx @@ -17,7 +17,8 @@

<> - Installation Date:  + { /* This will be removed in ticket #249 */} + Installation Date:  From 20c325207e939bfa9f2b7214d7ee2bdf009895c3 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Tue, 4 Mar 2025 14:01:46 -0700 Subject: [PATCH 22/34] 254 : Adjusted LabelValueWrapper to accept straight value instead of just path. Replaced an instance. --- src/components/label_value_wrapper.tsx | 7 +++++-- src/templates/doe_workflow_heat_pump_ducted.mdx | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/label_value_wrapper.tsx b/src/components/label_value_wrapper.tsx index 10bc78a1..1c24ec86 100644 --- a/src/components/label_value_wrapper.tsx +++ b/src/components/label_value_wrapper.tsx @@ -53,14 +53,17 @@ const LabelValueWrapper: React.FC = ({ decimalPlaces, type = 'string', dateOptions, + value, }: LabelValueWrapperProps): JSX.Element | null => { const [parentData, _] = useState(parent?.data_) return ( {({ data }) => { const data_object = parent ? parentData : data - const key = path == null ? '' : path - const value = get(data_object, key) + if (!value) { + const key = path == null ? '' : path + value = get(data_object, key) + } return ( This heat pump will: {props.data?.heat_pump_purpose}

+ Photo of existing heating appliance’s nameplate -

Cooling appliance exists: {props.data?.no_cooling_appliance?.length === 0 ? "Yes" : "No"}

+ Date: Wed, 5 Mar 2025 10:29:15 -0700 Subject: [PATCH 23/34] 254 : Changed some things to --- ..._workflow_combustion_appliance_safety_tests.mdx | 2 +- src/templates/doe_workflow_heat_pump_ducted.mdx | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx b/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx index de0d423f..f63ad462 100644 --- a/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx +++ b/src/templates/doe_workflow_combustion_appliance_safety_tests.mdx @@ -201,7 +201,7 @@ --- # Combustion Appliance Safety Testing ## Photo Report - + diff --git a/src/templates/doe_workflow_heat_pump_ducted.mdx b/src/templates/doe_workflow_heat_pump_ducted.mdx index 2b7ad478..160b270e 100644 --- a/src/templates/doe_workflow_heat_pump_ducted.mdx +++ b/src/templates/doe_workflow_heat_pump_ducted.mdx @@ -395,7 +395,7 @@ { props.data.comment_ductwork - ?

Ductwork Comments: {props.data.comment_ductwork}

+ ? : null } @@ -410,7 +410,7 @@ { props.data.comment_pre_upgrade_static_pressure_test - ?

Pre-Upgrade Static Pressure Test Notes: {props.data.comment_pre_upgrade_static_pressure_test}

+ ? : null } @@ -426,11 +426,11 @@ { props.data.comment_pre_upgrade_air_flow_test - ?

Pre-Upgrade Airflow Test Notes: {props.data.comment_pre_upgrade_air_flow_test}

+ ? : null } - ## Duck Leakage Test Results + ## Duct Leakage Test Results Leaky ducts mean the conditioned air doesn't make it to the rooms where the conditioned air is needed. The worse kind of duct leakage is leakage to outside because that means the air you paid to conditioned is leaking outside the house. The duct leakage test measures how leaky @@ -438,7 +438,7 @@ In existing construction it is highly recommended that action be taken to reduce duct leakage if the duct leakage test finds the leakage rate to be greater than 12 CFM25 per 100 ft2 of conditioned floor area. -

Test method used: {props.data?.duct_leakage_test_method}

+ Photo of duct test setup showing ring size and how it is attached to the duct system @@ -453,7 +453,9 @@ : null } -

CFM25 ={props.data.cfm25_calculator?.cfm25 ? props.data.cfm25_calculator.cfm25 : null}

+ + +

Conditioned Floor Area (ft2) = {props.data.cfm25_calculator?.conditioned_floor_area ? props.data.cfm25_calculator.conditioned_floor_area : null}

Duct CFM25 per 100 per ft2 = { props.data.cfm25_calculator?.cfm25 && props.data.cfm25_calculator?.conditioned_floor_area ? ((props.data.cfm25_calculator.cfm25 / props.data.cfm25_calculator.conditioned_floor_area) * 100).toFixed(2) : null }

From 71fc874f72190527ca6f71241b24c1e4292481c4 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Wed, 5 Mar 2025 10:48:44 -0700 Subject: [PATCH 24/34] 254 : Replaced all the strong:normal instances with LabelValues in heat_pump_ducted. --- .../LabelValueExamples/TextLabelValues.mdx | 6 +++ .../doe_workflow_heat_pump_ducted.mdx | 44 ++++++++++--------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/templates/LabelValueExamples/TextLabelValues.mdx b/src/templates/LabelValueExamples/TextLabelValues.mdx index 21f18c99..e665e355 100644 --- a/src/templates/LabelValueExamples/TextLabelValues.mdx +++ b/src/templates/LabelValueExamples/TextLabelValues.mdx @@ -13,4 +13,10 @@ import TextInput from '../../components/text_input_wrapper'
+
+ Test + + Conditioned Floor Area (ft2)} path="label-value-test-text-input" /> + +
\ No newline at end of file diff --git a/src/templates/doe_workflow_heat_pump_ducted.mdx b/src/templates/doe_workflow_heat_pump_ducted.mdx index 160b270e..98fe89d6 100644 --- a/src/templates/doe_workflow_heat_pump_ducted.mdx +++ b/src/templates/doe_workflow_heat_pump_ducted.mdx @@ -449,15 +449,18 @@ { props.data.type_of_duct_leakage_radio - ?

Type Of Duct Leakage Test Performed: {props.data.type_of_duct_leakage_radio}

+ ? + : null } - - -

Conditioned Floor Area (ft2) = {props.data.cfm25_calculator?.conditioned_floor_area ? props.data.cfm25_calculator.conditioned_floor_area : null}

-

Duct CFM25 per 100 per ft2 = { props.data.cfm25_calculator?.cfm25 && props.data.cfm25_calculator?.conditioned_floor_area ? ((props.data.cfm25_calculator.cfm25 / props.data.cfm25_calculator.conditioned_floor_area) * 100).toFixed(2) : null }

+ Conditioned Floor Area (ft2)} + value={props.data.cfm25_calculator?.conditioned_floor_area ? props.data.cfm25_calculator.conditioned_floor_area : null}/> + Duct CFM25 per 100 per ft2} + type={props.data.cfm25_calculator?.cfm25 && props.data.cfm25_calculator?.conditioned_floor_area ? "number" : "string"} + decimalPlaces={2} + value={ props.data.cfm25_calculator?.cfm25 && props.data.cfm25_calculator?.conditioned_floor_area ? ((props.data.cfm25_calculator.cfm25 / props.data.cfm25_calculator.conditioned_floor_area) * 100) : null }/> @@ -484,17 +487,17 @@ { props.data?.outdoor_unit?.odu_mounting_style - ?

ODU Mounting Style: {props.data.outdoor_unit.odu_mounting_style}

+ ? : null } { props.data.outdoor_unit?.odu_inches_above_ground - ?

ODU Inches Above The Ground (elevated above the snow): {props.data.outdoor_unit.odu_inches_above_ground}

- : null + ? + : null } { props.data.outdoor_unit?.snow_ice_protection - ?

Overhead Snow & Ice Protection: {props.data.outdoor_unit.snow_ice_protection}

+ ? : null } @@ -508,11 +511,8 @@ } - - { props.data.comment_manual_j - && (

Manual J Notes or Comments: {props.data.comment_manual_j}

- ) + && } ## Equipment Selection The selected heat pump's extended heating and cooling performance tables are shown below. These tables were used in concert with the ASHRAE heating @@ -523,17 +523,17 @@ { props.data.aux_heat_lockout_temperature - ?

Aux Heat Lockout Above This Temperature (°F): {props.data.aux_heat_lockout_temperature}

+ ? Aux Heat Lockout Above This Temperature (°F)} value={props.data.aux_heat_lockout_temperature}/> : null } { props.data.compresser_lockout_temperature - ?

Compresser Lockout Below This Temperature (°F): {props.data.compresser_lockout_temperature}

+ ? Compresser Lockout Below This Temperature (°F)} value={props.data.compresser_lockout_temperature}/> : null } { props.data.dual_fuel_switch_over_temperature - ?

Dual Fuel Switch Over Temperature (°F): {props.data.dual_fuel_switch_over_temperature}

+ ? Dual Fuel Switch Over Temperature (°F)} value={props.data.dual_fuel_switch_over_temperature}/> : null } @@ -543,7 +543,7 @@ { props.data.comment_ductwork_concluding_summary - ?

Pre-Installation Comments: {props.data.comment_ductwork_concluding_summary}

+ ? : null } @@ -571,7 +571,7 @@ { props.data.comment_circuit_breaker_notes - ?

Circuit Breaker Notes: {props.data.comment_circuit_breaker_notes}

+ ? : null } @@ -602,8 +602,9 @@ | Ounces of additional refrigerant = {(props.data?.refrigerant_calculator?.ft_line_set_beyond_factory_charge && props.data?.refrigerant_calculator?.oz_per_ft_refrigerant) ? props.data.refrigerant_calculator.ft_line_set_beyond_factory_charge * props.data.refrigerant_calculator.oz_per_ft_refrigerant : null} { props.data.comment_refrigerant_quantity_adjustments_or_weigh_in - ?

Notes About Refrigerant Quantity Adjustments Or Weigh In: {props.data.comment_refrigerant_quantity_adjustments_or_weigh_in}

- : null + ? + : null } @@ -644,7 +645,8 @@ { props.data.comment_about_thermostat_settings - ?

Post-Installation Notes About Thermostat Settings: {props.data.comment_about_thermostat_settings}

+ ? : null } From 4054f1ff22462a6140503d0fe8204238f6859024 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Wed, 5 Mar 2025 10:52:21 -0700 Subject: [PATCH 25/34] 254 : Replaced all strong:normal instances in heat_pump_ductless. --- src/templates/doe_workflow_heat_pump_ductless.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/templates/doe_workflow_heat_pump_ductless.mdx b/src/templates/doe_workflow_heat_pump_ductless.mdx index e931e318..adcb75f6 100644 --- a/src/templates/doe_workflow_heat_pump_ductless.mdx +++ b/src/templates/doe_workflow_heat_pump_ductless.mdx @@ -284,14 +284,14 @@ ## Pre-Installation -

This heat pump will: {props.data?.heat_pump_purpose}

+ Photo of the proposed heat pump outdoor unit (ODU) installation location { props.data.comment_odu_install_location - ?

Notes: {props.data.comment_odu_install_location}

+ ? : null } @@ -305,7 +305,7 @@ { props.data.comment_idu_install_location - ?

Notes: {props.data.comment_idu_install_location}

+ ? : null } @@ -416,7 +416,7 @@ { props.data.comment_refridgerant_adjustment - ?

Notes About Refridgerant Adjustment: {props.data.comment_refridgerant_adjustment}

+ ? : null } From fa75e3486f8f6b06d1aa29d4f6e0d7ea38dced98 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Wed, 5 Mar 2025 11:21:17 -0700 Subject: [PATCH 26/34] 254 : Replaced all strong:normal instances in heat_pump_water_heater. --- src/templates/LabelValueExamples/TextLabelValues.mdx | 2 +- src/templates/doe_workflow_heat_pump_water_heater.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/templates/LabelValueExamples/TextLabelValues.mdx b/src/templates/LabelValueExamples/TextLabelValues.mdx index e665e355..8f298b84 100644 --- a/src/templates/LabelValueExamples/TextLabelValues.mdx +++ b/src/templates/LabelValueExamples/TextLabelValues.mdx @@ -16,7 +16,7 @@ import TextInput from '../../components/text_input_wrapper'
Test - Conditioned Floor Area (ft2)} path="label-value-test-text-input" /> + Conditioned Floor Area (ft2)} value={102 ft3} />
\ No newline at end of file diff --git a/src/templates/doe_workflow_heat_pump_water_heater.mdx b/src/templates/doe_workflow_heat_pump_water_heater.mdx index cc84e8d9..3b74d453 100644 --- a/src/templates/doe_workflow_heat_pump_water_heater.mdx +++ b/src/templates/doe_workflow_heat_pump_water_heater.mdx @@ -251,7 +251,7 @@ { props.data.space_air_volume - ?

Air Volume of the Space: {props.data.space_air_volume} ft3

+ ? {props.data.space_air_volume}3}/> : null } From 245f5f7c39f5531d3647b6dc52a293cf07572568 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Wed, 5 Mar 2025 11:31:08 -0700 Subject: [PATCH 27/34] 254 : Replaced all strong:normal instances in attic_air_sealing_and_insulation --- .../ira_doe_workflow_attic_air_sealing_and_insulation.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/templates/ira_doe_workflow_attic_air_sealing_and_insulation.mdx b/src/templates/ira_doe_workflow_attic_air_sealing_and_insulation.mdx index 813781cf..159fe4bc 100644 --- a/src/templates/ira_doe_workflow_attic_air_sealing_and_insulation.mdx +++ b/src/templates/ira_doe_workflow_attic_air_sealing_and_insulation.mdx @@ -27,7 +27,7 @@ | ---------------------------- | | - |

ACH50: {!isNaN(props?.data?.air_leakage_cfm50) && !isNaN(props?.data?.conditioned_volume_ft3) ? ((props?.data?.air_leakage_cfm50 * 60) / props?.data?.conditioned_volume_ft3).toFixed(1): 'N/A'}

+ | Take a photo of the manometer showing CFM50 of air leakage before air sealing and insulation work was performed. @@ -188,8 +188,8 @@ | | | ---------------------------- | - |

Conditioned Volume (ft3): {props?.data?.conditioned_volume_ft3}

- |

ACH50: {!isNaN(props?.data?.postinstall_air_leakage_cfm50) && !isNaN(props?.data?.conditioned_volume_ft3) ? ((props?.data?.postinstall_air_leakage_cfm50 * 60) / props?.data?.conditioned_volume_ft3).toFixed(1): 'N/A'}

+ | + | Take a photo of the manometer showing CFM50 of air leakage before air sealing and insulation work was performed. From 9336dbf53e1681c9465ee828807c8c95e9dba8b8 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Wed, 5 Mar 2025 11:38:35 -0700 Subject: [PATCH 28/34] 254 : Replaced all strong:normal instances in duct_air_sealing_and_insulation --- .../ira_doe_workflow_duct_air_sealing_and_insulation.mdx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/templates/ira_doe_workflow_duct_air_sealing_and_insulation.mdx b/src/templates/ira_doe_workflow_duct_air_sealing_and_insulation.mdx index f930734c..48ae2069 100644 --- a/src/templates/ira_doe_workflow_duct_air_sealing_and_insulation.mdx +++ b/src/templates/ira_doe_workflow_duct_air_sealing_and_insulation.mdx @@ -26,7 +26,7 @@ | ---------------------------- | | - |

Cubic feet per minute (CFM) per 100 sq. ft. of conditioned floor area when the air handler is present: {!isNaN(props.data?.duct_leakage_cfm25) && !isNaN(props.data?.conditioned_floor_area_ft2) ? (props.data.duct_leakage_cfm25 / props.data.conditioned_floor_area_ft2 * 100).toFixed(1) : 'N/A'}

+ |
@@ -98,8 +98,11 @@ -

Conditioned Floor Area (ft2): {props.data?.conditioned_floor_area_ft2}

-

Cubic feet per minute (CFM) per 100 sq. ft. of conditioned floor area when the air handler is present: {!isNaN(props.data?.post_install_duct_leakage_cfm25) && !isNaN(props.data?.conditioned_floor_area_ft2) ? (props.data.post_install_duct_leakage_cfm25 / props.data.conditioned_floor_area_ft2 * 100).toFixed(1) : 'N/A'}

+ +
From d0dbf820a18d1fbffe134e2b6c65d90f9a0d8801 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Wed, 5 Mar 2025 11:44:51 -0700 Subject: [PATCH 29/34] 254 : Replaced all strong:normal instances in floor_air_sealing_and_insulation --- .../ira_doe_workflow_floor_air_sealing_and_insulation.mdx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/templates/ira_doe_workflow_floor_air_sealing_and_insulation.mdx b/src/templates/ira_doe_workflow_floor_air_sealing_and_insulation.mdx index 10cfa512..8387c759 100644 --- a/src/templates/ira_doe_workflow_floor_air_sealing_and_insulation.mdx +++ b/src/templates/ira_doe_workflow_floor_air_sealing_and_insulation.mdx @@ -29,7 +29,7 @@ | ---------------------------- | | - |

ACH50: {!isNaN(props?.data?.air_leakage_cfm50) && !isNaN(props?.data?.conditioned_volume_ft3) ? ((props?.data?.air_leakage_cfm50 * 60) / props?.data?.conditioned_volume_ft3).toFixed(1): 'N/A'}

+ | @@ -164,7 +164,10 @@

Conditioned Volume (ft3): {props.data?.conditioned_volume_ft3}

-

ACH50: {!isNaN(props?.data?.air_leakage_cfm50) && !isNaN(props?.data?.conditioned_volume_ft3) ? ((props?.data?.air_leakage_cfm50 * 60) / props?.data?.conditioned_volume_ft3).toFixed(1) : 'N/A'}

+ Photo of the manometer showing CFM50 of air leakage before air sealing and insulation work was performed From 5b31f45c2d04d678aca290263c002f0d6653052a Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Wed, 5 Mar 2025 16:37:01 -0700 Subject: [PATCH 30/34] 254 : Replaced all strong:normal instances in foundation_wall_air_sealing_and_insulation --- ...a_doe_workflow_floor_air_sealing_and_insulation.mdx | 1 + ...flow_foundation_wall_air_sealing_and_insulation.mdx | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/templates/ira_doe_workflow_floor_air_sealing_and_insulation.mdx b/src/templates/ira_doe_workflow_floor_air_sealing_and_insulation.mdx index 8387c759..6a0bfc44 100644 --- a/src/templates/ira_doe_workflow_floor_air_sealing_and_insulation.mdx +++ b/src/templates/ira_doe_workflow_floor_air_sealing_and_insulation.mdx @@ -165,6 +165,7 @@

Conditioned Volume (ft3): {props.data?.conditioned_volume_ft3}

diff --git a/src/templates/ira_doe_workflow_foundation_wall_air_sealing_and_insulation.mdx b/src/templates/ira_doe_workflow_foundation_wall_air_sealing_and_insulation.mdx index 512bacdc..215ec4ed 100644 --- a/src/templates/ira_doe_workflow_foundation_wall_air_sealing_and_insulation.mdx +++ b/src/templates/ira_doe_workflow_foundation_wall_air_sealing_and_insulation.mdx @@ -24,8 +24,7 @@ | ---------------------------- | | - |

ACH50: {!isNaN(props?.data?.air_leakage_cfm50) && !isNaN(props?.data?.conditioned_volume_ft3) ? ((props?.data?.air_leakage_cfm50 * 60) / props?.data?.conditioned_volume_ft3).toFixed(1): 'N/A'}

- + | Take a photo of the manometer showing CFM50 of air leakage before air sealing and insulation work was performed. @@ -175,8 +174,11 @@ -

Conditioned Volume (ft3): {props.data?.conditioned_volume_ft3}

-

ACH50: {!isNaN(props?.data?.air_leakage_cfm50) && !isNaN(props?.data?.conditioned_volume_ft3) ? ((props?.data?.air_leakage_cfm50 * 60) / props?.data?.conditioned_volume_ft3).toFixed(1): 'N/A'}

+

Conditioned Volume (ft3): {props.data?.conditioned_volume_ft3}

+ Photo of the manometer showing CFM50 of air leakage before air sealing and insulation work was performed From 0113cdb512ac333b21d5e14c003a168f0f83022e Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Thu, 6 Mar 2025 08:42:54 -0700 Subject: [PATCH 31/34] 254: Replaced strong:normal labels with LabelValue in limited_assessment. --- .../ira_doe_workflow_limited_assessment.mdx | 49 ++++++++----------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/src/templates/ira_doe_workflow_limited_assessment.mdx b/src/templates/ira_doe_workflow_limited_assessment.mdx index 326a7ed0..217dc277 100644 --- a/src/templates/ira_doe_workflow_limited_assessment.mdx +++ b/src/templates/ira_doe_workflow_limited_assessment.mdx @@ -201,8 +201,8 @@

{props.data.assessment_for === 'Whole multifamily building' - ? Multifamily Building Conditioned Area (ft2): {props.data.mf_conditioned_floor_area_sq_ft} - : Single-family/unit Conditioned Area (ft2): {props.data.sf_conditioned_floor_area_sq_ft} + ? Multifamily Building Conditioned Area (ft2)} value={props.data.mf_conditioned_floor_area_sq_ft}/> + : Single-family/unit Conditioned Area (ft2)} value={props.data.sf_conditioned_floor_area_sq_ft}/> }

@@ -236,42 +236,41 @@ <>

Heating System 1

-

Fuel and System Type: {props.data.heating_systems[0].fuel_and_system_type}

+ + {props.data.heating_systems[0].fuel_and_system_type === 'ELECTRIC_HEAT_PUMP' - ?

Heating Efficiency (HSPF): {props.data.heating_systems[0].is_efficiency_known === 'YES' ? props.data.heating_systems[0].efficiency_hspf : "NOT_KNOWN"}

- :

Heating Efficiency (AFUE): {props.data.heating_systems[0].is_efficiency_known === 'YES' ? props.data.heating_systems[0].efficiency_afue : "NOT_KNOWN"}

+ ? + : } - -

Percent Conditioned Area Served: {props.data.heating_systems[0].is_percent_conditioned_floor_area_served_known === 'YES' ? props.data.heating_systems[0].percent_conditioned_floor_area_served : "NOT_KNOWN"}

+ } {Number(props.data.num_heating_systems) > 1 && props.data.heating_systems[1] && <>

Heating System 2

- -

Fuel and System Type: {props.data.heating_systems[1].fuel_and_system_type}

+ {props.data.heating_systems[1].fuel_and_system_type === 'ELECTRIC_HEAT_PUMP' - ?

Heating Efficiency (HSPF): {props.data.heating_systems[1].is_efficiency_known === 'YES' ? props.data.heating_systems[1].efficiency_hspf : "NOT_KNOWN"}

- :

Heating Efficiency (AFUE): {props.data.heating_systems[1].is_efficiency_known === 'YES' ? props.data.heating_systems[1].efficiency_afue : "NOT_KNOWN"}

+ ? + : } -

Percent Conditioned Area Served: {props.data.heating_systems[1].is_percent_conditioned_floor_area_served_known === 'YES' ? props.data.heating_systems[1].percent_conditioned_floor_area_served : "NOT_KNOWN"}

+ } {Number(props.data.num_heating_systems) > 2 && props.data.heating_systems[2] && <>

Heating System 3

-

Fuel and System Type: {props.data.heating_systems[2].fuel_and_system_type}

+ {props.data.heating_systems[2].fuel_and_system_type === 'ELECTRIC_HEAT_PUMP' - ?

Heating Efficiency (HSPF): {props.data.heating_systems[2].is_efficiency_known === 'YES' ? props.data.heating_systems[2].efficiency_hspf : "NOT_KNOWN"}

- :

Heating Efficiency (AFUE): {props.data.heating_systems[2].is_efficiency_known === 'YES' ? props.data.heating_systems[2].efficiency_afue : "NOT_KNOWN"}

+ ? + : } -

Percent Conditioned Area Served: {props.data.heating_systems[2].is_percent_conditioned_floor_area_served_known === 'YES' ? props.data.heating_systems[2].percent_conditioned_floor_area_served : "NOT_KNOWN"}

+ } @@ -282,28 +281,22 @@ {Number(props.data.num_cooling_systems) > 0 && props.data.cooling_systems[0] && <>

Cooling System 1

- -

Cooling Efficiency (SEER): {props.data.cooling_systems[0].is_efficiency_known === 'YES' ? props.data.cooling_systems[0].efficiency_seer : "NOT_KNOWN"}

- -

Percent Conditioned Area Served: {props.data.cooling_systems[0].is_percent_conditioned_floor_area_served_known === 'YES' ? props.data.cooling_systems[0].percent_conditioned_floor_area_served : "NOT_KNOWN"}

+ + } {Number(props.data.num_cooling_systems) > 1 && props.data.cooling_systems[1] && <>

Cooling System 2

- -

Cooling Efficiency (SEER): {props.data.cooling_systems[1].is_efficiency_known === 'YES' ? props.data.cooling_systems[1].efficiency_seer : "NOT_KNOWN"}

- -

Percent Conditioned Area Served: {props.data.cooling_systems[1].is_percent_conditioned_floor_area_served_known === 'YES' ? props.data.cooling_systems[1].percent_conditioned_floor_area_served : "NOT_KNOWN"}

+ + } {Number(props.data.num_cooling_systems) > 2 && props.data.cooling_systems[2] && <>

Cooling System 3

- -

Cooling Efficiency (SEER): {props.data.cooling_systems[2].is_efficiency_known === 'YES' ? props.data.cooling_systems[2].efficiency_seer : "NOT_KNOWN"}

- -

Percent Conditioned Area Served: {props.data.cooling_systems[2].is_percent_conditioned_floor_area_served_known === 'YES' ? props.data.cooling_systems[2].percent_conditioned_floor_area_served : "NOT_KNOWN"}

+ + } From 65be2a885e9136125203fad47ab754775c1fe506 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Thu, 6 Mar 2025 08:52:34 -0700 Subject: [PATCH 32/34] 254: Replaced strong:normal labels with LabelValue in slap_foundation_exterior_sealing_and_insulation. --- ...rkflow_slap_foundation_exterior_sealing_and_insulation.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/templates/ira_doe_workflow_slap_foundation_exterior_sealing_and_insulation.mdx b/src/templates/ira_doe_workflow_slap_foundation_exterior_sealing_and_insulation.mdx index a7cedd0c..55a68836 100644 --- a/src/templates/ira_doe_workflow_slap_foundation_exterior_sealing_and_insulation.mdx +++ b/src/templates/ira_doe_workflow_slap_foundation_exterior_sealing_and_insulation.mdx @@ -19,7 +19,7 @@ | ---------------------------- | | - |

ACH50: {!isNaN(props?.data?.air_leakage_cfm50) && !isNaN(props?.data?.conditioned_volume_ft3) ? ((props?.data?.air_leakage_cfm50 * 60) / props?.data?.conditioned_volume_ft3).toFixed(1): 'N/A'}

+ | Take a photo of the manometer showing CFM50 of air leakage before air sealing and insulation work was performed. @@ -160,7 +160,7 @@

What is the starting air leakage rate for the home before modification? { props.data?.air_leakage_rate == 'CFM at 50Pa' ? ":" + props.data?.air_leakage_cfm50+ " " : null }{ props.data?.air_leakage_rate}

Conditioned Volume (ft3): {props.data?.conditioned_volume_ft3}

-

ACH50: {!isNaN(props?.data?.air_leakage_cfm50) && !isNaN(props?.data?.conditioned_volume_ft3) ? ((props?.data?.air_leakage_cfm50 * 60) / props?.data?.conditioned_volume_ft3).toFixed(1): 'N/A'}

+ Photo of the manometer showing CFM50 of air leakage before air sealing and insulation work was performed From 629798130d786b63b5ba45b7224e3d6a7e2c95f4 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Thu, 6 Mar 2025 08:55:47 -0700 Subject: [PATCH 33/34] 254: Replaced strong:normal labels with LabelValue in wall_air_sealing_and_insulation_dry_fill and project_info_report. --- ..._doe_workflow_wall_air_sealing_and_insulation_dry_fill.mdx | 4 ++-- src/templates/reusable/project_info_report.mdx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/templates/ira_doe_workflow_wall_air_sealing_and_insulation_dry_fill.mdx b/src/templates/ira_doe_workflow_wall_air_sealing_and_insulation_dry_fill.mdx index 9305e100..875533ee 100644 --- a/src/templates/ira_doe_workflow_wall_air_sealing_and_insulation_dry_fill.mdx +++ b/src/templates/ira_doe_workflow_wall_air_sealing_and_insulation_dry_fill.mdx @@ -25,7 +25,7 @@ | ---------------------------- | | - |

ACH50: {!isNaN(props?.data?.air_leakage_cfm50) && !isNaN(props?.data?.conditioned_volume_ft3) ? ((props?.data?.air_leakage_cfm50 * 60) / props?.data?.conditioned_volume_ft3).toFixed(1): 'N/A'}

+ | Take a photo of the manometer showing CFM50 of air leakage before air sealing and insulation work was performed. @@ -222,7 +222,7 @@

What is the starting air leakage rate for the home before modification? { props.data?.wall_air_leakage_rate == 'CFM at 50Pa' ? props.data?.air_leakage_cfm50 +" " : null } { props.data?.wall_air_leakage_rate}

Conditioned Volume (ft3): {props.data?.conditioned_volume_ft3}

-

ACH50: {!isNaN(props?.data?.air_leakage_cfm50) && !isNaN(props?.data?.conditioned_volume_ft3) ? ((props?.data?.air_leakage_cfm50 * 60) / props?.data?.conditioned_volume_ft3).toFixed(1): 'N/A'}

+ Photo of the manometer showing CFM50 of air leakage before air sealing and insulation work was performed diff --git a/src/templates/reusable/project_info_report.mdx b/src/templates/reusable/project_info_report.mdx index 7a0c507e..defc0694 100644 --- a/src/templates/reusable/project_info_report.mdx +++ b/src/templates/reusable/project_info_report.mdx @@ -18,7 +18,8 @@ <> { /* This will be removed in ticket #249 */} - Installation Date:  + From 2b7cdde84a20108c6df65e427e87e51b49734c69 Mon Sep 17 00:00:00 2001 From: Lindsay Johnston Date: Thu, 6 Mar 2025 09:03:59 -0700 Subject: [PATCH 34/34] 254 : Removed test example from playground. --- src/templates/LabelValueExamples/TextLabelValues.mdx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/templates/LabelValueExamples/TextLabelValues.mdx b/src/templates/LabelValueExamples/TextLabelValues.mdx index 8f298b84..21f18c99 100644 --- a/src/templates/LabelValueExamples/TextLabelValues.mdx +++ b/src/templates/LabelValueExamples/TextLabelValues.mdx @@ -13,10 +13,4 @@ import TextInput from '../../components/text_input_wrapper'
-
- Test - - Conditioned Floor Area (ft2)} value={102 ft3} /> - -
\ No newline at end of file