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 b61ff6e..f98a7ee 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java @@ -42,6 +42,7 @@ public class MockController { public final LessonRequestService lessonRequestService; ArrayList<User> mockUsers; + public static boolean isMocked = false; public final ResearchesService researchesService; public final UserCurriculumRepository ucr; public final MinervalRepository minervalRepository; @@ -78,7 +79,7 @@ public class MockController { @PostMapping("/mock") public void postMock() { - + if(!isMocked){ // user part User herobrine = new User("brine","hero","admin@admin.com","behind","ShadowsLand",new Date(0), null,Role.Admin,"admin"); User joe = new User("Piplo","Joe","student@student.com","roundabout","England",new Date(0), null,Role.Student,"student"); @@ -230,6 +231,9 @@ public class MockController { externalCurriculum = new ExternalCurriculum(inscriptionRequest, "HEH", "Bachelier en informatique", "Completed", 2015, 2018, null, null); externalCurriculumRepository.save(externalCurriculum); + + isMocked = true; + } } } diff --git a/frontend/public/i18n/EN.txt b/frontend/public/i18n/EN.txt index 6710080..dadb561 100644 --- a/frontend/public/i18n/EN.txt +++ b/frontend/public/i18n/EN.txt @@ -50,6 +50,7 @@ Delete=Delete Modify=Modify Create=Créer requestType=Request Type +lessonType=Course Type day=Day start=Start end=End diff --git a/frontend/public/i18n/FR.txt b/frontend/public/i18n/FR.txt index 547bbe5..f2485cc 100644 --- a/frontend/public/i18n/FR.txt +++ b/frontend/public/i18n/FR.txt @@ -50,6 +50,7 @@ Delete=Supprimer Modify=Modifier Create=Créer requestType=Type de Requête +lessonType=Type de cours day=Jour start=Début end=Fin @@ -287,4 +288,4 @@ cursusprereq=Le cursus que vous avez selectionné a des prérequis assurez vous imposecurriculum=Imposer un cursusgotimposed impose=Imposer gotimposed=Le cursus selectionné a été imposé -DifferentLanguage=Langues différentes \ No newline at end of file +DifferentLanguage=Langues différentes diff --git a/frontend/src/App.vue b/frontend/src/App.vue index c79cfae..9d2312b 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,14 +1,13 @@ <script setup> - import { toast } from 'vue3-toastify'; import { ref } from 'vue' import i18n, { setLang } from './i18n.js' import { isLogged, getSelf } from '@/rest/Users.js' import { notifications, fetchNotifications, archiveNotification } from '@/rest/notifications.js' - + import {postMock} from "@/rest/restConsumer.js"; import { appList, currentView } from '@/rest/apps.js' var prevURL; var currentURL = window.location.hash; - +postMock() window.onhashchange = function() { prevURL = currentURL; currentURL = window.location.hash; @@ -42,7 +41,7 @@ window.addEventListener('hashchange', () => { <div class="topBar"> <ul class="horizontal"> <li title=home> - <a class="icon" href="#home"> + <a class="icon" href="#home"> <img class="clyde" src="/Clyde.png" style="width: 40px; height: auto; margin-top:4px"> </a></li> <li title=home> diff --git a/frontend/src/Apps/LessonRequests.vue b/frontend/src/Apps/LessonRequests.vue index d84696f..bd573ae 100644 --- a/frontend/src/Apps/LessonRequests.vue +++ b/frontend/src/Apps/LessonRequests.vue @@ -18,7 +18,7 @@ const AcceptMod = ref(false); const moreInfosMod = ref(false); const requestTypes = ["Create", "Modify", "Delete"] const editElementID = ref(''); -const chosenLocal = ref(""); +const chosenLocal = ref(); const locals = ["A0B1","A1B1","A2B1","A0B2"]; const moreInfos = ref({}); @@ -30,6 +30,7 @@ const moreInfos = ref({}); async function upPage(id,review){ await changeRequestState(id, review) ; requests.value = await getAllRequests(); + chosenLocal.value = null; } /* diff --git a/frontend/src/Apps/ManageCourses.vue b/frontend/src/Apps/ManageCourses.vue index 4e60c7b..9b7172d 100644 --- a/frontend/src/Apps/ManageCourses.vue +++ b/frontend/src/Apps/ManageCourses.vue @@ -168,11 +168,9 @@ </div> <div v-if="!createMod && !deleteMod" v-for="item in curriculum" :key="item.title" style="width:50%;margin-left:auto; margin-right:auto;"> - <div v-if="editElementID !== item.title && editAddCourse !== item.title" style ="padding:15px 15px 15px 15px;"> - <button @click="editElementID = item.title; editAddCourse = ''; setModify(item); "> - {{i18n("courses.modify")}} - </button> - <button v-if="self.role !== 'Teacher'"@click="editAddCourse = item.title; editElementID ='';setAddToCurriculum(item)">Add to a new Curriculum</button> + <div v-if="editElementID !== item.title && editAddCourse !== item.title" style="display:flex;"> + <button @click="editElementID = item.title; editAddCourse = ''; setModify(item);">{{i18n("courses.modify")}}</button> + <button v-if="self.role !== 'Teacher'"@click="editAddCourse = item.title; editElementID ='';setAddToCurriculum(item)">{{i18n("courses.AddToCurriculum")}}</button> </div> <div v-if="editElementID == item.title"> <button @click="editElementID= '';patchCourse(item)"> {{i18n("courses.confirm")}} </button> diff --git a/frontend/src/Apps/ManageSchedule.vue b/frontend/src/Apps/ManageSchedule.vue index b34e4a5..dda4bae 100644 --- a/frontend/src/Apps/ManageSchedule.vue +++ b/frontend/src/Apps/ManageSchedule.vue @@ -221,6 +221,8 @@ async function setCourses(){ lessonBuffer.value = Object.assign({}, pattern); lessonFinder.value = null; lessonCreatorBuffer.value = Object.assign({},lessonCreator) + allSchedules.value = await getAllSchedule(); + schedule.value = null; trueSchedule.value = null; } diff --git a/frontend/src/rest/restConsumer.js b/frontend/src/rest/restConsumer.js index a103170..09ae660 100644 --- a/frontend/src/rest/restConsumer.js +++ b/frontend/src/rest/restConsumer.js @@ -27,6 +27,9 @@ export function restPatch(endPoint, data) { return _rest(endPoint, {method: "PATCH", credentials: 'include', body: JSON.stringify(data)}); } +export function postMock(){ + return restPost("/mock") +} /** * backbone for the request made by the frontend *