Skip to content

Commit 17216e9

Browse files
committed
Risolto errore docker e ripristinate pagine notifiche e profilo
- Aggiornale le immagini docker usate per T5 e T0 in seguito alla loro rimozione dalla libreria docker (docker-library/openjdk#550) - Ripristinata la navigazione verso le pagine delle notifiche e del profile in T5 - Fix percorsi frontend in T23 - Cleanup
1 parent 0f41a78 commit 17216e9

File tree

12 files changed

+29
-20
lines changed

12 files changed

+29
-20
lines changed

T0/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:8-slim
1+
FROM openjdk:8u342
22

33
RUN apt-get update && apt-get install -y bash && apt-get install -y maven && rm -rf /var/lib/apt/lists/*
44

T1-G11/applicazione/manvsclass/.scannerwork/.sonar_lock

Whitespace-only changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import {VIEWS} from "./utils/endpoints.js";
22

3+
document.addEventListener("DOMContentLoaded", () => {
4+
document.getElementById("login_user_redirect_btn").href = VIEWS.LOGIN_USER;
5+
document.getElementById("login_admin_redirect_btn").href = VIEWS.LOGIN_ADMIN;
6+
});
7+
8+
/*
39
document.getElementById("login_user_redirect_btn").addEventListener("click", () => {
410
window.location.href=VIEWS.LOGIN_USER;
511
});
612
713
document.getElementById("login_admin_redirect_btn").addEventListener("click", () => {
814
window.location.href=VIEWS.LOGIN_ADMIN;
915
});
16+
17+
*/

T23-G1/src/main/resources/templates/home.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@
2424
<div class="hero-content">
2525
<h1 th:text="#{menu.title}"></h1>
2626
<p th:text="#{menu.text}"></p>
27-
<a id="login_user_redirect_btn" th:text="#{button.student}" href="/login" class="button-3d"></a>
28-
<a id="login_admin_redirect_btn" th:text="#{button.admin}" href="/loginAdmin" class="button-3d adm"></a>
27+
<a id="login_user_redirect_btn" th:text="#{button.student}" href="" class="button-3d"></a>
28+
<a id="login_admin_redirect_btn" th:text="#{button.admin}" href="" class="button-3d adm"></a>
2929
</div>
3030
<div class="image-container">
3131
<img th:src="@{t23/css/images/HeroImageNew.png}" width="650">
3232
</div>
3333
</div>
3434
<div th:insert="layouts/footer :: footer"></div>
3535

36+
<script type="module" th:src="@{/t23/js/home.js}"></script>
37+
3638
</body>
3739
</html>

T5-G2/t5/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Usa un'immagine di base con Java installato
2-
FROM openjdk:17-jdk
2+
FROM eclipse-temurin:17-jdk-alpine
33

44
# Copia il tuo JAR nel container
55
COPY ./target/t5-0.0.1-SNAPSHOT.jar /app/
@@ -11,4 +11,4 @@ COPY configuration/* /app/configuration/
1111
WORKDIR /app
1212

1313
# Comando di avvio dell'applicazione
14-
CMD ["java", "-jar", "-Dspring.profiles.active=prod", "t5-0.0.1-SNAPSHOT.jar"]
14+
CMD ["java", "-Dspring.profiles.active=prod", "-jar", "t5-0.0.1-SNAPSHOT.jar"]

T5-G2/t5/src/main/java/com/g2/controllers/UserProfileController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void init() {
5555
File file = new File("%s/%s".formatted(System.getProperty("user.dir"), gamificationConFile.replace("/", File.separator)));
5656
this.gameConfigData = objectMapper.readValue(file, GameConfigData.class);
5757
} catch (IOException e) {
58-
logger.info("[PostConstruct init] Error in loading game_config.json, using default values: {}", e.getMessage());
58+
logger.info("[PostConstruct init] Error in loading gamification_config.json, using default values: {}", e.getMessage());
5959
this.gameConfigData = new GameConfigData(10, 5, 1);
6060
}
6161
}

T5-G2/t5/src/main/java/com/g2/game/service/GameManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void init() {
8181
File file = new File("%s/%s".formatted(System.getProperty("user.dir"), turnExecutionConfigFile.replace("/", File.separator)));
8282
this.config = objectMapper.readValue(file, GameExecutionConfig.class);
8383
} catch (IOException e) {
84-
logger.info("[PostConstruct init] Error in loading game_config.json, using default values: {}", e.getMessage());
84+
logger.info("[PostConstruct init] Error in loading gamification_config.json, using default values: {}", e.getMessage());
8585
this.config = new GameExecutionConfig(true);
8686
}
8787
}

T5-G2/t5/src/main/java/com/g2/interfaces/T23Service.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ private void registerGetUserActions() {
108108
));
109109

110110
registerAction("GetUser", new ServiceActionDefinition(
111-
params -> getUser((String) params[0]),
112-
String.class
111+
params -> getUser((Long) params[0]),
112+
Long.class
113113
));
114114

115115
registerAction("GetUsersByList", new ServiceActionDefinition(
@@ -254,20 +254,20 @@ private JwtValidationResponseDTO getAuthenticated(String jwt) {
254254

255255
// Metodo per ottenere la lista degli utenti
256256
private List<User> getUsers() {
257-
final String endpoint = "/student/students_list";
257+
final String endpoint = "/players/students_list";
258258
return callRestGET(endpoint, null, new ParameterizedTypeReference<List<User>>() {
259259
});
260260
}
261261

262-
private User getUser(String userId) {
263-
final String endpoint = "/student/students_list/" + userId;
262+
private User getUser(long userId) {
263+
final String endpoint = "/players/students_list/" + userId;
264264
return callRestGET(endpoint, null, User.class);
265265
}
266266

267267
//Do una lista di ID e mi ritorna una lista di User
268268
// Implementata a mano perchè un po' strana è una POST che ottiene dati come una GET
269269
private List<User> getUserByList(List<String> idsStudenti) {
270-
final String endpoint = "/student/getStudentiTeam";
270+
final String endpoint = "/players/getStudentiTeam";
271271
// Crea un oggetto HttpEntity con i dati che vogliamo inviare (la lista degli ID)
272272
HttpEntity<List<String>> requestEntity = new HttpEntity<>(idsStudenti);
273273
// Esegui la chiamata POST all'endpoint

T5-G2/t5/src/main/java/com/g2/t5/T5Application.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@
3333
@SpringBootApplication(
3434
scanBasePackages = {
3535
"com.g2.controllers",
36-
"com.g2.factory",
3736
"com.g2.interfaces",
3837
"com.g2.game",
3938
"com.g2.t5",
40-
"com.g2.service",
4139
"com.g2.session",
4240
"com.g2.security",
4341
"com.g2.language"

0 commit comments

Comments
 (0)