Skip to content

Commit

Permalink
Fix last issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Pelayori committed Apr 28, 2024
1 parent 849b1ad commit bc52ed8
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 4 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,71 @@ on:
types: [published]

jobs:
#app-tests-analyze:
# runs-on: ubuntu-latest
# services:
# mysql:
# image: mysql:latest
# env:
# MYSQL_ROOT_PASSWORD: root
# MYSQL_DATABASE: test_database
# ports:
# - 3306:3306
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
#
# steps:
# - uses: actions/checkout@v2
#
# - name: Cache Maven packages
# uses: actions/cache@v2
# with:
# path: |
# ~/.m2
# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# ${{ runner.os }}-m2
#
# - name: Set up JDK 17
# uses: actions/setup-java@v1
# with:
# java-version: '17'
#
# - name: Add exec permission to mvnw
# run: chmod +x mvnw
#
# - name: Compile the application
# run: ./mvnw -B clean install -DskipTests=true
#
# - name: Start the application
# run: |
# ./mvnw spring-boot:run > logs.txt 2>&1 &
# echo $! > spring-boot-app.pid
# sleep 5
# env:
# SPRING_DATASOURCE_URL: jdbc:mysql://localhost:3306/test_database
# SPRING_DATASOURCE_USERNAME: root
# SPRING_DATASOURCE_PASSWORD: root
# SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.cj.jdbc.Driver
# SPRING_PROFILES_ACTIVE: test
# - name: Check listening ports
# run: ss -tuln
# - name: Run tests
# run: |
# ./mvnw org.jacoco:jacoco-maven-plugin:prepare-agent verify -Dspring.datasource.url=jdbc:mysql://localhost:3306/test_database -Dspring.datasource.username=root -Dspring.datasource.password=root -Dspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# env:
# SPRING_PROFILES_ACTIVE: test
# headless: true
# EXCLUDE_JUNIT: true
# - name: Show app logs
# if: always()
# run: |
# cat logs.txt
# - name: Shut down the application
# run: |
# kill $(cat spring-boot-app.pid)
# - name: Collect Jacoco report and send to Sonar
# run: |
# ./mvnw org.jacoco:jacoco-maven-plugin:report sonar:sonar -Dsonar.projectKey=Arquisoft_wiq_es04b -Dsonar.organization=arquisoft -Dsonar.branch.name=${{ github.head_ref || github.ref_name }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dspring.profiles.active=test
build-and-push:
runs-on: ubuntu-latest
#needs: app-tests-analyze
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/uniovi/configuration/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.requestMatchers("/startMultiplayerGame/**", "/endGameList/**").authenticated()
.requestMatchers("/lobby/**").authenticated()
.requestMatchers("/ranking/playerRanking").authenticated()
//.requestMatchers("/player/admin/**").hasAuthority("ROLE_ADMIN")
.requestMatchers("/player/admin/**").hasAuthority("ROLE_ADMIN")
.requestMatchers("/**").permitAll()
).formLogin(
form -> form
Expand Down
7 changes: 4 additions & 3 deletions src/main/resources/templates/player/admin/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ <h1 th:text="#{navbar.section.admin}"></h1>

let tabContent = $('#tab-content');
activeTab = tabNum;
console.log(window.location.origin);
switch (tabNum) {
case 'tab1':
tabContent.load('/player/admin/userManagement');
tabContent.load(window.location.origin + '/player/admin/userManagement');
break;
case 'tab2':
tabContent.load('/player/admin/questionManagement');
tabContent.load(window.location.origin + '/player/admin/questionManagement');
break;
case 'tab3':
tabContent.load('/player/admin/monitoring');
tabContent.load(window.location.origin + '/player/admin/monitoring');
break;
}
});
Expand Down

0 comments on commit bc52ed8

Please sign in to comment.