Compare commits
	
		
			5 Commits
		
	
	
		
			5516f75346
			...
			3198a7ade0
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 3198a7ade0 | |||
| 59b82abf71 | |||
| cf0c465248 | |||
| 2917d645fa | |||
| 47eb98da57 | 
@ -42,6 +42,7 @@ public class MockController {
 | 
				
			|||||||
    public final LessonRequestService lessonRequestService;
 | 
					    public final LessonRequestService lessonRequestService;
 | 
				
			||||||
    ArrayList<User> mockUsers;
 | 
					    ArrayList<User> mockUsers;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public static boolean isMocked = false;
 | 
				
			||||||
    public final ResearchesService researchesService;
 | 
					    public final ResearchesService researchesService;
 | 
				
			||||||
    public final UserCurriculumRepository ucr;
 | 
					    public final UserCurriculumRepository ucr;
 | 
				
			||||||
    public final MinervalRepository minervalRepository;
 | 
					    public final MinervalRepository minervalRepository;
 | 
				
			||||||
@ -78,7 +79,7 @@ public class MockController {
 | 
				
			|||||||
    @PostMapping("/mock")
 | 
					    @PostMapping("/mock")
 | 
				
			||||||
    public void postMock() {
 | 
					    public void postMock() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if(!isMocked){
 | 
				
			||||||
        // user part
 | 
					        // user part
 | 
				
			||||||
        User herobrine = new User("brine","hero","admin@admin.com","behind","ShadowsLand",new Date(0), null,Role.Admin,"admin");
 | 
					        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");
 | 
					        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);
 | 
					        externalCurriculum = new ExternalCurriculum(inscriptionRequest, "HEH", "Bachelier en informatique", "Completed", 2015, 2018, null, null);
 | 
				
			||||||
        externalCurriculumRepository.save(externalCurriculum);
 | 
					        externalCurriculumRepository.save(externalCurriculum);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        isMocked = true;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -50,6 +50,7 @@ Delete=Delete
 | 
				
			|||||||
Modify=Modify
 | 
					Modify=Modify
 | 
				
			||||||
Create=Créer
 | 
					Create=Créer
 | 
				
			||||||
requestType=Request Type
 | 
					requestType=Request Type
 | 
				
			||||||
 | 
					lessonType=Course Type
 | 
				
			||||||
day=Day
 | 
					day=Day
 | 
				
			||||||
start=Start
 | 
					start=Start
 | 
				
			||||||
end=End
 | 
					end=End
 | 
				
			||||||
 | 
				
			|||||||
@ -50,6 +50,7 @@ Delete=Supprimer
 | 
				
			|||||||
Modify=Modifier
 | 
					Modify=Modifier
 | 
				
			||||||
Create=Créer
 | 
					Create=Créer
 | 
				
			||||||
requestType=Type de Requête
 | 
					requestType=Type de Requête
 | 
				
			||||||
 | 
					lessonType=Type de cours
 | 
				
			||||||
day=Jour
 | 
					day=Jour
 | 
				
			||||||
start=Début
 | 
					start=Début
 | 
				
			||||||
end=Fin
 | 
					end=Fin
 | 
				
			||||||
 | 
				
			|||||||
@ -1,14 +1,13 @@
 | 
				
			|||||||
<script setup>
 | 
					<script setup>
 | 
				
			||||||
  import { toast } from 'vue3-toastify';
 | 
					 | 
				
			||||||
  import { ref } from 'vue'
 | 
					  import { ref } from 'vue'
 | 
				
			||||||
  import i18n, { setLang } from './i18n.js'
 | 
					  import i18n, { setLang } from './i18n.js'
 | 
				
			||||||
  import { isLogged, getSelf } from '@/rest/Users.js'
 | 
					  import { isLogged, getSelf } from '@/rest/Users.js'
 | 
				
			||||||
	import { notifications, fetchNotifications, archiveNotification } from '@/rest/notifications.js'
 | 
						import { notifications, fetchNotifications, archiveNotification } from '@/rest/notifications.js'
 | 
				
			||||||
 | 
					  import {postMock} from "@/rest/restConsumer.js";
 | 
				
			||||||
  import { appList, currentView } from '@/rest/apps.js'
 | 
					  import { appList, currentView } from '@/rest/apps.js'
 | 
				
			||||||
		var prevURL;
 | 
							var prevURL;
 | 
				
			||||||
		var currentURL = window.location.hash;
 | 
							var currentURL = window.location.hash;
 | 
				
			||||||
 | 
					postMock()
 | 
				
			||||||
window.onhashchange = function() {
 | 
					window.onhashchange = function() {
 | 
				
			||||||
    prevURL = currentURL;
 | 
					    prevURL = currentURL;
 | 
				
			||||||
    currentURL = window.location.hash;
 | 
					    currentURL = window.location.hash;
 | 
				
			||||||
 | 
				
			|||||||
@ -18,7 +18,7 @@ const AcceptMod = ref(false);
 | 
				
			|||||||
const moreInfosMod = ref(false);
 | 
					const moreInfosMod = ref(false);
 | 
				
			||||||
const requestTypes = ["Create", "Modify", "Delete"]
 | 
					const requestTypes = ["Create", "Modify", "Delete"]
 | 
				
			||||||
const editElementID = ref('');
 | 
					const editElementID = ref('');
 | 
				
			||||||
const chosenLocal = ref("");
 | 
					const chosenLocal = ref();
 | 
				
			||||||
const locals = ["A0B1","A1B1","A2B1","A0B2"];
 | 
					const locals = ["A0B1","A1B1","A2B1","A0B2"];
 | 
				
			||||||
const moreInfos = ref({});
 | 
					const moreInfos = ref({});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -30,6 +30,7 @@ const moreInfos = ref({});
 | 
				
			|||||||
async function upPage(id,review){
 | 
					async function upPage(id,review){
 | 
				
			||||||
  await changeRequestState(id, review) ;
 | 
					  await changeRequestState(id, review) ;
 | 
				
			||||||
  requests.value = await getAllRequests();
 | 
					  requests.value = await getAllRequests();
 | 
				
			||||||
 | 
					  chosenLocal.value = null;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 | 
				
			|||||||
@ -168,11 +168,9 @@
 | 
				
			|||||||
    </div>
 | 
					    </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="!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;">
 | 
					      <div  v-if="editElementID !== item.title && editAddCourse !== item.title" style="display:flex;">
 | 
				
			||||||
        <button   @click="editElementID = item.title; editAddCourse = ''; setModify(item); ">
 | 
					        <button   @click="editElementID = item.title; editAddCourse = ''; setModify(item);">{{i18n("courses.modify")}}</button>
 | 
				
			||||||
        {{i18n("courses.modify")}}
 | 
					        <button v-if="self.role !== 'Teacher'"@click="editAddCourse = item.title; editElementID ='';setAddToCurriculum(item)">{{i18n("courses.AddToCurriculum")}}</button>
 | 
				
			||||||
        </button>
 | 
					 | 
				
			||||||
        <button v-if="self.role !== 'Teacher'"@click="editAddCourse = item.title; editElementID ='';setAddToCurriculum(item)">Add to a new Curriculum</button>
 | 
					 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
      <div v-if="editElementID == item.title">
 | 
					      <div v-if="editElementID == item.title">
 | 
				
			||||||
        <button @click="editElementID= '';patchCourse(item)"> {{i18n("courses.confirm")}} </button>
 | 
					        <button @click="editElementID= '';patchCourse(item)"> {{i18n("courses.confirm")}} </button>
 | 
				
			||||||
 | 
				
			|||||||
@ -221,6 +221,8 @@ async function setCourses(){
 | 
				
			|||||||
    lessonBuffer.value = Object.assign({}, pattern);
 | 
					    lessonBuffer.value = Object.assign({}, pattern);
 | 
				
			||||||
    lessonFinder.value = null;
 | 
					    lessonFinder.value = null;
 | 
				
			||||||
    lessonCreatorBuffer.value = Object.assign({},lessonCreator)
 | 
					    lessonCreatorBuffer.value = Object.assign({},lessonCreator)
 | 
				
			||||||
 | 
					    allSchedules.value = await getAllSchedule();
 | 
				
			||||||
 | 
					    schedule.value = null; 
 | 
				
			||||||
    trueSchedule.value = null;
 | 
					    trueSchedule.value = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
@ -27,6 +27,9 @@ export function restPatch(endPoint, data) {
 | 
				
			|||||||
	return _rest(endPoint, {method: "PATCH", credentials: 'include', body: JSON.stringify(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
 | 
					 * backbone for the request made by the frontend
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user