Compare commits
	
		
			1 Commits
		
	
	
		
			78da7b23d2
			...
			tonitch/fi
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| d21655c535 | 
| @ -14,26 +14,26 @@ on: | ||||
|   workflow_dispatch: | ||||
|  | ||||
| jobs: | ||||
|   # deploy-frontend: | ||||
|   #   runs-on: ubuntu-latest | ||||
|   #   steps: | ||||
|   #   - uses: actions/checkout@v4 | ||||
|   #   - name: Use Node.js ${{ matrix.node-version }} | ||||
|   #     uses: actions/setup-node@v3 | ||||
|   #     working-directory: ./frontend | ||||
|   #   - run: npm ci  | ||||
|   #     name: clean install | ||||
|   #     working-directory: ./frontend | ||||
|   #   - name: building  | ||||
|   #     working-directory: ./frontend | ||||
|   #     run: npm run build | ||||
|   #   - name: pushing to the server | ||||
|   #     working-directory: ./frontend | ||||
|   #     run: | | ||||
|   #       echo "${{ secrets.SSH_KEY }}" > key | ||||
|   #       chmod 0600 key | ||||
|   #       scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r dist/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}: | ||||
|   #   - run: echo "The website has been deployed. visit https://clyde.herisson.ovh/" | ||||
|   deploy-frontend: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|     - uses: actions/checkout@v4 | ||||
|     - name: Use Node.js ${{ matrix.node-version }} | ||||
|       uses: actions/setup-node@v3 | ||||
|       working-directory: ./frontend | ||||
|     - run: npm ci  | ||||
|       name: clean install | ||||
|       working-directory: ./frontend | ||||
|     - name: building  | ||||
|       working-directory: ./frontend | ||||
|       run: npm run build | ||||
|     - name: pushing to the server | ||||
|       working-directory: ./frontend | ||||
|       run: | | ||||
|         echo "${{ secrets.SSH_KEY }}" > key | ||||
|         chmod 0600 key | ||||
|         scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r dist/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}: | ||||
|     - run: echo "The website has been deployed. visit https://clyde.herisson.ovh/" | ||||
|  | ||||
|   deploy-backend: | ||||
|     runs-on: ubuntu-latest | ||||
| @ -46,5 +46,5 @@ jobs: | ||||
|         scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r * ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:api/ | ||||
|     - name: restarting the backend  | ||||
|       run: | | ||||
|         ssh -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd api/ && sed -i compose.yaml -e "s/8080:8080/4001:8080/" -e "s/8000:8080/4000:8080/" -e "23 i\    environment:\n      - VITE_CLYDE_MODE=prod" && docker-compose up --force-recreate --build -d' | ||||
|         ssh -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd api/ && sed -i compose.yaml -e "s/8080:8080/4001:8080/" -e "s/8000:8080/4000:8080/" && docker-compose up --force-recreate --build -d' | ||||
|     - run: echo "The backend has been deployed. running at https://clyde.herisson.ovh/api" | ||||
|  | ||||
| @ -13,7 +13,10 @@ import ovh.herisson.Clyde.Services.AuthenticatorService; | ||||
| import ovh.herisson.Clyde.Services.TokenService; | ||||
| import ovh.herisson.Clyde.Services.UserService; | ||||
| import ovh.herisson.Clyde.Tables.*; | ||||
| import ovh.herisson.Clyde.Tables.Inscription.*; | ||||
| import ovh.herisson.Clyde.Tables.Inscription.ExemptionsRequest; | ||||
| import ovh.herisson.Clyde.Tables.Inscription.Minerval; | ||||
| import ovh.herisson.Clyde.Tables.Inscription.ScholarshipRequest; | ||||
| import ovh.herisson.Clyde.Tables.Inscription.UnregisterRequest; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.Calendar; | ||||
| @ -325,7 +328,7 @@ public class RequestsController { | ||||
|             return new ResponseEntity<>(HttpStatus.OK); | ||||
|         } | ||||
|  | ||||
|         toEdit.setTeacherApprovalState(newteacherstate); | ||||
|         toEdit.setState(newteacherstate); | ||||
|         changeCurriculumRequestRepository.save(toEdit); | ||||
|  | ||||
|         if (newteacherstate == RequestState.Accepted && toEdit.getState() == RequestState.Accepted){ | ||||
|  | ||||
| @ -42,7 +42,6 @@ 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; | ||||
| @ -79,7 +78,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"); | ||||
| @ -185,11 +184,11 @@ public class MockController { | ||||
|  | ||||
|         //Schedule part | ||||
|  | ||||
|         Lesson lesson_0_progra1 = new Lesson(progra1, "Mon Apr 22 2024 08:15", "Mon Apr 22 2024 10:15","rgb(255,36,175)","A0B2","Course"); | ||||
|         Lesson lesson_0_chemistry1 = new Lesson(chemistry1, "Wed Mar 27 2024 08:15", "Wed Mar 27 2024 09:15","rgb(36,175,255)","A0B2","TP"); | ||||
|         Lesson lesson_0_psycho1 = new Lesson(psycho1, "Sun Mar 24 2024 10:30 ","Sun Mar 24 2024 12:30 ","rgb(255,36,175)", "A0B2","TD"); | ||||
|         Lesson lesson_1_progra1 = new Lesson(progra1, "Mon Apr 02 2024 13:30", "Mon Apr 02 2024 15:30","rgb(36,175,255)","A0B2","TP"); | ||||
|         Lesson lesson_0_commun = new Lesson(commun, "Mon Apr 01 2024 10:30", "Mon Apr 01 2024 12:30","rgb(255,36,175)","A0B2","Course"); | ||||
|         Lesson lesson_0_progra1 = new Lesson(progra1, "Mon Apr 22 2024 08:15", "Mon Apr 22 2024 10:15","rgb(0,50,100)","A0B2","Course"); | ||||
|         Lesson lesson_0_chemistry1 = new Lesson(chemistry1, "Wed Mar 27 2024 08:15", "Wed Mar 27 2024 09:15","rgb(100,50,0)","A0B2","TP"); | ||||
|         Lesson lesson_0_psycho1 = new Lesson(psycho1, "Sun Mar 24 2024 10:30 ","Sun Mar 24 2024 12:30 ","rgb(100,50,100)", "A0B2","TD"); | ||||
|         Lesson lesson_1_progra1 = new Lesson(progra1, "Mon Apr 02 2024 13:30", "Mon Apr 02 2024 15:30","rgb(0,50,100)","A0B2","TP"); | ||||
|         Lesson lesson_0_commun = new Lesson(commun, "Mon Apr 01 2024 10:30", "Mon Apr 01 2024 12:30","rgb(0,50,100)","A0B2","Course"); | ||||
|  | ||||
|         LessonChangesRequest request1 = new LessonChangesRequest(joke,RequestState.Pending,null,null,null,null,2,null,1); | ||||
|         LessonChangesRequest request2 = new LessonChangesRequest(joke,RequestState.Pending,"Fri Apr 19 2024 10:30 ","Fri Apr 19 2024 12:30 ",null,null,1,null,2); | ||||
| @ -231,9 +230,6 @@ public class MockController { | ||||
|  | ||||
|         externalCurriculum = new ExternalCurriculum(inscriptionRequest, "HEH", "Bachelier en informatique", "Completed", 2015, 2018, null, null); | ||||
|         externalCurriculumRepository.save(externalCurriculum); | ||||
|  | ||||
|         isMocked = true; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| package ovh.herisson.Clyde.Repositories.Inscription; | ||||
|  | ||||
| import org.springframework.data.repository.CrudRepository; | ||||
| import ovh.herisson.Clyde.Tables.Inscription.ChangeCurriculumRequest; | ||||
| import ovh.herisson.Clyde.Tables.ChangeCurriculumRequest; | ||||
|  | ||||
| public interface ChangeCurriculumRequestRepository extends CrudRepository<ChangeCurriculumRequest, Long> { | ||||
|     ChangeCurriculumRequest findById(long id); | ||||
|  | ||||
| @ -15,33 +15,33 @@ import java.util.Map; | ||||
|  | ||||
| public interface StatsRepository extends CrudRepository<Research,Long> { | ||||
|  | ||||
|     @Query("select new map(to_char(r.releaseDate, 'month') as label, sum(r.views) as y) from Research r where r.author.id = ?1 group by to_char(r.releaseDate, 'month')") | ||||
|     Iterable<Map<String ,Integer>> viewsByMonths(long researcherId); | ||||
|     @Query("select new map(to_char(r.releaseDate, 'month') as label, sum(r.views) as y) from Research r group by to_char(r.releaseDate, 'month')") | ||||
|     Iterable<Map<String ,Integer>> viewsByMonths(); | ||||
|  | ||||
|     @Query("select new map(to_char(r.releaseDate,'YYYY') as label, sum  (r.views) as y) from Research r group by to_char(r.releaseDate,'YYYY')") | ||||
|     Iterable<Map<String ,Integer>> viewsByYears(long researcherId); | ||||
|     Iterable<Map<String ,Integer>> viewsByYears(); | ||||
|  | ||||
|  | ||||
|     @Query("select new map(r.domain as label, sum(r.views) as y) from Research r where r.author.id = ?1 group by r.domain") | ||||
|     Iterable<Map<String ,Integer>> viewsByTopics(long researcherId); | ||||
|     @Query("select new map(r.domain as label, sum(r.views) as y) from Research r group by r.domain") | ||||
|     Iterable<Map<String ,Integer>> viewsByTopics(); | ||||
|  | ||||
|  | ||||
|     @Query("select new map(r.domain as label, count(distinct r.language) as y) from Research r where r.author.id = ?1 group by r.domain") | ||||
|     Iterable<Map<String ,Integer>> languageByTopics(long researcherId); | ||||
|     @Query("select new map(r.domain as label, count(distinct r.language) as y) from Research r group by r.domain") | ||||
|     Iterable<Map<String ,Integer>> languageByTopics(); | ||||
|  | ||||
|     @Query("select new map(to_char(r.releaseDate,'YYYY') as label,  count(distinct r.language) as y) from Research r where r.author.id = ?1 group by to_char(r.releaseDate,'YYYY')") | ||||
|     Iterable<Map<String ,Integer>> languageByYears(long researcherId); | ||||
|     @Query("select new map(to_char(r.releaseDate,'YYYY') as label,  count(distinct r.language) as y) from Research r group by to_char(r.releaseDate,'YYYY')") | ||||
|     Iterable<Map<String ,Integer>> languageByYears(); | ||||
|  | ||||
|     @Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r.language) as y) from Research r where r.author.id = ?1 group by to_char(r.releaseDate, 'month')") | ||||
|     Iterable<Map<String ,Integer>> languageByMonths(long researcherId); | ||||
|     @Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r.language) as y) from Research r group by to_char(r.releaseDate, 'month')") | ||||
|     Iterable<Map<String ,Integer>> languageByMonths(); | ||||
|  | ||||
|     @Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(distinct r) as y) from Research r where r.author.id = ?1 group by to_char(r.releaseDate,'YYYY')") | ||||
|     Iterable<Map<String ,Integer>> researchesByYears(long researcherId); | ||||
|     @Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(distinct r) as y) from Research r group by to_char(r.releaseDate,'YYYY')") | ||||
|     Iterable<Map<String ,Integer>> researchesByYears(); | ||||
|  | ||||
|     @Query("select new map(r.domain as label, count(distinct r) as y) from Research r where r.author.id = ?1 group by r.domain") | ||||
|     Iterable<Map<String ,Integer>> researchesByTopics(long researcherId); | ||||
|     @Query("select new map(r.domain as label, count(distinct r) as y) from Research r group by r.domain") | ||||
|     Iterable<Map<String ,Integer>> researchesByTopics(); | ||||
|  | ||||
|     @Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r) as y) from Research r where r.author.id = ?1 group by to_char(r.releaseDate, 'month')") | ||||
|     Iterable<Map<String ,Integer>> researchesByMonth(long researcherId); | ||||
|     @Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r) as y) from Research r group by to_char(r.releaseDate, 'month')") | ||||
|     Iterable<Map<String ,Integer>> researchesByMonth(); | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -34,17 +34,17 @@ public class StatisticsService { | ||||
|  | ||||
|         ArrayList<Iterable<Map<String,Integer>>> toReturn = new ArrayList<>(); | ||||
|  | ||||
|         toReturn.add(statsRepo.viewsByYears(researcher.getId())); | ||||
|         toReturn.add(statsRepo.viewsByMonths(researcher.getId())); | ||||
|         toReturn.add(statsRepo.viewsByTopics(researcher.getId())); | ||||
|         toReturn.add(statsRepo.viewsByYears()); | ||||
|         toReturn.add(statsRepo.viewsByMonths()); | ||||
|         toReturn.add(statsRepo.viewsByTopics()); | ||||
|  | ||||
|         toReturn.add(statsRepo.researchesByYears(researcher.getId())); | ||||
|         toReturn.add(statsRepo.researchesByMonth(researcher.getId())); | ||||
|         toReturn.add(statsRepo.researchesByTopics(researcher.getId())); | ||||
|         toReturn.add(statsRepo.researchesByYears()); | ||||
|         toReturn.add(statsRepo.researchesByMonth()); | ||||
|         toReturn.add(statsRepo.researchesByTopics()); | ||||
|  | ||||
|         toReturn.add(statsRepo.languageByYears(researcher.getId())); | ||||
|         toReturn.add(statsRepo.languageByMonths(researcher.getId())); | ||||
|         toReturn.add(statsRepo.languageByTopics(researcher.getId())); | ||||
|         toReturn.add(statsRepo.languageByYears()); | ||||
|         toReturn.add(statsRepo.languageByMonths()); | ||||
|         toReturn.add(statsRepo.languageByTopics()); | ||||
|         return toReturn; | ||||
|     } | ||||
| } | ||||
| @ -51,8 +51,8 @@ public class TokenService { | ||||
|         ArrayList<Token> tokenList = tokenRepo.getByUserOrderByExpirationDate(token.getUser()); | ||||
|  | ||||
|         while(tokenList.size() >= 5){ | ||||
|             tokenRepo.delete(tokenList.get(0)); | ||||
|             tokenList.remove(tokenList.get(0)); | ||||
|             tokenRepo.delete(tokenList.getFirst()); | ||||
|             tokenList.remove(tokenList.getFirst()); | ||||
|         } | ||||
|         tokenRepo.save(token); | ||||
|     } | ||||
|  | ||||
| @ -1,9 +1,6 @@ | ||||
| package ovh.herisson.Clyde.Tables.Inscription; | ||||
| package ovh.herisson.Clyde.Tables; | ||||
| 
 | ||||
| import jakarta.persistence.*; | ||||
| import ovh.herisson.Clyde.Tables.Curriculum; | ||||
| import ovh.herisson.Clyde.Tables.RequestState; | ||||
| import ovh.herisson.Clyde.Tables.User; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @ -2,6 +2,8 @@ package ovh.herisson.Clyde.Tables.Inscription; | ||||
|  | ||||
|  | ||||
| import jakarta.persistence.*; | ||||
| import org.hibernate.annotations.OnDelete; | ||||
| import org.hibernate.annotations.OnDeleteAction; | ||||
| import ovh.herisson.Clyde.Tables.Course; | ||||
| import ovh.herisson.Clyde.Tables.RequestState; | ||||
| import ovh.herisson.Clyde.Tables.User; | ||||
|  | ||||
| @ -7,6 +7,7 @@ import ovh.herisson.Clyde.Tables.RequestState; | ||||
| import ovh.herisson.Clyde.Tables.User; | ||||
|  | ||||
| import java.util.Date; | ||||
| import java.util.Map; | ||||
|  | ||||
| @Entity | ||||
| public class ScholarshipRequest { | ||||
|  | ||||
| @ -3,6 +3,7 @@ package ovh.herisson.Clyde.Tables.Inscription; | ||||
| import jakarta.persistence.*; | ||||
| import ovh.herisson.Clyde.Tables.Curriculum; | ||||
| import ovh.herisson.Clyde.Tables.RequestState; | ||||
| import ovh.herisson.Clyde.Tables.User; | ||||
|  | ||||
| import java.util.Date; | ||||
|  | ||||
|  | ||||
| @ -23,7 +23,6 @@ import ovh.herisson.Clyde.Repositories.TokenRepository; | ||||
| import ovh.herisson.Clyde.Repositories.UserRepository; | ||||
| import ovh.herisson.Clyde.Responses.UnauthorizedResponse; | ||||
| import ovh.herisson.Clyde.Services.TokenService; | ||||
| import ovh.herisson.Clyde.Services.UserService; | ||||
| import ovh.herisson.Clyde.Tables.Role; | ||||
| import ovh.herisson.Clyde.Tables.Token; | ||||
| import ovh.herisson.Clyde.Tables.User; | ||||
| @ -47,8 +46,7 @@ public class UserControllerTest { | ||||
|  | ||||
|     @Autowired | ||||
|     private TokenService tokenService; | ||||
|     @Autowired | ||||
|     private UserService userService; | ||||
|  | ||||
|     @Autowired | ||||
|     private UserRepository userRepository; | ||||
|     @Autowired | ||||
| @ -74,7 +72,6 @@ public class UserControllerTest { | ||||
|     @BeforeEach | ||||
|     void setup(){ | ||||
|         RestAssured.baseURI = "http://localhost:" + port; | ||||
|         userRepository.deleteAll(); | ||||
|     } | ||||
|  | ||||
|     @AfterEach | ||||
| @ -87,7 +84,7 @@ public class UserControllerTest { | ||||
|     public void userPostTest(){ | ||||
|         User god = new User("god","god","admin@admin.com","everywhere","every",new Date(0), null, Role.Admin,"goddoesntneedpassword"); | ||||
|         Token godToken = new Token(god, tokenService.generateNewToken(), new Date()); | ||||
|         userService.save(god); | ||||
|         userRepository.save(god); | ||||
|         tokenService.saveToken(godToken); | ||||
|  | ||||
|         //Can god post herobrine himself ? | ||||
|  | ||||
| @ -70,7 +70,7 @@ class TokenServiceTest { | ||||
|         ArrayList<Token> tokenList = new ArrayList<>(); | ||||
|         GregorianCalendar gc = new GregorianCalendar(); | ||||
|  | ||||
|         User malveillant = new User("Cargo", "John", "CargoJ@mail.com", "secret", "secret", new Date(), null, "secret", null); | ||||
|         User malveillant = new User("Cargo", "John", "CargoJ@mail.com", "secret", "secret", null, null, null, "secret"); | ||||
|         userRepository.save(malveillant); | ||||
|  | ||||
|         for (int i = 0; i < 20; i++){ | ||||
|  | ||||
| @ -50,7 +50,6 @@ Delete=Delete | ||||
| Modify=Modify | ||||
| Create=Créer | ||||
| requestType=Request Type | ||||
| lessonType=Course Type | ||||
| day=Day | ||||
| start=Start | ||||
| end=End | ||||
|  | ||||
| @ -50,7 +50,6 @@ Delete=Supprimer | ||||
| Modify=Modifier | ||||
| Create=Créer | ||||
| requestType=Type de Requête | ||||
| lessonType=Type de cours | ||||
| day=Jour | ||||
| start=Début | ||||
| end=Fin | ||||
| @ -288,4 +287,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 | ||||
| @ -1,13 +1,14 @@ | ||||
| <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; | ||||
| @ -41,7 +42,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> | ||||
|  | ||||
| @ -51,12 +51,12 @@ async function editChangeCurrReqTeacherApproval(state){ | ||||
|           <div> | ||||
|             <button @click="localwindowstate++"> {{ i18n("seeprofile") }} </button> | ||||
|           </div> | ||||
|           <div v-if="user.role === 'InscriptionService' || user.role==='Admin'"> | ||||
|           <div> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Accepted';uploadandrefreshChangeRequest('Accepted')">{{ i18n("request.accept") }}</button> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Refused';uploadandrefreshChangeRequest('Refused')" style="margin-left: 2%;">{{i18n("request.refuse")}}</button> | ||||
|           </div> | ||||
|           <div v-if="user.role === 'Teacher' || user.role === 'Admin'"> | ||||
|             <button v-if="req.teacherApprovalState === 'Pending'" @click="req.teacherApprovalState='Accepted';editChangeCurrReqTeacherApproval('Accepted')" style="margin-right: 2%">{{i18n("acceptequiv")}}</button> | ||||
|             <button v-if="req.teacherApprovalState === 'Pending'" @click="req.teacherApprovalState='Accepted';editChangeCurrReqTeacherApproval('Accepted')">{{i18n("acceptequiv")}}</button> | ||||
|             <button v-if="req.teacherApprovalState === 'Pending'" @click="req.teacherApprovalState='Refused';editChangeCurrReqTeacherApproval('Refused')">{{i18n("refuseequiv")}}</button> | ||||
|           </div> | ||||
|         </div> | ||||
|  | ||||
| @ -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,7 +30,6 @@ const moreInfos = ref({}); | ||||
| async function upPage(id,review){ | ||||
|   await changeRequestState(id, review) ; | ||||
|   requests.value = await getAllRequests(); | ||||
|   chosenLocal.value = null; | ||||
| } | ||||
|  | ||||
| /* | ||||
|  | ||||
| @ -168,9 +168,11 @@ | ||||
|     </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="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  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> | ||||
|       <div v-if="editElementID == item.title"> | ||||
|         <button @click="editElementID= '';patchCourse(item)"> {{i18n("courses.confirm")}} </button> | ||||
|  | ||||
| @ -221,8 +221,6 @@ 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; | ||||
|  | ||||
|   } | ||||
|  | ||||
| @ -343,19 +343,19 @@ | ||||
|             <select v-model="changecurrdata.actualcursus" style="margin-right: 3%"> | ||||
|               <option v-for="item in getActualCurriculumList()" style="font-size:20px;" :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option> | ||||
|             </select> | ||||
|             {{ i18n("newcursus") }} : | ||||
|             {{ i18n("newcurr") }} : | ||||
|             <select v-model="changecurrdata.newcursus"> | ||||
|               <option v-for="item in curricula"  :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option> | ||||
|             </select> | ||||
|           </div> | ||||
|           <div style="height:40px;" v-if="reRegState === 2"> | ||||
|             {{ i18n("newcursus") }} : | ||||
|             {{ i18n("newcurr") }} : | ||||
|             <select v-model="changecurrdata.newcursus"> | ||||
|               <option v-for="item in curricula"  :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option> | ||||
|             </select> | ||||
|           </div> | ||||
|           <div style="height:40px;" v-if="reRegState === 1"> | ||||
|             {{ i18n("newcursus") }} : | ||||
|             {{ i18n("newcurr") }} : | ||||
|             <select v-model="changecurrdata.newcursus" @change="getActualCurr(changecurrdata.newcursus);"> | ||||
|               <option v-for="item in getCurriculumsNextYear()" :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option> | ||||
|             </select> | ||||
|  | ||||
| @ -8,7 +8,7 @@ | ||||
|  | ||||
| <script setup> | ||||
|   import { ref } from 'vue' | ||||
|   import {getDifferenceTime,lastDateOfMonth,formatDate,getFirstDay,sortByDate,weekFromList,sundayToTheEnd,getMarginTop,getHoursMinutes, monthFromList} from '../scheduleFunctions.js' | ||||
|   import {getDifferenceTime,lastDateOfMonth,formatDate,getFirstDay,sortByDate,weekFromList,sundayToTheEnd,getMarginTop,getHoursMinutes, monthFromList, durationCourse} from '../scheduleFunctions.js' | ||||
|   import {getAllSchedule} from "@/rest/scheduleRest.js"; | ||||
|   import {getOnesLessons, getOwnedLessons } from "@/rest/lessonSchedule.js" | ||||
|   import {isLogged, getSelf,getTeachers} from "@/rest/Users.js" | ||||
| @ -76,6 +76,8 @@ | ||||
|   } | ||||
|   const days = ["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]; | ||||
|   const months = ["january","february","march","april",'may',"june","july","august","september","october","november","december"] | ||||
|   const firstDayOfMonth = ref(getFirstDay(new Date())) | ||||
|   const monthDone = ref(false); | ||||
|   function getMonday(d) { | ||||
|     d = new Date(d); | ||||
|     d.setHours(0,0,0); | ||||
| @ -575,7 +577,6 @@ | ||||
|         </div> | ||||
|         <div class="body"  style="background-color:rgb(50,50,50);">{{i18n("schedule.courses")}}</div> | ||||
|        <div class="body" style="background-color:#484848;"v-for="lesson in focusLessons"> | ||||
|           {{formatDate(lesson.lessonStart)}} | ||||
|           {{ getHoursMinutes(lesson.lessonStart)}}-{{getHoursMinutes(lesson.lessonEnd)}} | ||||
|           {{ lesson.local}} | ||||
|           {{i18n(lesson.lessonType.toString())}} | ||||
|  | ||||
| @ -136,10 +136,8 @@ const emit = defineEmits(["modified"]); | ||||
| <style scoped> | ||||
|  | ||||
| #researches{ | ||||
|   padding-top: 15px; | ||||
|   width: 100%; | ||||
|   height: 100%; | ||||
|   overflow: scroll; | ||||
| } | ||||
| #search{ | ||||
|   width: 100%; | ||||
| @ -224,4 +222,4 @@ a{ | ||||
| #toggledResearchButton:hover{ | ||||
|   background: #ff2d55; | ||||
| } | ||||
| </style> | ||||
| </style> | ||||
|  | ||||
| @ -82,7 +82,7 @@ function getPP(){ | ||||
|  | ||||
|  | ||||
|     </div> | ||||
|     <div> <ListResearches :allResearcher="allResearcher" :research-list="researchList" :manage="true" @modified="modifiedResearch"></ListResearches> </div> | ||||
|     <ListResearches :allResearcher="allResearcher" :research-list="researchList" :manage="true" @modified="modifiedResearch"></ListResearches> | ||||
|   </div> | ||||
| </div> | ||||
| </template> | ||||
| @ -181,4 +181,4 @@ a{ | ||||
|   text-decoration: underline; | ||||
|   cursor: pointer; | ||||
| } | ||||
| </style> | ||||
| </style> | ||||
|  | ||||
| @ -103,7 +103,7 @@ async function articleClicked(){ | ||||
|         </ul> | ||||
|           <div id="downloads" v-if="article.pdfLocation !== null && !manage"> | ||||
|             <a :href=downloadPdf() @click.stop="articleClicked" target="_blank">{{i18n("See.Research")}}</a> | ||||
|             <a v-if="article.bibTexLocation !== null" :href=downloadBibTex() @click.stop="emit('modal-close')"  target="_blank">{{i18n("SeeBibTex")}}</a> </div> | ||||
|             <a v-if="article.bibTexLocation !== null" :href=downloadBibTex() @click.stop="emit('modal-close')"  target="_blank">{{i18n("See.BibTex")}}</a> </div> | ||||
|         </div> | ||||
|         <div v-if="manage" id="manage"> | ||||
|           <div> | ||||
|  | ||||
| @ -111,7 +111,7 @@ function update(){ | ||||
| 		  <CanvasJSChart :options="options" id=chart @chart-ref="c => chart = c "/> | ||||
|       </div> | ||||
|     </div> | ||||
|     <div id="researches" style="margin-top: -15px"><list-researches :researchList="researchList"></list-researches></div> | ||||
|     <div id="researches"><list-researches :researchList="researchList"></list-researches></div> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
|  | ||||
| @ -27,9 +27,6 @@ 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 | ||||
|  * | ||||
|  | ||||
		Reference in New Issue
	
	Block a user