From f1cc2d66166d3719bee6e27319829a61448d1b3c Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Mon, 25 Jul 2022 21:47:22 +0200 Subject: [PATCH 1/3] Switch to the knockout version of SurveyJS The current SurveyVue plugin only works with Vue 2 and prevents us from upgrading. --- client/package.json | 5 +++-- client/src/pages/survey.vue | 11 +++++------ client/src/styles/_survey.scss | 6 ++++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/client/package.json b/client/package.json index 9d08dca6..fe4d7ba4 100644 --- a/client/package.json +++ b/client/package.json @@ -66,7 +66,7 @@ "eslint-plugin-vue": "^8.6.0", "eslint-webpack-plugin": "^3.2.0", "file-loader": "^6.2.0", - "graphql": "^16.1.0", + "graphql": "^16.3.0", "graphql-config": "^4.3.0", "graphql-tag": "^2.10.1", "graphql-tools": "^8.2.5", @@ -89,7 +89,8 @@ "sass-loader": "^12.6.0", "semver": "^5.3.0", "shelljs": "^0.8.5", - "survey-vue": "^1.9.2", + "survey-core": "^1.9.41", + "survey-knockout-ui": "^1.9.41", "ts-loader": "^8.3.0", "typescript": "^4.5.4", "uploadcare-widget": "^3.6.0", diff --git a/client/src/pages/survey.vue b/client/src/pages/survey.vue index e56e2017..245b14a1 100644 --- a/client/src/pages/survey.vue +++ b/client/src/pages/survey.vue @@ -3,7 +3,7 @@

{{ title }}

- +
import {css} from '@/survey.config'; import gql from 'graphql-tag'; + import {Model} from 'survey-core'; + // we are switching to the knockout version because the Vue version only works with Vue 2 (as of July 2022) + import 'survey-knockout-ui'; import SURVEY_QUERY from '@/graphql/gql/queries/surveyQuery.gql'; import UPDATE_ANSWER from '@/graphql/gql/mutations/updateAnswer.gql'; @@ -30,11 +33,8 @@ import {meQuery} from '@/graphql/queries'; - import * as SurveyVue from 'survey-vue'; const Solution = () => import(/* webpackChunkName: "content-components" */'@/components/content-blocks/Solution'); - const {Survey, Model} = SurveyVue; - const MODULE_QUERY = gql` query ModuleSolutions($slug: String) { module(slug: $slug) { @@ -46,10 +46,8 @@ export default { props: ['id'], - components: { Solution, - Survey, }, data() { @@ -191,6 +189,7 @@ survey.showProgressBar = 'bottom'; survey.pageNextText = 'Speichern & Weiter'; this.$log.debug(survey.data); + survey.render('survey'); return survey; }, reopen() { diff --git a/client/src/styles/_survey.scss b/client/src/styles/_survey.scss index d62f6c11..b6f48067 100644 --- a/client/src/styles/_survey.scss +++ b/client/src/styles/_survey.scss @@ -68,6 +68,7 @@ position: relative; box-sizing: border-box; display: flex; + margin-left: auto; > span { display: none; @@ -165,3 +166,8 @@ box-shadow: none; } } + +.sv-action { + // manually setting this for the knockout version + display: inline-flex; +} From 218047ed25c67f078b5881dcad38a80465aa0429 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Tue, 11 Oct 2022 22:06:10 +0200 Subject: [PATCH 2/3] Fix surveyjs version --- client/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/package.json b/client/package.json index fe4d7ba4..db1019a9 100644 --- a/client/package.json +++ b/client/package.json @@ -89,8 +89,8 @@ "sass-loader": "^12.6.0", "semver": "^5.3.0", "shelljs": "^0.8.5", - "survey-core": "^1.9.41", - "survey-knockout-ui": "^1.9.41", + "survey-core": "1.9.41", + "survey-knockout-ui": "1.9.41", "ts-loader": "^8.3.0", "typescript": "^4.5.4", "uploadcare-widget": "^3.6.0", From 5e497510744eda0dbf801a14086dbda3a404f700 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Tue, 25 Oct 2022 13:53:59 +0200 Subject: [PATCH 3/3] Update package-lock.json --- client/package-lock.json | 47 ++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index b562f979..3e01d5c5 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -49,7 +49,7 @@ "eslint-plugin-vue": "^8.6.0", "eslint-webpack-plugin": "^3.2.0", "file-loader": "^6.2.0", - "graphql": "^16.1.0", + "graphql": "^16.3.0", "graphql-config": "^4.3.0", "graphql-tag": "^2.10.1", "graphql-tools": "^8.2.5", @@ -72,7 +72,8 @@ "sass-loader": "^12.6.0", "semver": "^5.3.0", "shelljs": "^0.8.5", - "survey-vue": "^1.9.2", + "survey-core": "1.9.41", + "survey-knockout-ui": "1.9.41", "ts-loader": "^8.3.0", "typescript": "^4.5.4", "uploadcare-widget": "^3.6.0", @@ -13991,6 +13992,11 @@ "node": ">= 8" } }, + "node_modules/knockout": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/knockout/-/knockout-3.5.1.tgz", + "integrity": "sha512-wRJ9I4az0QcsH7A4v4l0enUpkS++MBx0BnL/68KaLzJg7x1qmbjSlwEoCNol7KTYZ+pmtI7Eh2J0Nu6/2Z5J/Q==" + }, "node_modules/lazy-ass": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", @@ -18171,12 +18177,18 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/survey-vue": { - "version": "1.9.54", - "resolved": "https://registry.npmjs.org/survey-vue/-/survey-vue-1.9.54.tgz", - "integrity": "sha512-X2wmGJopf42ioyKtTIKBjUF9GKbsJg01AdvwwpU4s2vPRfudk3j5JBAuDJw/WkIrtkWLXJvlKlCZjOKNaGv0RA==", + "node_modules/survey-core": { + "version": "1.9.41", + "resolved": "https://registry.npmjs.org/survey-core/-/survey-core-1.9.41.tgz", + "integrity": "sha512-JhJa27EPXqEPTZY1PR+4JwCKBgevGlHca2f6+R5QRCzeH5Xq7l+Fbg8HZCaPb967k1hSfCUUC8g07uUmO3oXLQ==" + }, + "node_modules/survey-knockout-ui": { + "version": "1.9.41", + "resolved": "https://registry.npmjs.org/survey-knockout-ui/-/survey-knockout-ui-1.9.41.tgz", + "integrity": "sha512-Dj5Yk/2iNZ2YzGxzX7gNOsRAW8qEnce4xr6YyeXKBHwV1VGjFC6jdTFeuE4EBmuFhZnIskjS0jRPH1tlBOm13Q==", "dependencies": { - "vue": "^2.1.10" + "knockout": "^3.5.0", + "survey-core": "*" } }, "node_modules/svgo": { @@ -30498,6 +30510,11 @@ "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.5.tgz", "integrity": "sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ==" }, + "knockout": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/knockout/-/knockout-3.5.1.tgz", + "integrity": "sha512-wRJ9I4az0QcsH7A4v4l0enUpkS++MBx0BnL/68KaLzJg7x1qmbjSlwEoCNol7KTYZ+pmtI7Eh2J0Nu6/2Z5J/Q==" + }, "lazy-ass": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", @@ -33562,12 +33579,18 @@ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" }, - "survey-vue": { - "version": "1.9.54", - "resolved": "https://registry.npmjs.org/survey-vue/-/survey-vue-1.9.54.tgz", - "integrity": "sha512-X2wmGJopf42ioyKtTIKBjUF9GKbsJg01AdvwwpU4s2vPRfudk3j5JBAuDJw/WkIrtkWLXJvlKlCZjOKNaGv0RA==", + "survey-core": { + "version": "1.9.41", + "resolved": "https://registry.npmjs.org/survey-core/-/survey-core-1.9.41.tgz", + "integrity": "sha512-JhJa27EPXqEPTZY1PR+4JwCKBgevGlHca2f6+R5QRCzeH5Xq7l+Fbg8HZCaPb967k1hSfCUUC8g07uUmO3oXLQ==" + }, + "survey-knockout-ui": { + "version": "1.9.41", + "resolved": "https://registry.npmjs.org/survey-knockout-ui/-/survey-knockout-ui-1.9.41.tgz", + "integrity": "sha512-Dj5Yk/2iNZ2YzGxzX7gNOsRAW8qEnce4xr6YyeXKBHwV1VGjFC6jdTFeuE4EBmuFhZnIskjS0jRPH1tlBOm13Q==", "requires": { - "vue": "^2.1.10" + "knockout": "^3.5.0", + "survey-core": "*" } }, "svgo": {