From c47b6948027908be6f4cd5a6c37fdbd1a9d00b38 Mon Sep 17 00:00:00 2001 From: Aaron Briggs <abriggs@contractor.usgs.gov> Date: Fri, 1 Jul 2022 09:31:34 -0500 Subject: [PATCH] added placeholder secondary method id to state --- .../secondary-parameter-controls.vue | 7 +++++-- .../store/hydrograph-state.js | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/secondary-parameter-controls.vue b/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/secondary-parameter-controls.vue index 8d303ecb7..1d580ca46 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/secondary-parameter-controls.vue +++ b/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/secondary-parameter-controls.vue @@ -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); }); }; diff --git a/assets/src/scripts/monitoring-location/store/hydrograph-state.js b/assets/src/scripts/monitoring-location/store/hydrograph-state.js index de21dcedf..807cb3ae3 100644 --- a/assets/src/scripts/monitoring-location/store/hydrograph-state.js +++ b/assets/src/scripts/monitoring-location/store/hydrograph-state.js @@ -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 { -- GitLab