Skip to content
Snippets Groups Projects
Commit 1aea7a19 authored by Bucknell, Mary S.'s avatar Bucknell, Mary S.
Browse files

Fixed setting initial gage height value.

parent ad55beb8
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,9 @@ import {fetchGroundwaterLevels} from 'ui/web-services/groundwater-levels';
import {fetchTimeSeries} from 'ui/web-services/instantaneous-values';
import {getConvertedTemperatureParameter, hasMeasuredFahrenheitParameter} from 'ml/iv-data-utils';
import {Actions as floodStateActions} from './flood-inundation';
const GAGE_HEIGHT_PARAMETER_CODE = '00065';
/*
* Synchronous Redux action - updatethe hydrograph variables
......@@ -41,6 +44,11 @@ export const retrieveHydrographParameters = function(siteno) {
unit: ts.variable.unit.unitCode,
hasIVData: true
};
// If the parameter is for gage height set the initial flood gage height
if (parameterCode === GAGE_HEIGHT_PARAMETER_CODE) {
dispatch(floodStateActions.setGageHeight(parseFloat(ts.values[0].value[0].value)));
}
// If it is a celsius parameterCode, add a variable for calculated Fahrenheit.
if (config.TEMPERATURE_PARAMETERS.celsius.includes(parameterCode) &&
!hasMeasuredFahrenheitParameter(parameterCode, allParameterCodes)) {
......
......@@ -107,7 +107,6 @@ describe('monitoring-location/store/hydrograph-parameters', () => {
expect(hydrographParameters['72019'].hasGWLevelsData).toBeTruthy();
expect(hydrographParameters['62610'].hasGWLevelsData).toBeTruthy();
expect(hydrographParameters['62611'].hasGWLevelsData).toBeTruthy();
});
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment