WIP Add toast after successful move

This commit is contained in:
2025-08-21 16:02:02 +02:00
parent ddf8da4cee
commit f6179cd3a3
3 changed files with 13 additions and 4 deletions

View File

@@ -53,7 +53,7 @@ import TimeSpentInput from "./TimeSpentInput.vue";
import CommentInput from "./CommentInput.vue"; import CommentInput from "./CommentInput.vue";
import DocumentsList from "./DocumentsList.vue"; import DocumentsList from "./DocumentsList.vue";
import DocumentActions from "./DocumentActions.vue"; import DocumentActions from "./DocumentActions.vue";
import { trans, EVALUATION_DOCUMENT_DUPLICATE_SUCCESS } from "translator"; import { trans, EVALUATION_DOCUMENT_DUPLICATE_SUCCESS, EVALUATION_DOCUMENT_MOVE_SUCCESS } from "translator";
import { useToast } from "vue-toast-notification"; import { useToast } from "vue-toast-notification";
const props = defineProps(["evaluation", "docAnchorId"]); const props = defineProps(["evaluation", "docAnchorId"]);
@@ -264,7 +264,15 @@ function moveDocumentToEvaluation({ evaluationDest, document }) {
evaluationInitial: props.evaluation, evaluationInitial: props.evaluation,
evaluationDest: evaluationDest, evaluationDest: evaluationDest,
document: document, document: document,
}); })
.then(() => {
$toast.open({
message: trans(EVALUATION_DOCUMENT_MOVE_SUCCESS),
});
})
.catch((e) => {
console.log(e);
});
} }
function onStatusDocumentChanged(newStatus) { function onStatusDocumentChanged(newStatus) {

View File

@@ -655,13 +655,13 @@ const store = createStore({
{ commit }, { commit },
{ evaluationInitial, evaluationDest, document }, { evaluationInitial, evaluationDest, document },
) { ) {
await moveDocumentToEvaluation(document.id, evaluationDest.id);
commit("moveDocumentToEvaluation", { commit("moveDocumentToEvaluation", {
evaluationInitial, evaluationInitial,
evaluationDest, evaluationDest,
document, document,
}); });
await moveDocumentToEvaluation(document.id, evaluationDest.id);
}, },
removeDocument({ commit }, payload) { removeDocument({ commit }, payload) {
commit("removeDocument", payload); commit("removeDocument", payload);

View File

@@ -782,6 +782,7 @@ evaluation:
duplicate_here: Dupliquer ici duplicate_here: Dupliquer ici
duplicate_to_other_evaluation: Dupliquer vers une autre évaluation duplicate_to_other_evaluation: Dupliquer vers une autre évaluation
duplicate_success: Le document d'évaluation a été dupliquer duplicate_success: Le document d'évaluation a été dupliquer
move_success: Le document d'évaluation a été déplacer
goal: goal: