Merge remote-tracking branch 'origin/master' into 709-notification-eval-action

This commit is contained in:
2023-06-13 23:05:51 +02:00
60 changed files with 1859 additions and 170 deletions

View File

@@ -122,7 +122,8 @@
<add-evaluation
v-for="e in pickedEvaluations"
v-bind:key="e.key"
v-bind:evaluation="e">
v-bind:evaluation="e"
v-bind:docAnchorId="this.docAnchorId">
</add-evaluation>
<!-- box to add new evaluation -->
@@ -406,6 +407,7 @@ export default {
i18n,
data() {
return {
docAnchorId: null,
isExpanded: false,
editor: ClassicEditor,
showAddObjective: false,
@@ -445,7 +447,14 @@ export default {
},
};
},
computed: {
beforeMount() {
const urlParams = new URLSearchParams(window.location.search);
this.docAnchorId = urlParams.get('doc_id');
},
mounted() {
this.scrollToElement(this.docAnchorId);
},
computed: {
...mapState([
'work',
'resultsForAction',
@@ -594,7 +603,7 @@ export default {
});
},
saveFormOnTheFly(payload) {
console.log('saveFormOnTheFly: type', payload.type, ', data', payload.data);
// console.log('saveFormOnTheFly: type', payload.type, ', data', payload.data);
let body = { type: payload.type };
body.name = payload.data.text;
@@ -616,6 +625,12 @@ export default {
this.$toast.open({message: 'An error occurred'});
}
})
},
scrollToElement(docAnchorId) {
const documentEl = document.getElementById(`document_${docAnchorId}`);
if (documentEl) {
documentEl.scrollIntoView({behavior: 'smooth'});
}
}
}
};