From 25c5c1b018cdde9861e74068d6cb5e00b48f2c67 Mon Sep 17 00:00:00 2001 From: Wawilski Date: Mon, 18 Mar 2024 17:28:14 +0100 Subject: [PATCH] Nearly finish --- .../Clyde/EndPoints/MockController.java | 3 +- frontend/src/App.vue | 5 +- frontend/src/Apps/Inscription.vue | 17 ++- frontend/src/Apps/Profil.vue | 100 +++++++----------- frontend/src/rest/Users.js | 8 +- frontend/src/rest/curriculum.js | 5 + 6 files changed, 67 insertions(+), 71 deletions(-) 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 6707fb7..b5d2c99 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java @@ -53,6 +53,7 @@ public class MockController { User joe = new User("Mama","Joe","student@student.com","roundabout","DaWarudo",new Date(0), null,Role.Student,passwordEncoder.encode("student")); User meh = new User("Inspiration","lackOf","secretary@secretary.com","a Box","the street",new Date(0), null,Role.Secretary,passwordEncoder.encode("secretary")); User joke = new User("CthemBalls","Lemme","teacher@teacher.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher")); + User joke = new User("hhoo","yeay","teacher2@teacher2.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher")); User lena = new User("Louille","Lena","inscriptionService@InscriptionService.com","no","yes",new Date(0), null,Role.InscriptionService,passwordEncoder.encode("inscriptionService")); mockUsers = new ArrayList<>(Arrays.asList(herobrine,joe,meh,joke,lena)); @@ -91,7 +92,7 @@ public class MockController { CurriculumCourseService.save(new CurriculumCourse(chemistryBab1,chemistry1)); - InscriptionRequest inscriptionRequest = new InscriptionRequest("helen","prenom","non","helen@gmail.com","america",new Date(),(long) 1,RequestState.Refused,"yes.png","password"); + InscriptionRequest inscriptionRequest = new InscriptionRequest("helen","prenom","non","helen@gmail.com","america",new Date(),(long) 1,RequestState.Pending,"yes.png","password"); inscriptionService.save(inscriptionRequest); diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 9049478..b74d1b5 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -12,8 +12,10 @@ window.onhashchange = function() { prevURL = currentURL; currentURL = window.location.hash; } +const Logged = ref(isLogged()); + window.addEventListener('hashchange', () => { - if(location.hash === "#/home" && prevURL === "#/login"){ + if((location.hash === "#/home" && prevURL === "#/login") || location.hash === "#/home" && prevURL === "#/profil" && !Logged)){ window.location.reload(); } }) @@ -24,7 +26,6 @@ window.addEventListener('hashchange', () => { const login=ref(i18n("app.login")) const active=ref(false) - const Logged = ref(isLogged()); const apps = ref([]) appList().then(e => apps.value = e) diff --git a/frontend/src/Apps/Inscription.vue b/frontend/src/Apps/Inscription.vue index 8adb9ce..94a1811 100644 --- a/frontend/src/Apps/Inscription.vue +++ b/frontend/src/Apps/Inscription.vue @@ -1,15 +1,22 @@