diff --git a/frontend/src/Apps/Inscription/ExternalCurriculumList.vue b/frontend/src/Apps/Inscription/ExternalCurriculumList.vue
index eba1cdf..c467853 100644
--- a/frontend/src/Apps/Inscription/ExternalCurriculumList.vue
+++ b/frontend/src/Apps/Inscription/ExternalCurriculumList.vue
@@ -4,15 +4,23 @@
import {getSelf} from "@/rest/Users.js";
import {createExternalCurriculum, getExternalCurriculumByUser} from "@/rest/externalCurriculum.js";
- //mode 0 = externalcurr related to inscrreq, 1 = externalcurr related to user
+ //mode 0 = externalcurr related to inscrreq, 1 = externalcurr related to user, 2 inscription procedure
const props = defineProps(["extCurrList", "mode"])
- const extCurrList = ref(props.extCurrList)
+ //Only usefull to pass the external curr array in the inscription procedure
+ const externalCurrTab = defineModel();
+
+ const extCurrList = ref({})
+ let extNum = 0
+ const User = ref({})
+
+ if (props.mode === 1){
+ User.value = await getSelf()
+ }
- const User = await getSelf()
const list = ref(true)
-
+ const editmode = ref(false)
const notcompletedCheck = ref(false);
const externalCurr = reactive({
@@ -28,22 +36,49 @@
if (props.mode === 1){
externalCurr.userRegNo = props.extCurrList[0].user.regNo
+ }else if(props.mode === 2){
+ extCurrList.value = externalCurrTab.value
+ }
+
+ if(props.mode !== 2){
+ extCurrList.value = props.extCurrList
+ console.log("oe")
+ }
+
+ function deleteExtCursus(extcursus){
+ externalCurrTab.value.splice(externalCurrTab.value.indexOf(extcursus),1)
}
async function postExternalCurr(){
- await createExternalCurriculum(externalCurr.inscriptionRequestId, externalCurr.school, externalCurr.formation, externalCurr.completion, externalCurr.startYear, externalCurr.endYear, externalCurr.justifdocUrl, externalCurr.userRegNo);
- //We refresh the list
- extCurrList.value = await getExternalCurriculumByUser(externalCurr.userRegNo);
- list.value = !list.value;
+ if (props.mode === 1){
+ await createExternalCurriculum(externalCurr.inscriptionRequestId, externalCurr.school, externalCurr.formation, externalCurr.completion, externalCurr.startYear, externalCurr.endYear, externalCurr.justifdocUrl, externalCurr.userRegNo);
+ //We refresh the list
+ extCurrList.value = await getExternalCurriculumByUser(externalCurr.userRegNo);
+ list.value = !list.value;
+ }else if (props.mode === 2){
+ externalCurrTab.value.push({
+ inscriptionRequestId : externalCurr.inscriptionRequestId,
+ school:externalCurr.school,
+ formation :externalCurr.formation,
+ completion : externalCurr.completion,
+ startYear : externalCurr.startYear,
+ endYear: externalCurr.endYear,
+ justifdocUrl : externalCurr.justifdocUrl,
+ userRegNo : externalCurr.userRegNo
+ });
+ extCurrList.value = externalCurrTab.value
+ list.value = !list.value;
+ console.log(externalCurrTab.value)
+ }
}
-
+
-
+
@@ -51,6 +86,8 @@
+
+
@@ -82,7 +119,8 @@
-
+
+
@@ -94,9 +132,9 @@
height:100px;
font-size:30px;
display:grid;
- grid-template-columns:15% 10% 20% 15% 13.1%;
+ grid-template-columns:5% 10% 20% 15% 20% 10%;
grid-template-areas:
- "status school formation completion download";
+ "status school formation completion download edit delete";
column-gap:10px;
}
@@ -106,6 +144,15 @@
font-size: 70%;
}
+.edit{
+ grid-area: edit;
+ align-self: center;
+}
+
+.delete{
+ grid-area: delete;
+ align-self: center;
+}
.school{
grid-area:school;
align-self:center;
diff --git a/frontend/src/Apps/Login.vue b/frontend/src/Apps/Login.vue
index 705012f..bb83a18 100644
--- a/frontend/src/Apps/Login.vue
+++ b/frontend/src/Apps/Login.vue
@@ -7,6 +7,8 @@
import {toast} from 'vue3-toastify'
import 'vue3-toastify/dist/index.css';
import {createExternalCurriculum} from "@/rest/externalCurriculum.js";
+ import ManageCourses from "@/Apps/ManageCourses.vue";
+ import ExternalCurriculumList from "@/Apps/Inscription/ExternalCurriculumList.vue";
const loginPage= ref(true)
const page = ref(0)
@@ -90,16 +92,11 @@
await createExternalCurriculum(val.id, externalCurrTab.value[item].school, externalCurrTab.value[item].formation, externalCurrTab.value[item].completion, externalCurrTab.value[item].startYear, externalCurrTab.value[item].endYear, externalCurrTab.value[item].justifdocUrl);
}
}
-
-
- function deleteExtCursus(extcursus){
- externalCurrTab.value.splice(externalCurrTab.value.indexOf(extcursus),1)
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+