From 27f8af559b7fb63bc5eefdcdd9174cbc13a0e3dd Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Tue, 12 May 2026 09:49:48 +0200 Subject: [PATCH] fix(DiaryView): update plan status badge rendering logic - Enhanced the condition for displaying the plan status badge to ensure it only renders when a valid label is present, improving clarity in the activity display. - Refactored the loading of the training plan to use a dedicated method, streamlining the data fetching process and improving code organization. - Initialized activity member maps after loading the training plan to ensure accurate member tracking for activities. --- frontend/src/views/DiaryView.vue | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/views/DiaryView.vue b/frontend/src/views/DiaryView.vue index e38a2db2..e01a3266 100644 --- a/frontend/src/views/DiaryView.vue +++ b/frontend/src/views/DiaryView.vue @@ -433,7 +433,7 @@
{{ getPlanItemDisplayLabel(item) }} - + {{ getPlanItemStatus(item).label }}
@@ -451,7 +451,7 @@
{{ getPlanItemDisplayLabel(item) }} - + {{ getPlanItemStatus(item).label }}
@@ -494,7 +494,7 @@ : (item.predefinedActivity ? item.predefinedActivity.name : item.activity) }} - + {{ getPlanItemStatus(item).label }}
@@ -589,7 +589,7 @@ ? groupItem.groupPredefinedActivity.code : groupItem.groupPredefinedActivity.name }} - + {{ getPlanItemStatus(groupItem).label }}
@@ -1640,10 +1640,7 @@ export default { await this.loadMembers(); await this.loadParticipants(dateId); await this.loadActivities(dateId); - this.trainingPlan = await apiClient - .get(`/diary-date-activities/${this.currentClub}/${this.date.id}`) - .then(response => response.data); - this.calculateIntermediateTimes(); + await this.loadTrainingPlan(); this.initializeSortable(); await this.loadGroups(); this.activeOverviewPanel = this.isDiaryDayConfigured() ? null : 'trainingDay'; @@ -3547,6 +3544,9 @@ export default { try { this.trainingPlan = await apiClient.get(`/diary-date-activities/${this.currentClub}/${this.date.id}`).then(response => response.data); this.calculateIntermediateTimes(); + this.activityMembersMap = {}; + this.groupActivityMembersMap = {}; + await this.loadAllActivityMembers(); } catch (error) { console.error('Fehler beim Laden des Trainingsplans:', error); } @@ -3637,7 +3637,7 @@ export default { : this.presentMembers.filter(member => this.isAssignedToActivity(item.id, member.id)).length; if (assignedCount > 0) { - return { key: 'ready', label: this.$t('diary.statusReadyShort'), tone: 'ready' }; + return { key: 'ready', label: '', tone: 'ready' }; } return { key: 'open', label: this.$t('diary.statusOpenShort'), tone: 'open' };