From fe46d62b330a81fc12637dfa9c033f227ef001f8 Mon Sep 17 00:00:00 2001 From: Noah Spannbauer Date: Sun, 2 Mar 2025 10:31:11 -0600 Subject: [PATCH] adding certificates to pilot form --- .DS_Store | Bin 8196 -> 8196 bytes .../pilot/certificate/certificate.entity.ts | 6 +- api/src/pilot/pilot.controller.ts | 38 +- api/src/pilot/pilot.dto.ts | 5 + api/src/pilot/pilot.entity.ts | 3 + app/package.json | 2 +- app/src/components/actionMenu/ActionMenu.tsx | 16 +- .../confirmationDialog/ConfirmationDialog.tsx | 9 +- app/src/components/logForm/LogForm.tsx | 19 +- app/src/components/logbook/Logbook.tsx | 23 +- app/src/components/pilotForm/PilotForm.tsx | 32 +- ...icate.type.ts => Certificate.interface.ts} | 2 +- .../IPilotFormCertificates.ts | 5 - .../PilotFormCertificates.tsx | 285 ++++---- .../PilotFormCertificatesProps.interface.ts | 6 + .../pilotFormMedical/PilotFormMedical.tsx | 2 +- app/src/components/pilots/Pilots.tsx | 16 +- app/src/components/siteNav/SiteNav.tsx | 15 +- pnpm-lock.yaml | 623 ++++++------------ 19 files changed, 453 insertions(+), 654 deletions(-) rename app/src/components/pilotFormCertificates/{certificate.type.ts => Certificate.interface.ts} (65%) delete mode 100644 app/src/components/pilotFormCertificates/IPilotFormCertificates.ts create mode 100644 app/src/components/pilotFormCertificates/PilotFormCertificatesProps.interface.ts diff --git a/.DS_Store b/.DS_Store index 113c4aa5743beff2c30013cb4636e889651ca30d..f3bfd60d241b31906b2fca4459b7638dd9442539 100644 GIT binary patch delta 40 pcmZp1XmOa}&nUhzU^hRb_+}n~Y}U=|MI)FdHdt(CmneX7OaTnj4H^Id delta 138 zcmZp1XmOa}&nU4mU^hRb#AY6WY*ynuhJ1z;hE#@lhFmbKlpzPmEB4IEPfp6oPhwzT e5MW?nlm%kG|6sttu(?PymT5D)L;< { return (
- + { {isAuthenticated && onOpenCloseForm(FormMode.EDIT, id)}> - + Edit } onOpenCloseForm(FormMode.VIEW, id)}> - + View @@ -58,7 +56,7 @@ const ActionMenu = ({ id, onDelete, onOpenCloseForm }: IActionMenuProps) => {
onDelete(id)}> - + Delete diff --git a/app/src/components/confirmationDialog/ConfirmationDialog.tsx b/app/src/components/confirmationDialog/ConfirmationDialog.tsx index 9607489..1bb0086 100644 --- a/app/src/components/confirmationDialog/ConfirmationDialog.tsx +++ b/app/src/components/confirmationDialog/ConfirmationDialog.tsx @@ -1,14 +1,13 @@ import { Box, Button, - CircleCheckIcon, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, - Spinner, - XmarkIcon + Icon, + Spinner } from '@noahspan/noahspan-components'; import { IDialogConfirmationProps } from './IConfirmationDialogProps'; @@ -34,13 +33,13 @@ const ConfirmationDialog = ({ {isLoading && } - diff --git a/app/src/components/logForm/LogForm.tsx b/app/src/components/logForm/LogForm.tsx index 13c0aad..4644495 100644 --- a/app/src/components/logForm/LogForm.tsx +++ b/app/src/components/logForm/LogForm.tsx @@ -5,16 +5,15 @@ import { AccordionSummary, Alert, Button, - ChevronDownIcon, DatePicker, Drawer, Grid, + Icon, IconButton, - SaveIcon, + IconName, Select, TextField, Typography, - XmarkIcon } from '@noahspan/noahspan-components'; import { useForm, Controller, FormProvider } from 'react-hook-form'; import { ILogFormProps } from './ILogFormProps'; @@ -179,7 +178,7 @@ const LogForm: React.FC = ({ - + {state.alert && ( @@ -208,7 +207,7 @@ const LogForm: React.FC = ({ -// -// -// -// -// -// -// ); -// }} -// /> -//
-//
-// { -// return ; -// }} -// /> -//
-//
-// { -// return ( -// { -// setValue(`certificates.${index}.dateOfIssue`, date); -// }} -// inputProps={{ -// value: field.value -// }} -// /> -// ); -// }} -// /> -//
-//
-// -//
-// -// ); -// })} -//
-// -//
-// -// ); -// }; + return ( + + + Certificates + + {fields.length > 0 && ( + <> + + Type + + + Number + + + Date of Issue + + + + {fields.map((field, index) => { + return ( + <> + + { + return ( +