sync3
Laurent 5 months ago
parent d35e312c3f
commit 4ee338df6d
  1. 4
      PadelClub.xcodeproj/project.pbxproj
  2. 2
      PadelClub.xcodeproj/xcshareddata/xcschemes/PadelClub ProdTest.xcscheme
  3. 2
      PadelClub.xcodeproj/xcshareddata/xcschemes/PadelClub Raw.xcscheme
  4. 4
      PadelClub.xcodeproj/xcshareddata/xcschemes/PadelClub TestFlight.xcscheme
  5. 2
      PadelClub.xcodeproj/xcshareddata/xcschemes/PadelClub.xcscheme
  6. 2
      PadelClub/Views/Calling/GroupStageCallingView.swift
  7. 14
      PadelClub/Views/GroupStage/Components/GroupStageSettingsView.swift
  8. 2
      PadelClub/Views/GroupStage/Components/GroupStageTeamView.swift
  9. 2
      PadelClub/Views/GroupStage/GroupStageView.swift
  10. 6
      PadelClub/Views/GroupStage/GroupStagesSettingsView.swift

@ -3359,7 +3359,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 = 3; CURRENT_PROJECT_VERSION = 6;
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\"";
@ -3403,7 +3403,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 = 3; CURRENT_PROJECT_VERSION = 6;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
DEVELOPMENT_TEAM = BQ3Y44M3Q6; DEVELOPMENT_TEAM = BQ3Y44M3Q6;

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1630" LastUpgradeVersion = "1600"
version = "1.7"> version = "1.7">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1630" LastUpgradeVersion = "1600"
version = "1.7"> version = "1.7">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1630" LastUpgradeVersion = "1600"
version = "1.7"> version = "1.7">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
@ -31,7 +31,7 @@
shouldAutocreateTestPlan = "YES"> shouldAutocreateTestPlan = "YES">
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Release" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0" launchStyle = "0"

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1630" LastUpgradeVersion = "1600"
version = "1.7"> version = "1.7">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

@ -122,7 +122,7 @@ struct GroupStageCallingView: View {
} }
} }
.overlay { .overlay {
if groupStage.startDate == nil && groupStage.matches().filter({ $0.startDate != nil }).isEmpty { if groupStage.startDate == nil && groupStage._matches().filter({ $0.startDate != nil }).isEmpty {
ContentUnavailableView { ContentUnavailableView {
Label("Aucun horaire défini", systemImage: "clock.badge.questionmark") Label("Aucun horaire défini", systemImage: "clock.badge.questionmark")
} description: { } description: {

@ -27,7 +27,7 @@ struct GroupStageSettingsView: View {
_groupStage = Bindable(groupStage) _groupStage = Bindable(groupStage)
_groupStageName = .init(wrappedValue: groupStage.name ?? "") _groupStageName = .init(wrappedValue: groupStage.name ?? "")
_size = .init(wrappedValue: groupStage.size) _size = .init(wrappedValue: groupStage.size)
_courtIndex = .init(wrappedValue: groupStage.matches().first?.courtIndex ?? 0) _courtIndex = .init(wrappedValue: groupStage._matches().first?.courtIndex ?? 0)
} }
var tournamentStore: TournamentStore? { var tournamentStore: TournamentStore? {
@ -66,12 +66,12 @@ struct GroupStageSettingsView: View {
Section { Section {
CourtPicker(title: "Piste dédié", selection: $courtIndex, maxCourt: tournament.courtCount) CourtPicker(title: "Piste dédié", selection: $courtIndex, maxCourt: tournament.courtCount)
RowButtonView("Confirmer", role: .destructive) { RowButtonView("Confirmer", role: .destructive) {
groupStage.matches().forEach { match in groupStage._matches().forEach { match in
match.setCourt(courtIndex) match.setCourt(courtIndex)
} }
do { do {
try tournamentStore?.matches.addOrUpdate(contentOfs: groupStage.matches()) try tournamentStore?.matches.addOrUpdate(contentOfs: groupStage._matches())
} catch { } catch {
Logger.error(error) Logger.error(error)
} }
@ -91,7 +91,7 @@ struct GroupStageSettingsView: View {
teams.forEach { team in teams.forEach { team in
team.groupStagePosition = nil team.groupStagePosition = nil
team.groupStage = nil team.groupStage = nil
groupStage.matches().forEach({ $0.updateTeamScores() }) groupStage._matches().forEach({ $0.updateTeamScores() })
} }
do { do {
try tournamentStore?.teamRegistrations.addOrUpdate(contentOfs: teams) try tournamentStore?.teamRegistrations.addOrUpdate(contentOfs: teams)
@ -111,13 +111,13 @@ struct GroupStageSettingsView: View {
Section { Section {
RowButtonView("Retirer tous les horaires", role: .destructive) { RowButtonView("Retirer tous les horaires", role: .destructive) {
groupStage.matches().forEach { match in groupStage._matches().forEach { match in
match.startDate = nil match.startDate = nil
match.endDate = nil match.endDate = nil
} }
do { do {
try tournamentStore?.matches.addOrUpdate(contentOfs: groupStage.matches()) try tournamentStore?.matches.addOrUpdate(contentOfs: groupStage._matches())
} catch { } catch {
Logger.error(error) Logger.error(error)
} }
@ -130,7 +130,7 @@ struct GroupStageSettingsView: View {
teams.forEach { team in teams.forEach { team in
team.groupStagePosition = nil team.groupStagePosition = nil
team.groupStage = nil team.groupStage = nil
groupStage.matches().forEach({ $0.updateTeamScores() }) groupStage._matches().forEach({ $0.updateTeamScores() })
} }
do { do {
try tournamentStore?.teamRegistrations.addOrUpdate(contentOfs: teams) try tournamentStore?.teamRegistrations.addOrUpdate(contentOfs: teams)

@ -103,7 +103,7 @@ struct GroupStageTeamView: View {
team.groupStagePosition = nil team.groupStagePosition = nil
team.groupStage = nil team.groupStage = nil
_save() _save()
groupStage.matches().forEach({ $0.updateTeamScores() }) groupStage._matches().forEach({ $0.updateTeamScores() })
} }
} }

@ -245,7 +245,7 @@ struct GroupStageView: View {
print(team.pasteData()) print(team.pasteData())
team.groupStage = groupStage.id team.groupStage = groupStage.id
team.groupStagePosition = index team.groupStagePosition = index
groupStage.matches().forEach({ $0.updateTeamScores() }) groupStage._matches().forEach({ $0.updateTeamScores() })
do { do {
try tournamentStore?.teamRegistrations.addOrUpdate(instance: team) try tournamentStore?.teamRegistrations.addOrUpdate(instance: team)
} catch { } catch {

@ -144,8 +144,8 @@ struct GroupStagesSettingsView: View {
Section { Section {
RowButtonView("Retirer tous les horaires", role: .destructive) { RowButtonView("Retirer tous les horaires", role: .destructive) {
let matches = tournament.groupStages().flatMap({ $0.matches() }) let matches = tournament.groupStages().flatMap({ $0._matches() })
tournament.groupStages().flatMap({ $0.matches() }).forEach { match in tournament.groupStages().flatMap({ $0._matches() }).forEach { match in
match.startDate = nil match.startDate = nil
match.endDate = nil match.endDate = nil
} }
@ -239,7 +239,7 @@ struct GroupStagesSettingsView: View {
teams.forEach { team in teams.forEach { team in
team.groupStagePosition = nil team.groupStagePosition = nil
team.groupStage = nil team.groupStage = nil
groupStage.matches().forEach({ $0.updateTeamScores() }) groupStage._matches().forEach({ $0.updateTeamScores() })
} }
do { do {
try tournamentStore?.teamRegistrations.addOrUpdate(contentOfs: teams) try tournamentStore?.teamRegistrations.addOrUpdate(contentOfs: teams)

Loading…
Cancel
Save