From 84a7377f8766e2f1026581c05136fe48d32b2cf1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 12 Jan 2025 19:34:14 +0000 Subject: [PATCH] Sync from monorepo: 2025-01-12 19:34:14 - # Korfbal ## Update - fixed buttons on player selector screen - Fixed caching for docker container builds - Moved countdownTimer so lookup should be fixed --- apps/game_tracker/models/player_group.py | 2 +- configs/webpack/webpack.config.js | 2 +- docker-compose.yml | 3 +-- pyproject.toml | 2 +- .../countdown_timer/countdownTimer.js} | 0 .../common => components/countdown_timer}/index.js | 0 static_workfile/js/features/clubs/clubDetail.js | 2 +- static_workfile/js/features/matches/matchDetail.js | 4 ++-- static_workfile/js/features/matches/matchTracker.js | 2 +- .../js/features/matches/playersSelector.js | 11 +++++++---- static_workfile/js/features/teams/teamDetail.js | 2 +- 11 files changed, 16 insertions(+), 14 deletions(-) rename static_workfile/js/{features/matches/common/countDownTimer.js => components/countdown_timer/countdownTimer.js} (100%) rename static_workfile/js/{features/matches/common => components/countdown_timer}/index.js (100%) diff --git a/apps/game_tracker/models/player_group.py b/apps/game_tracker/models/player_group.py index ffcc50a..62ee06e 100644 --- a/apps/game_tracker/models/player_group.py +++ b/apps/game_tracker/models/player_group.py @@ -50,7 +50,7 @@ def save(self, *args, **kwargs): if self.starting_type.name != "Reserve": reserve_player_group = self.match_data.player_groups.get( - starting_type__name="Reserve" + starting_type__name="Reserve", team=self.team ) for player in new_players: if player in reserve_player_group.players.all(): diff --git a/configs/webpack/webpack.config.js b/configs/webpack/webpack.config.js index 8dd011c..273a959 100644 --- a/configs/webpack/webpack.config.js +++ b/configs/webpack/webpack.config.js @@ -13,7 +13,7 @@ module.exports = { output: { path: path.resolve(__dirname, 'static_workfile/webpack_bundles'), filename: '[name].bundle.js', - publicPath: '/static_workfile/webpack_bundles/', + publicPath: '../../static_workfile/webpack_bundles/', clean: true, }, module: { diff --git a/docker-compose.yml b/docker-compose.yml index 260a3a0..cd228f7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,6 +26,7 @@ services: kwt-redis: image: redis:latest container_name: kwt-redis + restart: unless-stopped networks: - kwt-net @@ -52,7 +53,6 @@ services: - kwt-minio environment: - .env - restart: unless-stopped networks: - kwt-net @@ -62,7 +62,6 @@ services: command: python manage.py migrate env_file: - .env - restart: unless-stopped networks: - kwt-net diff --git a/pyproject.toml b/pyproject.toml index d5f579b..6fb5ad2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "KWT" -version = "1.2.4" +version = "1.2.5" [tool.black] line-length = 88 diff --git a/static_workfile/js/features/matches/common/countDownTimer.js b/static_workfile/js/components/countdown_timer/countdownTimer.js similarity index 100% rename from static_workfile/js/features/matches/common/countDownTimer.js rename to static_workfile/js/components/countdown_timer/countdownTimer.js diff --git a/static_workfile/js/features/matches/common/index.js b/static_workfile/js/components/countdown_timer/index.js similarity index 100% rename from static_workfile/js/features/matches/common/index.js rename to static_workfile/js/components/countdown_timer/index.js diff --git a/static_workfile/js/features/clubs/clubDetail.js b/static_workfile/js/features/clubs/clubDetail.js index ebba8a0..1feea5b 100644 --- a/static_workfile/js/features/clubs/clubDetail.js +++ b/static_workfile/js/features/clubs/clubDetail.js @@ -8,7 +8,7 @@ window.addEventListener('DOMContentLoaded', () => { const regex = /([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/; const url = window.location.href; - const user_id = document.getElementById('user_id').innerText; + const user_id = document.getElementById('user_id').innerText.trim(); const matches = regex.exec(url); const infoContainer = document.getElementById('info-container'); diff --git a/static_workfile/js/features/matches/matchDetail.js b/static_workfile/js/features/matches/matchDetail.js index f727282..3db24c1 100644 --- a/static_workfile/js/features/matches/matchDetail.js +++ b/static_workfile/js/features/matches/matchDetail.js @@ -5,16 +5,16 @@ import { updateStatistics, updateEvents, } from '../../components/carousel/index.js'; +import { CountdownTimer } from '../../components/countdown_timer/index.js'; import { initializeSocket, requestInitialData } from '../../utils/websockets/index.js'; import { cleanDomCarousel } from '../../utils/dom/'; -import { CountdownTimer } from './common/index.js'; window.addEventListener('DOMContentLoaded', () => { const carousel = document.querySelector('.carousel'); const buttons = document.querySelectorAll('.button'); const regex = /([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/; const url = window.location.href; - const user_id = document.getElementById('user_id').innerText; + const user_id = document.getElementById('user_id').innerText.trim(); const matches = regex.exec(url); let match_id; diff --git a/static_workfile/js/features/matches/matchTracker.js b/static_workfile/js/features/matches/matchTracker.js index 47672fc..5803734 100644 --- a/static_workfile/js/features/matches/matchTracker.js +++ b/static_workfile/js/features/matches/matchTracker.js @@ -1,4 +1,3 @@ -import { CountdownTimer } from './common/index.js'; import { truncateMiddle } from '../../utils'; import { createEventTypeDiv, @@ -7,6 +6,7 @@ import { getFormattedTime, } from '../../utils/events'; import { resetSwipe, setupSwipeDelete, deleteButtonSetup } from '../../components/swipe_delete'; +import { CountdownTimer } from '../../components/countdown_timer/index.js'; import { updatePlayerGroups } from '../../components/carousel'; import { initializeSocket, onMessageReceived } from '../../utils/websockets/index.js'; import { scoringButtonSetup, shotButtonReg } from '../../components/scoring_button/index.js'; diff --git a/static_workfile/js/features/matches/playersSelector.js b/static_workfile/js/features/matches/playersSelector.js index 7531e44..851c9c9 100644 --- a/static_workfile/js/features/matches/playersSelector.js +++ b/static_workfile/js/features/matches/playersSelector.js @@ -205,23 +205,26 @@ class PlayerGroupManager { } mapGroupIdsToTypeIds() { - // Map group IDs to type IDs this.typeIds.forEach((typeId) => { + // We expect an element in the DOM with id == this typeId const groupElement = document.getElementById(typeId); if (groupElement) { - this.groupIdToTypeId[groupElement.innerText] = typeId; + this.groupIdToTypeId[groupElement.innerText.trim()] = typeId; } }); + + console.log("groupIdToTypeId: ", this.groupIdToTypeId); } mapTypeIdsToGroupIds() { - // Map type IDs to group IDs this.typeIds.forEach((typeId) => { const groupElement = document.getElementById(typeId); if (groupElement) { - this.typeIdToGroupId[typeId] = groupElement.innerText; + this.typeIdToGroupId[typeId] = groupElement.innerText.trim(); } }); + + console.log("typeIdToGroupId: ", this.typeIdToGroupId); } getPlayersGroupsData() { diff --git a/static_workfile/js/features/teams/teamDetail.js b/static_workfile/js/features/teams/teamDetail.js index 3a48e7d..9bae131 100644 --- a/static_workfile/js/features/teams/teamDetail.js +++ b/static_workfile/js/features/teams/teamDetail.js @@ -14,7 +14,7 @@ window.addEventListener('DOMContentLoaded', () => { const regex = /([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/; const url = window.location.href; - const user_id = document.getElementById('user_id').innerText; + const user_id = document.getElementById('user_id').innerText.trim(); const matches = regex.exec(url); const infoContainer = document.getElementById('info-container');