1
0
forked from PGL/Clyde

Merge pull request 'Post mock when arrives on the app' (#182) from PostMockAndCorrections into master

Reviewed-on: PGL/Clyde#182
This commit is contained in:
Wal 2024-04-22 13:35:10 +02:00
commit 59b82abf71
8 changed files with 21 additions and 12 deletions

View File

@ -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;
}
}
}

View File

@ -50,6 +50,7 @@ Delete=Delete
Modify=Modify
Create=Créer
requestType=Request Type
lessonType=Course Type
day=Day
start=Start
end=End

View File

@ -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
DifferentLanguage=Langues différentes

View File

@ -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>

View File

@ -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;
}
/*

View File

@ -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>

View File

@ -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;
}

View File

@ -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
*