From 7875fcf6230e915357e5705416a157230bdd8156 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Fri, 2 Aug 2024 17:30:53 -0400 Subject: [PATCH 01/12] fix: don't extract the first element from vectors --- src/components/Survey/Survey.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Survey/Survey.vue b/src/components/Survey/Survey.vue index 9319a97..e6a69db 100644 --- a/src/components/Survey/Survey.vue +++ b/src/components/Survey/Survey.vue @@ -252,7 +252,7 @@ let usedList = []; let isAboutUrl = itemUrl; // eslint-disable-next-line no-prototype-builtins - if (_.isObject(val) && !val.hasOwnProperty('unitCode') && !(val instanceof Blob)) { // to find sub-activities; condition might need to be changed + if (_.isObject(val) && !_.isArray(val) && !val.hasOwnProperty('unitCode') && !(val instanceof Blob)) { // to find sub-activities; condition might need to be changed const sectionItemKey = Object.keys(val)[0]; const sectionItemValue = Object.values(val)[0]; exportVal = sectionItemValue; From d700981ffe76cc829bd7ee09e8e483b4ba439e1a Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Thu, 8 Aug 2024 22:18:28 -0400 Subject: [PATCH 02/12] Switch config to use main branch of demo protocol --- src/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index 829500c..0c457e6 100644 --- a/src/config.js +++ b/src/config.js @@ -1,5 +1,5 @@ module.exports = { - githubSrc: 'https://raw.githubusercontent.com/ReproNim/demo-protocol/master/DemoProtocol/DemoProtocol_schema', + githubSrc: 'https://raw.githubusercontent.com/ReproNim/demo-protocol/main/DemoProtocol/DemoProtocol_schema', startButton: { "en": 'Join', "es": 'Participar' From 4b4ce4eea2f5db54f7535be8001779895dde0fd7 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Thu, 8 Aug 2024 22:19:58 -0400 Subject: [PATCH 03/12] Adjust date element to return year or date as appropriate --- src/components/InputSelector/InputSelector.vue | 4 +--- src/components/Inputs/YearInput/YearInput.vue | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/components/InputSelector/InputSelector.vue b/src/components/InputSelector/InputSelector.vue index e973899..ced222d 100644 --- a/src/components/InputSelector/InputSelector.vue +++ b/src/components/InputSelector/InputSelector.vue @@ -343,9 +343,7 @@ export default { this.$emit('dontKnow'); }, sendData(val) { - if (val instanceof Date) { - this.$emit('valueChanged', val.getFullYear()); - } else this.$emit('valueChanged', val); + this.$emit('valueChanged', val); this.$emit('next'); }, }, diff --git a/src/components/Inputs/YearInput/YearInput.vue b/src/components/Inputs/YearInput/YearInput.vue index a8485b7..5453353 100644 --- a/src/components/Inputs/YearInput/YearInput.vue +++ b/src/components/Inputs/YearInput/YearInput.vue @@ -20,20 +20,16 @@ export default { watch: { input() { // if there is a change, emit it. - this.$emit('valueChanged', this.input); - + this.$emit('valueChanged', this.customFormatter(this.input)); // make sure you validate the date based on this.constraints. }, }, methods: { - sendData(val) { - this.$emit('valueChanged', val.getFullYear()); - }, customFormatter(date) { if (this.inputType === 'year') { return moment(date).format('YYYY'); } else if (this.inputType === 'date') { - return moment(date).format('MMM DD YYYY'); + return moment(date).format('YYYY MMM DD'); } return date; }, }, From 19862d87b384a984286457f1a3a45bb3b7f91614 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Thu, 8 Aug 2024 22:20:52 -0400 Subject: [PATCH 04/12] Return iso 8601 formatted start/end for duration. --- src/components/Inputs/TimeRange/TimeRange.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/Inputs/TimeRange/TimeRange.vue b/src/components/Inputs/TimeRange/TimeRange.vue index 9c53a62..7d7f27b 100644 --- a/src/components/Inputs/TimeRange/TimeRange.vue +++ b/src/components/Inputs/TimeRange/TimeRange.vue @@ -121,11 +121,7 @@ export default { }, methods: { sendData() { - this.$emit('valueChanged', { - startTime: this.sleptAt.toISOString(), - endTime: this.wokeAt.toISOString(), - difference: this.timeSlept, - }); + this.$emit('valueChanged', this.sleptAt.toISOString() + "/" + this.wokeAt.toISOString()); }, }, watch: { From f9becc0e5452ae0d6b772b831b02f0676a910a0d Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Thu, 8 Aug 2024 22:21:25 -0400 Subject: [PATCH 05/12] Removed unused block of code --- src/components/Survey/Survey.vue | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/components/Survey/Survey.vue b/src/components/Survey/Survey.vue index e6a69db..2d986af 100644 --- a/src/components/Survey/Survey.vue +++ b/src/components/Survey/Survey.vue @@ -251,14 +251,6 @@ let exportVal = val; let usedList = []; let isAboutUrl = itemUrl; - // eslint-disable-next-line no-prototype-builtins - if (_.isObject(val) && !_.isArray(val) && !val.hasOwnProperty('unitCode') && !(val instanceof Blob)) { // to find sub-activities; condition might need to be changed - const sectionItemKey = Object.keys(val)[0]; - const sectionItemValue = Object.values(val)[0]; - exportVal = sectionItemValue; - usedList.push(sectionItemKey); - isAboutUrl = sectionItemKey; - } usedList.push(`${itemUrl}`, `${this.srcUrl}`); const d2 = new Date(); const t1 = d2.toISOString(); From b567fed4b239cf176312a80239ae15064c3d6304 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Thu, 8 Aug 2024 22:21:47 -0400 Subject: [PATCH 06/12] Change message --- src/components/Inputs/StaticReadOnly/StaticReadOnly.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Inputs/StaticReadOnly/StaticReadOnly.vue b/src/components/Inputs/StaticReadOnly/StaticReadOnly.vue index f1ee934..7762fb6 100644 --- a/src/components/Inputs/StaticReadOnly/StaticReadOnly.vue +++ b/src/components/Inputs/StaticReadOnly/StaticReadOnly.vue @@ -1,7 +1,7 @@