diff --git a/package-lock.json b/package-lock.json index 1ee4a0c4..69deb2cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3668,9 +3668,10 @@ "license": "ISC" }, "node_modules/ejs": { - "version": "3.1.8", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "jake": "^10.8.5" }, @@ -3826,12 +3827,14 @@ } }, "node_modules/es5-ext": { - "version": "0.10.62", + "version": "0.10.64", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", + "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", "hasInstallScript": true, - "license": "ISC", "dependencies": { "es6-iterator": "^2.0.3", "es6-symbol": "^3.1.3", + "esniff": "^2.0.1", "next-tick": "^1.1.0" }, "engines": { @@ -4226,6 +4229,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/esniff": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.62", + "event-emitter": "^0.3.5", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esniff/node_modules/type": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", + "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==" + }, "node_modules/espree": { "version": "9.6.0", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz", @@ -4292,6 +4314,15 @@ "node": ">=0.10.0" } }, + "node_modules/event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, "node_modules/events": { "version": "3.3.0", "license": "MIT", @@ -8601,9 +8632,9 @@ "license": "MIT" }, "node_modules/vite": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", - "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.3.tgz", + "integrity": "sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==", "dev": true, "dependencies": { "esbuild": "^0.18.10", @@ -11695,7 +11726,9 @@ "version": "2.2.4" }, "ejs": { - "version": "3.1.8", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, "requires": { "jake": "^10.8.5" @@ -11815,10 +11848,13 @@ } }, "es5-ext": { - "version": "0.10.62", + "version": "0.10.64", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", + "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", "requires": { "es6-iterator": "^2.0.3", "es6-symbol": "^3.1.3", + "esniff": "^2.0.1", "next-tick": "^1.1.0" } }, @@ -12104,6 +12140,24 @@ "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", "dev": true }, + "esniff": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", + "requires": { + "d": "^1.0.1", + "es5-ext": "^0.10.62", + "event-emitter": "^0.3.5", + "type": "^2.7.2" + }, + "dependencies": { + "type": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", + "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==" + } + } + }, "espree": { "version": "9.6.0", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz", @@ -12141,6 +12195,15 @@ "esutils": { "version": "2.0.3" }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, "events": { "version": "3.3.0" }, @@ -15050,9 +15113,9 @@ "version": "1.0.2" }, "vite": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", - "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.3.tgz", + "integrity": "sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==", "dev": true, "requires": { "esbuild": "^0.18.10", diff --git a/src/app-bundles/report-configurations-bundle.js b/src/app-bundles/report-configurations-bundle.js index 47d59b78..f5d6bcb2 100644 --- a/src/app-bundles/report-configurations-bundle.js +++ b/src/app-bundles/report-configurations-bundle.js @@ -1,3 +1,7 @@ +import { toast } from 'react-toastify'; + +import { tUpdateError, tUpdateSuccess } from '../common/helpers/toast-helpers'; + export default { name: 'reportConfigurations', getReducer: () => { @@ -40,6 +44,7 @@ export default { }, doCreateNewReportConfiguration: (data) => ({ store, apiPost }) => { + const toastId = toast.loading('Creating Report Configuration...'); const projectId = store.selectProjectsIdByRoute()?.projectId; const uri = `/projects/${projectId}/report_configs`; @@ -50,30 +55,24 @@ export default { apiPost(uri, body, (err, _body) => { if (err) { - // eslint-disable-next-line no-console - console.log('todo', err); + tUpdateError(toastId, "Failed to create Report Configuration"); } else { + tUpdateSuccess(toastId, "Successfully created Report Configuration"); store.doFetchReportConfigurationsByProjectId(); } }); }, doUpdateReportConfiguration: (data) => ({ store, apiPut }) => { - const { id, name, description, plot_configs } = data; + const toastId = toast.loading('Updating Report Configuration...'); const projectId = store.selectProjectsIdByRoute()?.projectId; + const uri = `/projects/${projectId}/report_configs/${data?.id}`; - const uri = `/projects/${projectId}/report_configs/${id}`; - const body = { - name, - description, - plot_configs, - }; - - apiPut(uri, body, (err, _body) => { + apiPut(uri, data, (err, _body) => { if (err) { - // eslint-disable-next-line no-console - console.log('todo', err); + tUpdateError(toastId, "Failed to update Report Configuration"); } else { + tUpdateSuccess(toastId, "Successfully updated Report Configuration"); store.doFetchReportConfigurationsByProjectId(); } }); diff --git a/src/app-pages/project/batch-plotting/helper.js b/src/app-pages/project/batch-plotting/helper.js index 70a1f42f..fa515144 100644 --- a/src/app-pages/project/batch-plotting/helper.js +++ b/src/app-pages/project/batch-plotting/helper.js @@ -38,6 +38,7 @@ export const generateNewChartData = (measurements, timeseries, chartSettings, pl } = timeseries.find(t => t.id === timeseries_id) || {}; if (!instrument) { + // eslint-disable-next-line no-console console.error('Error: timeseries id (%s) does not exist in `timeseries` array.', String(timeseries_id)); return; } diff --git a/src/app-pages/project/batch-plotting/modals/components/SecondaryAxis.jsx b/src/app-pages/project/batch-plotting/modals/components/SecondaryAxis.jsx index ef78383e..520629b6 100644 --- a/src/app-pages/project/batch-plotting/modals/components/SecondaryAxis.jsx +++ b/src/app-pages/project/batch-plotting/modals/components/SecondaryAxis.jsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Button, Divider, FormControl, Input, InputLabel, MenuItem, Select } from '@mui/material'; +import { Button, FormControl, Input, InputLabel, MenuItem, Select } from '@mui/material'; import { connect } from 'redux-bundler-react'; const generateTimeseriesOptions = (timeseriesIds = [], timeseries = []) => { diff --git a/src/app-pages/project/batch-plotting/tab-content/batch-plot-chart.jsx b/src/app-pages/project/batch-plotting/tab-content/batch-plot-chart.jsx index 80e7081f..3dc9c3e3 100644 --- a/src/app-pages/project/batch-plotting/tab-content/batch-plot-chart.jsx +++ b/src/app-pages/project/batch-plotting/tab-content/batch-plot-chart.jsx @@ -9,7 +9,7 @@ import ChartErrors from '../components/batch-plot-errors'; import { generateNewChartData } from '../helper'; const BatchPlotChart = connect( - 'doPrintSetData', + // 'doPrintSetData', 'doTimeseriesMeasurementsFetchById', 'doBatchPlotConfigurationsSave', 'selectBatchPlotConfigurationsActiveId', @@ -17,7 +17,7 @@ const BatchPlotChart = connect( 'selectTimeseriesMeasurementsItems', 'selectInstrumentTimeseriesItems', ({ - doPrintSetData, + // doPrintSetData, doTimeseriesMeasurementsFetchById, doBatchPlotConfigurationsSave, batchPlotConfigurationsActiveId: activeId, diff --git a/src/app-pages/project/dashboard/modals/newReportConfigContent.jsx b/src/app-pages/project/dashboard/modals/newReportConfigContent.jsx index 625c7a8e..d1c79d86 100644 --- a/src/app-pages/project/dashboard/modals/newReportConfigContent.jsx +++ b/src/app-pages/project/dashboard/modals/newReportConfigContent.jsx @@ -29,11 +29,11 @@ const initFormState = (initValue = {}) => { }, show_masked: { enabled: false, - value: '', + value: true, }, show_nonvalidated: { enabled: false, - value: '', + value: true, } }, } = initValue; @@ -234,7 +234,7 @@ const NewReportConfigContent = connect( size='small' id='masked-select' value={String(formState?.global_overrides?.show_masked?.value)} - onChange={e => setFormState(prev => setGlobalOverrides(prev, 'show_masked', 'value', String(e.target.value)))} + onChange={e => setFormState(prev => setGlobalOverrides(prev, 'show_masked', 'value', Boolean(e.target.value)))} sx={{ width: '250px' }} > Hide Masked Values @@ -254,7 +254,7 @@ const NewReportConfigContent = connect( size='small' id='non-validated-select' value={String(formState?.global_overrides?.show_nonvalidated?.value)} - onChange={e => setFormState(prev => setGlobalOverrides(prev, 'show_nonvalidated', 'value', String(e.target.value)))} + onChange={e => setFormState(prev => setGlobalOverrides(prev, 'show_nonvalidated', 'value', Boolean(e.target.value)))} sx={{ width: '250px' }} > Hide Non-Validated Values