Skip to content

Commit

Permalink
Verify installation for inspection table
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Jul 19, 2024
1 parent 33746dd commit 5f562db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ export const InspectionOverviewSection = () => {

const anchorRef = useRef<HTMLButtonElement>(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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5f562db

Please sign in to comment.