Compare commits
21 Commits
672fcd099f
...
master
Author | SHA1 | Date | |
---|---|---|---|
c1b8c39e92
|
|||
3825565b16 | |||
48640dfa8b | |||
3acfd02bfb
|
|||
a3fe6ce6bd
|
|||
96965bde97 | |||
302e0b555c | |||
84a408298d | |||
3b48e5adfb | |||
78da7b23d2
|
|||
1831cc7eb2
|
|||
cc51510dac | |||
44bb04f21b | |||
1ed61c8c7b | |||
59c82d7482 | |||
772fa09e28 | |||
1f66ac5a4d | |||
730a72dba3 | |||
34e537ff02 | |||
364f39c4bc | |||
f2675ed764 |
@ -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/" && 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"
|
||||
|
14
README.md
14
README.md
@ -1,5 +1,7 @@
|
||||
# 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
|
||||
|
||||
Projet du groupe 01:
|
||||
@ -11,21 +13,28 @@ Projet du groupe 01:
|
||||
|
||||
## Running
|
||||
|
||||
**Attention**: Vous devez avoir installé docker-compose pour lancer ce projet.
|
||||
|
||||
Le projet peut être lancé grace à docker compose.
|
||||
|
||||
```sh
|
||||
$ 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
|
||||
$ 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
|
||||
|
||||
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!
|
||||
|
||||
```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 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)
|
||||
|
||||
|
@ -185,11 +185,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(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");
|
||||
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");
|
||||
|
||||
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);
|
||||
|
@ -51,8 +51,8 @@ public class TokenService {
|
||||
ArrayList<Token> tokenList = tokenRepo.getByUserOrderByExpirationDate(token.getUser());
|
||||
|
||||
while(tokenList.size() >= 5){
|
||||
tokenRepo.delete(tokenList.getFirst());
|
||||
tokenList.remove(tokenList.getFirst());
|
||||
tokenRepo.delete(tokenList.get(0));
|
||||
tokenList.remove(tokenList.get(0));
|
||||
}
|
||||
tokenRepo.save(token);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ 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;
|
||||
@ -46,7 +47,8 @@ public class UserControllerTest {
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
private UserRepository userRepository;
|
||||
@Autowired
|
||||
@ -72,6 +74,7 @@ public class UserControllerTest {
|
||||
@BeforeEach
|
||||
void setup(){
|
||||
RestAssured.baseURI = "http://localhost:" + port;
|
||||
userRepository.deleteAll();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
@ -84,7 +87,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());
|
||||
userRepository.save(god);
|
||||
userService.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", null, null, null, "secret");
|
||||
User malveillant = new User("Cargo", "John", "CargoJ@mail.com", "secret", "secret", new Date(), null, "secret", null);
|
||||
userRepository.save(malveillant);
|
||||
|
||||
for (int i = 0; i < 20; i++){
|
||||
|
@ -32,6 +32,7 @@ async function createResearcher(){
|
||||
toCreate.user = user.value
|
||||
await postResearcher(toCreate)
|
||||
creating.value = false
|
||||
allResearcher.value = await fetchAllResearchers()
|
||||
for (let i = 0; i < allResearcher.value.length; i++) {
|
||||
if (user.value.regNo === allResearcher.value[i].user.regNo){
|
||||
researcher.value = allResearcher.value[i]
|
||||
@ -147,8 +148,7 @@ async function modify(){
|
||||
column-gap:2.7%;
|
||||
row-gap:45px;
|
||||
grid-template-areas:
|
||||
"profilPic globalInfos"
|
||||
"minfos minfos";
|
||||
"profilPic globalInfos";
|
||||
}
|
||||
|
||||
.profilPic{
|
||||
@ -167,7 +167,8 @@ async function modify(){
|
||||
display:flex;
|
||||
align-items:center;
|
||||
justify-content:center;
|
||||
margin-top:5%;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.subContainer{
|
||||
|
@ -93,12 +93,14 @@
|
||||
|
||||
async function ChangeInfos(){
|
||||
for (let element in toModify){
|
||||
console.log(element)
|
||||
console.log(toModify[element])
|
||||
if (element ==="email" && (toModify[element] !== null)){
|
||||
await alterSelf(user.value.regNo,{email : toModify[element]});
|
||||
}
|
||||
|
||||
if (element ==="profilPictureUrl" && (toModify[element] !== null)){
|
||||
await alterSelf(user.value.regNo,{ profilPictureUrl : toModify[element]});
|
||||
if (element ==="profilePictureUrl" && (toModify[element] !== null)){
|
||||
await alterSelf(user.value.regNo,{ profilePictureUrl : toModify[element]});
|
||||
}
|
||||
else if(element === "address" && (toModify[element] !== null)){
|
||||
await alterSelf(user.value.regNo,{address : toModify[element]});
|
||||
@ -116,7 +118,7 @@
|
||||
toModify.address = item.address;
|
||||
toModify.profilPictureUrl = item.profilPictureUrl;
|
||||
toModify.email= item.email;
|
||||
toModify.password= item.password;
|
||||
toModify.password= item.password
|
||||
}
|
||||
|
||||
function getPP(){
|
||||
@ -176,6 +178,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function getProfilePic(data){
|
||||
const pp= await uploadProfilePicture(data)
|
||||
toModify.profilePictureUrl = pp.url
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -306,7 +315,7 @@
|
||||
<div v-else-if="windowState === 1" class="infosContainer">
|
||||
<div>
|
||||
{{i18n("profile.picture")}}:
|
||||
<input type="file" @change="user.profilPicture = uploadProfilePicture($event.target.files);" accept="image/*">
|
||||
<input type="file" @change="getProfilePic($event.target.files)" accept="image/*">
|
||||
</div>
|
||||
<div>
|
||||
{{ i18n("login.guest.email")}}
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<script setup>
|
||||
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 {getOnesLessons, getOwnedLessons } from "@/rest/lessonSchedule.js"
|
||||
import {isLogged, getSelf,getTeachers} from "@/rest/Users.js"
|
||||
@ -76,8 +76,6 @@
|
||||
}
|
||||
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);
|
||||
@ -534,7 +532,7 @@
|
||||
<option v-for="item in allSchedules" :value='item'>{{item.curriculum.option}}-{{item.curriculum.year}}</option>
|
||||
</select>
|
||||
<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 == 'List'" @click ="format = 'Grid'">{{i18n("List")}}</button>
|
||||
<button v-if="verifUser()" @click="jsonMod=false ;displayOwnSchedule();">{{i18n("OwnSchedule")}}</button>
|
||||
@ -577,6 +575,7 @@
|
||||
</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())}}
|
||||
|
@ -35,6 +35,14 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
async function modified(){
|
||||
if (typeof props.researchList === 'undefined'){
|
||||
researchList.value = await fetchAllResearches()
|
||||
}
|
||||
else {
|
||||
emit('modified')
|
||||
}
|
||||
}
|
||||
|
||||
const openFilter = () => {
|
||||
isFilterOpened.value = true;
|
||||
@ -112,7 +120,7 @@ const emit = defineEmits(["modified"]);
|
||||
<template>
|
||||
<div id="researches">
|
||||
<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">
|
||||
<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"/>
|
||||
|
@ -51,7 +51,7 @@ function getPP(){
|
||||
<template> <div class="body"><div id="main">
|
||||
<ResearchPostComponent :allResearcher="allResearcher" :researcher="researcher" :isOpen="isPostResearchOpened" @modal-close="isPostResearchOpened = false" @posted="modifiedResearch"></ResearchPostComponent>
|
||||
<div id="profilePicture" >
|
||||
<img :src=getPP() />
|
||||
<img :src=getPP() style="border-radius: 20%"/>
|
||||
</div>
|
||||
<div id="researcherInfos">
|
||||
<div class="surrounded" v-if="!changing">{{researcher.user.lastName}} {{researcher.user.firstName}}</div>
|
||||
|
@ -73,12 +73,16 @@ function update(){
|
||||
}
|
||||
|
||||
}
|
||||
async function modifiedResearch(){
|
||||
researchList.value = await fetchResearches(researcher.value.id)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div id="main">
|
||||
<div id="profilePicture">
|
||||
<img :src=getPP() />
|
||||
<img :src=getPP() style="border-radius: 20%"/>
|
||||
</div>
|
||||
<div id="researcherInfos">
|
||||
<div class="surrounded">{{researcher.user.lastName}} {{researcher.user.firstName}}</div>
|
||||
@ -111,7 +115,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" style="margin-top: -15px"><list-researches :researchList="researchList" @modified="modifiedResearch"></list-researches></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
Reference in New Issue
Block a user