From 25c3b90972b66cde0e127bc6d129989970aea8d7 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Wed, 6 May 2026 09:55:53 +0200 Subject: [PATCH] feat(TeamManagementView): enhance league validation logic for team management - Updated league validation to consider both leagueId and plannedLeagueName, allowing for more flexible team management workflows. - Adjusted missing items logic to reflect the new validation criteria, improving user feedback on required fields. - Enhanced tooltip and state management to accurately represent league requirements based on the updated validation rules. --- frontend/src/views/TeamManagementView.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/TeamManagementView.vue b/frontend/src/views/TeamManagementView.vue index e46da5f7..9c227671 100644 --- a/frontend/src/views/TeamManagementView.vue +++ b/frontend/src/views/TeamManagementView.vue @@ -1498,7 +1498,7 @@ export default { teamFormIsOpen.value = true; activeEditorSection.value = 'basic'; - if (!team.leagueId) { + if (!team.leagueId && !String(team?.plannedLeagueName || '').trim()) { await showInfo( t('teamManagement.editTeam'), t('teamManagement.leagueFieldRequired'), @@ -2235,6 +2235,9 @@ export default { const hasTeamId = !!team.myTischtennisTeamId; const hasLeague = !!team.league; + const hasPlannedLeague = !!String(team?.plannedLeagueName || '').trim(); + // Für den Planungs-Workflow gilt ein geplanter Liga-Text als valider Zwischenstand. + const hasLeagueForWorkflow = hasLeague || hasPlannedLeague; const hasLeagueConfig = hasLeague && !!team.league.myTischtennisGroupId && !!team.league.association && @@ -2242,13 +2245,13 @@ export default { const missingItems = []; if (!hasTeamId) missingItems.push(t('teamManagement.teamId')); - if (!hasLeague) missingItems.push(t('teamManagement.league')); + if (!hasLeagueForWorkflow) missingItems.push(t('teamManagement.league')); if (hasLeague && !team.league.myTischtennisGroupId) missingItems.push(t('teamManagement.groupId')); if (hasLeague && !team.league.association) missingItems.push(t('teamManagement.association')); if (hasLeague && !team.league.groupname) missingItems.push(t('teamManagement.groupName')); const complete = hasTeamId && hasLeagueConfig; - const partial = (hasTeamId || hasLeagueConfig) && !complete; + const partial = (hasTeamId || hasLeagueConfig || hasPlannedLeague) && !complete; let tooltip = ''; if (complete) { @@ -2267,7 +2270,7 @@ export default { missing: missingItems.length > 0 ? t('teamManagement.missingItems', { items: missingItems.join(', ') }) : '', missingItemLabels: [...missingItems], tooltip, - needsLeague: !hasLeague, + needsLeague: !hasLeagueForWorkflow, needsTeamId: !hasTeamId, needsLeagueGroupId: !!(hasLeague && !team.league.myTischtennisGroupId), needsLeagueAssociation: !!(hasLeague && !team.league.association),