mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 16:43:48 +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 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 { useToast } from "vue-toast-notification";
|
||||||
|
|
||||||
const props = defineProps(["evaluation", "docAnchorId"]);
|
const props = defineProps(["evaluation", "docAnchorId"]);
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
|
|
||||||
|
const $toast = useToast();
|
||||||
|
|
||||||
const timeSpentChoices = [
|
const timeSpentChoices = [
|
||||||
{ text: "1 minute", value: 60 },
|
{ text: "1 minute", value: 60 },
|
||||||
{ text: "2 minutes", value: 120 },
|
{ text: "2 minutes", value: 120 },
|
||||||
@@ -234,13 +241,19 @@ function duplicateDocument(document) {
|
|||||||
store.dispatch("duplicateDocument", {
|
store.dispatch("duplicateDocument", {
|
||||||
evaluation_key: props.evaluation.key,
|
evaluation_key: props.evaluation.key,
|
||||||
document: document,
|
document: document,
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function duplicateDocumentToEvaluation({ evaluation, document }) {
|
function duplicateDocumentToEvaluation({ evaluation, document }) {
|
||||||
store.dispatch("duplicateDocumentToEvaluation", {
|
store.dispatch("duplicateDocumentToEvaluation", {
|
||||||
evaluation: evaluation,
|
evaluation: evaluation,
|
||||||
document: document,
|
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,
|
document: newDoc,
|
||||||
evaluation,
|
evaluation,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return newDoc;
|
||||||
},
|
},
|
||||||
removeDocument({ commit }, payload) {
|
removeDocument({ commit }, payload) {
|
||||||
commit("removeDocument", payload);
|
commit("removeDocument", payload);
|
||||||
|
@@ -780,6 +780,7 @@ evaluation:
|
|||||||
duplicate: Dupliquer
|
duplicate: Dupliquer
|
||||||
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
|
||||||
|
|
||||||
|
|
||||||
goal:
|
goal:
|
||||||
|
Reference in New Issue
Block a user