Switch to the knockout version of SurveyJS
The current SurveyVue plugin only works with Vue 2 and prevents us from upgrading.
This commit is contained in:
parent
8555e2c6ed
commit
f1cc2d6616
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<h1 class="survey-page__title">
|
||||
{{ title }}
|
||||
</h1>
|
||||
<survey :survey="survey" />
|
||||
<div id="survey" />
|
||||
|
||||
<solution
|
||||
:value="solution"
|
||||
|
|
@ -21,6 +21,9 @@
|
|||
<script>
|
||||
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() {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue