mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 07:33:50 +00:00
Display toast upon successful duplication of evaluation document
This commit is contained in:
@@ -52,10 +52,17 @@ import TimeSpentInput from "./TimeSpentInput.vue";
|
||||
import CommentInput from "./CommentInput.vue";
|
||||
import DocumentsList from "./DocumentsList.vue";
|
||||
import DocumentActions from "./DocumentActions.vue";
|
||||
import {
|
||||
trans,
|
||||
EVALUATION_DOCUMENT_DUPLICATE_SUCCESS
|
||||
} from "translator";
|
||||
import { useToast } from "vue-toast-notification";
|
||||
|
||||
const props = defineProps(["evaluation", "docAnchorId"]);
|
||||
const store = useStore();
|
||||
|
||||
const $toast = useToast();
|
||||
|
||||
const timeSpentChoices = [
|
||||
{ text: "1 minute", value: 60 },
|
||||
{ text: "2 minutes", value: 120 },
|
||||
@@ -234,13 +241,19 @@ function duplicateDocument(document) {
|
||||
store.dispatch("duplicateDocument", {
|
||||
evaluation_key: props.evaluation.key,
|
||||
document: document,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function duplicateDocumentToEvaluation({ evaluation, document }) {
|
||||
store.dispatch("duplicateDocumentToEvaluation", {
|
||||
evaluation: evaluation,
|
||||
document: document,
|
||||
})
|
||||
.then(() => {
|
||||
$toast.open({ message: trans(EVALUATION_DOCUMENT_DUPLICATE_SUCCESS) });
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -619,6 +619,8 @@ const store = createStore({
|
||||
document: newDoc,
|
||||
evaluation,
|
||||
});
|
||||
|
||||
return newDoc;
|
||||
},
|
||||
removeDocument({ commit }, payload) {
|
||||
commit("removeDocument", payload);
|
||||
|
@@ -780,6 +780,7 @@ evaluation:
|
||||
duplicate: Dupliquer
|
||||
duplicate_here: Dupliquer ici
|
||||
duplicate_to_other_evaluation: Dupliquer vers une autre évaluation
|
||||
duplicate_success: Le document d'évaluation a été dupliquer
|
||||
|
||||
|
||||
goal:
|
||||
|
Reference in New Issue
Block a user