From e7c4e17d0cb9b7d8e64ca45b01a082f73b53f3ad Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Tue, 2 Oct 2018 13:08:34 -0400 Subject: [PATCH 1/2] temporary changes to fix new instrument field names --- eapp/modules/data-collection/js/dc-form-2.js | 2 +- eapp/modules/instrument-editor/js/ie.js | 6 +++--- eapp/modules/nda-editor/js/form-builder.js | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/eapp/modules/data-collection/js/dc-form-2.js b/eapp/modules/data-collection/js/dc-form-2.js index 80b511a..22768ef 100644 --- a/eapp/modules/data-collection/js/dc-form-2.js +++ b/eapp/modules/data-collection/js/dc-form-2.js @@ -104,7 +104,7 @@ $('#btn-subjDCSave').click(function(e){ for (let i=0; i< subjectDataCollection.length; i++) { if (subjectDataCollection[i]['status'] !== 'completed') { console.log("subject" + i + "data---" , subjectDataCollection[i]['status']) - saveDCFormData(e, subjectDataCollection[i]) + saveDCFormData(e, subjectDataCollection[i]) // save non-complete tasks } } window.location.href = serverURL+"/data-collection/html/dc-list.html" diff --git a/eapp/modules/instrument-editor/js/ie.js b/eapp/modules/instrument-editor/js/ie.js index b3cb0e1..204d678 100644 --- a/eapp/modules/instrument-editor/js/ie.js +++ b/eapp/modules/instrument-editor/js/ie.js @@ -132,7 +132,7 @@ function setTerm(schema, key, field,position){ term['filterElement'] = termsIndex[termId].filterElement term['position'] = termsIndex[termId].position term['dataElementId'] = termsIndex[termId].dataElementId - term['name'] = key + term['name'] = field.label term['type'] = termsIndex[termId].type term['renderType'] = field.type term['size'] = termsIndex[termId].size @@ -161,9 +161,9 @@ function setTerm(schema, key, field,position){ term['position'] = position term['dataElementId'] = position if(field.hasOwnProperty('name')){ - term['name'] = field.name + term['name'] = field.label }else{ - term['name'] = termId + term['name'] = field.label } term['description'] = field.label if(schema.properties[key].enum === undefined){ diff --git a/eapp/modules/nda-editor/js/form-builder.js b/eapp/modules/nda-editor/js/form-builder.js index 593975e..6b11cfd 100644 --- a/eapp/modules/nda-editor/js/form-builder.js +++ b/eapp/modules/nda-editor/js/form-builder.js @@ -680,6 +680,7 @@ var setup = function(){ else if (parentField.getType() === "object") { itemKey = "new" + new Date().getTime(); + console.log(" --this is the culprit key ---",itemKey) } var insertAfterId = null; From 07c2ccf702cda7c60c110b0af9609702cd8b6392 Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Tue, 2 Oct 2018 13:08:34 -0400 Subject: [PATCH 2/2] temporary changes to fix new instrument field names --- eapp/modules/data-collection/js/dc-form-2.js | 2 +- eapp/modules/instrument-editor/js/ie.js | 6 +++--- eapp/modules/nda-editor/js/form-builder.js | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/eapp/modules/data-collection/js/dc-form-2.js b/eapp/modules/data-collection/js/dc-form-2.js index 80b511a..22768ef 100644 --- a/eapp/modules/data-collection/js/dc-form-2.js +++ b/eapp/modules/data-collection/js/dc-form-2.js @@ -104,7 +104,7 @@ $('#btn-subjDCSave').click(function(e){ for (let i=0; i< subjectDataCollection.length; i++) { if (subjectDataCollection[i]['status'] !== 'completed') { console.log("subject" + i + "data---" , subjectDataCollection[i]['status']) - saveDCFormData(e, subjectDataCollection[i]) + saveDCFormData(e, subjectDataCollection[i]) // save non-complete tasks } } window.location.href = serverURL+"/data-collection/html/dc-list.html" diff --git a/eapp/modules/instrument-editor/js/ie.js b/eapp/modules/instrument-editor/js/ie.js index b3cb0e1..204d678 100644 --- a/eapp/modules/instrument-editor/js/ie.js +++ b/eapp/modules/instrument-editor/js/ie.js @@ -132,7 +132,7 @@ function setTerm(schema, key, field,position){ term['filterElement'] = termsIndex[termId].filterElement term['position'] = termsIndex[termId].position term['dataElementId'] = termsIndex[termId].dataElementId - term['name'] = key + term['name'] = field.label term['type'] = termsIndex[termId].type term['renderType'] = field.type term['size'] = termsIndex[termId].size @@ -161,9 +161,9 @@ function setTerm(schema, key, field,position){ term['position'] = position term['dataElementId'] = position if(field.hasOwnProperty('name')){ - term['name'] = field.name + term['name'] = field.label }else{ - term['name'] = termId + term['name'] = field.label } term['description'] = field.label if(schema.properties[key].enum === undefined){ diff --git a/eapp/modules/nda-editor/js/form-builder.js b/eapp/modules/nda-editor/js/form-builder.js index 593975e..6b11cfd 100644 --- a/eapp/modules/nda-editor/js/form-builder.js +++ b/eapp/modules/nda-editor/js/form-builder.js @@ -680,6 +680,7 @@ var setup = function(){ else if (parentField.getType() === "object") { itemKey = "new" + new Date().getTime(); + console.log(" --this is the culprit key ---",itemKey) } var insertAfterId = null;