Skip to content

Commit

Permalink
Trivial bug fixes (#3921)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgboss authored Sep 12, 2024
1 parent 5493240 commit 6cfbdac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions web/src/features/fba/components/infoPanel/AdvisoryText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ const AdvisoryText = ({
{issueDate?.isValid ? (
<Typography data-testid="default-message">Please select a fire center.</Typography>
) : (
<Typography data-testid="no-data-message">No advisory data available for today.</Typography>
<Typography data-testid="no-data-message">No advisory data available for the selected date.</Typography>
)}{' '}
</>
)
}

const renderAdvisoryText = () => {
const forToday = issueDate?.toISODate() === forDate.toISODate()
const forToday = forDate.toISODate() === DateTime.now().toISODate()
const displayForDate = forToday ? 'today' : forDate.toLocaleString({ month: 'short', day: 'numeric' })

const fireCenterSummary = provincialSummary[selectedFireCenter!.name]
Expand All @@ -133,7 +133,7 @@ const AdvisoryText = ({
{!isUndefined(zoneStatus) && zoneStatus === AdvisoryStatus.WARNING && (
<Typography data-testid="advisory-message-warning">{message}</Typography>
)}
{!hasCriticalHours && (
{!hasCriticalHours && !isUndefined(zoneStatus) && (
<Typography data-testid="advisory-message-no-critical-hours" sx={{ paddingTop: '1rem' }}>
No critical hours available.
</Typography>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { selectFireCentreHFIFuelStats, selectFireCentreTPIStats } from '@/app/rootReducer'
import { calculateStatusColour } from '@/features/fba/calculateZoneStatus'
import { Box, Grid, Tab, Tabs, Tooltip } from '@mui/material'
import { Box, Grid, Tab, Tabs, Tooltip, Typography } from '@mui/material'
import { FireCenter, FireShape } from 'api/fbaAPI'
import { INFO_PANEL_CONTENT_BACKGROUND, theme } from 'app/theme'
import FireZoneUnitSummary from 'features/fba/components/infoPanel/FireZoneUnitSummary'
import InfoAccordion from 'features/fba/components/infoPanel/InfoAccordion'
import TabPanel from 'features/fba/components/infoPanel/TabPanel'
import { useFireCentreDetails } from 'features/fba/hooks/useFireCentreDetails'
import { isNull, isUndefined } from 'lodash'
import { isEmpty, isNull, isUndefined } from 'lodash'
import React, { useEffect, useMemo, useState } from 'react'
import { useSelector } from 'react-redux'

Expand Down Expand Up @@ -91,6 +91,11 @@ const FireZoneUnitTabs = ({
title={selectedFireCenter.name}
accordionDetailBackgroundColour={INFO_PANEL_CONTENT_BACKGROUND}
>
{isEmpty(sortedGroupedFireZoneUnits) && (
<Typography sx={{ paddingLeft: '1rem', paddingTop: '1rem' }}>
No advisory data available for the selected date.
</Typography>
)}
<Grid container justifyContent="center" minHeight={500}>
<Grid item sx={{ width: '95%' }}>
<Box>
Expand Down

0 comments on commit 6cfbdac

Please sign in to comment.