diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java index df79ede..96e7be4 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java @@ -67,11 +67,15 @@ public class MockController { Curriculum chemistryBab1 = new Curriculum(1,"chemistry"); Curriculum psychologyBab1 = new Curriculum(1,"psychology"); Curriculum infoBab2 = new Curriculum(2,"info"); + Curriculum masterinfo1 = new Curriculum(4, "info"); + Curriculum masterinfo2 = new Curriculum(5, "info"); curriculumService.save(infoBab1); curriculumService.save(chemistryBab1); curriculumService.save(psychologyBab1); curriculumService.save(infoBab2); + curriculumService.save(masterinfo1); + curriculumService.save(masterinfo2); ucr.save(new UserCurriculum(joe, infoBab1, 2022)); ucr.save(new UserCurriculum(joe, chemistryBab1, 2023)); diff --git a/frontend/src/Apps/AboutRequest.vue b/frontend/src/Apps/AboutRequest.vue index c443ad0..a818e18 100644 --- a/frontend/src/Apps/AboutRequest.vue +++ b/frontend/src/Apps/AboutRequest.vue @@ -9,10 +9,10 @@ let request = await getRegisters(props.target); const cursus = await getcurriculum(request.curriculum); function getPP(){ - if(request.profilePicture === null){ + if(request.profilePictureUrl === null){ return "/Clyde.png" } - return request.profilePicture; + return request.profilePictureUrl; } diff --git a/frontend/src/Apps/Inscription.vue b/frontend/src/Apps/Inscription.vue index 6f79966..b02cfcd 100644 --- a/frontend/src/Apps/Inscription.vue +++ b/frontend/src/Apps/Inscription.vue @@ -13,7 +13,6 @@ async function upPage(id,review){ await validateRegister(id,review); requests.value = await getAllRegisters(); - } diff --git a/frontend/src/Apps/Login.vue b/frontend/src/Apps/Login.vue index cf68d13..036b6fb 100644 --- a/frontend/src/Apps/Login.vue +++ b/frontend/src/Apps/Login.vue @@ -24,9 +24,12 @@ const submitValue= ref(i18n("login.guest.submit")) const passwordConfirm=ref("") - + + //Allows to display MA or BAB for years + let yearprefix = ""; + const imageSaved = ref(false) - const ppData = ref(false) + let ppData = ""; const curricula= await getAllCurriculums(); @@ -50,7 +53,20 @@ disconnect(); window.location.reload();} - + async function uploadPP(arg){ + const data = await uploadProfilePicture(arg); + ppData = data.url; + console.log(ppData); + } + + //This functions makes the distinction between a master cursus (year 4 or more) and a bachelor cursus (year 3 or less) + function getCursusDisplay(cursus){ + if (cursus.year <= 3){ + return "BAB " + cursus.year + " " + cursus.option; + }else{ + return "MA" + (parseInt(cursus.year)-3).toString() + " " + cursus.option; + } + } @@ -130,16 +146,16 @@

{{i18n("profile.picture").toUpperCase()}}

- +

{{i18n("Curriculum").toUpperCase()}}

-
@@ -153,7 +169,6 @@
Carte d'identité : -
diff --git a/frontend/src/rest/Users.js b/frontend/src/rest/Users.js index 760bfc7..6d9d05b 100644 --- a/frontend/src/rest/Users.js +++ b/frontend/src/rest/Users.js @@ -26,7 +26,7 @@ export function disconnect(){ * @param curriculum * @param imageId id of the image in database returned when uploaded */ -export async function register(firstname, lastname, birthDate, password, email, address, country, curriculumId, imageId){ +export async function register(firstname, lastname, birthDate, password, email, address, country, curriculumId, imageId, identityCardId, submissionDate){ return restPost("/register", { firstName: firstname, lastName: lastname, @@ -36,7 +36,9 @@ export async function register(firstname, lastname, birthDate, password, email, address: address, country: country, curriculumId: curriculumId, - profilePictureUrl: imageId, + profilePicture: imageId, + identityCard : identityCardId, + submissionDate : submissionDate }); } @@ -52,7 +54,7 @@ export async function register(firstname, lastname, birthDate, password, email, * @param country * @param imageId id of the image in database returned when uploaded * - * PS: the password is not is not required as it is generated by the backend and sent to the user + * PS: the password is not required as it is generated by the backend and sent to the user * by mail. it's up to the user to change it if he cares about security */ export async function createUser(firstname, lastname, birthDate, email, address, country, role, imageId){ diff --git a/frontend/src/rest/uploads.js b/frontend/src/rest/uploads.js index 48623cf..856024d 100644 --- a/frontend/src/rest/uploads.js +++ b/frontend/src/rest/uploads.js @@ -7,5 +7,17 @@ import { restPostFile } from '@/rest/restConsumer.js' export async function uploadProfilePicture(file){ const formData = new FormData(); formData.append("file", file[0]); - return restPostFile("/upload/ProfilePicture", formData) + + return restPostFile("/upload/ProfilePicture", formData); } + + +/** + * More generic version of the upload method + */ + +export async function uploadFile(file, type){ + const formData = new FormData(); + formData.append("file", file[0]); + return restPostFile("/upload/"+type, formData) +} \ No newline at end of file