Fixed: [vue][evaluation] save social action and evaluation before opening collabora edition

This commit is contained in:
Mathieu Jaumotte 2023-01-25 17:24:07 +01:00
parent f9b151e4db
commit 214bfd198e

View File

@ -118,7 +118,7 @@
</add-async-upload-downloader> </add-async-upload-downloader>
</li> </li>
<li v-if="canEditDocument(d)"> <li v-if="canEditDocument(d)">
<a :href="buildEditLink(d.storedObject)" class="btn btn-wopilink"></a> <a class="btn btn-wopilink" @click="submitBeforeEdit(d.storedObject)"></a>
</li> </li>
<li v-if="d.workflows.length === 0"> <li v-if="d.workflows.length === 0">
<a class="btn btn-delete" @click="removeDocument(d)"> <a class="btn btn-delete" @click="removeDocument(d)">
@ -359,10 +359,19 @@ export default {
}) })
; ;
}, },
buildEditLink(storedObject) { buildEditLink(document) {
return `/chill/wopi/edit/${storedObject.uuid}?returnPath=` + encodeURIComponent( return `/chill/wopi/edit/${document.storedObject.uuid}?returnPath=` + encodeURIComponent(
window.location.pathname + window.location.search + window.location.hash); window.location.pathname + window.location.search + window.location.hash);
}, },
submitBeforeEdit(storedObject) {
const callback = (data) => {
let evaluation = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key);
let document = evaluation.documents.find(d => d.storedObject.id === storedObject.id);
//console.log('=> document', document);
window.location.assign(this.buildEditLink(document));
};
return this.$store.dispatch('submit', callback).catch(e => { console.log(e); throw e; });
},
submitBeforeGenerate({template}) { submitBeforeGenerate({template}) {
const callback = (data) => { const callback = (data) => {
let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id; let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id;