From b67b25b4a465e7c343eef57f820006bc70051a5f Mon Sep 17 00:00:00 2001 From: Wawilski Date: Sun, 17 Mar 2024 13:24:24 +0100 Subject: [PATCH] Login Finished, add curricula and apps --- .../EndPoints/ApplicationsController.java | 11 ++++++++-- .../herisson/Clyde/Tables/Applications.java | 4 +++- frontend/src/App.vue | 18 ++++++++++++++- frontend/src/Apps/Inscription.vue | 2 +- frontend/src/Apps/Login.vue | 22 +++++++++++-------- frontend/src/rest/apps.js | 8 ++++++- frontend/src/rest/curriculum.js | 2 +- 7 files changed, 51 insertions(+), 16 deletions(-) diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java index 77b2f3e..bab7d5a 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java @@ -61,10 +61,17 @@ public class ApplicationsController { authorizedApps.add(Applications.Rdv); } - if (posterRole == Role.Teacher || posterRole == Role.Secretary || posterRole == Role.Admin) authorizedApps.add(Applications.ManageCourses); + if (posterRole == Role.Teacher || posterRole == Role.Secretary || posterRole == Role.Admin){ + authorizedApps.add(Applications.ManageCourses); + } - if (posterRole == Role.InscriptionService || posterRole == Role.Admin) authorizedApps.add(Applications.Inscription); + if (posterRole == Role.InscriptionService || posterRole == Role.Admin) { + authorizedApps.add(Applications.Inscription); + authorizedApps.add(Applications.StudentsList); + } + if (posterRole == Role.Secretary || posterRole == Role.Admin){ + authorizedApps.add(Applications.UsersList);} return authorizedApps; } } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java index 6ad6567..3dadcec 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java @@ -15,7 +15,9 @@ public enum Applications { // teachers and Secretary authorization ManageCourses, + UsersList, // InscriptionService authorization - Inscription + Inscription, + StudentsList } diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 6414ee9..35f7f04 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -5,6 +5,22 @@ import { isLogged } from '@/rest/Users.js' import { appList, currentView } from '@/rest/apps.js' + var prevURL; + var currentURL = window.location.hash; + +window.onhashchange = function() { + prevURL = currentURL; + currentURL = window.location.hash; +} + console.log(location) +window.addEventListener('hashchange', () => { + console.log(prevURL) + console.log(location.hash) + console.log(isLogged()) + if(location.hash === "#/home" && prevURL === "#/login"){ + window.location.reload(); + } +}) const home=ref(i18n("app.home")) const notifications=ref(i18n("app.notifications")) @@ -66,7 +82,7 @@