Alugnos comentarios y ajustes al css y html de botones pdf.

master
vicsash 5 months ago
parent b7da5dc143
commit bcdb9c1217

@ -8,7 +8,9 @@ import org.springframework.security.web.authentication.SimpleUrlAuthenticationSu
import java.io.IOException;
public class CustomAuthenticacionHandler extends SimpleUrlAuthenticationSuccessHandler {
/**
* This method redirects to buscador after validation
*/
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
Authentication authentication) throws IOException, ServletException {

@ -7,6 +7,9 @@ import org.springframework.security.crypto.password.PasswordEncoder;
@Configuration
public class PasswordEcodingConf {
/**
* This method encrypts the password with BCrypt
*/
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();

@ -21,19 +21,23 @@ public class SecurityConfig{
private static final Logger logger = LoggerFactory.getLogger(SecurityConfig.class);
@Autowired
private JdbcTemplate jdbcTemplate;
@Autowired
private UsuarioService usuarioService;
@Autowired
private RolRepository rolService;
@Autowired
private CustomAuth customAuth;
/**
* This method is used to configure the global AuthenticationManager.
*/
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(customAuth);
}
/**
* This bean is used to configure the security filter chain.
* The security filter chain is responsible for handling all security related tasks.
* It is the most important part of the Spring Security configuration.
* It is responsible for authenticating the user, authorizing the user, and handling the session.
*/
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
initializeAutoridadAndRolTables();
@ -67,6 +71,11 @@ public class SecurityConfig{
return new CustomAuthenticacionHandler();
}
/**
* This method is in charge of create the default roles, authorities and admin user.
* also uses method to instert some other information in the database. Skill, Sector, Family and Cycle
*/
private void initializeAutoridadAndRolTables() {
// Check if the autoridad table is empty
Integer autoridadCount = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM autoridad", Integer.class);

@ -6,7 +6,6 @@ import com.example.proyectofinal.servicios.empresa.AlumnoService;
import com.example.proyectofinal.servicios.empresa.CicloService;
import com.example.proyectofinal.servicios.empresa.SkillService;
import com.example.proyectofinal.servicios.user.UsuarioService;
import jakarta.annotation.security.RolesAllowed;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -74,7 +73,6 @@ public class AlumnoController {
if(testIfExist != null){
return new ResponseEntity<>("El alumno ya existe", HttpStatus.BAD_REQUEST);
}
String password = "1234";
StringBuilder nombreUsuarioBuilder = new StringBuilder();
nombreUsuarioBuilder.append(alumno.getNombre().toLowerCase());
@ -142,10 +140,6 @@ public class AlumnoController {
nombreUsuarioBuilder.append(alumno.getApellido2().toLowerCase());
}
String nombreUsuario = nombreUsuarioBuilder.toString();
String nia = alumno.getNia();
String firstThreeLetters = nia.substring(0, 3);
String nombreLogIn="alu." +alumno.getNombre()+firstThreeLetters;
usuario.setNombreLogIn(nombreLogIn);
usuario.setNombreUsuario(nombreUsuario);
usuarioService.saveUser(usuario);

@ -33,7 +33,7 @@ public class MailService {
helper.setTo("empresas@ies.edu.es");
helper.setText(textMessage, true);
helper.setSubject(subject);
helper.setCc("victorsash96@gmail.com");
//helper.setCc(email);
emailSender.send(message);
send = true;
LOGGER.info("Mail sent!");

@ -28,15 +28,11 @@ public class AlumnoService implements IAlumno{
if(secondaryOption.equalsIgnoreCase("Todo")){
return findAllPaginated(pageNum, size, sortField, sortDir);
}else if (secondaryOption.equals("Apellido")) {
return alumnoRepository.findAlumnoByApellido(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
return alumnoRepository.findAlumnoByApellidos(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
} else if(secondaryOption.equals("Nombre")) {
return alumnoRepository.findAlumnoByNombre(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
}else if(secondaryOption.equals("Keywords")) {
return alumnoRepository.findAlumnoByKeywords(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
}else if(secondaryOption.equals("Nia")) {
return alumnoRepository.findAlumnoByNia(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
}else if(secondaryOption.equals("Dni")) {
return alumnoRepository.findAlumnoByDni(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
}else if(secondaryOption.equals("Ciclo")) {
return alumnoRepository.findAlumnoByCiclo(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
} else {
@ -49,8 +45,6 @@ public class AlumnoService implements IAlumno{
return alumnoRepository.findAll();
}
@Override
public Alumno findById(Long id) {
return alumnoRepository.findById(id).orElse(null);

@ -113,10 +113,14 @@ body {
white-space: normal;
text-align: center;
}
.toolbar {
display: flex;
align-items: center;
justify-content: space-between;
}
i.fas.fa-arrow-left {
z-index: 1;
pointer-events: auto; /* Add this line */
pointer-events: auto;
}
.button-group {
display: flex;
@ -164,7 +168,6 @@ html, body {
#create-icon {
color: green;
font-size: 20px;
margin-left: 10px;
}
.inactive {
pointer-events: none;

@ -30,11 +30,15 @@
</div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" th:if="${isAdmin}"></i>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
<div class="toolbar">
<div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" ></i>
</div>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
</div>
</div>
<div class="scrollable-table">

@ -24,13 +24,16 @@
</div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" th:if="${isAdmin}"></i>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
<div class="toolbar">
<div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" ></i>
</div>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
</div>
</div>
<div class="table-container">
<table class="table" id="table">
<thead class="thread-light">

@ -24,12 +24,17 @@
</div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon"></i>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
<div class="toolbar">
<div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" ></i>
</div>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
</div>
</div>
<div class="table-container">
<table class="table" id="table">
<thead class="thread-light">

@ -27,11 +27,15 @@
</div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" ></i>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
<div class="toolbar">
<div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" ></i>
</div>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
</div>
</div>
<div class="table-container">

@ -22,13 +22,17 @@
<a href="/logout" class="logout-button"><i class="fas fa-door-open "></i></a>
</div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" th:if="${isAdmin}"></i>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
<div class="toolbar">
<div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" ></i>
</div>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
</div>
</div>
<div class="table-container">
<table class="table" id="table">
<thead class="thread-light">

@ -26,11 +26,15 @@
</div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon"></i>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
<div class="toolbar">
<div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" ></i>
</div>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
</div>
</div>
<div class="scrollable-table">

@ -24,11 +24,15 @@
</div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" th:if="${isAdmin}"></i>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
<div class="toolbar">
<div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" ></i>
</div>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
</div>
</div>
<div class="table-container">

@ -15,10 +15,6 @@
</head>
<body>
<div class="header">
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
</div>
<h1>
<i class="fas fa-arrow-left" onclick="goBack()" style="cursor:pointer;"></i>
Listado de Skills
@ -27,7 +23,16 @@
</div>
<input type="text" id="myInput" placeholder="Buscar por...."> <i class="fas fa-plus hide-icon" id="create-icon" th:if="${isAdmin}"></i>
<div class="toolbar">
<div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" ></i>
</div>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
</div>
</div>
<div class="table-container">
<table class="table" id="table">

@ -15,10 +15,6 @@
</head>
<body>
<div class="header">
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
</div>
<h1>
<i class="fas fa-arrow-left" onclick="goBack()" style="cursor:pointer;"></i>
Listado de Ofertas
@ -27,7 +23,16 @@
</div>
<input type="text" id="myInput" placeholder="Buscar por...."> <i class="fas fa-plus hide-icon" id="create-icon"></i>
<div class="toolbar">
<div>
<input type="text" id="myInput" placeholder="Buscar por....">
<i class="fas fa-plus hide-icon" id="create-icon" ></i>
</div>
<div class="button-group">
<button class="pdfButton" onclick="generatePDF()">Generar PDF de esta pagina</button>
<button class="pdfButton" onclick="generatePDF_All()">Generar PDF de todas entradas</button>
</div>
</div>
<div class="table-container">
<table class="table" id="table">

@ -75,7 +75,7 @@
<div class ="form-group row">
<label class="col-sm-3 col-form-label" for="apellido2">Apellido2</label>
<div class = "col-sm-9">
<input type="text" th:field="*{apellido2}" required minlength="1" maxlength="100" class="form-control" id="apellido2">
<input type="text" th:field="*{apellido2}" minlength="1" maxlength="100" class="form-control" id="apellido2">
</div>
</div>

Loading…
Cancel
Save

Powered by INFORMATICA.FP.EDU.ES.