diff --git a/frontend/src/components/Pages/InspectionPage/InspectionTable.tsx b/frontend/src/components/Pages/InspectionPage/InspectionTable.tsx index 050cb9349..1678c5e5f 100644 --- a/frontend/src/components/Pages/InspectionPage/InspectionTable.tsx +++ b/frontend/src/components/Pages/InspectionPage/InspectionTable.tsx @@ -193,7 +193,7 @@ const InspectionRow = ({ {mission.comment} - {mission.area.areaName} + {mission.area ? mission.area.areaName : '-'} {lastCompleted} {inspection.deadline ? formatDateString(inspection.deadline.toISOString()) : ''} diff --git a/frontend/src/components/Pages/MissionDefinitionPage/MissionDefinitionPage.tsx b/frontend/src/components/Pages/MissionDefinitionPage/MissionDefinitionPage.tsx index d45faef99..95e353010 100644 --- a/frontend/src/components/Pages/MissionDefinitionPage/MissionDefinitionPage.tsx +++ b/frontend/src/components/Pages/MissionDefinitionPage/MissionDefinitionPage.tsx @@ -79,8 +79,8 @@ function MissionDefinitionPageBody({ missionDefinition, updateMissionDefinition const { TranslateText } = useLanguageContext() let navigate = useNavigate() - const displayInspectionFrequency = (inspectionFrequency: string) => { - if (inspectionFrequency === null) return TranslateText('No inspection frequency set') + const displayInspectionFrequency = (inspectionFrequency: string | undefined) => { + if (inspectionFrequency === undefined) return TranslateText('No inspection frequency set') const timeArray = inspectionFrequency.split(':') const days: number = +timeArray[0] const hours: number = +timeArray[1] @@ -101,10 +101,22 @@ function MissionDefinitionPageBody({ missionDefinition, updateMissionDefinition left={TranslateText('Inspection frequency')} right={displayInspectionFrequency(missionDefinition.inspectionFrequency)} /> - - - - + + + + { } export const getInspectionDeadline = ( - inspectionFrequency: string | null, + inspectionFrequency: string | undefined, lastRunTime: Date | null ): Date | undefined => { if (!inspectionFrequency || !lastRunTime) return undefined