-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58e9c9c
commit 071d793
Showing
4 changed files
with
54 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/app-pages/project/batch-plotting/components/cwms-errors.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Box } from '@mui/material'; | ||
import React from 'react'; | ||
|
||
const CwmsErrors = ({ | ||
midasCwmsTimeseries, | ||
cwmsMeasurementsErrors, | ||
}) => { | ||
const errorIdxs = cwmsMeasurementsErrors.map((el, ind) => { | ||
if (el === true) return ind; | ||
else return null; | ||
}).filter(e => e); | ||
|
||
const errorTimeseries = (errorIdxs?.length) ? midasCwmsTimeseries.filter((_el, ind) => errorIdxs.includes(ind)) : []; | ||
const errorTimeseriesIds = [...new Set(errorTimeseries.map(el => el.cwms_timeseries_id))]; | ||
|
||
return ( | ||
<Box sx={{ marginTop: '10px' }}> | ||
{!!errorTimeseriesIds?.length && ( | ||
<span className='text-danger px-2'> | ||
The following selected CWMS timeseries have not returned data. We recommend using a smaller time range or a less frequent sampling rate: | ||
<ul> | ||
{errorTimeseriesIds.map(el => ( | ||
<li key={el}>{el}</li> | ||
))} | ||
</ul> | ||
</span> | ||
)} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default CwmsErrors; |