small improvements

main
Razmig Sarkissian 3 weeks ago
parent 9bb753cce1
commit 236406e262
  1. 8
      PadelClub.xcodeproj/project.pbxproj
  2. 31
      PadelClub/Views/Calling/CallView.swift
  3. 3
      PadelClub/Views/Calling/Components/PlayersWithoutContactView.swift
  4. 5
      PadelClub/Views/Calling/TeamsCallingView.swift
  5. 12
      PadelClub/Views/Cashier/CashierView.swift
  6. 12
      PadelClub/Views/Team/EditingTeamView.swift
  7. 2
      PadelClub/Views/Tournament/TournamentBuildView.swift

@ -3412,7 +3412,7 @@
CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
@ -3439,7 +3439,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.2.37; MARKETING_VERSION = 1.2.57;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -3459,7 +3459,7 @@
CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
DEVELOPMENT_TEAM = BQ3Y44M3Q6; DEVELOPMENT_TEAM = BQ3Y44M3Q6;
@ -3485,7 +3485,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.2.37; MARKETING_VERSION = 1.2.57;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

@ -148,6 +148,11 @@ struct CallView: View {
} }
func finalMessage(summonType: SummonType, forcedEmptyMessage: Bool) -> String { func finalMessage(summonType: SummonType, forcedEmptyMessage: Bool) -> String {
if summonType == .contactWithoutSignature {
return ""
}
if simpleMode || forcedEmptyMessage { if simpleMode || forcedEmptyMessage {
let signature = dataStore.user.getSummonsMessageSignature() ?? dataStore.user.defaultSignature(tournament) let signature = dataStore.user.getSummonsMessageSignature() ?? dataStore.user.defaultSignature(tournament)
return "\n\n\n\n" + signature return "\n\n\n\n" + signature
@ -309,17 +314,9 @@ struct CallView: View {
self._summonMenu(byMessage: false) self._summonMenu(byMessage: false)
} label: { } label: {
VStack(alignment: .leading) { VStack(alignment: .leading) {
let callWord : String = (summonType.isRecall() ? "Reconvoquer" : mainWord) let callWord : String = summonType.mainWord()
if self.teams.count == 1 { if self.teams.count == 1 {
if simpleMode { Text("\(callWord) cette paire")
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")
}
}
} else { } else {
Text("\(callWord) ces \(self.teams.count) paires") Text("\(callWord) ces \(self.teams.count) paires")
} }
@ -344,6 +341,8 @@ struct CallView: View {
self._summon(byMessage: byMessage, summonType: .summonWalkoutFollowUp) self._summon(byMessage: byMessage, summonType: .summonWalkoutFollowUp)
case .summonErrorFollowUp: case .summonErrorFollowUp:
self._summon(byMessage: byMessage, summonType: .summonErrorFollowUp) self._summon(byMessage: byMessage, summonType: .summonErrorFollowUp)
case .contactWithoutSignature:
self._summon(byMessage: byMessage, summonType: .contactWithoutSignature, forcedEmptyMessage: true)
} }
} label: { } label: {
Text(byMessage ? "sms" : "mail") Text(byMessage ? "sms" : "mail")
@ -363,11 +362,13 @@ struct CallView: View {
self._summon(byMessage: byMessage, summonType: .summonErrorFollowUp) self._summon(byMessage: byMessage, summonType: .summonErrorFollowUp)
} }
if simpleMode == false { Divider()
Divider()
Button("Contacter") { Button("Contacter") {
self._summon(byMessage: byMessage, summonType: .contact, forcedEmptyMessage: true) self._summon(byMessage: byMessage, summonType: .contact, forcedEmptyMessage: true)
} }
Button("Contacter sans texte par défaut") {
self._summon(byMessage: byMessage, summonType: .contactWithoutSignature, forcedEmptyMessage: true)
} }
} label: { } label: {

@ -46,7 +46,7 @@ struct PlayersWithoutContactView: View {
LabeledContent { LabeledContent {
Text(withoutPhones.count.formatted()) Text(withoutPhones.count.formatted())
} label: { } 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: { } header: {
@ -54,3 +54,4 @@ struct PlayersWithoutContactView: View {
} }
} }
} }

@ -131,7 +131,7 @@ struct CallMenuOptionsView: View {
let action: (() -> Void)? let action: (() -> Void)?
@State private var callDate: Date @State private var callDate: Date
init(team: TeamRegistration, action: (() -> Void)?) { init(team: TeamRegistration, action: (() -> Void)? = nil) {
self.team = team self.team = team
self.action = action self.action = action
_callDate = .init(wrappedValue: team.expectedSummonDate() ?? team.tournamentObject()?.startDate ?? Date()) _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: .summonWalkoutFollowUp)
CallView(team: team, displayContext: .menu, summonType: .summonErrorFollowUp) CallView(team: team, displayContext: .menu, summonType: .summonErrorFollowUp)
} }
CallView(team: team, displayContext: .menu, summonType: .contact)
CallView(team: team, displayContext: .menu, summonType: .contactWithoutSignature)
} }
Section { Section {

@ -51,6 +51,7 @@ class CashierViewModel: ObservableObject {
@Published var sortOrder: PadelClubData.SortOrder = .ascending @Published var sortOrder: PadelClubData.SortOrder = .ascending
@Published var searchText: String = "" @Published var searchText: String = ""
@Published var isSearching: Bool = false @Published var isSearching: Bool = false
@Published var paymentType: PlayerPaymentType? = nil
func _shouldDisplayTeam(_ team: TeamRegistration) -> Bool { func _shouldDisplayTeam(_ team: TeamRegistration) -> Bool {
team.unsortedPlayers().anySatisfy({ team.unsortedPlayers().anySatisfy({
@ -65,6 +66,7 @@ class CashierViewModel: ObservableObject {
sortOption.shouldDisplayPlayer(player) sortOption.shouldDisplayPlayer(player)
&& filterOption.shouldDisplayPlayer(player) && filterOption.shouldDisplayPlayer(player)
&& presenceFilterOption.shouldDisplayPlayer(player) && presenceFilterOption.shouldDisplayPlayer(player)
&& (paymentType == nil || player.paymentType == paymentType)
} }
} }
@ -261,6 +263,16 @@ struct CashierView: View {
} label: { } label: {
Text("Statut du règlement") 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) { Picker(selection: $cashierViewModel.sortOption) {

@ -106,9 +106,11 @@ struct EditingTeamView: View {
List { List {
#if PRODTEST #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) Text(pid)
} footer: {
CopyPasteButtonView(pasteValue: pid)
} }
} }
// } else { // } else {
@ -243,6 +245,12 @@ struct EditingTeamView: View {
Text("Équipe sur place") Text("Équipe sur place")
} }
} }
NavigationLink {
CallMenuOptionsView(team: team)
.environment(tournament)
} label: {
Text("Modifier la convocation")
}
} }
Section { Section {

@ -21,7 +21,7 @@ struct TournamentBuildView: View {
let state = tournament.state() let state = tournament.state()
Section { Section {
if tournament.groupStageCount > 0 { if tournament.hasGroupeStages() {
NavigationLink(value: Screen.groupStage) { NavigationLink(value: Screen.groupStage) {
LabeledContent { LabeledContent {
if let groupStageStatus { if let groupStageStatus {

Loading…
Cancel
Save