Skip to content
Snippets Groups Projects
Commit c47b6948 authored by Briggs, Aaron Shane's avatar Briggs, Aaron Shane
Browse files

added placeholder secondary method id to state

parent 614874c9
No related branches found
No related tags found
1 merge request!372WDFN-734 Plot Secondary Time Series - add data retrieve option
......@@ -23,7 +23,7 @@
import {ref, inject} from 'vue';
import {useActions} from 'redux-connect-vue';
import {setSecondaryIVDataVisibility, setCompareDataVisibility, setMedianDataVisibility} from 'ml/store/hydrograph-state';
import {setSecondaryIVDataVisibility, setCompareDataVisibility, setMedianDataVisibility, setSelectedSecondaryIVMethodID} from 'ml/store/hydrograph-state';
import {retrieveSecondParameterIVData} from 'ml/store/hydrograph-data';
import {getTimeRange} from 'ml/selectors/hydrograph-data-selector';
import {showDataIndicators} from '../data-indicator';
......@@ -55,7 +55,8 @@ export default {
setSecondaryIVDataVisibility,
setCompareDataVisibility,
setMedianDataVisibility,
retrieveSecondParameterIVData
retrieveSecondParameterIVData,
setSelectedSecondaryIVMethodID
});
const showSecondParameterList = ref(false);
......@@ -96,6 +97,8 @@ export default {
endTime: currentTimeRange.end
}
).then(() => {
const sortedMethods = 'new method id';
actions.setSelectedSecondaryIVMethodID(sortedMethods);
showDataIndicators(false, reduxStore);
});
};
......
......@@ -10,6 +10,7 @@ export const INITIAL_STATE = {
selectedTimeSpan: 'P7D',
selectedParameterCode: null,
selectedIVMethodID: null,
selectedSecondaryIVMethodID: null,
graphCursorOffset: null,
graphBrushOffset: null
};
......@@ -75,6 +76,19 @@ export const setSelectedIVMethodID = function(methodID) {
};
};
/*
* Synchronous action to set the selected method ID secondary parameter (uniquely identifies the IV time series).
* Some parameter codes have more than one IV time series. The method ID distinguishes these
* @param {String} methodID
* @return {Object} - Redux action
*/
export const setSelectedSecondaryIVMethodID = function(methodID) {
return {
type: 'SET_SELECTED_SECONDARY_IV_METHOD_ID',
methodID
};
};
/*
* Synchronous action sets the time span of the hydrograph.
* @param {String or Object} timeSpan - Can either be a String representing an ISO8601 Duration or an
......@@ -178,6 +192,12 @@ export const hydrographStateReducer = function(hydrographState = INITIAL_STATE,
selectedIVMethodID: action.methodID
};
case 'SET_SELECTED_SECONDARY_IV_METHOD_ID':
return {
...hydrographState,
selectedSecondaryIVMethodID: action.methodID
};
case 'SET_SELECTED_TIME_SPAN':
if (typeof action.timeSpan === 'string') {
return {
......
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