From 5f562dbf4d7ff32e682f98ebf506c7aadbca6996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Chirico=20Indreb=C3=B8?= Date: Thu, 18 Jul 2024 09:21:05 +0200 Subject: [PATCH] Verify installation for inspection table --- .../InspectionPage/InspectionOverview.tsx | 18 ++++++++++-------- .../Pages/InspectionPage/InspectionSection.tsx | 4 +++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/Pages/InspectionPage/InspectionOverview.tsx b/frontend/src/components/Pages/InspectionPage/InspectionOverview.tsx index 0b4d8624c..cc9de3fd1 100644 --- a/frontend/src/components/Pages/InspectionPage/InspectionOverview.tsx +++ b/frontend/src/components/Pages/InspectionPage/InspectionOverview.tsx @@ -59,14 +59,16 @@ export const InspectionOverviewSection = () => { const anchorRef = useRef(null) - const allInspections = missionDefinitions.map((m) => { - return { - missionDefinition: m, - deadline: m.lastSuccessfulRun - ? getInspectionDeadline(m.inspectionFrequency, m.lastSuccessfulRun.endTime!) - : undefined, - } - }) + const allInspections = missionDefinitions + .filter((m) => m.installationCode === installationCode) + .map((m) => { + return { + missionDefinition: m, + deadline: m.lastSuccessfulRun + ? getInspectionDeadline(m.inspectionFrequency, m.lastSuccessfulRun.endTime!) + : undefined, + } + }) const fetchEchoMissions = () => { setIsFetchingEchoMissions(true) diff --git a/frontend/src/components/Pages/InspectionPage/InspectionSection.tsx b/frontend/src/components/Pages/InspectionPage/InspectionSection.tsx index 8de5f2645..d02745b3f 100644 --- a/frontend/src/components/Pages/InspectionPage/InspectionSection.tsx +++ b/frontend/src/components/Pages/InspectionPage/InspectionSection.tsx @@ -67,7 +67,9 @@ export const InspectionSection = () => { const deckMissions: DeckInspectionTuple[] = decks?.map(({ areas, deck }) => { - const missionDefinitionsInDeck = missionDefinitions.filter((m) => m.area?.deckName === deck.deckName) + const missionDefinitionsInDeck = missionDefinitions.filter( + (m) => m.area?.deckName === deck.deckName && m.installationCode === installationCode + ) return { inspections: missionDefinitionsInDeck.map((m) => { return {