Compare commits

...

11 Commits

Author SHA1 Message Date
1777e894e9 removing spaces
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 2m2s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-14 21:33:36 +01:00
3c3659c056 Merge branch 'master' into wal/front/Translations 2024-03-14 21:31:22 +01:00
97a2c8a9f6 Fix the "error" bug
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m34s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Successful in 2m21s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Build and test backend / Test-backend (push) Successful in 1m21s
Even when the requests was sucessfull, the "error" toast was
appearing... now it should do a "success" when adequate
2024-03-14 21:06:33 +01:00
6228e21d38
easter is coming (dont look it's not fun)
All checks were successful
deploy to production / deploy-frontend (push) Successful in 26s
Build and test backend / Build-backend (push) Successful in 2m13s
Build and test backend / Test-backend (push) Successful in 1m23s
deploy to production / deploy-backend (push) Successful in 2m20s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
2024-03-13 23:28:25 +01:00
cead1188ab Merge pull request 'Leo/Backend' (#95) from Leo/Backend into master
All checks were successful
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m19s
Build and test backend / Build-backend (push) Successful in 2m15s
Build and test backend / Test-backend (push) Successful in 1m22s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
Reviewed-on: #95
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-03-13 18:06:33 +01:00
5c7147bb17 fixing the double throw before the merge
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
Signed-off-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-03-13 18:05:35 +01:00
2a58c335f2 Apply les trucs de l'exception
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 1m55s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-13 15:48:28 +01:00
66282bce9f Create new constructor for ReinscriptionRequest so you don't have to worry about the type of the request
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m15s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-12 17:53:52 +01:00
b7a574a312 Merge branch 'master' into Leo/Backend
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m57s
Build and test backend / Test-backend (pull_request) Successful in 1m55s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-12 11:17:14 +01:00
8fbfb36958 Remove the bad link between users and file. Add a delete function for storageFile entities and clean things.
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-12 10:48:13 +01:00
ab91a39a63 Create exception for file deletion.
Add user/inscriptionrequest connection to StorageFile entity.
Create a prototype of the delete for file function
2024-03-11 20:23:45 +01:00
11 changed files with 42 additions and 26 deletions

View File

@ -41,3 +41,4 @@ tasks.register("run") {
tasks.withType<Test> {
useJUnitPlatform()
}

View File

@ -1,20 +1,14 @@
package ovh.herisson.Clyde.EndPoints;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.TokenRepository;
import ovh.herisson.Clyde.Repositories.UserRepository;
import ovh.herisson.Clyde.Services.TokenService;
import ovh.herisson.Clyde.Tables.Role;
import ovh.herisson.Clyde.Tables.Token;
import ovh.herisson.Clyde.Tables.User;
import ovh.herisson.Clyde.Tables.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
@RestController
@ -26,6 +20,7 @@ public class MockController {
public final UserRepository userRepo;
public final TokenRepository tokenRepo;
public final TokenService tokenService;
ArrayList<User> mockUsers;
@ -62,3 +57,4 @@ public class MockController {
userRepo.deleteAll(mockUsers);
}
}

View File

@ -1,13 +1,13 @@
package ovh.herisson.Clyde.Services;
import org.springframework.core.io.UrlResource;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import ovh.herisson.Clyde.Repositories.FileRepository;
import ovh.herisson.Clyde.Tables.FileType;
import ovh.herisson.Clyde.Tables.StorageFile;
import ovh.herisson.Clyde.Tables.*;
import java.io.File;
import java.io.IOException;
import org.springframework.core.io.Resource;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@ -53,4 +53,12 @@ public class StorageService {
return url;
}
public void delete(StorageFile file) throws SecurityException {
File f = new File(file.getUrl());
f.delete();
//Delete l'entité
fileRepo.delete(file);
}
}

View File

@ -4,7 +4,10 @@ import jakarta.persistence.*;
import java.util.Date;
@Entity
public class InscriptionRequest {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private String firstName;

View File

@ -20,7 +20,7 @@ public class ReinscriptionRequest {
//Permet de différencier les demandes de changement et une réinscription dans le même cursus
//Pour la réinscription on va le mettre a 0
private boolean type;
private boolean type = false;
public ReinscriptionRequest(){}
@ -31,6 +31,12 @@ public class ReinscriptionRequest {
this.type = type;
}
public ReinscriptionRequest(User user, Cursus newCursus, RequestState state){
this.user = user;
this.newCursus = newCursus;
this.state = state;
}
public int getId() {
return id;
}

View File

@ -1,9 +1,6 @@
package ovh.herisson.Clyde.Tables;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.*;
@Entity
@ -19,7 +16,6 @@ public class StorageFile {
private FileType fileType;
public StorageFile(String name, String url, FileType fileType){
this.name = name;
this.url = url;
@ -60,4 +56,5 @@ public class StorageFile {
public void setFileType(FileType fileType) {
this.fileType = fileType;
}
}

View File

@ -3,7 +3,7 @@ login.guest.register=Register
login.guest.alregister=Already Registered
login.guest.welcome=WELCOME TO THE UNIVERSITY
login.guest.email=E-MAIL
login.guest.firstname= FIRSTNAME
login.guest.firstname=FIRSTNAME
login.guest.surname=SURNAME
login.guest.country=COUNTRY
login.guest.address=ADDRESS
@ -13,7 +13,7 @@ login.guest.lastpage=Last Page
login.guest.submit=Submit
login.guest.birthday=BIRTHDAY
login.guest.confirm=CONFIRM
login.cPassword= Confirm Password
login.cPassword=Confirm Password
login.password=Password
app.home=Home
app.login=Login

View File

@ -3,11 +3,11 @@ login.guest.register=S'enregistrer
login.guest.alregister=Déjà Enregistré
login.guest.welcome=BIENVENUE A L'UNIVERSITE
login.guest.email=E-MAIL
login.guest.firstname= PRENOM
login.guest.surname= NOM
login.guest.country= PAYS
login.guest.firstname=PRENOM
login.guest.surname=NOM
login.guest.country=PAYS
login.guest.address=ADRESSE
login.guest.password= MOT DE PASSE
login.guest.password=MOT DE PASSE
login.guest.nextpage=Prochaine Page
login.guest.lastpage=Derniere Page
login.guest.submit=Envoyer

View File

@ -41,7 +41,7 @@
<ul class="horizontal">
<li title=home>
<a class="icon" href="#home">
<img @click="draw" src="./assets/Clyde.png" style="width: 40px; height: auto; margin-top:4px">
<img class="clyde" src="./assets/Clyde.png" style="width: 40px; height: auto; margin-top:4px">
</a></li>
<li title=home>
<a class="icon" href="#home">
@ -267,5 +267,9 @@
transition-duration: .3s;
padding-left: 15px;
}
.clyde:hover{
content: url("./assets/angry_clyde.png")
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -41,7 +41,8 @@ async function _rest(endPoint, config){
pending: config['pending'] != null ? config['pending'] : 'pending',
error: config['error'] != null ? config['error'] : 'Network Failure...',
success: config['success'] != null ? config['success'] : {render(res){
return res.ok ? "Success" : "error";
console.log(res);
return res.data.ok ? "Success" : "error";
}},
})
.then( e => e.json()).catch( e => e );