Skip to content

Commit

Permalink
Finished HomeInformation on single, CurrentHeatingSystem WIP
Browse files Browse the repository at this point in the history
Co-authored-by: plocket <[email protected]>
Co-authored-by: Clayton Schneider <[email protected]>
Co-authored-by: Leopardfoot <[email protected]>
Co-authored-by: Camden Blatchly <[email protected]>
  • Loading branch information
5 people committed Mar 20, 2024
1 parent ee739ea commit b490059
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function CurrentHeatingSystem() {
const titleClass = 'text-5xl font-extrabold tracking-wide'
const descriptiveClass = 'mt-2 text-sm text-slate-500'
const componentMargin = 'mt-10'
const subtitleClass = 'text-2xl font-semibold text-zinc-950 mt-9'

return (
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import { AnalysisHeader } from './AnalysisHeader.tsx'
import { EnergyUseHistoryChart } from './EnergyUseHistoryChart.tsx'
import { Button } from '#/app/components/ui/button.tsx'

Check warning on line 3 in heat-stack/app/components/ui/heat/CaseSummaryComponents/EnergyUseHistory.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

`#/app/components/ui/button.tsx` import should occur before import of `./AnalysisHeader.tsx`

import { Form } from '@remix-run/react'

Check warning on line 5 in heat-stack/app/components/ui/heat/CaseSummaryComponents/EnergyUseHistory.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

`@remix-run/react` import should occur before import of `./AnalysisHeader.tsx`

Check warning on line 5 in heat-stack/app/components/ui/heat/CaseSummaryComponents/EnergyUseHistory.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

'Form' is defined but never used
import { ErrorList } from "./ErrorList.tsx"

Check warning on line 6 in heat-stack/app/components/ui/heat/CaseSummaryComponents/EnergyUseHistory.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

'ErrorList' is defined but never used
import { Input } from '#/app/components/ui/input.tsx'
import { Label } from '#/app/components/ui/label.tsx'
import { FieldMetadata, useForm } from '@conform-to/react'


export function EnergyUseHistory() {
const titleClass = 'text-5xl font-extrabold tracking-wide mt-10'
Expand All @@ -11,7 +17,7 @@ export function EnergyUseHistory() {
<div>
<h2 className={`${titleClass}`}>Energy Use History</h2>
<div>
<h6 <Button type="submit">Upload</Button>
<Button type="submit">Upload</Button>
</div>
<AnalysisHeader />
<EnergyUseHistoryChart />
Expand Down
5 changes: 5 additions & 0 deletions heat-stack/app/routes/_heat+/Inputs1.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@


// Archived 03/19/2024


import { useForm } from '@conform-to/react'
import { HomeInformation } from '../../components/ui/heat/CaseSummaryComponents/HomeInformation.tsx'

Expand Down
19 changes: 14 additions & 5 deletions heat-stack/app/routes/_heat+/single.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/** THE BELOW PROBABLY NEEDS TO MOVE TO A ROUTE RATHER THAN A COMPONENT, including action function, */
// import { redirect } from '@remix-run/react'
import { z } from 'zod'
import { useForm } from '@conform-to/react'
import { json, ActionFunctionArgs } from '@remix-run/node'
import { parseWithZod } from '@conform-to/zod'
import { invariantResponse } from '@epic-web/invariant'
import { json, ActionFunctionArgs } from '@remix-run/node'
import { Form, redirect, useActionData } from '@remix-run/react'
import { z } from 'zod'

// Ours
import { Button } from '#/app/components/ui/button.tsx'
import { ErrorList } from '#app/components/ui/heat/CaseSummaryComponents/ErrorList.tsx'
import { CurrentHeatingSystem } from '../../components/ui/heat/CaseSummaryComponents/CurrentHeatingSystem.tsx'
import { EnergyUseHistory } from '../../components/ui/heat/CaseSummaryComponents/EnergyUseHistory.tsx'
import { HomeInformation } from '../../components/ui/heat/CaseSummaryComponents/HomeInformation.tsx'
import HeatLoadAnalysis from './heatloadanalysis.tsx'
import { ErrorList } from '#app/components/ui/heat/CaseSummaryComponents/ErrorList.tsx'
import { Button } from '#/app/components/ui/button.tsx'

const nameMaxLength = 50
const addressMaxLength = 100
Expand All @@ -26,6 +26,15 @@ const HomeInformationSchema = z.object({
livingSpace: z.number().min(1),
})

const EnergyUseSchema = z.object({
fuelType: z.string().min(1).max(nameMaxLength),
efficiency: z.string().min(1).max(addressMaxLength),
override: z.number().min(1),
setpoint: z.string().min(1).max(nameMaxLength),
setbackTemp: z.string().min(1).max(addressMaxLength),
setbackHours: z.number().min(1),
})

export async function action({ request, params }: ActionFunctionArgs) {
// Checks if url has a homeId parameter, throws 400 if not there
// invariantResponse(params.homeId, 'homeId param is required')
Expand Down Expand Up @@ -81,7 +90,7 @@ export default function Inputs() {
<>
<Form id={form.id} method="post" onSubmit={form.onSubmit} action="/single">
<HomeInformation fields={fields} />
<CurrentHeatingSystem />
<CurrentHeatingSystem fields={fields} />
<EnergyUseHistory />
<ErrorList id={form.errorId} errors={form.errors} />
<Button type="submit">Submit</Button>
Expand Down

0 comments on commit b490059

Please sign in to comment.