Merge remote-tracking branch 'origin/master' into issue714_eval_time_spent

This commit is contained in:
2023-03-24 17:51:37 +01:00
158 changed files with 2482 additions and 797 deletions

View File

@@ -130,6 +130,7 @@
:filename="d.title"
:can-edit="true"
:execute-before-leave="submitBeforeLeaveToEditor"
@on-stored-object-status-change="onStatusDocumentChanged"
></document-action-buttons-group>
</li>
<li v-if="d.workflows.length === 0">
@@ -374,6 +375,10 @@ export default {
this.$store.commit('removeDocument', {key: this.evaluation.key, document: document});
}
},
onStatusDocumentChanged(newStatus) {
console.log('onStatusDocumentChanged', newStatus);
this.$store.commit('statusDocumentChanged', {key: this.evaluation.key, newStatus: newStatus});
},
goToGenerateWorkflowEvaluationDocument({event, link, workflowName, payload}) {
const callback = (data) => {
let evaluation = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key);

View File

@@ -367,7 +367,22 @@ const store = createStore({
state.evaluationsPicked.find(e => e.key === payload.evaluationKey)
.documents.find(d => d.id === payload.id).title = payload.title;
}
}
},
statusDocumentChanged(state, {newStatus, key}) {
const e = state.evaluationsPicked.find(e => e.key === key);
if (typeof e === 'undefined') {
console.error('evaluation not found for given key', {key});
}
const doc = e.documents.find(d => d.storedObject?.id === newStatus.id);
if (typeof doc === 'undefined') {
console.error('document not found', {newStatus});
}
doc.storedObject.status = newStatus.status;
doc.storedObject.type = newStatus.type;
doc.storedObject.filename = newStatus.filename;
},
},
actions: {
updateThirdParty({ commit }, payload) {