Merge branch 'hotfix/deleted-survey-answers' into develop

This commit is contained in:
Ramon Wenger 2021-03-03 21:54:37 +01:00
commit 271b517fdc
4 changed files with 177 additions and 174 deletions

View File

@ -19008,9 +19008,9 @@
}
},
"survey-vue": {
"version": "1.5.18",
"resolved": "https://registry.npmjs.org/survey-vue/-/survey-vue-1.5.18.tgz",
"integrity": "sha512-DJURzwbCmVgcW2YTM/L9+8J8AgfRffqbPygYY9eXtf5UR4YVAX0wGcVzmcnqwHnjxCw4sX5DW1UDLzXRBtgGWQ==",
"version": "1.8.33",
"resolved": "https://registry.npmjs.org/survey-vue/-/survey-vue-1.8.33.tgz",
"integrity": "sha512-ffsYmW8AJCiAyJiNAaZtDxAxYoaSiZCVZQHoAVFcK8IZCuKa2gPYpbZEnC2ytK0WjJ84XdZo+/TcLNU6DnlneQ==",
"requires": {
"vue": "^2.1.10"
}

View File

@ -69,7 +69,7 @@
"sass-loader": "^7.1.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"survey-vue": "^1.5.18",
"survey-vue": "^1.8.32",
"uglifyjs-webpack-plugin": "^1.1.1",
"unfetch": "^3.1.1",
"uploadcare-widget": "^3.6.0",

View File

@ -90,7 +90,6 @@
return 'document' in this.userInput;
},
showSpellcheckButton() {
console.log(process.env.VUE_APP_ENABLE_SPELLCHECK);
return this.spellcheck && process.env.VUE_APP_ENABLE_SPELLCHECK;
},
spellcheckText() {

View File

@ -47,6 +47,7 @@ export default {
me: {
permissions: []
},
saveDisabled: false
};
},
@ -101,10 +102,10 @@ export default {
}
survey.data = flatAnswers;
const saveSurvey = (sender, options) => {
// sender.clear(false);
//
// sender.mode = 'display';
const saveSurvey = (sender) => {
if (this.saveDisabled) {
return;
}
this.completed = true;
@ -119,15 +120,16 @@ export default {
};
}
}
const answer = {
surveyId: this.id,
data: JSON.stringify(data)
};
this.$apollo.mutate({
mutation: UPDATE_ANSWER,
variables: {
input: {
answer: {
surveyId: this.id,
data: JSON.stringify(data)
}
answer
}
},
// fixme: make the update work instead of refetching
@ -153,10 +155,12 @@ export default {
return survey;
},
reopen() {
this.saveDisabled = true; // disable saving, because resetting triggers a page change which we don't want to save
this.completed = false;
let data = this.survey.data; // save the data
this.survey.clear();
this.survey.data = data; // reapply it
this.saveDisabled = false;
}
},