From 2acee3f53f0ec910ae906916941a6e1e3c65607f Mon Sep 17 00:00:00 2001 From: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> Date: Mon, 16 Jun 2025 11:00:42 -0400 Subject: [PATCH 1/5] lgtm --- babel.config.js | 4 +- package-lock.json | 4 +- src/components/CanvasInput.vue | 183 ++++++++++++++++ .../InputSelector/InputSelector.vue | 56 +++-- .../Inputs/CanvasInput/CanvasInput.vue | 203 ++++++++++++++++++ src/components/SurveyItem/SurveyItem.vue | 16 ++ src/config.js | 2 +- 7 files changed, 443 insertions(+), 25 deletions(-) create mode 100644 src/components/CanvasInput.vue create mode 100644 src/components/Inputs/CanvasInput/CanvasInput.vue diff --git a/babel.config.js b/babel.config.js index 397abca8..3f453d44 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,5 @@ module.exports = { - presets: ["@vue/cli-plugin-babel/preset"] + presets: [ + '@vue/cli-plugin-babel/preset' + ] }; diff --git a/package-lock.json b/package-lock.json index bc4eacce..aa0f5c87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "schema-ui", + "name": "reproschema-ui", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "schema-ui", + "name": "reproschema-ui", "version": "0.1.0", "dependencies": { "@adapttive/vue-markdown": "^4.0.2", diff --git a/src/components/CanvasInput.vue b/src/components/CanvasInput.vue new file mode 100644 index 00000000..3af8749c --- /dev/null +++ b/src/components/CanvasInput.vue @@ -0,0 +1,183 @@ + + + + + \ No newline at end of file diff --git a/src/components/InputSelector/InputSelector.vue b/src/components/InputSelector/InputSelector.vue index ced222d0..53830787 100644 --- a/src/components/InputSelector/InputSelector.vue +++ b/src/components/InputSelector/InputSelector.vue @@ -172,6 +172,16 @@ :init="init" v-on:valueChanged="sendData"/> + +
+ +
+
+ + \ No newline at end of file diff --git a/src/components/SurveyItem/SurveyItem.vue b/src/components/SurveyItem/SurveyItem.vue index c9ab2b8b..9a23ae89 100644 --- a/src/components/SurveyItem/SurveyItem.vue +++ b/src/components/SurveyItem/SurveyItem.vue @@ -18,6 +18,7 @@ :ipAddress="clientIp" :showPassOptions="showPassOptions" :showItemPassOptions="itemAllow" + :ui="uiConfig" v-on:skip="sendSkip" v-on:dontKnow="sendDontKnow" v-on:next="sendNext" @@ -181,6 +182,19 @@ return 'N/A'; /* eslint-enable */ }, + uiConfig() { + const config = {}; + if (this.data['http://schema.repronim.org/inputType']) { + config.inputType = this.data['http://schema.repronim.org/inputType'][0]['@value']; + } + if (this.data['http://schema.repronim.org/backgroundImage']) { + config.backgroundImage = this.data['http://schema.repronim.org/backgroundImage'][0]['@value']; + } + if (this.data['http://schema.repronim.org/allow']) { + config.allow = this.data['http://schema.repronim.org/allow'].map(a => a['@id']); + } + return config; + }, widgetType() { if (this.data['http://schema.org/readonlyValue']) { return this.data['http://schema.org/readonlyValue'][0]['@value']; @@ -241,6 +255,8 @@ // console.log(247, resp); if (resp.length) { this.data = resp[0]; + console.log('SurveyItem processActivityData - data:', this.data); + console.log('SurveyItem processActivityData - backgroundImage:', this.data['http://schema.repronim.org/backgroundImage']); if (this.data['http://schema.repronim.org/responseOptions']) { if (Object.keys(this.data['http://schema.repronim.org/responseOptions'][0]).indexOf('@id') > -1) { // console.log(260, this.data['http://schema.repronim.org/responseOptions'][0]['@id']); diff --git a/src/config.js b/src/config.js index 0c457e66..90780bc9 100644 --- a/src/config.js +++ b/src/config.js @@ -1,5 +1,5 @@ module.exports = { - githubSrc: 'https://raw.githubusercontent.com/ReproNim/demo-protocol/main/DemoProtocol/DemoProtocol_schema', + githubSrc: 'http://localhost:3000/DemoProtocol/DemoProtocol_schema', startButton: { "en": 'Join', "es": 'Participar' From d1231212f7187e500c75069bc75e3dc47c29a4ca Mon Sep 17 00:00:00 2001 From: Yibei Chen Date: Mon, 16 Jun 2025 11:56:02 -0400 Subject: [PATCH 2/5] Update config.js put the original url back --- src/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index 90780bc9..0c457e66 100644 --- a/src/config.js +++ b/src/config.js @@ -1,5 +1,5 @@ module.exports = { - githubSrc: 'http://localhost:3000/DemoProtocol/DemoProtocol_schema', + githubSrc: 'https://raw.githubusercontent.com/ReproNim/demo-protocol/main/DemoProtocol/DemoProtocol_schema', startButton: { "en": 'Join', "es": 'Participar' From b84fea26ebd05628e36a215151d4c2fc7bf99d6d Mon Sep 17 00:00:00 2001 From: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> Date: Tue, 17 Jun 2025 15:51:11 -0400 Subject: [PATCH 3/5] update import statements --- .../InputSelector/InputSelector.vue | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/components/InputSelector/InputSelector.vue b/src/components/InputSelector/InputSelector.vue index 53830787..e998cdfe 100644 --- a/src/components/InputSelector/InputSelector.vue +++ b/src/components/InputSelector/InputSelector.vue @@ -257,25 +257,25 @@