Merge branch 'main' into sync2

sync2
Laurent 8 months ago
commit ef387783c1
  1. 8
      PadelClub.xcodeproj/project.pbxproj
  2. 33
      PadelClub/Assets.xcassets/beigeNotUniversal.colorset/Contents.json
  3. 33
      PadelClub/Assets.xcassets/grayNotUniversal.colorset/Contents.json
  4. 4
      PadelClub/Data/PlayerRegistration.swift
  5. 12
      PadelClub/Data/TeamRegistration.swift
  6. 4
      PadelClub/Data/Tournament.swift
  7. 4
      PadelClub/InscriptionLegendView.swift
  8. 7
      PadelClub/Views/Navigation/Agenda/EventListView.swift
  9. 9
      PadelClub/Views/Tournament/FileImportView.swift
  10. 2
      PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift
  11. 1
      PadelClub/Views/Tournament/Shared/TournamentCellView.swift
  12. 2
      PadelClub/Views/ViewModifiers/ListRowViewModifier.swift

@ -3624,7 +3624,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 = 2; CURRENT_PROJECT_VERSION = 1;
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\"";
@ -3650,7 +3650,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.1.20; MARKETING_VERSION = 1.1.22;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -3670,7 +3670,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 = 2; CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
DEVELOPMENT_TEAM = BQ3Y44M3Q6; DEVELOPMENT_TEAM = BQ3Y44M3Q6;
@ -3695,7 +3695,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.1.20; MARKETING_VERSION = 1.1.22;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

@ -0,0 +1,33 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.808",
"green" : "0.906",
"red" : "0.980"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"platform" : "ios",
"reference" : "systemGrayColor"
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -0,0 +1,33 @@
{
"colors" : [
{
"color" : {
"platform" : "ios",
"reference" : "systemGrayColor"
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x00",
"green" : "0xD2",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -18,9 +18,13 @@ final class PlayerRegistration: BasePlayerRegistration, SideStorable {
case .beachPadel: case .beachPadel:
return "beach-padel" return "beach-padel"
case nil: case nil:
if registeredOnline {
return "à vérifier vous-même"
} else {
return "créé par vous-même" return "créé par vous-même"
} }
} }
}
init(teamRegistration: String? = nil, firstName: String, lastName: String, licenceId: String? = nil, rank: Int? = nil, paymentType: PlayerPaymentType? = nil, sex: PlayerSexType? = nil, tournamentPlayed: Int? = nil, points: Double? = nil, clubName: String? = nil, ligueName: String? = nil, assimilation: String? = nil, phoneNumber: String? = nil, email: String? = nil, birthdate: String? = nil, computedRank: Int = 0, source: PlayerRegistration.PlayerDataSource? = nil, hasArrived: Bool = false) { init(teamRegistration: String? = nil, firstName: String, lastName: String, licenceId: String? = nil, rank: Int? = nil, paymentType: PlayerPaymentType? = nil, sex: PlayerSexType? = nil, tournamentPlayed: Int? = nil, points: Double? = nil, clubName: String? = nil, ligueName: String? = nil, assimilation: String? = nil, phoneNumber: String? = nil, email: String? = nil, birthdate: String? = nil, computedRank: Int = 0, source: PlayerRegistration.PlayerDataSource? = nil, hasArrived: Bool = false) {
super.init() super.init()

@ -701,7 +701,17 @@ final class TeamRegistration: BaseTeamRegistration, SideStorable {
} }
func bracketMatchTitleAndQualifiedStatus() -> String? { func bracketMatchTitleAndQualifiedStatus() -> String? {
let values = [qualified ? "Qualifié" : nil, initialMatch()?.roundAndMatchTitle()].compactMap({ $0 }) let v = groupStageObject()?.groupStageTitle()
var base = "Qualifié"
if qualified {
if let groupStageTitle = groupStageObject()?.groupStageTitle() {
base = base + " (\(groupStageTitle))"
}
}
let suffix = qualified ? nil : groupStageObject()?.groupStageTitle()
let initalMatchTitle = initialMatch()?.roundAndMatchTitle() ?? suffix
let values = [qualified ? base : nil, initalMatchTitle].compactMap({ $0 })
if values.isEmpty { if values.isEmpty {
return nil return nil
} }

@ -697,7 +697,7 @@ defer {
} }
func cutLabelColor(index: Int?, teamCount: Int?) -> Color { func cutLabelColor(index: Int?, teamCount: Int?) -> Color {
guard let index else { return Color.gray } guard let index else { return Color.grayNotUniversal }
let _teamCount = teamCount ?? selectedSortedTeams().count let _teamCount = teamCount ?? selectedSortedTeams().count
let groupStageCut = groupStageCut() let groupStageCut = groupStageCut()
let bracketCut = bracketCut(teamCount: _teamCount, groupStageCut: groupStageCut) let bracketCut = bracketCut(teamCount: _teamCount, groupStageCut: groupStageCut)
@ -706,7 +706,7 @@ defer {
} else if index - bracketCut < groupStageCut && _teamCount > 0 { } else if index - bracketCut < groupStageCut && _teamCount > 0 {
return Color.indigo return Color.indigo
} else { } else {
return Color.gray return Color.grayNotUniversal
} }
} }

@ -42,7 +42,7 @@ struct InscriptionLegendView: View {
Section { Section {
Text("Équipe en liste d'attente") Text("Équipe en liste d'attente")
.listRowView(isActive: true, color: .gray, hideColorVariation: true, alignment: .leading) .listRowView(isActive: true, color: .grayNotUniversal, hideColorVariation: true, alignment: .leading)
Text("Équipe forfaite") Text("Équipe forfaite")
.listRowView(isActive: true, color: .logoRed, hideColorVariation: true, alignment: .leading) .listRowView(isActive: true, color: .logoRed, hideColorVariation: true, alignment: .leading)
} }
@ -56,7 +56,7 @@ struct InscriptionLegendView: View {
Section { Section {
Text("Équipe ayant un joueur ne provenant pas du fichier beach-padel") Text("Équipe ayant un joueur ne provenant pas du fichier beach-padel")
.listRowView(isActive: true, color: .beige, hideColorVariation: true, backgroundColor: .beige, alignment: .leading) .listRowView(isActive: true, color: .beigeNotUniversal, hideColorVariation: true, backgroundColor: .beigeNotUniversal, alignment: .leading)
} footer: { } footer: {
Text("Une fois que vous avez importé votre fichier, Padel Club vous affiche ainsi les équipes ayant des joueurs ne provenant pas du fichier.") Text("Une fois que vous avez importé votre fichier, Padel Club vous affiche ainsi les équipes ayant des joueurs ne provenant pas du fichier.")
} }

@ -261,6 +261,13 @@ struct EventListView: View {
private func _tournamentView(_ tournament: Tournament) -> some View { private func _tournamentView(_ tournament: Tournament) -> some View {
NavigationLink(value: tournament) { NavigationLink(value: tournament) {
TournamentCellView(tournament: tournament) TournamentCellView(tournament: tournament)
.onReceive(NotificationCenter.default.publisher(for: NSNotification.Name.CollectionDidLoad), perform: { notification in
if let store = notification.object as? StoredCollection<TeamRegistration>, store.id == tournament.id {
tournament.lastTeamRefresh = Date()
}
})
.id(tournament.lastTeamRefresh) .id(tournament.lastTeamRefresh)
.task(priority: .background) { .task(priority: .background) {
await tournament.refreshTeamList() await tournament.refreshTeamList()

@ -67,8 +67,6 @@ struct FileImportView: View {
@Environment(Tournament.self) var tournament: Tournament @Environment(Tournament.self) var tournament: Tournament
@Environment(\.dismiss) private var dismiss @Environment(\.dismiss) private var dismiss
let notFoundAreWalkOutTip = NotFoundAreWalkOutTip()
@State private var fileContent: String? @State private var fileContent: String?
@State private var teams: [FileImportManager.TeamHolder] = [] @State private var teams: [FileImportManager.TeamHolder] = []
@State private var isShowing = false @State private var isShowing = false
@ -323,13 +321,6 @@ struct FileImportView: View {
let _filteredTeams = filteredTeams let _filteredTeams = filteredTeams
let previousTeams = tournament.sortedTeams(selectedSortedTeams: tournament.selectedSortedTeams()) let previousTeams = tournament.sortedTeams(selectedSortedTeams: tournament.selectedSortedTeams())
if previousTeams.isEmpty == false {
Section {
TipView(notFoundAreWalkOutTip)
.tipStyle(tint: nil)
}
}
if multiImport, fileProvider == .frenchFederation, let tournaments = tournament.eventObject()?.tournaments, tournaments.count > 1 { if multiImport, fileProvider == .frenchFederation, let tournaments = tournament.eventObject()?.tournaments, tournaments.count > 1 {
ForEach(tournaments) { tournament in ForEach(tournaments) { tournament in
let tournamentFilteredTeams = self.filteredTeams(tournament: tournament) let tournamentFilteredTeams = self.filteredTeams(tournament: tournament)

@ -615,7 +615,7 @@ struct InscriptionManagerView: View {
Section { Section {
ForEach(teams) { team in ForEach(teams) { team in
let teamIndex = team.index(in: sortedTeams) let teamIndex = team.index(in: sortedTeams)
let color: Color? = isImported ? (team.unrankedOrUnknown() ? .logoRed : (team.isImported() == false ? .beige : nil)) : nil let color: Color? = isImported ? (team.unrankedOrUnknown() ? .logoRed : (team.isImported() == false ? .beigeNotUniversal : nil)) : nil
NavigationLink { NavigationLink {
EditingTeamView(team: team) EditingTeamView(team: team)

@ -40,6 +40,7 @@ struct TournamentCellView: View {
_buildView(build, existingTournament: event?.existingBuild(build)) _buildView(build, existingTournament: event?.existingBuild(build))
} }
} }
.id(shouldTournamentBeOver)
} }
var teamCount: Int? { var teamCount: Int? {

@ -15,7 +15,7 @@ struct ListRowViewModifier: ViewModifier {
let alignment: Alignment let alignment: Alignment
func colorVariation() -> Color { func colorVariation() -> Color {
hideColorVariation ? (backgroundColor ?? Color(uiColor: .systemBackground)) : color.variation() hideColorVariation ? (backgroundColor ?? Color(uiColor: .secondarySystemGroupedBackground)) : color.variation()
} }
func body(content: Content) -> some View { func body(content: Content) -> some View {

Loading…
Cancel
Save