From d43553a27bd53682c27934321208290838ce5055 Mon Sep 17 00:00:00 2001 From: Kevin Jackson <30411845+KevinJJackson@users.noreply.github.com> Date: Fri, 8 Mar 2024 10:35:47 -0500 Subject: [PATCH] bugfix/timeseries-masking (#215) - fixes checking masked and validated fields on instrument timeseries --- package.json | 2 +- src/app-bundles/time-series-measurements-bundle.js | 2 +- src/app-pages/instrument/timeseries/timeseries.jsx | 4 ++-- src/upload-parsers/timeseries_measurements.js | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 41548cd5..131388a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hhd-ui", - "version": "0.15.5", + "version": "0.15.6", "private": true, "dependencies": { "@ag-grid-community/client-side-row-model": "^30.0.3", diff --git a/src/app-bundles/time-series-measurements-bundle.js b/src/app-bundles/time-series-measurements-bundle.js index c4e60123..eea2c441 100644 --- a/src/app-bundles/time-series-measurements-bundle.js +++ b/src/app-bundles/time-series-measurements-bundle.js @@ -75,7 +75,7 @@ export default createRestBundle({ }); }, - doPostTimeseriesMeasurements: ({ measurements = []}) => ({ store, apiPost }) => { + doPostTimeseriesMeasurements: ({ measurements = [] }) => ({ store, apiPost }) => { const project = store['selectProjectsIdByRoute'](); const { projectId } = project; diff --git a/src/app-pages/instrument/timeseries/timeseries.jsx b/src/app-pages/instrument/timeseries/timeseries.jsx index 2ad4bed6..643599a9 100644 --- a/src/app-pages/instrument/timeseries/timeseries.jsx +++ b/src/app-pages/instrument/timeseries/timeseries.jsx @@ -143,8 +143,8 @@ export default connect( newValue.value = new Number(value); if (field === 'time') doTimeseriesMeasurementsDelete({ timeseriesId: activeTimeseries, date: oldValue }); - if (field === 'validated') newValue.validated = validated === 'true'; - if (field === 'masked') newValue.masked = masked === 'true'; + if (field === 'validated') newValue.validated = validated === true; + if (field === 'masked') newValue.masked = masked === true; doTimeseriesMeasurementsSave({ timeseries_id: activeTimeseries, diff --git a/src/upload-parsers/timeseries_measurements.js b/src/upload-parsers/timeseries_measurements.js index 75cba858..82abcf4c 100644 --- a/src/upload-parsers/timeseries_measurements.js +++ b/src/upload-parsers/timeseries_measurements.js @@ -1,6 +1,7 @@ import { DateTime } from 'luxon'; import { isNumeric } from '../common/helpers/utils'; +// TODO: Transition this to pass an array, instead of an object, to the timeseries_measurements endpoint. const timeseriesMeasurementParser = { name: 'Timeseries Measurement', url: '/projects/:projectId/timeseries_measurements',