diff --git a/src/app-bundles/time-series-bundle.js b/src/app-bundles/time-series-bundle.js index 9809ca72..0d513254 100644 --- a/src/app-bundles/time-series-bundle.js +++ b/src/app-bundles/time-series-bundle.js @@ -33,14 +33,12 @@ export default createRestBundle({ doSaveFieldNamesToTimeseries: (newObject, instrumentId, dataLoggerId, tableId) => ({ dispatch, store, apiPost }) => { dispatch({ type: 'ASSIGN_FIELD_NAMES_TO_TIMESERIES_START' }); const toastId = tLoading('Creating new timeseries...'); - const { projectId } = store.selectProjectsIdByRoute(); const { newTs, existingTs } = newObject; const uri = '/timeseries'; const formData = []; newTs.forEach(item => formData.push({ - project_id: projectId, instrument_id: instrumentId, name: item?.field_name, })); diff --git a/src/app-pages/project/batch-plotting/helper.js b/src/app-pages/project/batch-plotting/helper.js index e199970e..9f938da1 100644 --- a/src/app-pages/project/batch-plotting/helper.js +++ b/src/app-pages/project/batch-plotting/helper.js @@ -12,8 +12,6 @@ const getStyle = (_index) => ({ export const generateNewChartData = (measurements, timeseries, chartSettings) => { const { show_comments, show_masked, show_nonvalidated } = chartSettings || {}; - console.log('test measurements, ts', measurements, timeseries) - if (measurements.length && timeseries.length) { const data = measurements.map((elem, index) => { if (elem && timeseries.length) { diff --git a/src/upload-parsers/inclinometer_measurements.js b/src/upload-parsers/inclinometer_measurements.js index b21f95c8..6920a4ed 100644 --- a/src/upload-parsers/inclinometer_measurements.js +++ b/src/upload-parsers/inclinometer_measurements.js @@ -34,12 +34,8 @@ const inclinometerMeasurementParser = { required: true, useFilterComponent: true, provider: state => { - const regex = new RegExp('/projects/(.*)/instruments'); - const match = state.instruments._lastResource.match(regex); - const projectId = match && match.length >= 2 ? match[1] : ''; - return Object.keys(state.instrumentTimeseries) - .filter(key => (key.charAt(0) !== '_' && state.instrumentTimeseries[key].project_id === projectId)) + .filter(key => key.charAt(0) !== '_') .map(key => ({ value: key, text: `${state.instrumentTimeseries[key].instrument} - ${state.instrumentTimeseries[key].name}`, diff --git a/src/upload-parsers/timeseries_measurements.js b/src/upload-parsers/timeseries_measurements.js index b1acbf08..75cba858 100644 --- a/src/upload-parsers/timeseries_measurements.js +++ b/src/upload-parsers/timeseries_measurements.js @@ -7,12 +7,11 @@ const timeseriesMeasurementParser = { prePostFilter: (data) => ( /** this will work for single timeseries_id, needs to be updated to allow for multiple */ data.reduce((accum, current) => { - const { timeseries_id, time, value, masked, validated, annotation, project_id } = current; + const { timeseries_id, time, value, masked, validated, annotation } = current; return ({ ...accum, timeseries_id, - project_id, items: (accum['items'] || []).concat([{ time: DateTime.fromISO(time, { zone: 'utc' }), value, @@ -30,12 +29,8 @@ const timeseriesMeasurementParser = { required: true, useFilterComponent: true, provider: state => { - const regex = new RegExp('/projects/(.*)/instruments'); - const match = state.instruments._lastResource.match(regex); - const projectId = match && match.length >= 2 ? match[1] : ''; - return Object.keys(state.instrumentTimeseries) - .filter(key => (key.charAt(0) !== '_' && state.instrumentTimeseries[key].project_id === projectId)) + .filter(key => key.charAt(0) !== '_') .map(key => ({ value: key, text: `${state.instrumentTimeseries[key].instrument} - ${state.instrumentTimeseries[key].name}`,