Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trivial bug fixes #3921

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading