From f0919515bf737509c2ae47941435c5d73820a453 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Thu, 20 Jun 2024 18:57:48 +0200 Subject: [PATCH 1/3] v60 --- PadelClub.xcodeproj/project.pbxproj | 4 ++-- PadelClub/Utils/Network/NetworkManager.swift | 2 +- PadelClub/Views/Navigation/MainView.swift | 2 +- PadelClub/Views/Navigation/Umpire/PadelClubView.swift | 6 ++++-- PadelClub/Views/Navigation/Umpire/UmpireView.swift | 6 +++--- PadelClub/Views/Shared/SupportButtonView.swift | 2 +- PadelClub/Views/Subscription/Guard.swift | 10 +++++----- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/PadelClub.xcodeproj/project.pbxproj b/PadelClub.xcodeproj/project.pbxproj index b7dc75f..8e865a1 100644 --- a/PadelClub.xcodeproj/project.pbxproj +++ b/PadelClub.xcodeproj/project.pbxproj @@ -1901,7 +1901,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 59; + CURRENT_PROJECT_VERSION = 60; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; @@ -1941,7 +1941,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 59; + CURRENT_PROJECT_VERSION = 60; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_TEAM = BQ3Y44M3Q6; diff --git a/PadelClub/Utils/Network/NetworkManager.swift b/PadelClub/Utils/Network/NetworkManager.swift index ed705bf..a86596b 100644 --- a/PadelClub/Utils/Network/NetworkManager.swift +++ b/PadelClub/Utils/Network/NetworkManager.swift @@ -24,7 +24,7 @@ class NetworkManager { let documentsUrl: URL = SourceFileManager.shared.rankingSourceDirectory let destinationFileUrl = documentsUrl.appendingPathComponent("\(dateString)") - let fileURL = URL(string: "https://padelclub.app/static/\(dateString)") + let fileURL = URL(string: "https://xlr.alwaysdata.net/static/rankings/\(dateString)") if FileManager.default.fileExists(atPath: destinationFileUrl.path()) { return diff --git a/PadelClub/Views/Navigation/MainView.swift b/PadelClub/Views/Navigation/MainView.swift index 4976bcc..1684052 100644 --- a/PadelClub/Views/Navigation/MainView.swift +++ b/PadelClub/Views/Navigation/MainView.swift @@ -54,7 +54,7 @@ struct MainView: View { } var badgeText: Text? { - return _isConnected() == false ? Text("!").font(.headline) : nil + return (Store.main.userName() != nil && _isConnected() == false) ? Text("!").font(.headline) : nil } var body: some View { diff --git a/PadelClub/Views/Navigation/Umpire/PadelClubView.swift b/PadelClub/Views/Navigation/Umpire/PadelClubView.swift index b55ccb5..e08d35e 100644 --- a/PadelClub/Views/Navigation/Umpire/PadelClubView.swift +++ b/PadelClub/Views/Navigation/Umpire/PadelClubView.swift @@ -107,8 +107,10 @@ struct PadelClubView: View { } description: { Text("Padel Club peut importer toutes les données publiques de la FFT concernant tous les compétiteurs et compétitrices.") } actions: { - RowButtonView("Démarrer l'importation") { - _startImporting() + if lastDataSource != nil { + RowButtonView("Démarrer l'importation") { + _startImporting() + } } } } diff --git a/PadelClub/Views/Navigation/Umpire/UmpireView.swift b/PadelClub/Views/Navigation/Umpire/UmpireView.swift index ff46754..dba656e 100644 --- a/PadelClub/Views/Navigation/Umpire/UmpireView.swift +++ b/PadelClub/Views/Navigation/Umpire/UmpireView.swift @@ -228,11 +228,11 @@ struct AccountRowView: View { if Store.main.hasToken() { Text(self.userName) } else { - Image(systemName: "xmark.circle.fill") - .foregroundStyle(.logoRed) + Image(systemName: "exclamationmark.circle.fill") + .foregroundStyle(.master) } } label: { - Label("Mon compte", systemImage: "person.fill") + Label(Store.main.userName() == nil ? "Créer votre compte Padel Club" : "Mon compte", systemImage: "person.fill") if dataStore.user.email.isEmpty == false { Text(dataStore.user.email) } diff --git a/PadelClub/Views/Shared/SupportButtonView.swift b/PadelClub/Views/Shared/SupportButtonView.swift index 904545d..cc177ba 100644 --- a/PadelClub/Views/Shared/SupportButtonView.swift +++ b/PadelClub/Views/Shared/SupportButtonView.swift @@ -80,7 +80,7 @@ struct SupportButtonView: View { private func _getBody() -> String { let separator = "---------------------------------------------" - return ["token", Store.main.token(), separator, "userId", Store.main.userId, separator, "dataStore userId", DataStore.shared.user.id].compacted().joined(separator: "\n\n") + return ["Décrivez votre problème", "\n\n\n", separator, "token", Store.main.token(), separator, "userId", Store.main.userId, separator, "dataStore userId", DataStore.shared.user.id].compacted().joined(separator: "\n") } private func _getDeviceIdentifier() -> String { diff --git a/PadelClub/Views/Subscription/Guard.swift b/PadelClub/Views/Subscription/Guard.swift index c7fc264..0d1fa2e 100644 --- a/PadelClub/Views/Subscription/Guard.swift +++ b/PadelClub/Views/Subscription/Guard.swift @@ -140,14 +140,14 @@ import LeStorage } var currentPlan: StoreItem? { - return .monthlyUnlimited +// return .monthlyUnlimited // #if DEBUG // return .monthlyUnlimited // #else -// if let currentBestPlan = self.currentBestPlan, let plan = StoreItem(rawValue: currentBestPlan.productID) { -// return plan -// } -// return nil + if let currentBestPlan = self.currentBestPlan, let plan = StoreItem(rawValue: currentBestPlan.productID) { + return plan + } + return nil // #endif } From c5cc8c0233edb32ca7ea515b95b3d40f86f1c650 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Thu, 20 Jun 2024 19:13:52 +0200 Subject: [PATCH 2/3] consistency yellow --- PadelClub/ViewModel/AgendaDestination.swift | 2 +- PadelClub/Views/Navigation/Umpire/UmpireView.swift | 8 ++++---- .../Tournament/Shared/TournamentBroadcastRowView.swift | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PadelClub/ViewModel/AgendaDestination.swift b/PadelClub/ViewModel/AgendaDestination.swift index 49480f1..7b9c77d 100644 --- a/PadelClub/ViewModel/AgendaDestination.swift +++ b/PadelClub/ViewModel/AgendaDestination.swift @@ -80,7 +80,7 @@ enum AgendaDestination: Int, CaseIterable, Identifiable, Selectable, Equatable { return nil case .tenup: if FederalDataViewModel.shared.federalTournaments.isEmpty { - return .custom(systemName: "exclamationmark.circle.fill", color: .yellow) + return .custom(systemName: "exclamationmark.circle.fill", color: .logoYellow) } else { return nil } diff --git a/PadelClub/Views/Navigation/Umpire/UmpireView.swift b/PadelClub/Views/Navigation/Umpire/UmpireView.swift index dba656e..04345a2 100644 --- a/PadelClub/Views/Navigation/Umpire/UmpireView.swift +++ b/PadelClub/Views/Navigation/Umpire/UmpireView.swift @@ -227,12 +227,12 @@ struct AccountRowView: View { LabeledContent { if Store.main.hasToken() { Text(self.userName) - } else { - Image(systemName: "exclamationmark.circle.fill") - .foregroundStyle(.master) + } else if Store.main.userName() != nil { + Image(systemName: "xmark.circle.fill") + .foregroundStyle(.logoRed) } } label: { - Label(Store.main.userName() == nil ? "Créer votre compte Padel Club" : "Mon compte", systemImage: "person.fill") + Label("Mon compte Padel Club", systemImage: "person.fill") if dataStore.user.email.isEmpty == false { Text(dataStore.user.email) } diff --git a/PadelClub/Views/Tournament/Shared/TournamentBroadcastRowView.swift b/PadelClub/Views/Tournament/Shared/TournamentBroadcastRowView.swift index d4b1ce2..cef1f5c 100644 --- a/PadelClub/Views/Tournament/Shared/TournamentBroadcastRowView.swift +++ b/PadelClub/Views/Tournament/Shared/TournamentBroadcastRowView.swift @@ -16,7 +16,7 @@ struct TournamentBroadcastRowView: View { LabeledContent { if Store.main.userId == nil { Image(systemName: "exclamationmark.circle.fill") - .foregroundStyle(.master) + .foregroundStyle(.logoYellow) } else { if tournament.isPrivate { Text("tournoi privé").foregroundStyle(.logoRed) From 99c7c1999132240e13f427f97625d77f6a8d517d Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Thu, 20 Jun 2024 19:14:20 +0200 Subject: [PATCH 3/3] fix guard --- PadelClub/Views/Subscription/Guard.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PadelClub/Views/Subscription/Guard.swift b/PadelClub/Views/Subscription/Guard.swift index 0d1fa2e..c7fc264 100644 --- a/PadelClub/Views/Subscription/Guard.swift +++ b/PadelClub/Views/Subscription/Guard.swift @@ -140,14 +140,14 @@ import LeStorage } var currentPlan: StoreItem? { -// return .monthlyUnlimited + return .monthlyUnlimited // #if DEBUG // return .monthlyUnlimited // #else - if let currentBestPlan = self.currentBestPlan, let plan = StoreItem(rawValue: currentBestPlan.productID) { - return plan - } - return nil +// if let currentBestPlan = self.currentBestPlan, let plan = StoreItem(rawValue: currentBestPlan.productID) { +// return plan +// } +// return nil // #endif }