mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
addded changes to let build work
This commit is contained in:
parent
2b02e3714b
commit
f8db2da9e6
7 changed files with 50 additions and 25 deletions
1
run_build.sh
Normal file
1
run_build.sh
Normal file
|
|
@ -0,0 +1 @@
|
|||
npm run build
|
||||
|
|
@ -10,7 +10,7 @@ import {
|
|||
boolean,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { InferModel } from "drizzle-orm";
|
||||
import { C } from "drizzle-orm/db.d-cf0abe10";
|
||||
// import { C } from "drizzle-orm/db.d-cf0abe10";
|
||||
|
||||
export const solar = pgTable("solar", {
|
||||
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
// insertUploadedFile.ts
|
||||
import { uploaded_files } from "@/app/db/surveyDB/schema/surveyDB";
|
||||
import { uploaded_files, docTypeEnum } from "@/app/db/surveyDB/schema/surveyDB";
|
||||
import { surveyDB } from "../connection";
|
||||
import type { ReportType, ReportTypeSchema} from "../schema/documents";
|
||||
import { reportTypeToDbLabel } from "../schema/documents";
|
||||
type DbDocType = (typeof docTypeEnum.enumValues)[number];
|
||||
|
||||
export interface UploadedFileInput {
|
||||
s3JsonUri?: string; // optional
|
||||
|
|
@ -19,7 +20,7 @@ export async function insertUploadedFile(data: UploadedFileInput) {
|
|||
.values({
|
||||
s3JsonUri: data.s3JsonUri ?? null, // Pass null if missing
|
||||
s3FileUri: data.s3FileUri,
|
||||
docType: reportTypeToDbLabel[data.docType], // map UI value -> DB enum NAME
|
||||
docType: reportTypeToDbLabel[data.docType] as DbDocType, // map UI value -> DB enum NAME
|
||||
s3FileUploadTimestamp: data.s3FileUploadTimestamp,
|
||||
s3JsonUploadTimestamp: data.s3JsonUploadTimestamp ?? null, // Pass null if missing
|
||||
uprn: data.uprn,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { Menu, Transition } from "@headlessui/react";
|
|||
import { Fragment } from "react";
|
||||
import { Button } from "@/app/shadcn_components/ui/button";
|
||||
import { PlusIcon, ChevronDownIcon } from "@heroicons/react/20/solid";
|
||||
import { Float } from "@headlessui-float/react";
|
||||
// import { Float } from "@headlessui-float/react";
|
||||
|
||||
export type Option = { label: string; value: string; disabled?: boolean };
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
"use client";
|
||||
|
||||
import { Dialog, Transition } from "@headlessui/react";
|
||||
import {
|
||||
Dialog,
|
||||
DialogBackdrop,
|
||||
DialogPanel,
|
||||
DialogTitle,
|
||||
Transition,
|
||||
TransitionChild,
|
||||
} from "@headlessui/react";
|
||||
|
||||
import { Fragment, useMemo } from "react";
|
||||
import { Input } from "@/app/shadcn_components/ui/input";
|
||||
import { Button } from "@/app/shadcn_components/ui/button";
|
||||
|
|
@ -542,7 +550,7 @@ export default function RemoteAssessmentModal({
|
|||
onClose={() => setIsOpen(false)}
|
||||
>
|
||||
<div className="min-h-screen px-4 text-center">
|
||||
<Transition.Child
|
||||
<TransitionChild
|
||||
as={Fragment}
|
||||
enter="ease-out duration-300"
|
||||
enterFrom="opacity-0"
|
||||
|
|
@ -551,8 +559,8 @@ export default function RemoteAssessmentModal({
|
|||
leaveFrom="opacity-100"
|
||||
leaveTo="opacity-0"
|
||||
>
|
||||
<Dialog.Overlay className="fixed inset-0 bg-black bg-opacity-25" />
|
||||
</Transition.Child>
|
||||
<DialogBackdrop className="fixed inset-0 bg-black/25" />
|
||||
</TransitionChild>
|
||||
|
||||
{/* Spacer for centering */}
|
||||
<span
|
||||
|
|
@ -562,7 +570,7 @@ export default function RemoteAssessmentModal({
|
|||
​
|
||||
</span>
|
||||
|
||||
<Transition.Child
|
||||
<TransitionChild
|
||||
as={Fragment}
|
||||
enter="ease-out duration-300"
|
||||
enterFrom="opacity-0 scale-95"
|
||||
|
|
@ -571,10 +579,10 @@ export default function RemoteAssessmentModal({
|
|||
leaveFrom="opacity-100 scale-100"
|
||||
leaveTo="opacity-0 scale-95"
|
||||
>
|
||||
<div className="inline-block w-full max-w-2xl p-6 my-8 overflow-visible text-left align-middle transition-all transform bg-white shadow-xl rounded-2xl">
|
||||
<Dialog.Title className="text-lg font-medium">
|
||||
<DialogPanel className="inline-block w-full max-w-2xl p-6 my-8 overflow-visible text-left align-middle transition-all transform bg-white shadow-xl rounded-2xl">
|
||||
<DialogTitle className="text-lg font-medium">
|
||||
Remote Assessment Details
|
||||
</Dialog.Title>
|
||||
</DialogTitle>
|
||||
|
||||
<FormProvider {...form}>
|
||||
<form onSubmit={onSubmit} className="space-y-6 mt-4">
|
||||
|
|
@ -929,8 +937,8 @@ export default function RemoteAssessmentModal({
|
|||
)}
|
||||
</form>
|
||||
</FormProvider>
|
||||
</div>
|
||||
</Transition.Child>
|
||||
</DialogPanel>
|
||||
</TransitionChild>
|
||||
</div>
|
||||
</Dialog>
|
||||
</Transition>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
"use client";
|
||||
|
||||
import { Dialog, Transition } from "@headlessui/react";
|
||||
import {
|
||||
Dialog,
|
||||
DialogBackdrop,
|
||||
DialogPanel,
|
||||
DialogTitle,
|
||||
Transition,
|
||||
TransitionChild,
|
||||
} from "@headlessui/react";
|
||||
|
||||
import { Fragment, useMemo, useState } from "react";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { InputFile } from "@/app/portfolio/[slug]/components/InputFile";
|
||||
|
|
@ -427,7 +435,7 @@ export default function UploadCsvModal({
|
|||
onClose={() => setIsOpen(false)}
|
||||
>
|
||||
<div className="min-h-screen px-4 text-center">
|
||||
<Transition.Child
|
||||
<TransitionChild
|
||||
as={Fragment}
|
||||
enter="ease-out duration-300"
|
||||
enterFrom="opacity-0"
|
||||
|
|
@ -436,15 +444,15 @@ export default function UploadCsvModal({
|
|||
leaveFrom="opacity-100"
|
||||
leaveTo="opacity-0"
|
||||
>
|
||||
<Dialog.Overlay className="fixed inset-0 bg-black bg-opacity-25" />
|
||||
</Transition.Child>
|
||||
<DialogBackdrop className="fixed inset-0 bg-black bg-opacity-25" />
|
||||
</TransitionChild>
|
||||
<span
|
||||
className="inline-block h-screen align-middle"
|
||||
aria-hidden="true"
|
||||
>
|
||||
​
|
||||
</span>
|
||||
<Transition.Child
|
||||
<TransitionChild
|
||||
as={Fragment}
|
||||
enter="ease-out duration-300"
|
||||
enterFrom="opacity-0 scale-95"
|
||||
|
|
@ -454,9 +462,9 @@ export default function UploadCsvModal({
|
|||
leaveTo="opacity-0 scale-95"
|
||||
>
|
||||
<div className="inline-block w-full max-w-2xl p-6 my-8 overflow-visible text-left align-middle transition-all transform bg-white shadow-xl rounded-2xl">
|
||||
<Dialog.Title className="text-lg font-medium">
|
||||
<DialogTitle className="text-lg font-medium">
|
||||
Upload Property Data
|
||||
</Dialog.Title>
|
||||
</DialogTitle>
|
||||
<FormProvider {...form}>
|
||||
<form
|
||||
onSubmit={onSubmit}
|
||||
|
|
@ -745,7 +753,7 @@ export default function UploadCsvModal({
|
|||
</form>
|
||||
</FormProvider>
|
||||
</div>
|
||||
</Transition.Child>
|
||||
</TransitionChild>
|
||||
</div>
|
||||
</Dialog>
|
||||
</Transition>
|
||||
|
|
|
|||
|
|
@ -14,9 +14,16 @@ const DialogPortal = ({
|
|||
className,
|
||||
children,
|
||||
...props
|
||||
}: DialogPrimitive.DialogPortalProps) => (
|
||||
<DialogPrimitive.Portal className={cn(className)} {...props}>
|
||||
<div className="fixed inset-0 z-50 flex items-start justify-center sm:items-center">
|
||||
}: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal> & {
|
||||
className?: string
|
||||
}) => (
|
||||
<DialogPrimitive.Portal {...props}>
|
||||
<div
|
||||
className={cn(
|
||||
"fixed inset-0 z-50 flex items-start justify-center sm:items-center",
|
||||
className
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
</DialogPrimitive.Portal>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue