Skip to content

Commit

Permalink
bugfix/uploader-timeseries-id (#236)
Browse files Browse the repository at this point in the history
* fix options that render via fieldmap key instead of from csv data source
* filter TS by standard
  • Loading branch information
KevinJJackson authored Aug 23, 2024
1 parent 7867570 commit 23c3931
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hhd-ui",
"version": "0.17.1",
"version": "0.17.2",
"private": true,
"dependencies": {
"@ag-grid-community/client-side-row-model": "^30.0.3",
Expand Down
4 changes: 2 additions & 2 deletions src/app-bundles/upload-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ const uploadBundle = {
? setAllTo[1] === 'true'
: setAllTo[1];
} else {
// If field not mapped, set to null; if required field, push error
const data = row[sourceKey];
const data = config.useFieldMapKey ? fieldMap[key] : row[sourceKey];

if (!data) {
parsedRow[key] = null;
if (config.required) parsedRow.errors.push(key);
Expand Down
1 change: 1 addition & 0 deletions src/upload-parsers/inclinometer_measurements.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const inclinometerMeasurementParser = {
type: 'internal',
required: true,
useFilterComponent: true,
useFieldMapKey: true,
provider: state => {
return Object.keys(state.instrumentTimeseries)
.filter(key => key.charAt(0) !== '_')
Expand Down
1 change: 1 addition & 0 deletions src/upload-parsers/timeseries.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const timeseriesParser = {
type: 'internal',
required: true,
useFilterComponent: true,
useFieldMapKey: true,
hideCsvMappings: true,
provider: state => (
Object.keys(state.instruments)
Expand Down
3 changes: 2 additions & 1 deletion src/upload-parsers/timeseries_measurements.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ const timeseriesMeasurementParser = {
type: 'internal',
required: true,
useFilterComponent: true,
useFieldMapKey: true,
provider: state => {
return Object.keys(state.instrumentTimeseries)
.filter(key => key.charAt(0) !== '_')
.filter(key => key.charAt(0) !== '_' && state.instrumentTimeseries[key].type === 'standard')
.map(key => ({
value: key,
text: `${state.instrumentTimeseries[key].instrument} - ${state.instrumentTimeseries[key].name}`,
Expand Down

0 comments on commit 23c3931

Please # to comment.