Compare commits
	
		
			26 Commits
		
	
	
		
			730a72dba3
			...
			master
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						
						
							
						
						c1b8c39e92
	
				 | 
					
					
						|||
| 3825565b16 | |||
| 48640dfa8b | |||
| 
						
						
							
						
						3acfd02bfb
	
				 | 
					
					
						|||
| 
						
						
							
						
						a3fe6ce6bd
	
				 | 
					
					
						|||
| 96965bde97 | |||
| 302e0b555c | |||
| 84a408298d | |||
| 3b48e5adfb | |||
| 
						
						
							
						
						78da7b23d2
	
				 | 
					
					
						|||
| 
						
						
							
						
						1831cc7eb2
	
				 | 
					
					
						|||
| cc51510dac | |||
| 44bb04f21b | |||
| 1ed61c8c7b | |||
| 59c82d7482 | |||
| 772fa09e28 | |||
| 672fcd099f | |||
| 3198a7ade0 | |||
| 5516f75346 | |||
| 1f66ac5a4d | |||
| 59b82abf71 | |||
| cf0c465248 | |||
| 2917d645fa | |||
| 47eb98da57 | |||
| eafcf6b265 | |||
| 85c1282f48 | 
@ -14,26 +14,26 @@ on:
 | 
				
			|||||||
  workflow_dispatch:
 | 
					  workflow_dispatch:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
jobs:
 | 
					jobs:
 | 
				
			||||||
  deploy-frontend:
 | 
					  # deploy-frontend:
 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					  #   runs-on: ubuntu-latest
 | 
				
			||||||
    steps:
 | 
					  #   steps:
 | 
				
			||||||
    - uses: actions/checkout@v4
 | 
					  #   - uses: actions/checkout@v4
 | 
				
			||||||
    - name: Use Node.js ${{ matrix.node-version }}
 | 
					  #   - name: Use Node.js ${{ matrix.node-version }}
 | 
				
			||||||
      uses: actions/setup-node@v3
 | 
					  #     uses: actions/setup-node@v3
 | 
				
			||||||
      working-directory: ./frontend
 | 
					  #     working-directory: ./frontend
 | 
				
			||||||
    - run: npm ci 
 | 
					  #   - run: npm ci 
 | 
				
			||||||
      name: clean install
 | 
					  #     name: clean install
 | 
				
			||||||
      working-directory: ./frontend
 | 
					  #     working-directory: ./frontend
 | 
				
			||||||
    - name: building 
 | 
					  #   - name: building 
 | 
				
			||||||
      working-directory: ./frontend
 | 
					  #     working-directory: ./frontend
 | 
				
			||||||
      run: npm run build
 | 
					  #     run: npm run build
 | 
				
			||||||
    - name: pushing to the server
 | 
					  #   - name: pushing to the server
 | 
				
			||||||
      working-directory: ./frontend
 | 
					  #     working-directory: ./frontend
 | 
				
			||||||
      run: |
 | 
					  #     run: |
 | 
				
			||||||
        echo "${{ secrets.SSH_KEY }}" > key
 | 
					  #       echo "${{ secrets.SSH_KEY }}" > key
 | 
				
			||||||
        chmod 0600 key
 | 
					  #       chmod 0600 key
 | 
				
			||||||
        scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r dist/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:
 | 
					  #       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/"
 | 
					  #   - run: echo "The website has been deployed. visit https://clyde.herisson.ovh/"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  deploy-backend:
 | 
					  deploy-backend:
 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					    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/
 | 
					        scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r * ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:api/
 | 
				
			||||||
    - name: restarting the backend 
 | 
					    - name: restarting the backend 
 | 
				
			||||||
      run: |
 | 
					      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/" && 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/" && sed -e "8d" -i frontend/Dockerfile && docker-compose up --force-recreate --build -d'
 | 
				
			||||||
    - run: echo "The backend has been deployed. running at https://clyde.herisson.ovh/api"
 | 
					    - run: echo "The backend has been deployed. running at https://clyde.herisson.ovh/api"
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										14
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								README.md
									
									
									
									
									
								
							@ -1,5 +1,7 @@
 | 
				
			|||||||
# Clyde project
 | 
					# Clyde project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Système de gestion d'universitée (dévelopé dans le cadre du cours de projet de génie logiciel de l'Umons 2024)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Signature
 | 
					## Signature
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Projet du groupe 01:
 | 
					Projet du groupe 01:
 | 
				
			||||||
@ -11,21 +13,28 @@ Projet du groupe 01:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## Running
 | 
					## Running
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Attention**: Vous devez avoir installé docker-compose pour lancer ce projet.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Le projet peut être lancé grace à docker compose.
 | 
					Le projet peut être lancé grace à docker compose.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```sh
 | 
					```sh
 | 
				
			||||||
$ docker compose up 
 | 
					$ docker compose up 
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Dans le cas ou vous modifiers des fichiers, pour éviter que les images de docker soient recrées avec les changement
 | 
					Dans le cas ou vous modifiez des fichiers, pour éviter que les images de docker ne soient réutilisés sans les
 | 
				
			||||||
 | 
					changements.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```sh
 | 
					```sh
 | 
				
			||||||
$ docker compose up --force-recreate --build
 | 
					$ docker compose up --force-recreate --build
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					Vous pouvez alors accéder au frontend à l'adresse [http://localhost:5173](http://localhost:5173)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Une version finie du site construite automatiquement à l'aide de gitea actions tourne à l'adresse
 | 
				
			||||||
 | 
					[https://clyde.herisson.ovh/](https://clyde.herisson.ovh/)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Dévelopement
 | 
					## Dévelopement
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Dans le cas ou vous êtes dans une phase de développement, il est plus simple d'utiliser gradle pour lancer le backend et frontend dans un mode de développement.
 | 
					Dans le cas ou vous êtes dans une phase de développement, il est plus simple d'utiliser gradle pour lancer le backend et frontend.
 | 
				
			||||||
**Attention**: Ce mode n'est pas fait pour être utilisé en production!
 | 
					**Attention**: Ce mode n'est pas fait pour être utilisé en production!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```sh
 | 
					```sh
 | 
				
			||||||
@ -38,4 +47,3 @@ Ceci requière également docker pour lancer une instance de postgresql pris en
 | 
				
			|||||||
Il est possible de se passer entièrement de docker en supprimant la dépendance dans le fichier `backend/build.gradle.kts`: ~~`developmentOnly("org.springframework.boot:spring-boot-docker-compose")`~~
 | 
					Il est possible de se passer entièrement de docker en supprimant la dépendance dans le fichier `backend/build.gradle.kts`: ~~`developmentOnly("org.springframework.boot:spring-boot-docker-compose")`~~
 | 
				
			||||||
Il est alors nécéssaire d'avoir une instance de postgresql tournant sur `localhost:5432` avec une table `clyde`, utilisateur: `devel` et password: `devel`
 | 
					Il est alors nécéssaire d'avoir une instance de postgresql tournant sur `localhost:5432` avec une table `clyde`, utilisateur: `devel` et password: `devel`
 | 
				
			||||||
(cette configuration peut également être changée dans le fichier resources/application.properties de spring)
 | 
					(cette configuration peut également être changée dans le fichier resources/application.properties de spring)
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -13,10 +13,7 @@ import ovh.herisson.Clyde.Services.AuthenticatorService;
 | 
				
			|||||||
import ovh.herisson.Clyde.Services.TokenService;
 | 
					import ovh.herisson.Clyde.Services.TokenService;
 | 
				
			||||||
import ovh.herisson.Clyde.Services.UserService;
 | 
					import ovh.herisson.Clyde.Services.UserService;
 | 
				
			||||||
import ovh.herisson.Clyde.Tables.*;
 | 
					import ovh.herisson.Clyde.Tables.*;
 | 
				
			||||||
import ovh.herisson.Clyde.Tables.Inscription.ExemptionsRequest;
 | 
					import ovh.herisson.Clyde.Tables.Inscription.*;
 | 
				
			||||||
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.ArrayList;
 | 
				
			||||||
import java.util.Calendar;
 | 
					import java.util.Calendar;
 | 
				
			||||||
@ -328,7 +325,7 @@ public class RequestsController {
 | 
				
			|||||||
            return new ResponseEntity<>(HttpStatus.OK);
 | 
					            return new ResponseEntity<>(HttpStatus.OK);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        toEdit.setState(newteacherstate);
 | 
					        toEdit.setTeacherApprovalState(newteacherstate);
 | 
				
			||||||
        changeCurriculumRequestRepository.save(toEdit);
 | 
					        changeCurriculumRequestRepository.save(toEdit);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (newteacherstate == RequestState.Accepted && toEdit.getState() == RequestState.Accepted){
 | 
					        if (newteacherstate == RequestState.Accepted && toEdit.getState() == RequestState.Accepted){
 | 
				
			||||||
 | 
				
			|||||||
@ -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");
 | 
				
			||||||
@ -184,11 +185,11 @@ public class MockController {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        //Schedule part
 | 
					        //Schedule part
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        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_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(100,50,0)","A0B2","TP");
 | 
					        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(100,50,100)", "A0B2","TD");
 | 
					        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(0,50,100)","A0B2","TP");
 | 
					        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(0,50,100)","A0B2","Course");
 | 
					        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");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        LessonChangesRequest request1 = new LessonChangesRequest(joke,RequestState.Pending,null,null,null,null,2,null,1);
 | 
					        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);
 | 
					        LessonChangesRequest request2 = new LessonChangesRequest(joke,RequestState.Pending,"Fri Apr 19 2024 10:30 ","Fri Apr 19 2024 12:30 ",null,null,1,null,2);
 | 
				
			||||||
@ -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;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
package ovh.herisson.Clyde.Repositories.Inscription;
 | 
					package ovh.herisson.Clyde.Repositories.Inscription;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.springframework.data.repository.CrudRepository;
 | 
					import org.springframework.data.repository.CrudRepository;
 | 
				
			||||||
import ovh.herisson.Clyde.Tables.ChangeCurriculumRequest;
 | 
					import ovh.herisson.Clyde.Tables.Inscription.ChangeCurriculumRequest;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public interface ChangeCurriculumRequestRepository extends CrudRepository<ChangeCurriculumRequest, Long> {
 | 
					public interface ChangeCurriculumRequestRepository extends CrudRepository<ChangeCurriculumRequest, Long> {
 | 
				
			||||||
    ChangeCurriculumRequest findById(long id);
 | 
					    ChangeCurriculumRequest findById(long id);
 | 
				
			||||||
 | 
				
			|||||||
@ -51,8 +51,8 @@ public class TokenService {
 | 
				
			|||||||
        ArrayList<Token> tokenList = tokenRepo.getByUserOrderByExpirationDate(token.getUser());
 | 
					        ArrayList<Token> tokenList = tokenRepo.getByUserOrderByExpirationDate(token.getUser());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        while(tokenList.size() >= 5){
 | 
					        while(tokenList.size() >= 5){
 | 
				
			||||||
            tokenRepo.delete(tokenList.getFirst());
 | 
					            tokenRepo.delete(tokenList.get(0));
 | 
				
			||||||
            tokenList.remove(tokenList.getFirst());
 | 
					            tokenList.remove(tokenList.get(0));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        tokenRepo.save(token);
 | 
					        tokenRepo.save(token);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,9 @@
 | 
				
			|||||||
package ovh.herisson.Clyde.Tables;
 | 
					package ovh.herisson.Clyde.Tables.Inscription;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import jakarta.persistence.*;
 | 
					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;
 | 
					import java.util.Date;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -2,8 +2,6 @@ package ovh.herisson.Clyde.Tables.Inscription;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import jakarta.persistence.*;
 | 
					import jakarta.persistence.*;
 | 
				
			||||||
import org.hibernate.annotations.OnDelete;
 | 
					 | 
				
			||||||
import org.hibernate.annotations.OnDeleteAction;
 | 
					 | 
				
			||||||
import ovh.herisson.Clyde.Tables.Course;
 | 
					import ovh.herisson.Clyde.Tables.Course;
 | 
				
			||||||
import ovh.herisson.Clyde.Tables.RequestState;
 | 
					import ovh.herisson.Clyde.Tables.RequestState;
 | 
				
			||||||
import ovh.herisson.Clyde.Tables.User;
 | 
					import ovh.herisson.Clyde.Tables.User;
 | 
				
			||||||
 | 
				
			|||||||
@ -7,7 +7,6 @@ import ovh.herisson.Clyde.Tables.RequestState;
 | 
				
			|||||||
import ovh.herisson.Clyde.Tables.User;
 | 
					import ovh.herisson.Clyde.Tables.User;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.util.Date;
 | 
					import java.util.Date;
 | 
				
			||||||
import java.util.Map;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Entity
 | 
					@Entity
 | 
				
			||||||
public class ScholarshipRequest {
 | 
					public class ScholarshipRequest {
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,6 @@ package ovh.herisson.Clyde.Tables.Inscription;
 | 
				
			|||||||
import jakarta.persistence.*;
 | 
					import jakarta.persistence.*;
 | 
				
			||||||
import ovh.herisson.Clyde.Tables.Curriculum;
 | 
					import ovh.herisson.Clyde.Tables.Curriculum;
 | 
				
			||||||
import ovh.herisson.Clyde.Tables.RequestState;
 | 
					import ovh.herisson.Clyde.Tables.RequestState;
 | 
				
			||||||
import ovh.herisson.Clyde.Tables.User;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.util.Date;
 | 
					import java.util.Date;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -23,6 +23,7 @@ import ovh.herisson.Clyde.Repositories.TokenRepository;
 | 
				
			|||||||
import ovh.herisson.Clyde.Repositories.UserRepository;
 | 
					import ovh.herisson.Clyde.Repositories.UserRepository;
 | 
				
			||||||
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
 | 
					import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
 | 
				
			||||||
import ovh.herisson.Clyde.Services.TokenService;
 | 
					import ovh.herisson.Clyde.Services.TokenService;
 | 
				
			||||||
 | 
					import ovh.herisson.Clyde.Services.UserService;
 | 
				
			||||||
import ovh.herisson.Clyde.Tables.Role;
 | 
					import ovh.herisson.Clyde.Tables.Role;
 | 
				
			||||||
import ovh.herisson.Clyde.Tables.Token;
 | 
					import ovh.herisson.Clyde.Tables.Token;
 | 
				
			||||||
import ovh.herisson.Clyde.Tables.User;
 | 
					import ovh.herisson.Clyde.Tables.User;
 | 
				
			||||||
@ -46,7 +47,8 @@ public class UserControllerTest {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Autowired
 | 
					    @Autowired
 | 
				
			||||||
    private TokenService tokenService;
 | 
					    private TokenService tokenService;
 | 
				
			||||||
 | 
					    @Autowired
 | 
				
			||||||
 | 
					    private UserService userService;
 | 
				
			||||||
    @Autowired
 | 
					    @Autowired
 | 
				
			||||||
    private UserRepository userRepository;
 | 
					    private UserRepository userRepository;
 | 
				
			||||||
    @Autowired
 | 
					    @Autowired
 | 
				
			||||||
@ -72,6 +74,7 @@ public class UserControllerTest {
 | 
				
			|||||||
    @BeforeEach
 | 
					    @BeforeEach
 | 
				
			||||||
    void setup(){
 | 
					    void setup(){
 | 
				
			||||||
        RestAssured.baseURI = "http://localhost:" + port;
 | 
					        RestAssured.baseURI = "http://localhost:" + port;
 | 
				
			||||||
 | 
					        userRepository.deleteAll();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @AfterEach
 | 
					    @AfterEach
 | 
				
			||||||
@ -84,7 +87,7 @@ public class UserControllerTest {
 | 
				
			|||||||
    public void userPostTest(){
 | 
					    public void userPostTest(){
 | 
				
			||||||
        User god = new User("god","god","admin@admin.com","everywhere","every",new Date(0), null, Role.Admin,"goddoesntneedpassword");
 | 
					        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());
 | 
					        Token godToken = new Token(god, tokenService.generateNewToken(), new Date());
 | 
				
			||||||
        userRepository.save(god);
 | 
					        userService.save(god);
 | 
				
			||||||
        tokenService.saveToken(godToken);
 | 
					        tokenService.saveToken(godToken);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Can god post herobrine himself ?
 | 
					        //Can god post herobrine himself ?
 | 
				
			||||||
 | 
				
			|||||||
@ -70,7 +70,7 @@ class TokenServiceTest {
 | 
				
			|||||||
        ArrayList<Token> tokenList = new ArrayList<>();
 | 
					        ArrayList<Token> tokenList = new ArrayList<>();
 | 
				
			||||||
        GregorianCalendar gc = new GregorianCalendar();
 | 
					        GregorianCalendar gc = new GregorianCalendar();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        User malveillant = new User("Cargo", "John", "CargoJ@mail.com", "secret", "secret", null, null, null, "secret");
 | 
					        User malveillant = new User("Cargo", "John", "CargoJ@mail.com", "secret", "secret", new Date(), null, "secret", null);
 | 
				
			||||||
        userRepository.save(malveillant);
 | 
					        userRepository.save(malveillant);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (int i = 0; i < 20; i++){
 | 
					        for (int i = 0; i < 20; i++){
 | 
				
			||||||
 | 
				
			|||||||
@ -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
 | 
				
			||||||
@ -287,4 +288,4 @@ cursusprereq=Le cursus que vous avez selectionné a des prérequis assurez vous
 | 
				
			|||||||
imposecurriculum=Imposer un cursusgotimposed
 | 
					imposecurriculum=Imposer un cursusgotimposed
 | 
				
			||||||
impose=Imposer
 | 
					impose=Imposer
 | 
				
			||||||
gotimposed=Le cursus selectionné a été imposé
 | 
					gotimposed=Le cursus selectionné a été imposé
 | 
				
			||||||
DifferentLanguage=Langues différentes
 | 
					DifferentLanguage=Langues différentes
 | 
				
			||||||
 | 
				
			|||||||
@ -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;
 | 
				
			||||||
@ -42,7 +41,7 @@ window.addEventListener('hashchange', () => {
 | 
				
			|||||||
    <div class="topBar">
 | 
					    <div class="topBar">
 | 
				
			||||||
      <ul class="horizontal">
 | 
					      <ul class="horizontal">
 | 
				
			||||||
        <li title=home>
 | 
					        <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">
 | 
					                <img class="clyde" src="/Clyde.png" style="width: 40px; height: auto; margin-top:4px">
 | 
				
			||||||
            </a></li>
 | 
					            </a></li>
 | 
				
			||||||
        <li title=home>
 | 
					        <li title=home>
 | 
				
			||||||
 | 
				
			|||||||
@ -51,12 +51,12 @@ async function editChangeCurrReqTeacherApproval(state){
 | 
				
			|||||||
          <div>
 | 
					          <div>
 | 
				
			||||||
            <button @click="localwindowstate++"> {{ i18n("seeprofile") }} </button>
 | 
					            <button @click="localwindowstate++"> {{ i18n("seeprofile") }} </button>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
          <div>
 | 
					          <div v-if="user.role === 'InscriptionService' || user.role==='Admin'">
 | 
				
			||||||
            <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='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>
 | 
					            <button v-if="req.state === 'Pending'" @click="req.state='Refused';uploadandrefreshChangeRequest('Refused')" style="margin-left: 2%;">{{i18n("request.refuse")}}</button>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
          <div v-if="user.role === 'Teacher' || user.role === 'Admin'">
 | 
					          <div v-if="user.role === 'Teacher' || user.role === 'Admin'">
 | 
				
			||||||
            <button v-if="req.teacherApprovalState === 'Pending'" @click="req.teacherApprovalState='Accepted';editChangeCurrReqTeacherApproval('Accepted')">{{i18n("acceptequiv")}}</button>
 | 
					            <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='Refused';editChangeCurrReqTeacherApproval('Refused')">{{i18n("refuseequiv")}}</button>
 | 
					            <button v-if="req.teacherApprovalState === 'Pending'" @click="req.teacherApprovalState='Refused';editChangeCurrReqTeacherApproval('Refused')">{{i18n("refuseequiv")}}</button>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 | 
				
			|||||||
@ -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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
@ -352,19 +352,19 @@
 | 
				
			|||||||
            <select v-model="changecurrdata.actualcursus" style="margin-right: 3%">
 | 
					            <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>
 | 
					              <option v-for="item in getActualCurriculumList()" style="font-size:20px;" :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option>
 | 
				
			||||||
            </select>
 | 
					            </select>
 | 
				
			||||||
            {{ i18n("newcurr") }} :
 | 
					            {{ i18n("newcursus") }} :
 | 
				
			||||||
            <select v-model="changecurrdata.newcursus">
 | 
					            <select v-model="changecurrdata.newcursus">
 | 
				
			||||||
              <option v-for="item in curricula"  :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option>
 | 
					              <option v-for="item in curricula"  :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option>
 | 
				
			||||||
            </select>
 | 
					            </select>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
          <div style="height:40px;" v-if="reRegState === 2">
 | 
					          <div style="height:40px;" v-if="reRegState === 2">
 | 
				
			||||||
            {{ i18n("newcurr") }} :
 | 
					            {{ i18n("newcursus") }} :
 | 
				
			||||||
            <select v-model="changecurrdata.newcursus">
 | 
					            <select v-model="changecurrdata.newcursus">
 | 
				
			||||||
              <option v-for="item in curricula"  :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option>
 | 
					              <option v-for="item in curricula"  :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option>
 | 
				
			||||||
            </select>
 | 
					            </select>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
          <div style="height:40px;" v-if="reRegState === 1">
 | 
					          <div style="height:40px;" v-if="reRegState === 1">
 | 
				
			||||||
            {{ i18n("newcurr") }} :
 | 
					            {{ i18n("newcursus") }} :
 | 
				
			||||||
            <select v-model="changecurrdata.newcursus" @change="getActualCurr(changecurrdata.newcursus);">
 | 
					            <select v-model="changecurrdata.newcursus" @change="getActualCurr(changecurrdata.newcursus);">
 | 
				
			||||||
              <option v-for="item in getCurriculumsNextYear()" :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option>
 | 
					              <option v-for="item in getCurriculumsNextYear()" :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option>
 | 
				
			||||||
            </select>
 | 
					            </select>
 | 
				
			||||||
 | 
				
			|||||||
@ -8,7 +8,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<script setup>
 | 
					<script setup>
 | 
				
			||||||
  import { ref } from 'vue'
 | 
					  import { ref } from 'vue'
 | 
				
			||||||
  import {getDifferenceTime,lastDateOfMonth,formatDate,getFirstDay,sortByDate,weekFromList,sundayToTheEnd,getMarginTop,getHoursMinutes, monthFromList, durationCourse} from '../scheduleFunctions.js'
 | 
					  import {getDifferenceTime,lastDateOfMonth,formatDate,getFirstDay,sortByDate,weekFromList,sundayToTheEnd,getMarginTop,getHoursMinutes, monthFromList} from '../scheduleFunctions.js'
 | 
				
			||||||
  import {getAllSchedule} from "@/rest/scheduleRest.js";
 | 
					  import {getAllSchedule} from "@/rest/scheduleRest.js";
 | 
				
			||||||
  import {getOnesLessons, getOwnedLessons } from "@/rest/lessonSchedule.js"
 | 
					  import {getOnesLessons, getOwnedLessons } from "@/rest/lessonSchedule.js"
 | 
				
			||||||
  import {isLogged, getSelf,getTeachers} from "@/rest/Users.js"
 | 
					  import {isLogged, getSelf,getTeachers} from "@/rest/Users.js"
 | 
				
			||||||
@ -76,8 +76,6 @@
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
  const days = ["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];
 | 
					  const days = ["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];
 | 
				
			||||||
  const months = ["january","february","march","april",'may',"june","july","august","september","october","november","december"]
 | 
					  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) {
 | 
					  function getMonday(d) {
 | 
				
			||||||
    d = new Date(d);
 | 
					    d = new Date(d);
 | 
				
			||||||
    d.setHours(0,0,0);
 | 
					    d.setHours(0,0,0);
 | 
				
			||||||
@ -534,7 +532,7 @@
 | 
				
			|||||||
        <option v-for="item in allSchedules" :value='item'>{{item.curriculum.option}}-{{item.curriculum.year}}</option>
 | 
					        <option v-for="item in allSchedules" :value='item'>{{item.curriculum.option}}-{{item.curriculum.year}}</option>
 | 
				
			||||||
      </select>
 | 
					      </select>
 | 
				
			||||||
      <button v-if="display=='Week'" @click="display='Month'">{{i18n("Week")}}</button>
 | 
					      <button v-if="display=='Week'" @click="display='Month'">{{i18n("Week")}}</button>
 | 
				
			||||||
      <button v-if="display=='Month'" @click="display='Week'; value=1;">{{i18("Month")}}</button>
 | 
					      <button v-if="display=='Month'" @click="display='Week'; value=1;">{{i18n("Month")}}</button>
 | 
				
			||||||
      <button v-if="format == 'Grid'" @click="format ='List'">{{i18n("Grid")}}</button>
 | 
					      <button v-if="format == 'Grid'" @click="format ='List'">{{i18n("Grid")}}</button>
 | 
				
			||||||
      <button v-if="format == 'List'" @click ="format = 'Grid'">{{i18n("List")}}</button>
 | 
					      <button v-if="format == 'List'" @click ="format = 'Grid'">{{i18n("List")}}</button>
 | 
				
			||||||
      <button v-if="verifUser()" @click="jsonMod=false ;displayOwnSchedule();">{{i18n("OwnSchedule")}}</button>
 | 
					      <button v-if="verifUser()" @click="jsonMod=false ;displayOwnSchedule();">{{i18n("OwnSchedule")}}</button>
 | 
				
			||||||
@ -577,6 +575,7 @@
 | 
				
			|||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div class="body"  style="background-color:rgb(50,50,50);">{{i18n("schedule.courses")}}</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">
 | 
					       <div class="body" style="background-color:#484848;"v-for="lesson in focusLessons">
 | 
				
			||||||
 | 
					          {{formatDate(lesson.lessonStart)}}
 | 
				
			||||||
          {{ getHoursMinutes(lesson.lessonStart)}}-{{getHoursMinutes(lesson.lessonEnd)}}
 | 
					          {{ getHoursMinutes(lesson.lessonStart)}}-{{getHoursMinutes(lesson.lessonEnd)}}
 | 
				
			||||||
          {{ lesson.local}}
 | 
					          {{ lesson.local}}
 | 
				
			||||||
          {{i18n(lesson.lessonType.toString())}}
 | 
					          {{i18n(lesson.lessonType.toString())}}
 | 
				
			||||||
 | 
				
			|||||||
@ -35,6 +35,14 @@ watch(
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async function modified(){
 | 
				
			||||||
 | 
					  if (typeof props.researchList === 'undefined'){
 | 
				
			||||||
 | 
					    researchList.value = await fetchAllResearches()
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  else {
 | 
				
			||||||
 | 
					    emit('modified')
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const openFilter = () => {
 | 
					const openFilter = () => {
 | 
				
			||||||
  isFilterOpened.value = true;
 | 
					  isFilterOpened.value = true;
 | 
				
			||||||
@ -112,7 +120,7 @@ const emit = defineEmits(["modified"]);
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
<div id="researches">
 | 
					<div id="researches">
 | 
				
			||||||
  <FilterComponent :isOpen="isFilterOpened" :allArticles="researchList" @modal-close="closeFilter" @submit="submitFilters"></FilterComponent>
 | 
					  <FilterComponent :isOpen="isFilterOpened" :allArticles="researchList" @modal-close="closeFilter" @submit="submitFilters"></FilterComponent>
 | 
				
			||||||
  <ArticleComponent :allResearcher="allResearcher" :article="articleToDisplay" :isOpen="isResearchOpened" :manage="props.manage" @modal-close="closeResearch" @modified="emit('modified')"></ArticleComponent>
 | 
					  <ArticleComponent :allResearcher="allResearcher" :article="articleToDisplay" :isOpen="isResearchOpened" :manage="props.manage" @modal-close="closeResearch" @modified="modified"></ArticleComponent>
 | 
				
			||||||
  <div id="search">
 | 
					  <div id="search">
 | 
				
			||||||
    <input v-if="!isResearcher" type="text" id="search-input" :placeholder="i18n('Search.Researches')"  v-model="input"/>
 | 
					    <input v-if="!isResearcher" type="text" id="search-input" :placeholder="i18n('Search.Researches')"  v-model="input"/>
 | 
				
			||||||
    <input v-else type="text" id="search-input" :placeholder="i18n('Search.Researchers')" v-model="input"/>
 | 
					    <input v-else type="text" id="search-input" :placeholder="i18n('Search.Researchers')" v-model="input"/>
 | 
				
			||||||
 | 
				
			|||||||
@ -73,6 +73,10 @@ function update(){
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					async function modifiedResearch(){
 | 
				
			||||||
 | 
					  researchList.value = await fetchResearches(researcher.value.id)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
@ -111,7 +115,7 @@ function update(){
 | 
				
			|||||||
		  <CanvasJSChart :options="options" id=chart @chart-ref="c => chart = c "/>
 | 
							  <CanvasJSChart :options="options" id=chart @chart-ref="c => chart = c "/>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div id="researches" style="margin-top: -15px"><list-researches :researchList="researchList"></list-researches></div>
 | 
					    <div id="researches" style="margin-top: -15px"><list-researches :researchList="researchList" @modified="modifiedResearch"></list-researches></div>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -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