From 236406e2629c1fb76ea729ae268fe44fa11effb6 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Mon, 20 Oct 2025 09:44:43 +0200 Subject: [PATCH] small improvements --- PadelClub.xcodeproj/project.pbxproj | 8 ++--- PadelClub/Views/Calling/CallView.swift | 31 ++++++++++--------- .../PlayersWithoutContactView.swift | 3 +- .../Views/Calling/TeamsCallingView.swift | 5 ++- PadelClub/Views/Cashier/CashierView.swift | 12 +++++++ PadelClub/Views/Team/EditingTeamView.swift | 12 +++++-- .../Tournament/TournamentBuildView.swift | 2 +- 7 files changed, 49 insertions(+), 24 deletions(-) diff --git a/PadelClub.xcodeproj/project.pbxproj b/PadelClub.xcodeproj/project.pbxproj index b7beca3..9380b25 100644 --- a/PadelClub.xcodeproj/project.pbxproj +++ b/PadelClub.xcodeproj/project.pbxproj @@ -3412,7 +3412,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; @@ -3439,7 +3439,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.37; + MARKETING_VERSION = 1.2.57; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -3459,7 +3459,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_TEAM = BQ3Y44M3Q6; @@ -3485,7 +3485,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.37; + MARKETING_VERSION = 1.2.57; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/PadelClub/Views/Calling/CallView.swift b/PadelClub/Views/Calling/CallView.swift index 8c4e84d..1f06157 100644 --- a/PadelClub/Views/Calling/CallView.swift +++ b/PadelClub/Views/Calling/CallView.swift @@ -148,6 +148,11 @@ struct CallView: View { } func finalMessage(summonType: SummonType, forcedEmptyMessage: Bool) -> String { + + if summonType == .contactWithoutSignature { + return "" + } + if simpleMode || forcedEmptyMessage { let signature = dataStore.user.getSummonsMessageSignature() ?? dataStore.user.defaultSignature(tournament) return "\n\n\n\n" + signature @@ -309,17 +314,9 @@ struct CallView: View { self._summonMenu(byMessage: false) } label: { VStack(alignment: .leading) { - let callWord : String = (summonType.isRecall() ? "Reconvoquer" : mainWord) + let callWord : String = summonType.mainWord() if self.teams.count == 1 { - if simpleMode { - Text("\(callWord) cette paire") - } else { - if let previousCallDate = teams.first?.callDate, Calendar.current.compare(previousCallDate, to: callDate, toGranularity: .minute) != .orderedSame { - Text("Reconvoquer \(self.callDate.localizedDate())") - } else { - Text("\(callWord) cette paire") - } - } + Text("\(callWord) cette paire") } else { Text("\(callWord) ces \(self.teams.count) paires") } @@ -344,6 +341,8 @@ struct CallView: View { self._summon(byMessage: byMessage, summonType: .summonWalkoutFollowUp) case .summonErrorFollowUp: self._summon(byMessage: byMessage, summonType: .summonErrorFollowUp) + case .contactWithoutSignature: + self._summon(byMessage: byMessage, summonType: .contactWithoutSignature, forcedEmptyMessage: true) } } label: { Text(byMessage ? "sms" : "mail") @@ -363,11 +362,13 @@ struct CallView: View { self._summon(byMessage: byMessage, summonType: .summonErrorFollowUp) } - if simpleMode == false { - Divider() - Button("Contacter") { - self._summon(byMessage: byMessage, summonType: .contact, forcedEmptyMessage: true) - } + Divider() + + Button("Contacter") { + self._summon(byMessage: byMessage, summonType: .contact, forcedEmptyMessage: true) + } + Button("Contacter sans texte par défaut") { + self._summon(byMessage: byMessage, summonType: .contactWithoutSignature, forcedEmptyMessage: true) } } label: { diff --git a/PadelClub/Views/Calling/Components/PlayersWithoutContactView.swift b/PadelClub/Views/Calling/Components/PlayersWithoutContactView.swift index d670b41..f73fb8f 100644 --- a/PadelClub/Views/Calling/Components/PlayersWithoutContactView.swift +++ b/PadelClub/Views/Calling/Components/PlayersWithoutContactView.swift @@ -46,7 +46,7 @@ struct PlayersWithoutContactView: View { LabeledContent { Text(withoutPhones.count.formatted()) } label: { - Text("Joueurs sans téléphone portable français") + Text(Locale.current.region?.identifier == "FR" ? "Joueurs sans téléphone portable français" : "Joueurs sans téléphone") } } } header: { @@ -54,3 +54,4 @@ struct PlayersWithoutContactView: View { } } } + diff --git a/PadelClub/Views/Calling/TeamsCallingView.swift b/PadelClub/Views/Calling/TeamsCallingView.swift index 1a42de7..7bda749 100644 --- a/PadelClub/Views/Calling/TeamsCallingView.swift +++ b/PadelClub/Views/Calling/TeamsCallingView.swift @@ -131,7 +131,7 @@ struct CallMenuOptionsView: View { let action: (() -> Void)? @State private var callDate: Date - init(team: TeamRegistration, action: (() -> Void)?) { + init(team: TeamRegistration, action: (() -> Void)? = nil) { self.team = team self.action = action _callDate = .init(wrappedValue: team.expectedSummonDate() ?? team.tournamentObject()?.startDate ?? Date()) @@ -185,6 +185,9 @@ struct CallMenuOptionsView: View { CallView(team: team, displayContext: .menu, summonType: .summonWalkoutFollowUp) CallView(team: team, displayContext: .menu, summonType: .summonErrorFollowUp) } + + CallView(team: team, displayContext: .menu, summonType: .contact) + CallView(team: team, displayContext: .menu, summonType: .contactWithoutSignature) } Section { diff --git a/PadelClub/Views/Cashier/CashierView.swift b/PadelClub/Views/Cashier/CashierView.swift index f175f52..bc71d0b 100644 --- a/PadelClub/Views/Cashier/CashierView.swift +++ b/PadelClub/Views/Cashier/CashierView.swift @@ -51,6 +51,7 @@ class CashierViewModel: ObservableObject { @Published var sortOrder: PadelClubData.SortOrder = .ascending @Published var searchText: String = "" @Published var isSearching: Bool = false + @Published var paymentType: PlayerPaymentType? = nil func _shouldDisplayTeam(_ team: TeamRegistration) -> Bool { team.unsortedPlayers().anySatisfy({ @@ -65,6 +66,7 @@ class CashierViewModel: ObservableObject { sortOption.shouldDisplayPlayer(player) && filterOption.shouldDisplayPlayer(player) && presenceFilterOption.shouldDisplayPlayer(player) + && (paymentType == nil || player.paymentType == paymentType) } } @@ -261,6 +263,16 @@ struct CashierView: View { } label: { Text("Statut du règlement") } + + Picker(selection: $cashierViewModel.paymentType) { + Text("N'importe").tag(nil as PlayerPaymentType?) + ForEach(PlayerPaymentType.allCases) { paymentType in + Text(paymentType.localizedLabel()).tag(paymentType) + } + } label: { + Text("Type de règlement") + } + } Picker(selection: $cashierViewModel.sortOption) { diff --git a/PadelClub/Views/Team/EditingTeamView.swift b/PadelClub/Views/Team/EditingTeamView.swift index a819287..345f834 100644 --- a/PadelClub/Views/Team/EditingTeamView.swift +++ b/PadelClub/Views/Team/EditingTeamView.swift @@ -106,9 +106,11 @@ struct EditingTeamView: View { List { #if PRODTEST - Section { - if let pid = team.players().first(where: { $0.paymentId != nil })?.paymentId { + if let pid = team.players().first(where: { $0.paymentId != nil })?.paymentId { + Section { Text(pid) + } footer: { + CopyPasteButtonView(pasteValue: pid) } } // } else { @@ -243,6 +245,12 @@ struct EditingTeamView: View { Text("Équipe sur place") } } + NavigationLink { + CallMenuOptionsView(team: team) + .environment(tournament) + } label: { + Text("Modifier la convocation") + } } Section { diff --git a/PadelClub/Views/Tournament/TournamentBuildView.swift b/PadelClub/Views/Tournament/TournamentBuildView.swift index 00cee8d..1924b65 100644 --- a/PadelClub/Views/Tournament/TournamentBuildView.swift +++ b/PadelClub/Views/Tournament/TournamentBuildView.swift @@ -21,7 +21,7 @@ struct TournamentBuildView: View { let state = tournament.state() Section { - if tournament.groupStageCount > 0 { + if tournament.hasGroupeStages() { NavigationLink(value: Screen.groupStage) { LabeledContent { if let groupStageStatus {