Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions public/bootstrap.min.css

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion src/components/repeatable.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
import React from 'react'

import { type CloneableProps, cloneElement } from '../utilities/cloning_utils'
import LabelValue from './label_value'

interface RepeatableProps {
path: string
keys: React.Key[]
children: React.ReactNode
label?: string
}

const Repeatable: React.FC<RepeatableProps> = ({ path, keys, children }) => {
const Repeatable: React.FC<RepeatableProps> = ({
path,
keys,
children,
label,
}) => {
return keys.map(key => (
<div key={key}>
{label && (
<LabelValue label={label} value={String(Number(key) + 1)} />
)}
{React.Children.map(children, (child, childIndex) => {
return cloneElement(
child as React.ReactElement<CloneableProps>,
Expand Down
3 changes: 3 additions & 0 deletions src/components/repeatable_wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ import { StoreContext } from '../providers/store_provider'
interface RepeatableWrapperProps {
path: string
children: React.ReactNode
label?: string
}

const RepeatableWrapper: React.FC<RepeatableWrapperProps> = ({
path,
children,
label,
}) => {
return (
<StoreContext.Consumer>
{({ doc }) => {
return (
<Repeatable
path={path}
label={label}
keys={Object.keys((doc && get(doc.data_, path)) ?? [])}
>
{children}
Expand Down
67 changes: 61 additions & 6 deletions src/components/views/faqs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'
import { Container } from 'react-bootstrap'
import Layout from '../layouts/default'
import Collapsible from '../../collapsible'
import { TfiImport } from 'react-icons/tfi'

const FaqsPage: React.FC = () => {
return (
Expand Down Expand Up @@ -31,11 +32,26 @@ const FaqsPage: React.FC = () => {
strongly recommend exporting your projects regularly as a
backup.
</Collapsible>
<Collapsible header="How can I back up my data?">
You can export your projects from the main project list.
This will save your data as a file on your device, which you
can then transfer and import on another device or keep a
backup.
<Collapsible header="How can I back up / download my data?">
You can export or download yourprojects as JSON. The
Download icon <TfiImport size={25} color={'black'} />{' '}
appears next to each project in the main project list and at
the top of other pages. Clicking this icon allows you to
save a project’s data as a JSON file on your device,
containing all the information related to that project.
<br />
<br />
Downloading your projects serves as a backup mechanism. If
your browser&rsquo;s cache or site data is cleared (either
accidentally or due to browser updates/settings), having
these downloaded files allows you to restore your projects
by importing them back into the application. This is also
useful for sharing project data with others or moving it to
another device.
<br />
<br />
Please note that you must download each project
individually.
</Collapsible>
<Collapsible header="Can I use the app on multiple devices?">
Since data is stored locally on each device, your projects
Expand All @@ -61,7 +77,46 @@ const FaqsPage: React.FC = () => {
Installation. To do this, navigate to the desired
Installation in the project&rsquo;s installation list, and
click the &ldquo;Print Report&rdquo; button within the
Report tab to open the report as a PDF in your browser.
Report tab to open the report as a PDF in your browser. If
nothing happens when you click &ldquo;Print Report&rdquo;,
your browser&rdquo;s pop-up blocker may be preventing the
PDF from opening from https://quality-install-tool.pnnl.gov/
<br />
<b>For desktop browsers:</b>
<ol>
<li>
In Google Chrome, click &ldquo;Print Report&rdquo;
and check for a pop-up blocker icon on the right
side of the address bar. Click it and allow pop-ups
from
&ldquo;https://quality-install-tool.pnnl.gov/&rdquo;.
You can also enable this via: Settings → Privacy and
security → Site settings → Pop-ups and redirects,
then add QI Tool under Allowed.
</li>
<li>
In Safari on macOS, go to Safari → Settings
(Preferences) → Websites → Pop-up Windows, find your
site in the list, and set it to Allow. Then reload
the page and click “Print Report” again.
</li>
</ol>
<b>For mobile browsers:</b>
<ol>
<li>
In Chrome on Android, the PDF may open in the same
tab. If it appears blocked, open Chrome&rdquo;s menu
and go to Settings → Site settings → Pop-ups and
redirects, and allow pop-ups for QI Tool site (or
enable pop-ups in general).
</li>
<li>
In Safari on iPhone or iPad, adjust pop-up behavior
via the iOS Settings app by going to Settings →
Safari → Block Pop-Ups and turning this option off
if needed, then try “Print Report” again.
</li>
</ol>
</Collapsible>
</Container>
</Layout>
Expand Down
12 changes: 12 additions & 0 deletions src/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import DOEWorkflowMechanicalVentilation from './ira_doe_workflow_mechanical_vent
import DOEWorkflowSlapFoundationExterior from './ira_doe_workflow_slap_foundation_exterior_sealing_and_insulation.mdx'
import DOEWorkflowWallAirSealingAndInsulation from './ira_doe_workflow_wall_air_sealing_and_insulation_dry_fill.mdx'
import IRADOEWorkflowLimitedAssessment from './ira_doe_workflow_limited_assessment.mdx'
import DOEAppliancesWorkflow from './ira_doe_workflow_appliances.mdx'
import DOEWorkflowWoodAndPelletStove from './ira_doe_workflow_wood_and_pallet_stove.mdx'
// import Playground from './playground.mdx'

import {
Expand Down Expand Up @@ -57,6 +59,11 @@ const INSTALLATION_SUB_TITLE = {
}

const TEMPLATES: Record<string, TemplateConfiguration> = {
doe_workflow_appliances: {
title: 'Appliance / Equipment Replacement',
subtitle: INSTALLATION_SUB_TITLE,
template: DOEAppliancesWorkflow,
},
doe_workflow_attic_air_sealing_and_insulation: {
title: 'Attic Air Sealing and Insulation',
subtitle: INSTALLATION_SUB_TITLE,
Expand Down Expand Up @@ -177,6 +184,11 @@ const TEMPLATES: Record<string, TemplateConfiguration> = {
},
template: IRADOEWorkflowLimitedAssessment,
},
ira_doe_workflow_wood_and_pellet_stove: {
title: 'Wood or Pellet Stove',
subtitle: INSTALLATION_SUB_TITLE,
template: DOEWorkflowWoodAndPelletStove,
},
// playground: {
// title: 'Playground',
// subtitle: {
Expand Down
Loading
Loading