diff --git a/.DS_Store b/.DS_Store index 113c4aa..f3bfd60 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/api/src/pilot/certificate/certificate.entity.ts b/api/src/pilot/certificate/certificate.entity.ts index e578c08..3c2c143 100644 --- a/api/src/pilot/certificate/certificate.entity.ts +++ b/api/src/pilot/certificate/certificate.entity.ts @@ -1,7 +1,5 @@ export class Certificate { - partitionKey: string; - rowKey: string; type: string; - issueDate: Date; - number?: string; + issueDate: string; + number: string; } diff --git a/api/src/pilot/pilot.controller.ts b/api/src/pilot/pilot.controller.ts index d255163..a29116d 100644 --- a/api/src/pilot/pilot.controller.ts +++ b/api/src/pilot/pilot.controller.ts @@ -51,9 +51,23 @@ export class PilotController { @Post() async create(@Body() pilotDto: PilotDto) { try { - const pilot = new Pilot(); - - Object.assign(pilot, pilotDto); + let pilot = new Pilot(); + + pilot = { + partitionKey: pilotDto.partitionKey, + rowKey: pilotDto.rowKey, + id: pilotDto.id, + name: pilotDto.name, + address: pilotDto.address, + city: pilotDto.city, + state: pilotDto.state, + postalCode: pilotDto.postalCode, + email: pilotDto.email, + phone: pilotDto.phone, + medicalClass: pilotDto.medicalClass, + medicalExpiration: pilotDto.medicalExpiration, + certificates: JSON.stringify(pilotDto.certificates) + } return await this.pilotService.create(pilot); } catch (error) { @@ -70,9 +84,23 @@ export class PilotController { @Body() pilotDto: PilotDto ) { try { - const pilot = new Pilot(); + let pilot = new Pilot(); - Object.assign(pilot, pilotDto); + pilot = { + partitionKey: pilotDto.partitionKey, + rowKey: pilotDto.rowKey, + id: pilotDto.id, + name: pilotDto.name, + address: pilotDto.address, + city: pilotDto.city, + state: pilotDto.state, + postalCode: pilotDto.postalCode, + email: pilotDto.email, + phone: pilotDto.phone, + medicalClass: pilotDto.medicalClass, + medicalExpiration: pilotDto.medicalExpiration, + certificates: JSON.stringify(pilotDto.certificates) + } return await this.pilotService.update(partitionKey, rowKey, pilot); } catch (error) { diff --git a/api/src/pilot/pilot.dto.ts b/api/src/pilot/pilot.dto.ts index 8247399..5183b72 100644 --- a/api/src/pilot/pilot.dto.ts +++ b/api/src/pilot/pilot.dto.ts @@ -1,3 +1,5 @@ +import { Certificate } from "./certificate/certificate.entity"; + export class PilotDto { partitionKey: string; rowKey: string; @@ -9,4 +11,7 @@ export class PilotDto { postalCode: string; email?: string; phone?: string; + medicalClass?: string; + medicalExpiration?: string; + certificates: Certificate; } diff --git a/api/src/pilot/pilot.entity.ts b/api/src/pilot/pilot.entity.ts index 7405b24..74b25b3 100644 --- a/api/src/pilot/pilot.entity.ts +++ b/api/src/pilot/pilot.entity.ts @@ -11,4 +11,7 @@ export class Pilot { @EntityString() postalCode?: string; @EntityString() email?: string; @EntityString() phone?: string; + @EntityString() medicalClass?: string; + @EntityString() medicalExpiration: string; + @EntityString() certificates: string; } diff --git a/app/package.json b/app/package.json index b6ab024..ff79115 100644 --- a/app/package.json +++ b/app/package.json @@ -13,7 +13,7 @@ "dependencies": { "@azure/msal-browser": "^4.0.1", "@azure/msal-react": "^3.0.1", - "@noahspan/noahspan-components": "^0.8.9", + "@noahspan/noahspan-components": "^1.3.1", "axios": "^1.7.2", "dotenv": "^16.4.7", "react": "^18.3.1", diff --git a/app/src/components/actionMenu/ActionMenu.tsx b/app/src/components/actionMenu/ActionMenu.tsx index e6ad4d7..40f0280 100644 --- a/app/src/components/actionMenu/ActionMenu.tsx +++ b/app/src/components/actionMenu/ActionMenu.tsx @@ -1,15 +1,13 @@ import { useState } from 'react'; import { IActionMenuProps } from './IActionMenuProps'; import { - EllipsisVerticalIcon, - EyeIcon, IconButton, + Icon, + IconName, ListItemIcon, ListItemText, Menu, - MenuItem, - PenIcon, - TrashIcon + MenuItem } from '@noahspan/noahspan-components'; import { FormMode } from '../../enums/formMode'; import { useIsAuthenticated } from '@azure/msal-react'; @@ -31,7 +29,7 @@ const ActionMenu = ({ id, onDelete, onOpenCloseForm }: IActionMenuProps) => { 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 ( +