diff --git a/PadelClub/Data/TeamRegistration.swift b/PadelClub/Data/TeamRegistration.swift index a601504..bd4b065 100644 --- a/PadelClub/Data/TeamRegistration.swift +++ b/PadelClub/Data/TeamRegistration.swift @@ -249,7 +249,7 @@ class TeamRegistration: ModelObject, Storable { } func pasteData() -> String { - [name, playersPasteData(), formattedInscriptionDate()].compactMap({ $0 }).joined(separator: "\n") + [playersPasteData(), formattedInscriptionDate(), name].compactMap({ $0 }).joined(separator: "\n") } var computedRegistrationDate: Date { diff --git a/PadelClub/Data/Tournament.swift b/PadelClub/Data/Tournament.swift index 06e87bd..59fc04e 100644 --- a/PadelClub/Data/Tournament.swift +++ b/PadelClub/Data/Tournament.swift @@ -929,7 +929,7 @@ class Tournament : ModelObject, Storable { }), let previousTeamRegistrationDate = previousPlayer.team()?.registrationDate { registrationDate = previousTeamRegistrationDate } - let newTeam = addTeam(team.players, registrationDate: registrationDate) + let newTeam = addTeam(team.players, registrationDate: registrationDate, name: team.name) teamsToImport.append(newTeam) } } @@ -1528,8 +1528,8 @@ class Tournament : ModelObject, Storable { } } - func addTeam(_ players: Set, registrationDate: Date? = nil) -> TeamRegistration { - let team = TeamRegistration(tournament: id, registrationDate: registrationDate ?? Date()) + func addTeam(_ players: Set, registrationDate: Date? = nil, name: String? = nil) -> TeamRegistration { + let team = TeamRegistration(tournament: id, registrationDate: registrationDate ?? Date(), name: name) team.setWeight(from: Array(players), inTournamentCategory: tournamentCategory) players.forEach { player in player.teamRegistration = team.id diff --git a/PadelClub/Utils/FileImportManager.swift b/PadelClub/Utils/FileImportManager.swift index 2d0a80d..e338fe7 100644 --- a/PadelClub/Utils/FileImportManager.swift +++ b/PadelClub/Utils/FileImportManager.swift @@ -103,10 +103,12 @@ class FileImportManager { let tournamentCategory: TournamentCategory let previousTeam: TeamRegistration? var registrationDate: Date? = nil + var name: String? = nil - init(players: [PlayerRegistration], tournamentCategory: TournamentCategory, previousTeam: TeamRegistration?, registrationDate: Date? = nil, tournament: Tournament) { + init(players: [PlayerRegistration], tournamentCategory: TournamentCategory, previousTeam: TeamRegistration?, registrationDate: Date? = nil, name: String? = nil, tournament: Tournament) { self.players = Set(players) self.tournamentCategory = tournamentCategory + self.name = name self.previousTeam = previousTeam if players.count < 2 { let s = players.compactMap { $0.sex?.rawValue } @@ -354,6 +356,14 @@ class FileImportManager { } return nil } + + var name: String? { + if let name = data[safe:3] { + return name + } + return nil + } + let team = TeamHolder(players: registeredPlayers, tournamentCategory: tournament.tournamentCategory, previousTeam: tournament.findTeam(registeredPlayers), registrationDate: registrationDate, tournament: tournament) results.append(team) } diff --git a/PadelClub/Utils/PadelRule.swift b/PadelClub/Utils/PadelRule.swift index 96b6250..88bc3df 100644 --- a/PadelClub/Utils/PadelRule.swift +++ b/PadelClub/Utils/PadelRule.swift @@ -787,7 +787,7 @@ enum TournamentCategory: Int, Hashable, Codable, CaseIterable, Identifiable { var playerFilterOption: PlayerFilterOption { switch self { case .men: - return .male + return .all case .women: return .female case .mix: diff --git a/PadelClub/Views/Calling/CallSettingsView.swift b/PadelClub/Views/Calling/CallSettingsView.swift index 091305c..34bd12d 100644 --- a/PadelClub/Views/Calling/CallSettingsView.swift +++ b/PadelClub/Views/Calling/CallSettingsView.swift @@ -92,6 +92,6 @@ struct CallSettingsView: View { } } -#Preview { - CallSettingsView() -} +//#Preview { +// CallSettingsView() +//} diff --git a/PadelClub/Views/Calling/Components/MenuWarningView.swift b/PadelClub/Views/Calling/Components/MenuWarningView.swift index ef6ca1b..3451ac7 100644 --- a/PadelClub/Views/Calling/Components/MenuWarningView.swift +++ b/PadelClub/Views/Calling/Components/MenuWarningView.swift @@ -105,6 +105,6 @@ struct MenuWarningView: View { } } -#Preview { - MenuWarningView(teams: [], contactType: .constant(nil)) -} +//#Preview { +// MenuWarningView(teams: [], contactType: .constant(nil)) +//} diff --git a/PadelClub/Views/Calling/GroupStageCallingView.swift b/PadelClub/Views/Calling/GroupStageCallingView.swift index 6e74ce4..a26d723 100644 --- a/PadelClub/Views/Calling/GroupStageCallingView.swift +++ b/PadelClub/Views/Calling/GroupStageCallingView.swift @@ -103,6 +103,6 @@ struct GroupStageCallingView: View { } } -#Preview { - GroupStageCallingView() -} +//#Preview { +// GroupStageCallingView() +//} diff --git a/PadelClub/Views/Calling/SeedsCallingView.swift b/PadelClub/Views/Calling/SeedsCallingView.swift index 4ce94e5..3f4a33d 100644 --- a/PadelClub/Views/Calling/SeedsCallingView.swift +++ b/PadelClub/Views/Calling/SeedsCallingView.swift @@ -113,6 +113,6 @@ struct SeedsCallingView: View { } } -#Preview { - SeedsCallingView() -} +//#Preview { +// SeedsCallingView() +//} diff --git a/PadelClub/Views/Calling/SendToAllView.swift b/PadelClub/Views/Calling/SendToAllView.swift index ec02e47..4b60117 100644 --- a/PadelClub/Views/Calling/SendToAllView.swift +++ b/PadelClub/Views/Calling/SendToAllView.swift @@ -224,6 +224,6 @@ struct SendToAllView: View { } -#Preview { - SendToAllView(addLink: true) -} +//#Preview { +// SendToAllView(addLink: true) +//} diff --git a/PadelClub/Views/Cashier/CashierSettingsView.swift b/PadelClub/Views/Cashier/CashierSettingsView.swift index e70ffb0..73bec04 100644 --- a/PadelClub/Views/Cashier/CashierSettingsView.swift +++ b/PadelClub/Views/Cashier/CashierSettingsView.swift @@ -60,6 +60,6 @@ struct CashierSettingsView: View { } } -#Preview { - CashierSettingsView(tournaments: []) -} +//#Preview { +// CashierSettingsView(tournaments: []) +//} diff --git a/PadelClub/Views/Cashier/Event/EventCreationView.swift b/PadelClub/Views/Cashier/Event/EventCreationView.swift index 3e04a56..1813470 100644 --- a/PadelClub/Views/Cashier/Event/EventCreationView.swift +++ b/PadelClub/Views/Cashier/Event/EventCreationView.swift @@ -208,7 +208,7 @@ struct EventCreationView: View { } -#Preview { - EventCreationView() - .environmentObject(DataStore.shared) -} +//#Preview { +// EventCreationView() +// .environmentObject(DataStore.shared) +//} diff --git a/PadelClub/Views/Cashier/Event/EventLinksView.swift b/PadelClub/Views/Cashier/Event/EventLinksView.swift index 1eb1358..3dcd1b1 100644 --- a/PadelClub/Views/Cashier/Event/EventLinksView.swift +++ b/PadelClub/Views/Cashier/Event/EventLinksView.swift @@ -55,6 +55,6 @@ struct EventLinksView: View { } } -#Preview { - EventLinksView(event: Event.mock()) -} +//#Preview { +// EventLinksView(event: Event.mock()) +//} diff --git a/PadelClub/Views/Club/ClubDetailView.swift b/PadelClub/Views/Club/ClubDetailView.swift index 62081e7..61c0d37 100644 --- a/PadelClub/Views/Club/ClubDetailView.swift +++ b/PadelClub/Views/Club/ClubDetailView.swift @@ -260,6 +260,6 @@ struct ClubDetailView: View { } } -#Preview { - ClubDetailView(club: Club.mock(), displayContext: .edition) -} +//#Preview { +// ClubDetailView(club: Club.mock(), displayContext: .edition) +//} diff --git a/PadelClub/Views/Club/ClubImportView.swift b/PadelClub/Views/Club/ClubImportView.swift index 8a80052..faf2099 100644 --- a/PadelClub/Views/Club/ClubImportView.swift +++ b/PadelClub/Views/Club/ClubImportView.swift @@ -34,9 +34,9 @@ struct ClubImportView: View { } } -#Preview { - ClubImportView() -} +//#Preview { +// ClubImportView() +//} /* jQuery.extend(Drupal.settings, {"basePath":"\/","pathPrefix":"","setHasJsCookie":0,"ajaxPageState":{"theme":"met","theme_token":"utLEekigHne808an7j1tJnCcET9qmvCzWWw4NgcPkZ8","jquery_version":"2.2","jquery_version_token":"scWlNljFircoQ0sImdjBmQd-ItZCEG4rYp2CfoxyMbw","css":{"modules\/system\/system.base.css":1,"misc\/ui\/jquery.ui.core.css":1,"misc\/ui\/jquery.ui.theme.css":1,"modules\/field\/theme\/field.css":1,"modules\/node\/node.css":1,"sites\/all\/modules\/contrib\/views\/css\/views.css":1,"sites\/all\/modules\/contrib\/back_to_top\/css\/back_to_top.css":1,"sites\/all\/modules\/contrib\/media\/modules\/media_wysiwyg\/css\/media_wysiwyg.base.css":1,"sites\/all\/libraries\/dynatable\/jquery.dynatable.css":1,"sites\/all\/modules\/custom\/actency_itineraire\/css\/actency_itineraire.css":1,"sites\/all\/modules\/contrib\/ctools\/css\/ctools.css":1,"sites\/all\/modules\/contrib\/video\/css\/video.css":1,"sites\/all\/modules\/contrib\/ctools\/css\/modal.css":1,"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@3.4.1\/dist\/css\/bootstrap.min.css":1,"https:\/\/cdn.jsdelivr.net\/npm\/@unicorn-fail\/drupal-bootstrap-styles@0.0.2\/dist\/3.3.1\/7.x-3.x\/drupal-bootstrap.min.css":1,"https:\/\/stackpath.bootstrapcdn.com\/font-awesome\/4.7.0\/css\/font-awesome.min.css":1,"sites\/all\/modules\/custom\/actency_background\/css\/actency_background.css":1,"sites\/all\/themes\/met\/public\/css\/met.css":1},"js":{"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@3.4.1\/dist\/js\/bootstrap.min.js":1,"sites\/all\/themes\/met\/public\/js\/club.js":1,"\/\/cdn.tagcommander.com\/3288\/tc_FFT_19.js":1,"sites\/all\/modules\/custom\/met_tagcommander\/js\/met_tagcommander.js":1,"sites\/all\/themes\/bootstrap\/js\/bootstrap.js":1,"sites\/all\/modules\/contrib\/jquery_update\/replace\/jquery\/2.2\/jquery.min.js":1,"misc\/jquery-extend-3.4.0.js":1,"misc\/jquery-html-prefilter-3.5.0-backport.js":1,"misc\/jquery.once.js":1,"misc\/drupal.js":1,"sites\/all\/modules\/contrib\/jquery_update\/js\/jquery_browser.js":1,"sites\/all\/modules\/contrib\/jquery_update\/replace\/ui\/ui\/minified\/jquery.ui.core.min.js":1,"sites\/all\/modules\/contrib\/jquery_update\/replace\/ui\/ui\/minified\/jquery.ui.effect.min.js":1,"sites\/all\/modules\/contrib\/jquery_update\/replace\/ui\/external\/jquery.cookie.js":1,"sites\/all\/modules\/contrib\/jquery_update\/replace\/jquery.form\/4\/jquery.form.min.js":1,"misc\/ajax.js":1,"sites\/all\/modules\/contrib\/jquery_update\/js\/jquery_update.js":1,"sites\/all\/modules\/custom\/actency_dynatable\/actency_dynatable.js":1,"sites\/all\/modules\/contrib\/entityreference\/js\/entityreference.js":1,"sites\/all\/modules\/contrib\/back_to_top\/js\/back_to_top.js":1,"public:\/\/languages\/fr_WZMeukhvWvW_cblXuy_3SROUpPpfX7YEK6xml2YasT8.js":1,"sites\/all\/libraries\/dynatable\/jquery.dynatable.js":1,"sites\/all\/modules\/custom\/actency_popup_message\/js\/actency_popup_message.js":1,"sites\/all\/modules\/contrib\/image_caption\/image_caption.min.js":1,"sites\/all\/modules\/contrib\/video\/js\/video.js":1,"sites\/all\/themes\/bootstrap\/js\/misc\/_progress.js":1,"sites\/all\/modules\/contrib\/ctools\/js\/modal.js":1,"sites\/all\/modules\/custom\/user_actency\/js\/user_actency.js":1,"sites\/all\/modules\/custom\/adherent\/js\/adherent_modal.js":1,"sites\/all\/modules\/custom\/met_tagcommander\/js\/met_tagcommander_vuejs.js":1,"\/\/cdn.tagcommander.com\/3288\/tc_FFT_18.js":1,"sites\/all\/modules\/custom\/tagcommander_click\/js\/tagcommander_click.js":1,"sites\/all\/modules\/custom\/actency_tournoi_favoris\/js\/actency_tournoi_favoris.js":1,"sites\/all\/themes\/met\/js\/met.js":1,"sites\/all\/themes\/bootstrap\/js\/modules\/ctools\/js\/modal.js":1,"sites\/all\/themes\/bootstrap\/js\/misc\/ajax.js":1}},"fft_club":{"fiche":{"nom":"T.C ROQUEFORT-LA-BEDOULE","labels":[{"class":"galaxie","label":"\u00c9cole de Tennis Galaxie (d\u00e8s 3 ans)"},{"class":"fauteuil","label":"Tennis Fauteuil"}]},"labelsRecompenses":[{"class":["meticon-engage","yellow"],"label":"CLUB ENGAG\u00c9","detail":"xxx"}],"description":"","installations":[{"nom":"T.C.R.B.","bgClass":"tennis","photoPrincipale":"","nbTerrainsSurfacesText":"5 terrains de 3 surfaces","adresse":"110 AV Michelangeli - 13830 ROQUEFORT-LA-BEDOULE","pratiques":[{"cssClass":"meticon-racket-tennis-inclined","label":"TENNIS","typesSurfaces":{"dur":{"cssClass":"meticon-surface-hard","natures":{"bp":{"label":"B\u00e9ton poreux","nbTerrainsSurfacesText":"2 terrains"}}},"gazon":{"cssClass":"meticon-surface-other","natures":{"gas":{"label":"Gazon synth\u00e9tique","nbTerrainsSurfacesText":"2 terrains"}}},"autre":{"cssClass":"meticon-ellipsis-v","natures":{"par":{"label":"Parquet","nbTerrainsSurfacesText":"1 terrain dont 1 couvert"}}}}}],"services":{"vestiaires":{"iconClass":"meticon-clothes","label":"Vestiaires","messageInfos":""},"parking":{"iconClass":"meticon-parking","label":"Parking","messageInfos":""},"wifi":{"iconClass":"meticon-wifi","label":"Wifi","messageInfos":"Non disponible"},"television":{"iconClass":"meticon-tv","label":"TV","messageInfos":"Non disponible"},"pmr":{"cssClass":"details-PMR","iconClass":"meticon-wheelchair","label":"Accessibilit\u00e9 PMR","listeServices":[{"class":"active","label":"DOUCHES"},{"class":"active","label":"SANITAIRES"},{"class":"active","label":"TERRAINS"},{"class":"active","label":"CLUB HOUSE"}]}},"horaires":[],"adresseUrl":"https:\/\/www.google.com\/maps\/dir\/?api=1\u0026destination=43.248363,5.585647","photoPlaceholder":"\/sites\/all\/modules\/custom\/fft_vuejs\/modules\/vuejs_club\/img\/installation_default.png"}],"enseignants":[{"diplomeCode":"BE2","fonctionCode":"DS","imageSrc":"\/sites\/all\/modules\/custom\/actency_user_picture\/images\/identification.svg","libelleDiplome":"Professeur","libelleCompletDiplome":"Brevet d\u0027Etat 2\u00e8me degr\u00e9 - Professeur","nom":"TASSARO","nomComplet":"Herv\u00e9 TASSARO","fonction":"Directeur Sportif","specialites":["Tennis sant\u00e9"]},{"diplomeCode":"DE","fonctionCode":"ETP","imageSrc":"\/sites\/all\/modules\/custom\/actency_user_picture\/images\/identification.svg","libelleDiplome":"Moniteur","libelleCompletDiplome":"Dipl\u00f4me d\u0027Etat JEPS Tennis - Moniteur","nom":"TASSARO","nomComplet":"Bastien TASSARO","fonction":"Enseignant tous publics","specialites":[]},{"diplomeCode":"DE","fonctionCode":"ETP","imageSrc":"\/sites\/all\/modules\/custom\/actency_user_picture\/images\/identification.svg","libelleDiplome":"Moniteur","libelleCompletDiplome":"Dipl\u00f4me d\u0027Etat JEPS Tennis - Moniteur","nom":"TASSARO","nomComplet":"GABRIEL TASSARO","fonction":"Enseignant tous publics","specialites":["Padel"]}],"periodes":[{"titre":"Tennis","libelle":"Jan. - F\u00e9v. - Mar. - Avr. - Mai - Juin - Juil. - Ao\u00fb. - Sep. - Oct. - Nov. - D\u00e9c."}],"equipements":[],"services":[{"iconClass":"active","label":"Service de cordage"},{"iconClass":"active","label":"Pr\u00eat de mat\u00e9riel"},{"iconClass":"active","label":"Vente de mat\u00e9riel"}],"effectifs":[{"millesime":"saison 2023 - 2024","jeune":188,"adulte":132,"femme":89,"homme":231,"total":320},{"millesime":"saison 2022 - 2023","jeune":226,"adulte":144,"femme":106,"homme":264,"total":370},{"millesime":"saison 2021 - 2022","jeune":206,"adulte":134,"femme":87,"homme":253,"total":340}],"navigation":[{"label":"Club","href":"\/club\/62130381","actif":true},{"label":"Offres","href":"\/club\/62130381\/offres","actif":false},{"label":"Comp\u00e9titions","href":"\/club\/62130381\/competitions","actif":false},{"label":"\u00c9v\u00e9nements","href":"\/club\/62130381\/evenements","actif":false}],"onglet_actif":"Club","partenaires":[],"question":{"title":"Une question ?","label":"Contactez le club pour en savoir plus.","liste":[{"class":"meticon-phone","label":"T\u00e9l\u00e9phone","infos":"0609546866"},{"class":"meticon-at","label":"Courriel","infos":"\/club\/62130381\/contact\/formulaire"},{"class":"meticon-web","label":"Site web","infos":"http:\/\/www.tc-roquefort-la-bedoule.fr\/"},{"class":"fa fa-facebook","label":"Facebook","infos":"https:\/\/www.facebook.com\/Tennis-Club-de-Roquefort-La-B\u00e9doule"}]},"facebookUrl":"https:\/\/www.facebook.com\/Tennis-Club-de-Roquefort-La-B\u00e9doule"},"vuejs_context":"clubInfo","urlImage":"https:\/\/tenup.fft.fr\/sites\/default\/files\/actency_backgrounds\/propositions_0001_02_0.png","CToolsModal":{"loadingText":"En cours de chargement...","closeText":"Fermer la fen\u00eatre","closeImage":"\u003Cimg class=\u0022img-responsive\u0022 src=\u0022https:\/\/tenup.fft.fr\/sites\/all\/modules\/contrib\/ctools\/images\/icon-close-window.png\u0022 alt=\u0022Fermer la fen\u00eatre\u0022 title=\u0022Fermer la fen\u00eatre\u0022 \/\u003E","throbber":"\u003Cimg class=\u0022img-responsive\u0022 src=\u0022https:\/\/tenup.fft.fr\/sites\/all\/modules\/contrib\/ctools\/images\/throbber.gif\u0022 alt=\u0022En cours de chargement\u0022 title=\u0022En cours de chargement...\u0022 \/\u003E"},"happy-modal-style":{"modalSize":{"type":"fixed","width":320,"max-width":360,"height":180,"addWidth":10,"addHeight":10,"contentRight":10,"contentLeft":10,"contentBottom":10,"top":0},"modalClass":"user-actency-cancel","modalOptions":{"opacity":0.6,"background-color":"#000"},"styleCss":"user_cancel_class"},"better_exposed_filters":{"views":{"partenaires":{"displays":{"block":{"filters":[]}}}}},"back_to_top":{"back_to_top_button_trigger":"100","back_to_top_button_text":"Back to top","#attached":{"library":[["system","ui"]]}},"bootstrap":{"anchorsFix":"0","anchorsSmoothScrolling":"0","formHasError":1,"popoverEnabled":1,"popoverOptions":{"animation":1,"html":0,"placement":"right","selector":"","trigger":"click","triggerAutoclose":1,"title":"","content":"","delay":0,"container":"body"},"tooltipEnabled":1,"tooltipOptions":{"animation":1,"html":0,"placement":"auto left","selector":"","trigger":"hover focus","delay":0,"container":"body"}}}); diff --git a/PadelClub/Views/Club/ClubRowView.swift b/PadelClub/Views/Club/ClubRowView.swift index 0f7f2fd..85a64ed 100644 --- a/PadelClub/Views/Club/ClubRowView.swift +++ b/PadelClub/Views/Club/ClubRowView.swift @@ -25,6 +25,6 @@ struct ClubRowView: View { } } -#Preview { - ClubRowView(club: Club.mock()) -} +//#Preview { +// ClubRowView(club: Club.mock()) +//} diff --git a/PadelClub/Views/Club/ClubSearchView.swift b/PadelClub/Views/Club/ClubSearchView.swift index 7f393d6..6ea6d9f 100644 --- a/PadelClub/Views/Club/ClubSearchView.swift +++ b/PadelClub/Views/Club/ClubSearchView.swift @@ -423,6 +423,6 @@ fileprivate extension CLPlacemark { } -#Preview { - ClubSearchView() -} +//#Preview { +// ClubSearchView() +//} diff --git a/PadelClub/Views/Club/ClubsView.swift b/PadelClub/Views/Club/ClubsView.swift index 862f897..d69825d 100644 --- a/PadelClub/Views/Club/ClubsView.swift +++ b/PadelClub/Views/Club/ClubsView.swift @@ -153,9 +153,9 @@ struct ClubsView: View { } } -#Preview { - NavigationStack { - ClubsView() - .environmentObject(DataStore.shared) - } -} +//#Preview { +// NavigationStack { +// ClubsView() +// .environmentObject(DataStore.shared) +// } +//} diff --git a/PadelClub/Views/Club/CourtView.swift b/PadelClub/Views/Club/CourtView.swift index a0df1b5..8986cc4 100644 --- a/PadelClub/Views/Club/CourtView.swift +++ b/PadelClub/Views/Club/CourtView.swift @@ -77,6 +77,6 @@ struct CourtView: View { } } -#Preview { - CourtView(court: Court.mock()) -} +//#Preview { +// CourtView(court: Court.mock()) +//} diff --git a/PadelClub/Views/Club/CreateClubView.swift b/PadelClub/Views/Club/CreateClubView.swift index 36ffa1e..d3d7d3a 100644 --- a/PadelClub/Views/Club/CreateClubView.swift +++ b/PadelClub/Views/Club/CreateClubView.swift @@ -71,7 +71,7 @@ struct CreateClubView: View { } } -#Preview { - CreateClubView(club: Club.mock()) - .environmentObject(DataStore.shared) -} +//#Preview { +// CreateClubView(club: Club.mock()) +// .environmentObject(DataStore.shared) +//} diff --git a/PadelClub/Views/Components/FortuneWheelView.swift b/PadelClub/Views/Components/FortuneWheelView.swift index abd7ece..af0b274 100644 --- a/PadelClub/Views/Components/FortuneWheelView.swift +++ b/PadelClub/Views/Components/FortuneWheelView.swift @@ -345,7 +345,7 @@ struct Triangle: Shape { } } -#Preview { - SpinDrawView(drawees: ["3", "4"], segments: ["1", "2"]) { draws in - } -} +//#Preview { +// SpinDrawView(drawees: ["3", "4"], segments: ["1", "2"]) { draws in +// } +//} diff --git a/PadelClub/Views/Components/StepperView.swift b/PadelClub/Views/Components/StepperView.swift index aac0bf7..638ec99 100644 --- a/PadelClub/Views/Components/StepperView.swift +++ b/PadelClub/Views/Components/StepperView.swift @@ -88,6 +88,6 @@ struct StepperView: View { } -#Preview { - StepperView(title: "poule", count: .constant(1)) -} +//#Preview { +// StepperView(title: "poule", count: .constant(1)) +//} diff --git a/PadelClub/Views/GroupStage/GroupStageSettingsView.swift b/PadelClub/Views/GroupStage/GroupStageSettingsView.swift index 0d902f8..13aef34 100644 --- a/PadelClub/Views/GroupStage/GroupStageSettingsView.swift +++ b/PadelClub/Views/GroupStage/GroupStageSettingsView.swift @@ -130,7 +130,7 @@ struct GroupStageSettingsView: View { } } -#Preview { - GroupStageSettingsView() - .environment(Tournament.mock()) -} +//#Preview { +// GroupStageSettingsView() +// .environment(Tournament.mock()) +//} diff --git a/PadelClub/Views/GroupStage/GroupStageView.swift b/PadelClub/Views/GroupStage/GroupStageView.swift index 8624757..4346e47 100644 --- a/PadelClub/Views/GroupStage/GroupStageView.swift +++ b/PadelClub/Views/GroupStage/GroupStageView.swift @@ -126,13 +126,12 @@ struct GroupStageView: View { } .font(.footnote) HStack { - if let teamName = team.name { - Text(teamName).font(.title) - } else { - VStack(alignment: .leading) { - ForEach(team.players()) { player in - Text(player.playerLabel()).lineLimit(1) - } + VStack(alignment: .leading) { + if let teamName = team.name { + Text(teamName).foregroundStyle(.secondary) + } + ForEach(team.players()) { player in + Text(player.playerLabel()).lineLimit(1) } } Spacer() diff --git a/PadelClub/Views/GroupStage/Shared/GroupStageTeamReplacementView.swift b/PadelClub/Views/GroupStage/Shared/GroupStageTeamReplacementView.swift index 7a6d41f..5c1b8f2 100644 --- a/PadelClub/Views/GroupStage/Shared/GroupStageTeamReplacementView.swift +++ b/PadelClub/Views/GroupStage/Shared/GroupStageTeamReplacementView.swift @@ -156,6 +156,6 @@ struct GroupStageTeamReplacementView: View { } } -#Preview { - GroupStageTeamReplacementView(team: TeamRegistration.mock()) -} +//#Preview { +// GroupStageTeamReplacementView(team: TeamRegistration.mock()) +//} diff --git a/PadelClub/Views/Match/Components/MatchTeamDetailView.swift b/PadelClub/Views/Match/Components/MatchTeamDetailView.swift index b5fb3dd..1ecdc93 100644 --- a/PadelClub/Views/Match/Components/MatchTeamDetailView.swift +++ b/PadelClub/Views/Match/Components/MatchTeamDetailView.swift @@ -40,6 +40,6 @@ struct MatchTeamDetailView: View { } -#Preview { - MatchTeamDetailView(match: Match.mock()) -} +//#Preview { +// MatchTeamDetailView(match: Match.mock()) +//} diff --git a/PadelClub/Views/Match/Components/PlayerBlockView.swift b/PadelClub/Views/Match/Components/PlayerBlockView.swift index 330797d..c5a6791 100644 --- a/PadelClub/Views/Match/Components/PlayerBlockView.swift +++ b/PadelClub/Views/Match/Components/PlayerBlockView.swift @@ -57,12 +57,18 @@ struct PlayerBlockView: View { Text("Repêchée").italic().font(.caption) } + if let name = team?.name { + Text(name).foregroundStyle(.secondary) + } ForEach(names, id: \.self) { name in Text(name).lineLimit(1) } } else { ZStack(alignment: .leading) { VStack { + if let name = team?.name { + Text(name).foregroundStyle(.secondary) + } Text("longLabelPlayerOne").lineLimit(1) Text("longLabelPlayerTwo").lineLimit(1) } diff --git a/PadelClub/Views/Match/MatchDetailView.swift b/PadelClub/Views/Match/MatchDetailView.swift index 62c86f3..79e1cc7 100644 --- a/PadelClub/Views/Match/MatchDetailView.swift +++ b/PadelClub/Views/Match/MatchDetailView.swift @@ -451,6 +451,6 @@ struct MatchDetailView: View { } } -#Preview { - MatchDetailView(match: Match.mock(), matchViewStyle: .standardStyle) -} +//#Preview { +// MatchDetailView(match: Match.mock(), matchViewStyle: .standardStyle) +//} diff --git a/PadelClub/Views/Match/MatchRowView.swift b/PadelClub/Views/Match/MatchRowView.swift index 6d5dda4..e27e585 100644 --- a/PadelClub/Views/Match/MatchRowView.swift +++ b/PadelClub/Views/Match/MatchRowView.swift @@ -64,6 +64,6 @@ struct MatchRowView: View { } -#Preview { - MatchRowView(match: Match.mock(), matchViewStyle: .standardStyle) -} +//#Preview { +// MatchRowView(match: Match.mock(), matchViewStyle: .standardStyle) +//} diff --git a/PadelClub/Views/Match/MatchSetupView.swift b/PadelClub/Views/Match/MatchSetupView.swift index 11f1410..4031257 100644 --- a/PadelClub/Views/Match/MatchSetupView.swift +++ b/PadelClub/Views/Match/MatchSetupView.swift @@ -171,7 +171,7 @@ struct MatchSetupView: View { } } -#Preview { - MatchSetupView(match: Match.mock()) - .environmentObject(DataStore.shared) -} +//#Preview { +// MatchSetupView(match: Match.mock()) +// .environmentObject(DataStore.shared) +//} diff --git a/PadelClub/Views/Match/MatchSummaryView.swift b/PadelClub/Views/Match/MatchSummaryView.swift index 8efbdf4..7c0529d 100644 --- a/PadelClub/Views/Match/MatchSummaryView.swift +++ b/PadelClub/Views/Match/MatchSummaryView.swift @@ -99,6 +99,6 @@ struct MatchSummaryView: View { } } -#Preview { - MatchSummaryView(match: Match.mock(), matchViewStyle: .standardStyle) -} +//#Preview { +// MatchSummaryView(match: Match.mock(), matchViewStyle: .standardStyle) +//} diff --git a/PadelClub/Views/Navigation/Agenda/ActivityView.swift b/PadelClub/Views/Navigation/Agenda/ActivityView.swift index 33adcab..1395a8b 100644 --- a/PadelClub/Views/Navigation/Agenda/ActivityView.swift +++ b/PadelClub/Views/Navigation/Agenda/ActivityView.swift @@ -21,6 +21,18 @@ struct ActivityView: View { @State private var error: Error? @State private var uuid: UUID = UUID() @State private var presentClubSearchView: Bool = false + @State private var quickAccessScreen: QuickAccessScreen? = nil + + enum QuickAccessScreen : Identifiable, Hashable { + case inscription(pasteString: String) + + var id: String { + switch self { + case .inscription: + return "inscription" + } + } + } var runningTournaments: [FederalTournamentHolder] { dataStore.tournaments.filter({ $0.endDate == nil }) @@ -60,27 +72,15 @@ struct ActivityView: View { @ViewBuilder private func _pasteView() -> some View { - if UIPasteboard.general.hasStrings { - // Enable string-related control... - if let string = UIPasteboard.general.string { - // use the string here - Section { - Menu("Utiliser le contenu du presse-papier") { - Section { - ForEach(getRunningTournaments()) { tournament in - Button(tournament.tournamentTitle()) { - navigation.path.append(tournament) - tournament.navigationPath = [Screen.inscription] - } - } - } header: { - Text("coller dans") - } - } - } - } + PasteButton(payloadType: String.self) { strings in + guard let first = strings.first else { return } + quickAccessScreen = .inscription(pasteString: first) } + .foregroundStyle(.master) + .labelStyle(.iconOnly) + .buttonBorderShape(.capsule) } + var body: some View { @Bindable var navigation = navigation NavigationStack(path: $navigation.path) { @@ -90,7 +90,6 @@ struct ActivityView: View { List { switch navigation.agendaDestination! { case .activity: - _pasteView() EventListView(tournaments: runningTournaments, viewStyle: viewStyle, sortAscending: true) case .history: EventListView(tournaments: endedTournaments, viewStyle: viewStyle, sortAscending: false) @@ -196,6 +195,8 @@ struct ActivityView: View { .frame(minHeight: 28) } .symbolVariant(federalDataViewModel.areFiltersEnabled() ? .fill : .none) + + _pasteView() } ToolbarItem(placement: .topBarTrailing) { @@ -231,6 +232,46 @@ struct ActivityView: View { } } } + .sheet(item: $quickAccessScreen) { screen in + switch screen { + case .inscription(let pasteString): + NavigationStack { + List { + Section { + Text(pasteString) + } header: { + Text("Contenu du presse-papier") + } + + Section { + ForEach(getRunningTournaments()) { tournament in + NavigationLink { + InscriptionManagerView(tournament: tournament, pasteString: pasteString) + .environment(tournament) + } label: { + VStack(alignment: .leading) { + Text(tournament.tournamentTitle()) + Text(tournament.formattedDate()).foregroundStyle(.secondary) + } + } + } + } header: { + Text("À coller dans la liste d'inscription") + } + } + .toolbar { + ToolbarItem(placement: .topBarLeading) { + Button("Fermer") { + self.quickAccessScreen = nil + } + } + } + .navigationTitle("Choix du tournoi") + .navigationBarTitleDisplayMode(.inline) + .toolbarBackground(.visible, for: .navigationBar) + } + } + } } private func _gatherFederalTournaments() { @@ -323,6 +364,6 @@ struct ActivityView: View { } -#Preview { - ActivityView() -} +//#Preview { +// ActivityView() +//} diff --git a/PadelClub/Views/Navigation/Agenda/CalendarView.swift b/PadelClub/Views/Navigation/Agenda/CalendarView.swift index a7740de..a39f63f 100644 --- a/PadelClub/Views/Navigation/Agenda/CalendarView.swift +++ b/PadelClub/Views/Navigation/Agenda/CalendarView.swift @@ -176,6 +176,6 @@ struct CalendarView: View { } -#Preview { - CalendarView(date: .now, tournaments: []) -} +//#Preview { +// CalendarView(date: .now, tournaments: []) +//} diff --git a/PadelClub/Views/Navigation/Agenda/EventListView.swift b/PadelClub/Views/Navigation/Agenda/EventListView.swift index 7adadb5..2520186 100644 --- a/PadelClub/Views/Navigation/Agenda/EventListView.swift +++ b/PadelClub/Views/Navigation/Agenda/EventListView.swift @@ -118,6 +118,6 @@ struct EventListView: View { } -#Preview { - EventListView(tournaments: [], viewStyle: .calendar, sortAscending: true) -} +//#Preview { +// EventListView(tournaments: [], viewStyle: .calendar, sortAscending: true) +//} diff --git a/PadelClub/Views/Navigation/MainView.swift b/PadelClub/Views/Navigation/MainView.swift index 4ce48f1..672eb17 100644 --- a/PadelClub/Views/Navigation/MainView.swift +++ b/PadelClub/Views/Navigation/MainView.swift @@ -165,6 +165,6 @@ struct MainView: View { } } -#Preview { - MainView() -} +//#Preview { +// MainView() +//} diff --git a/PadelClub/Views/Navigation/Ongoing/OngoingView.swift b/PadelClub/Views/Navigation/Ongoing/OngoingView.swift index 4e4f865..1120c62 100644 --- a/PadelClub/Views/Navigation/Ongoing/OngoingView.swift +++ b/PadelClub/Views/Navigation/Ongoing/OngoingView.swift @@ -103,6 +103,6 @@ struct OngoingView: View { } } -#Preview { - OngoingView() -} +//#Preview { +// OngoingView() +//} diff --git a/PadelClub/Views/Navigation/Organizer/TournamentOrganizerView.swift b/PadelClub/Views/Navigation/Organizer/TournamentOrganizerView.swift index 44a4699..cd028a4 100644 --- a/PadelClub/Views/Navigation/Organizer/TournamentOrganizerView.swift +++ b/PadelClub/Views/Navigation/Organizer/TournamentOrganizerView.swift @@ -50,6 +50,6 @@ struct TournamentOrganizerView: View { } } -#Preview { - TournamentOrganizerView() -} +//#Preview { +// TournamentOrganizerView() +//} diff --git a/PadelClub/Views/Navigation/Toolbox/APICallsListView.swift b/PadelClub/Views/Navigation/Toolbox/APICallsListView.swift index 4700e81..1cb241d 100644 --- a/PadelClub/Views/Navigation/Toolbox/APICallsListView.swift +++ b/PadelClub/Views/Navigation/Toolbox/APICallsListView.swift @@ -38,6 +38,6 @@ struct APICallsView: View { } } -#Preview { - APICallsListView() -} +//#Preview { +// APICallsListView() +//} diff --git a/PadelClub/Views/Navigation/Toolbox/DebugSettingsView.swift b/PadelClub/Views/Navigation/Toolbox/DebugSettingsView.swift index 1258d24..1cb74a8 100644 --- a/PadelClub/Views/Navigation/Toolbox/DebugSettingsView.swift +++ b/PadelClub/Views/Navigation/Toolbox/DebugSettingsView.swift @@ -45,6 +45,6 @@ struct DebugSettingsView: View { } } -#Preview { - DebugSettingsView() -} +//#Preview { +// DebugSettingsView() +//} diff --git a/PadelClub/Views/Navigation/Toolbox/DurationSettingsView.swift b/PadelClub/Views/Navigation/Toolbox/DurationSettingsView.swift index 1af446c..8dd7fc4 100644 --- a/PadelClub/Views/Navigation/Toolbox/DurationSettingsView.swift +++ b/PadelClub/Views/Navigation/Toolbox/DurationSettingsView.swift @@ -20,6 +20,6 @@ struct DurationSettingsView: View { } } -#Preview { - DurationSettingsView() -} +//#Preview { +// DurationSettingsView() +//} diff --git a/PadelClub/Views/Navigation/Toolbox/ToolboxView.swift b/PadelClub/Views/Navigation/Toolbox/ToolboxView.swift index 19985c8..8a7a5c7 100644 --- a/PadelClub/Views/Navigation/Toolbox/ToolboxView.swift +++ b/PadelClub/Views/Navigation/Toolbox/ToolboxView.swift @@ -123,6 +123,6 @@ struct ToolboxView: View { } } -#Preview { - ToolboxView() -} +//#Preview { +// ToolboxView() +//} diff --git a/PadelClub/Views/Navigation/Umpire/PadelClubView.swift b/PadelClub/Views/Navigation/Umpire/PadelClubView.swift index 59e97bd..b55ccb5 100644 --- a/PadelClub/Views/Navigation/Umpire/PadelClubView.swift +++ b/PadelClub/Views/Navigation/Umpire/PadelClubView.swift @@ -239,6 +239,6 @@ struct PadelClubView: View { } } -#Preview { - PadelClubView() -} +//#Preview { +// PadelClubView() +//} diff --git a/PadelClub/Views/Navigation/Umpire/UmpireView.swift b/PadelClub/Views/Navigation/Umpire/UmpireView.swift index 15303e1..ff46754 100644 --- a/PadelClub/Views/Navigation/Umpire/UmpireView.swift +++ b/PadelClub/Views/Navigation/Umpire/UmpireView.swift @@ -240,6 +240,6 @@ struct AccountRowView: View { } } -#Preview { - UmpireView() -} +//#Preview { +// UmpireView() +//} diff --git a/PadelClub/Views/Planning/CourtAvailabilitySettingsView.swift b/PadelClub/Views/Planning/CourtAvailabilitySettingsView.swift index 2f55b8a..10733b2 100644 --- a/PadelClub/Views/Planning/CourtAvailabilitySettingsView.swift +++ b/PadelClub/Views/Planning/CourtAvailabilitySettingsView.swift @@ -198,6 +198,6 @@ struct CourtPicker: View { } } -#Preview { - CourtAvailabilitySettingsView(event: Event.mock()) -} +//#Preview { +// CourtAvailabilitySettingsView(event: Event.mock()) +//} diff --git a/PadelClub/Views/Planning/GroupStageScheduleEditorView.swift b/PadelClub/Views/Planning/GroupStageScheduleEditorView.swift index 0ceeec7..597edbe 100644 --- a/PadelClub/Views/Planning/GroupStageScheduleEditorView.swift +++ b/PadelClub/Views/Planning/GroupStageScheduleEditorView.swift @@ -36,6 +36,6 @@ struct GroupStageScheduleEditorView: View { } } -#Preview { - GroupStageScheduleEditorView(groupStage: GroupStage.mock(), tournament: Tournament.mock()) -} +//#Preview { +// GroupStageScheduleEditorView(groupStage: GroupStage.mock(), tournament: Tournament.mock()) +//} diff --git a/PadelClub/Views/Planning/MatchScheduleEditorView.swift b/PadelClub/Views/Planning/MatchScheduleEditorView.swift index 6edf190..4bd86f6 100644 --- a/PadelClub/Views/Planning/MatchScheduleEditorView.swift +++ b/PadelClub/Views/Planning/MatchScheduleEditorView.swift @@ -37,6 +37,6 @@ struct MatchScheduleEditorView: View { } } -#Preview { - MatchScheduleEditorView(match: Match.mock(), tournament: Tournament.mock()) -} +//#Preview { +// MatchScheduleEditorView(match: Match.mock(), tournament: Tournament.mock()) +//} diff --git a/PadelClub/Views/Planning/PlanningSettingsView.swift b/PadelClub/Views/Planning/PlanningSettingsView.swift index e09ec60..45223f6 100644 --- a/PadelClub/Views/Planning/PlanningSettingsView.swift +++ b/PadelClub/Views/Planning/PlanningSettingsView.swift @@ -252,6 +252,6 @@ struct PlanningSettingsView: View { } } -#Preview { - PlanningSettingsView(tournament: Tournament.mock()) -} +//#Preview { +// PlanningSettingsView(tournament: Tournament.mock()) +//} diff --git a/PadelClub/Views/Planning/PlanningView.swift b/PadelClub/Views/Planning/PlanningView.swift index 80565f8..b6fb138 100644 --- a/PadelClub/Views/Planning/PlanningView.swift +++ b/PadelClub/Views/Planning/PlanningView.swift @@ -98,6 +98,6 @@ struct PlanningView: View { } } -#Preview { - PlanningView(matches: [], selectedScheduleDestination: .constant(nil)) -} +//#Preview { +// PlanningView(matches: [], selectedScheduleDestination: .constant(nil)) +//} diff --git a/PadelClub/Views/Planning/RoundScheduleEditorView.swift b/PadelClub/Views/Planning/RoundScheduleEditorView.swift index ef94726..8b8d6e8 100644 --- a/PadelClub/Views/Planning/RoundScheduleEditorView.swift +++ b/PadelClub/Views/Planning/RoundScheduleEditorView.swift @@ -69,6 +69,6 @@ struct RoundScheduleEditorView: View { } } -#Preview { - RoundScheduleEditorView(round: Round.mock(), tournament: Tournament.mock()) -} +//#Preview { +// RoundScheduleEditorView(round: Round.mock(), tournament: Tournament.mock()) +//} diff --git a/PadelClub/Views/Planning/SchedulerView.swift b/PadelClub/Views/Planning/SchedulerView.swift index da758fc..924720d 100644 --- a/PadelClub/Views/Planning/SchedulerView.swift +++ b/PadelClub/Views/Planning/SchedulerView.swift @@ -181,6 +181,6 @@ struct SchedulerView: View { } } -#Preview { - SchedulerView(tournament: Tournament.mock(), destination: .scheduleBracket) -} +//#Preview { +// SchedulerView(tournament: Tournament.mock(), destination: .scheduleBracket) +//} diff --git a/PadelClub/Views/Player/Components/PlayerPopoverView.swift b/PadelClub/Views/Player/Components/PlayerPopoverView.swift index 3ceb4a4..55ff56c 100644 --- a/PadelClub/Views/Player/Components/PlayerPopoverView.swift +++ b/PadelClub/Views/Player/Components/PlayerPopoverView.swift @@ -257,8 +257,8 @@ struct PlayerPopoverView: View { } -#Preview { - PlayerPopoverView(source: "Razmig Sarkissian", sex: 1) { player in - - } -} +//#Preview { +// PlayerPopoverView(source: "Razmig Sarkissian", sex: 1) { player in +// +// } +//} diff --git a/PadelClub/Views/Player/Components/PlayerSexPickerView.swift b/PadelClub/Views/Player/Components/PlayerSexPickerView.swift index 09e8989..fa4e53f 100644 --- a/PadelClub/Views/Player/Components/PlayerSexPickerView.swift +++ b/PadelClub/Views/Player/Components/PlayerSexPickerView.swift @@ -49,7 +49,7 @@ struct PlayerSexPickerView: View { } -#Preview { - PlayerSexPickerView(player: PlayerRegistration.mock()) - .environment(Tournament.mock()) -} +//#Preview { +// PlayerSexPickerView(player: PlayerRegistration.mock()) +// .environment(Tournament.mock()) +//} diff --git a/PadelClub/Views/Player/PlayerDetailView.swift b/PadelClub/Views/Player/PlayerDetailView.swift index bb03bb0..33d8f00 100644 --- a/PadelClub/Views/Player/PlayerDetailView.swift +++ b/PadelClub/Views/Player/PlayerDetailView.swift @@ -122,6 +122,6 @@ struct PlayerDetailView: View { } } -#Preview { - PlayerDetailView(player: PlayerRegistration.mock()) -} +//#Preview { +// PlayerDetailView(player: PlayerRegistration.mock()) +//} diff --git a/PadelClub/Views/Player/PlayerView.swift b/PadelClub/Views/Player/PlayerView.swift index 8486d84..98afc1f 100644 --- a/PadelClub/Views/Player/PlayerView.swift +++ b/PadelClub/Views/Player/PlayerView.swift @@ -28,6 +28,6 @@ struct PlayerView: View { } } -#Preview { - PlayerView(player: PlayerRegistration.mock()) -} +//#Preview { +// PlayerView(player: PlayerRegistration.mock()) +//} diff --git a/PadelClub/Views/Round/LoserRoundSettingsView.swift b/PadelClub/Views/Round/LoserRoundSettingsView.swift index e254e6a..21824f2 100644 --- a/PadelClub/Views/Round/LoserRoundSettingsView.swift +++ b/PadelClub/Views/Round/LoserRoundSettingsView.swift @@ -26,6 +26,6 @@ struct LoserRoundSettingsView: View { } } -#Preview { - LoserRoundSettingsView() -} +//#Preview { +// LoserRoundSettingsView() +//} diff --git a/PadelClub/Views/Round/RoundSettingsView.swift b/PadelClub/Views/Round/RoundSettingsView.swift index cd1b35f..51b87dc 100644 --- a/PadelClub/Views/Round/RoundSettingsView.swift +++ b/PadelClub/Views/Round/RoundSettingsView.swift @@ -132,8 +132,8 @@ struct RoundSettingsView: View { } } -#Preview { - RoundSettingsView() - .environment(Tournament.mock()) - .environmentObject(DataStore.shared) -} +//#Preview { +// RoundSettingsView() +// .environment(Tournament.mock()) +// .environmentObject(DataStore.shared) +//} diff --git a/PadelClub/Views/Round/RoundView.swift b/PadelClub/Views/Round/RoundView.swift index 6231590..ee0d1d5 100644 --- a/PadelClub/Views/Round/RoundView.swift +++ b/PadelClub/Views/Round/RoundView.swift @@ -328,7 +328,7 @@ struct RoundView: View { } } -#Preview { - RoundView(round: Round.mock()) - .environment(Tournament.mock()) -} +//#Preview { +// RoundView(round: Round.mock()) +// .environment(Tournament.mock()) +//} diff --git a/PadelClub/Views/Round/RoundsView.swift b/PadelClub/Views/Round/RoundsView.swift index e1fbacc..1647906 100644 --- a/PadelClub/Views/Round/RoundsView.swift +++ b/PadelClub/Views/Round/RoundsView.swift @@ -43,6 +43,6 @@ struct RoundsView: View { } } -#Preview { - RoundsView(tournament: Tournament.mock()) -} +//#Preview { +// RoundsView(tournament: Tournament.mock()) +//} diff --git a/PadelClub/Views/Shared/MatchFormatPickerView.swift b/PadelClub/Views/Shared/MatchFormatPickerView.swift index fadefd0..8004386 100644 --- a/PadelClub/Views/Shared/MatchFormatPickerView.swift +++ b/PadelClub/Views/Shared/MatchFormatPickerView.swift @@ -50,8 +50,8 @@ struct MatchFormatPickerView: View { } -#Preview { - List { - MatchFormatPickerView(headerLabel: "Test", matchFormat: .constant(MatchFormat.superTie)) - } -} +//#Preview { +// List { +// MatchFormatPickerView(headerLabel: "Test", matchFormat: .constant(MatchFormat.superTie)) +// } +//} diff --git a/PadelClub/Views/Shared/TournamentFilterView.swift b/PadelClub/Views/Shared/TournamentFilterView.swift index 91d2455..000b035 100644 --- a/PadelClub/Views/Shared/TournamentFilterView.swift +++ b/PadelClub/Views/Shared/TournamentFilterView.swift @@ -145,6 +145,6 @@ struct TournamentFilterView: View { } } -#Preview { - TournamentFilterView(federalDataViewModel: FederalDataViewModel()) -} +//#Preview { +// TournamentFilterView(federalDataViewModel: FederalDataViewModel()) +//} diff --git a/PadelClub/Views/Subscription/PurchaseListView.swift b/PadelClub/Views/Subscription/PurchaseListView.swift index 1420176..b9960f1 100644 --- a/PadelClub/Views/Subscription/PurchaseListView.swift +++ b/PadelClub/Views/Subscription/PurchaseListView.swift @@ -116,6 +116,6 @@ struct PurchaseView: View { } } -#Preview { - PurchaseListView() -} +//#Preview { +// PurchaseListView() +//} diff --git a/PadelClub/Views/Subscription/SubscriptionInfoView.swift b/PadelClub/Views/Subscription/SubscriptionInfoView.swift index 81e3fb3..4566f43 100644 --- a/PadelClub/Views/Subscription/SubscriptionInfoView.swift +++ b/PadelClub/Views/Subscription/SubscriptionInfoView.swift @@ -52,6 +52,6 @@ struct NoPaymentTip: Tip { } } -#Preview { - SubscriptionInfoView(payment: .free) -} +//#Preview { +// SubscriptionInfoView(payment: .free) +//} diff --git a/PadelClub/Views/Subscription/SubscriptionView.swift b/PadelClub/Views/Subscription/SubscriptionView.swift index 37b8ece..23f2b67 100644 --- a/PadelClub/Views/Subscription/SubscriptionView.swift +++ b/PadelClub/Views/Subscription/SubscriptionView.swift @@ -398,12 +398,12 @@ fileprivate struct SubscriptionDetailView: View { } -#Preview { - SubscriptionDetailView() -} +//#Preview { +// SubscriptionDetailView() +//} -#Preview { - NavigationStack { - SubscriptionView(isPresented: .constant(true), showLackOfPlanMessage: false) - } -} +//#Preview { +// NavigationStack { +// SubscriptionView(isPresented: .constant(true), showLackOfPlanMessage: false) +// } +//} diff --git a/PadelClub/Views/Team/Components/TeamHeaderView.swift b/PadelClub/Views/Team/Components/TeamHeaderView.swift index 32dfb0f..1edf316 100644 --- a/PadelClub/Views/Team/Components/TeamHeaderView.swift +++ b/PadelClub/Views/Team/Components/TeamHeaderView.swift @@ -26,6 +26,12 @@ struct TeamHeaderView: View { Text("Poids").font(.caption) Text(team.weight.formatted()) } + if let name = team.name { + VStack(alignment: .leading, spacing: 0) { + Text("Nom de l'équipe").font(.caption) + Text(name) + } + } } Spacer() VStack(alignment: .trailing, spacing: 0) { @@ -45,6 +51,6 @@ struct TeamHeaderView: View { } } -#Preview { - TeamHeaderView(team: TeamRegistration.mock(), teamIndex: 1, tournament: nil) -} +//#Preview { +// TeamHeaderView(team: TeamRegistration.mock(), teamIndex: 1, tournament: nil) +//} diff --git a/PadelClub/Views/Team/Components/TeamWeightView.swift b/PadelClub/Views/Team/Components/TeamWeightView.swift index deb2c3b..9840490 100644 --- a/PadelClub/Views/Team/Components/TeamWeightView.swift +++ b/PadelClub/Views/Team/Components/TeamWeightView.swift @@ -39,6 +39,6 @@ struct TeamWeightView: View { } } -#Preview { - TeamWeightView(team: TeamRegistration.mock(), teamPosition: .one) -} +//#Preview { +// TeamWeightView(team: TeamRegistration.mock(), teamPosition: .one) +//} diff --git a/PadelClub/Views/Team/EditingTeamView.swift b/PadelClub/Views/Team/EditingTeamView.swift index a42b4af..0612876 100644 --- a/PadelClub/Views/Team/EditingTeamView.swift +++ b/PadelClub/Views/Team/EditingTeamView.swift @@ -12,14 +12,34 @@ struct EditingTeamView: View { @EnvironmentObject var dataStore: DataStore var team: TeamRegistration @State private var registrationDate : Date + @State private var name: String init(team: TeamRegistration) { self.team = team + _name = .init(wrappedValue: team.name ?? "") _registrationDate = State(wrappedValue: team.registrationDate ?? Date()) } var body: some View { List { + Section { + TextField("Nom de l'équipe", text: $name) + .autocorrectionDisabled() + .keyboardType(.alphabet) + .frame(maxWidth: .infinity) + .submitLabel(.done) + .onSubmit(of: .text) { + let trimmed = name.trimmed + if trimmed.isEmpty { + team.name = nil + } else { + team.name = trimmed + } + + _save() + } + + } Section { DatePicker(registrationDate.formatted(.dateTime.weekday()), selection: $registrationDate) } header: { @@ -61,6 +81,6 @@ struct EditingTeamView: View { } } -#Preview { - EditingTeamView(team: TeamRegistration.mock()) -} +//#Preview { +// EditingTeamView(team: TeamRegistration.mock()) +//} diff --git a/PadelClub/Views/Team/TeamDetailView.swift b/PadelClub/Views/Team/TeamDetailView.swift index 8325fc2..2131e41 100644 --- a/PadelClub/Views/Team/TeamDetailView.swift +++ b/PadelClub/Views/Team/TeamDetailView.swift @@ -28,6 +28,6 @@ struct TeamDetailView: View { } } -#Preview { - TeamDetailView(team: TeamRegistration.mock()) -} +//#Preview { +// TeamDetailView(team: TeamRegistration.mock()) +//} diff --git a/PadelClub/Views/Team/TeamPickerView.swift b/PadelClub/Views/Team/TeamPickerView.swift index 9f93b05..b4d6ab8 100644 --- a/PadelClub/Views/Team/TeamPickerView.swift +++ b/PadelClub/Views/Team/TeamPickerView.swift @@ -89,10 +89,10 @@ struct TeamPickerView: View { } } -#Preview { - TeamPickerView(teamPicked: { team in - }) - .environment(Tournament.mock()) - .environmentObject(DataStore.shared) - -} +//#Preview { +// TeamPickerView(teamPicked: { team in +// }) +// .environment(Tournament.mock()) +// .environmentObject(DataStore.shared) +// +//} diff --git a/PadelClub/Views/Team/TeamRowView.swift b/PadelClub/Views/Team/TeamRowView.swift index 48ade73..e9c97bb 100644 --- a/PadelClub/Views/Team/TeamRowView.swift +++ b/PadelClub/Views/Team/TeamRowView.swift @@ -17,6 +17,9 @@ struct TeamRowView: View { TeamWeightView(team: team, teamPosition: teamPosition) } label: { VStack(alignment: .leading) { + if let name = team.name { + Text(name).foregroundStyle(.secondary) + } ForEach(team.players()) { player in Text(player.playerLabel()) } @@ -31,6 +34,6 @@ struct TeamRowView: View { } } -#Preview { - TeamRowView(team: TeamRegistration.mock()) -} +//#Preview { +// TeamRowView(team: TeamRegistration.mock()) +//} diff --git a/PadelClub/Views/Tournament/FileImportView.swift b/PadelClub/Views/Tournament/FileImportView.swift index 87cafe6..2f918ed 100644 --- a/PadelClub/Views/Tournament/FileImportView.swift +++ b/PadelClub/Views/Tournament/FileImportView.swift @@ -215,6 +215,13 @@ struct FileImportView: View { .navigationTitle("Importation") .navigationBarTitleDisplayMode(.large) .toolbar { + ToolbarItem(placement: .bottomBar) { + PasteButton(payloadType: String.self) { strings in + guard let string = strings.first else { return } + fileContent = string + fileProvider = .padelClub + } + } ToolbarItem(placement: .cancellationAction) { Button("Annuler", role: .cancel) { dismiss() @@ -315,10 +322,10 @@ struct FileImportView: View { } } -#Preview { - FileImportView() - .environment(Tournament.mock()) -} +//#Preview { +// FileImportView() +// .environment(Tournament.mock()) +//} enum TeamImportStrategy: CaseIterable { case notFoundAreWalkOut diff --git a/PadelClub/Views/Tournament/Screen/BroadcastView.swift b/PadelClub/Views/Tournament/Screen/BroadcastView.swift index 3542a95..252be48 100644 --- a/PadelClub/Views/Tournament/Screen/BroadcastView.swift +++ b/PadelClub/Views/Tournament/Screen/BroadcastView.swift @@ -373,6 +373,6 @@ struct BroadcastView: View { } -#Preview { - BroadcastView() -} +//#Preview { +// BroadcastView() +//} diff --git a/PadelClub/Views/Tournament/Screen/Components/InscriptionInfoView.swift b/PadelClub/Views/Tournament/Screen/Components/InscriptionInfoView.swift index bc0710e..80fc68b 100644 --- a/PadelClub/Views/Tournament/Screen/Components/InscriptionInfoView.swift +++ b/PadelClub/Views/Tournament/Screen/Components/InscriptionInfoView.swift @@ -216,7 +216,7 @@ struct InscriptionInfoView: View { } } -#Preview { - InscriptionInfoView() - .environment(Tournament.mock()) -} +//#Preview { +// InscriptionInfoView() +// .environment(Tournament.mock()) +//} diff --git a/PadelClub/Views/Tournament/Screen/Components/TournamentClubSettingsView.swift b/PadelClub/Views/Tournament/Screen/Components/TournamentClubSettingsView.swift index 2cf4816..0ab2809 100644 --- a/PadelClub/Views/Tournament/Screen/Components/TournamentClubSettingsView.swift +++ b/PadelClub/Views/Tournament/Screen/Components/TournamentClubSettingsView.swift @@ -120,6 +120,6 @@ struct TournamentClubSettingsView: View { } } -#Preview { - TournamentClubSettingsView() -} +//#Preview { +// TournamentClubSettingsView() +//} diff --git a/PadelClub/Views/Tournament/Screen/Components/TournamentDurationManagerView.swift b/PadelClub/Views/Tournament/Screen/Components/TournamentDurationManagerView.swift index 93bbe59..aded23e 100644 --- a/PadelClub/Views/Tournament/Screen/Components/TournamentDurationManagerView.swift +++ b/PadelClub/Views/Tournament/Screen/Components/TournamentDurationManagerView.swift @@ -21,7 +21,7 @@ struct TournamentDurationManagerView: View { } } -#Preview { - TournamentDurationManagerView() - .environment(Tournament.mock()) -} +//#Preview { +// TournamentDurationManagerView() +// .environment(Tournament.mock()) +//} diff --git a/PadelClub/Views/Tournament/Screen/Components/TournamentFieldsManagerView.swift b/PadelClub/Views/Tournament/Screen/Components/TournamentFieldsManagerView.swift index 4faa4e1..512288e 100644 --- a/PadelClub/Views/Tournament/Screen/Components/TournamentFieldsManagerView.swift +++ b/PadelClub/Views/Tournament/Screen/Components/TournamentFieldsManagerView.swift @@ -22,7 +22,7 @@ struct TournamentFieldsManagerView: View { } } -#Preview { - TournamentFieldsManagerView(localizedStringKey: "test", count: .constant(2), max: 10) - .environment(Tournament.mock()) -} +//#Preview { +// TournamentFieldsManagerView(localizedStringKey: "test", count: .constant(2), max: 10) +// .environment(Tournament.mock()) +//} diff --git a/PadelClub/Views/Tournament/Screen/Components/TournamentMatchFormatsSettingsView.swift b/PadelClub/Views/Tournament/Screen/Components/TournamentMatchFormatsSettingsView.swift index 543d536..bfa628a 100644 --- a/PadelClub/Views/Tournament/Screen/Components/TournamentMatchFormatsSettingsView.swift +++ b/PadelClub/Views/Tournament/Screen/Components/TournamentMatchFormatsSettingsView.swift @@ -116,6 +116,6 @@ struct TournamentMatchFormatsSettingsView: View { } } -#Preview { - TournamentMatchFormatsSettingsView() -} +//#Preview { +// TournamentMatchFormatsSettingsView() +//} diff --git a/PadelClub/Views/Tournament/Screen/Components/TournamentStatusView.swift b/PadelClub/Views/Tournament/Screen/Components/TournamentStatusView.swift index 3796fc7..e92c761 100644 --- a/PadelClub/Views/Tournament/Screen/Components/TournamentStatusView.swift +++ b/PadelClub/Views/Tournament/Screen/Components/TournamentStatusView.swift @@ -114,6 +114,6 @@ struct TournamentStatusView: View { } } -#Preview { - TournamentStatusView() -} +//#Preview { +// TournamentStatusView() +//} diff --git a/PadelClub/Views/Tournament/Screen/Components/UpdateSourceRankDateView.swift b/PadelClub/Views/Tournament/Screen/Components/UpdateSourceRankDateView.swift index c06c505..00480f9 100644 --- a/PadelClub/Views/Tournament/Screen/Components/UpdateSourceRankDateView.swift +++ b/PadelClub/Views/Tournament/Screen/Components/UpdateSourceRankDateView.swift @@ -96,6 +96,6 @@ struct UpdateSourceRankDateView: View { } } -#Preview { - UpdateSourceRankDateView(currentRankSourceDate: .constant(Date()), confirmUpdateRank: .constant(true), tournament: Tournament.mock()) -} +//#Preview { +// UpdateSourceRankDateView(currentRankSourceDate: .constant(Date()), confirmUpdateRank: .constant(true), tournament: Tournament.mock()) +//} diff --git a/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift b/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift index b5bb7b9..c76390e 100644 --- a/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift +++ b/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift @@ -22,6 +22,7 @@ let padelBeachImportTip = PadelBeachImportTip() struct InscriptionManagerView: View { @EnvironmentObject var dataStore: DataStore @EnvironmentObject var networkMonitor: NetworkMonitor + @Environment(\.dismiss) var dismiss @FetchRequest( sortDescriptors: [], @@ -29,6 +30,8 @@ struct InscriptionManagerView: View { private var fetchPlayers: FetchedResults var tournament: Tournament + var cancelShouldDismiss: Bool = false + @State private var searchField: String = "" @State private var presentSearch: Bool = false @State private var presentPlayerSearch: Bool = false @@ -101,20 +104,15 @@ struct InscriptionManagerView: View { } } - let categoryOption: PlayerFilterOption - let filterable: Bool - - init(tournament: Tournament) { + init(tournament: Tournament, pasteString: String? = nil) { self.tournament = tournament - _currentRankSourceDate = State(wrappedValue: tournament.rankSourceDate) - switch tournament.tournamentCategory { - case .women: - categoryOption = .female - filterable = false - default: - categoryOption = .all - filterable = true + if let pasteString { + _pasteString = .init(wrappedValue: pasteString) + _fetchPlayers = FetchRequest(sortDescriptors: [NSSortDescriptor(keyPath: \ImportedPlayer.rank, ascending: true)], predicate: Self._pastePredicate(pasteField: pasteString, mostRecentDate: tournament.rankSourceDate, filterOption: tournament.tournamentCategory.playerFilterOption)) + _autoSelect = .init(wrappedValue: true) + cancelShouldDismiss = true } + _currentRankSourceDate = State(wrappedValue: tournament.rankSourceDate) } private func _clearScreen() { @@ -337,6 +335,9 @@ struct InscriptionManagerView: View { editedTeam = nil createdPlayers.removeAll() createdPlayerIds.removeAll() + if cancelShouldDismiss { + dismiss() + } } } } else { @@ -515,7 +516,7 @@ struct InscriptionManagerView: View { RowButtonView("Créer une équipe") { Task { await MainActor.run() { - fetchPlayers.nsPredicate = _pastePredicate(pasteField: searchField, mostRecentDate: SourceFileManager.shared.mostRecentDateAvailable) + fetchPlayers.nsPredicate = Self._pastePredicate(pasteField: searchField, mostRecentDate: SourceFileManager.shared.mostRecentDateAvailable, filterOption: _filterOption()) fetchPlayers.nsSortDescriptors = [NSSortDescriptor(keyPath: \ImportedPlayer.rank, ascending: true)] pasteString = searchField } @@ -572,7 +573,7 @@ struct InscriptionManagerView: View { guard let first = strings.first else { return } Task { await MainActor.run { - fetchPlayers.nsPredicate = _pastePredicate(pasteField: first, mostRecentDate: SourceFileManager.shared.mostRecentDateAvailable) + fetchPlayers.nsPredicate = Self._pastePredicate(pasteField: first, mostRecentDate: SourceFileManager.shared.mostRecentDateAvailable, filterOption: _filterOption()) fetchPlayers.nsSortDescriptors = [NSSortDescriptor(keyPath: \ImportedPlayer.rank, ascending: true)] pasteString = first autoSelect = true @@ -641,14 +642,7 @@ struct InscriptionManagerView: View { } private func _filterOption() -> PlayerFilterOption { - switch tournament.tournamentCategory { - case .men: - return .male - case .women: - return .female - case .mix: - return .all - } + return tournament.tournamentCategory.playerFilterOption } @ViewBuilder @@ -672,7 +666,7 @@ struct InscriptionManagerView: View { if let paste = UIPasteboard.general.string { Task { await MainActor.run { - fetchPlayers.nsPredicate = _pastePredicate(pasteField: paste, mostRecentDate: SourceFileManager.shared.mostRecentDateAvailable) + fetchPlayers.nsPredicate = Self._pastePredicate(pasteField: paste, mostRecentDate: SourceFileManager.shared.mostRecentDateAvailable, filterOption: _filterOption()) fetchPlayers.nsSortDescriptors = [NSSortDescriptor(keyPath: \ImportedPlayer.rank, ascending: true)] pasteString = paste autoSelect = true @@ -739,7 +733,7 @@ struct InscriptionManagerView: View { LabeledContent { Text(max(0, unsortedTeamsWithoutWO.count - tournament.teamCount).formatted()).font(.largeTitle) } label: { - Text("Liste d'attente") + Text("Attente") } NavigationLink { @@ -807,7 +801,7 @@ struct InscriptionManagerView: View { selectionSearchField ?? pasteString } - private func _pastePredicate(pasteField: String, mostRecentDate: Date?) -> NSPredicate? { + static private func _pastePredicate(pasteField: String, mostRecentDate: Date?, filterOption: PlayerFilterOption) -> NSPredicate? { let text = pasteField.canonicalVersion let nameComponents = text.components(separatedBy: .whitespacesAndNewlines).compactMap { $0.isEmpty ? nil : $0 }.filter({ $0 != "de" && $0 != "la" && $0 != "le" && $0.count > 1 }) @@ -816,9 +810,9 @@ struct InscriptionManagerView: View { //self.wordsCount = nameComponents.count - if _filterOption() == .male { + if filterOption == .male { andPredicates.append(NSPredicate(format: "male == YES")) - } else if _filterOption() == .female { + } else if filterOption == .female { andPredicates.append(NSPredicate(format: "male == NO")) } @@ -1244,9 +1238,9 @@ struct InscriptionManagerView: View { } } -#Preview { - NavigationStack { - InscriptionManagerView(tournament: Tournament.mock()) - .environment(Tournament.mock()) - } -} +//#Preview { +// NavigationStack { +// InscriptionManagerView(tournament: Tournament.mock()) +// .environment(Tournament.mock()) +// } +//} diff --git a/PadelClub/Views/Tournament/Screen/TableStructureView.swift b/PadelClub/Views/Tournament/Screen/TableStructureView.swift index 2a67098..4fd4a9c 100644 --- a/PadelClub/Views/Tournament/Screen/TableStructureView.swift +++ b/PadelClub/Views/Tournament/Screen/TableStructureView.swift @@ -347,10 +347,10 @@ extension TableStructureView { } -#Preview { - NavigationStack { - TableStructureView() - .environment(Tournament.mock()) - .environmentObject(DataStore.shared) - } -} +//#Preview { +// NavigationStack { +// TableStructureView() +// .environment(Tournament.mock()) +// .environmentObject(DataStore.shared) +// } +//} diff --git a/PadelClub/Views/Tournament/Screen/TournamentCallView.swift b/PadelClub/Views/Tournament/Screen/TournamentCallView.swift index a768f17..5e5024e 100644 --- a/PadelClub/Views/Tournament/Screen/TournamentCallView.swift +++ b/PadelClub/Views/Tournament/Screen/TournamentCallView.swift @@ -109,6 +109,6 @@ struct TournamentCallView: View { } -#Preview { - TournamentCallView(tournament: Tournament.mock()) -} +//#Preview { +// TournamentCallView(tournament: Tournament.mock()) +//} diff --git a/PadelClub/Views/Tournament/Screen/TournamentCashierView.swift b/PadelClub/Views/Tournament/Screen/TournamentCashierView.swift index 97b47b8..00a5407 100644 --- a/PadelClub/Views/Tournament/Screen/TournamentCashierView.swift +++ b/PadelClub/Views/Tournament/Screen/TournamentCashierView.swift @@ -158,9 +158,9 @@ struct TournamentCashierView: View { } } -#Preview { - TournamentCashierView(tournament: Tournament.mock()) -} +//#Preview { +// TournamentCashierView(tournament: Tournament.mock()) +//} //class DebouncedObject: ObservableObject { // @Published var searchText: String = "" { diff --git a/PadelClub/Views/Tournament/Screen/TournamentRankView.swift b/PadelClub/Views/Tournament/Screen/TournamentRankView.swift index ab99337..7660b28 100644 --- a/PadelClub/Views/Tournament/Screen/TournamentRankView.swift +++ b/PadelClub/Views/Tournament/Screen/TournamentRankView.swift @@ -101,6 +101,10 @@ struct TournamentRankView: View { Divider() VStack(alignment: .leading) { + if let name = team.name { + Text(name).foregroundStyle(.secondary) + } + ForEach(team.players()) { player in VStack(alignment: .leading, spacing: -4.0) { Text(player.playerLabel()).bold() @@ -149,6 +153,6 @@ struct TournamentRankView: View { } } -#Preview { - TournamentRankView() -} +//#Preview { +// TournamentRankView() +//} diff --git a/PadelClub/Views/Tournament/Screen/TournamentScheduleView.swift b/PadelClub/Views/Tournament/Screen/TournamentScheduleView.swift index 792c87f..26fc077 100644 --- a/PadelClub/Views/Tournament/Screen/TournamentScheduleView.swift +++ b/PadelClub/Views/Tournament/Screen/TournamentScheduleView.swift @@ -96,6 +96,6 @@ struct TournamentScheduleView: View { } } -#Preview { - TournamentScheduleView(tournament: Tournament.mock()) -} +//#Preview { +// TournamentScheduleView(tournament: Tournament.mock()) +//} diff --git a/PadelClub/Views/Tournament/Screen/TournamentSettingsView.swift b/PadelClub/Views/Tournament/Screen/TournamentSettingsView.swift index 70ba98a..6a2574b 100644 --- a/PadelClub/Views/Tournament/Screen/TournamentSettingsView.swift +++ b/PadelClub/Views/Tournament/Screen/TournamentSettingsView.swift @@ -83,6 +83,6 @@ struct TournamentSettingsView: View { } -#Preview { - TournamentSettingsView() -} +//#Preview { +// TournamentSettingsView() +//} diff --git a/PadelClub/Views/Tournament/Shared/DateBoxView.swift b/PadelClub/Views/Tournament/Shared/DateBoxView.swift index 62a7afc..42f8ee1 100644 --- a/PadelClub/Views/Tournament/Shared/DateBoxView.swift +++ b/PadelClub/Views/Tournament/Shared/DateBoxView.swift @@ -60,6 +60,6 @@ struct MonthYearView: View { // } //} -#Preview { - DateVerticalView(date: Date()) -} +//#Preview { +// DateVerticalView(date: Date()) +//} diff --git a/PadelClub/Views/Tournament/Shared/PadelClubButtonView.swift b/PadelClub/Views/Tournament/Shared/PadelClubButtonView.swift index faf6b9f..ba47b06 100644 --- a/PadelClub/Views/Tournament/Shared/PadelClubButtonView.swift +++ b/PadelClub/Views/Tournament/Shared/PadelClubButtonView.swift @@ -30,6 +30,6 @@ struct PadelClubButtonView: View { } -#Preview { - PadelClubButtonView(isImported: true) -} +//#Preview { +// PadelClubButtonView(isImported: true) +//} diff --git a/PadelClub/Views/Tournament/Shared/TournamentCellView.swift b/PadelClub/Views/Tournament/Shared/TournamentCellView.swift index ecd2f32..f855add 100644 --- a/PadelClub/Views/Tournament/Shared/TournamentCellView.swift +++ b/PadelClub/Views/Tournament/Shared/TournamentCellView.swift @@ -151,6 +151,6 @@ struct TournamentCellView: View { } } -#Preview { - TournamentCellView(tournament: Tournament.fake()) -} +//#Preview { +// TournamentCellView(tournament: Tournament.fake()) +//} diff --git a/PadelClub/Views/Tournament/TournamentBuildView.swift b/PadelClub/Views/Tournament/TournamentBuildView.swift index 4f5cb61..77ad3d7 100644 --- a/PadelClub/Views/Tournament/TournamentBuildView.swift +++ b/PadelClub/Views/Tournament/TournamentBuildView.swift @@ -151,6 +151,6 @@ struct TournamentBuildView: View { } } -#Preview { - TournamentBuildView(tournament: Tournament.mock()) -} +//#Preview { +// TournamentBuildView(tournament: Tournament.mock()) +//} diff --git a/PadelClub/Views/Tournament/TournamentInitView.swift b/PadelClub/Views/Tournament/TournamentInitView.swift index 65c92a7..f0dbaf4 100644 --- a/PadelClub/Views/Tournament/TournamentInitView.swift +++ b/PadelClub/Views/Tournament/TournamentInitView.swift @@ -51,6 +51,6 @@ struct TournamentInitView: View { } } -#Preview { - TournamentInitView(tournament: Tournament.mock()) -} +//#Preview { +// TournamentInitView(tournament: Tournament.mock()) +//} diff --git a/PadelClub/Views/Tournament/TournamentRunningView.swift b/PadelClub/Views/Tournament/TournamentRunningView.swift index b6c6cdf..4cb25cc 100644 --- a/PadelClub/Views/Tournament/TournamentRunningView.swift +++ b/PadelClub/Views/Tournament/TournamentRunningView.swift @@ -25,6 +25,6 @@ struct TournamentRunningView: View { } } -#Preview { - TournamentRunningView(tournament: Tournament.mock()) -} +//#Preview { +// TournamentRunningView(tournament: Tournament.mock()) +//} diff --git a/PadelClub/Views/Tournament/TournamentView.swift b/PadelClub/Views/Tournament/TournamentView.swift index 0f3d4a9..52d3868 100644 --- a/PadelClub/Views/Tournament/TournamentView.swift +++ b/PadelClub/Views/Tournament/TournamentView.swift @@ -200,8 +200,8 @@ struct TournamentView: View { } } -#Preview { - NavigationStack { - TournamentView(tournament: Tournament.mock(), presentationContext: .agenda) - } -} +//#Preview { +// NavigationStack { +// TournamentView(tournament: Tournament.mock(), presentationContext: .agenda) +// } +//} diff --git a/PadelClub/Views/User/AccountView.swift b/PadelClub/Views/User/AccountView.swift index 38b66b9..6fc5ccc 100644 --- a/PadelClub/Views/User/AccountView.swift +++ b/PadelClub/Views/User/AccountView.swift @@ -26,8 +26,8 @@ struct AccountView: View { } } -#Preview { - AccountView(user: User(username: "coco", email: ",mail", firstName: "first", lastName: "last", phone: "44444", country: "US")) { - - } -} +//#Preview { +// AccountView(user: User(username: "coco", email: ",mail", firstName: "first", lastName: "last", phone: "44444", country: "US")) { +// +// } +//} diff --git a/PadelClub/Views/User/ChangePasswordView.swift b/PadelClub/Views/User/ChangePasswordView.swift index 8483964..4f3e210 100644 --- a/PadelClub/Views/User/ChangePasswordView.swift +++ b/PadelClub/Views/User/ChangePasswordView.swift @@ -61,8 +61,8 @@ struct ChangePasswordView: View { } -#Preview { - NavigationStack { - ChangePasswordView() - } -} +//#Preview { +// NavigationStack { +// ChangePasswordView() +// } +//} diff --git a/PadelClub/Views/User/LoginView.swift b/PadelClub/Views/User/LoginView.swift index b3adfc0..695712a 100644 --- a/PadelClub/Views/User/LoginView.swift +++ b/PadelClub/Views/User/LoginView.swift @@ -167,12 +167,12 @@ struct EmailConfirmationView: View { } -#Preview { - NavigationStack { - LoginView(handler: { _ in }) - } -} +//#Preview { +// NavigationStack { +// LoginView(handler: { _ in }) +// } +//} -#Preview { - EmailConfirmationView() -} +//#Preview { +// EmailConfirmationView() +//} diff --git a/PadelClub/Views/User/UserCreationView.swift b/PadelClub/Views/User/UserCreationView.swift index abdb76d..1d60bae 100644 --- a/PadelClub/Views/User/UserCreationView.swift +++ b/PadelClub/Views/User/UserCreationView.swift @@ -179,6 +179,6 @@ struct UserCreationFormView: View { } -#Preview { - UserCreationFormView(isPresented: .constant(true), showEmailValidationMessage: .constant(true)) -} +//#Preview { +// UserCreationFormView(isPresented: .constant(true), showEmailValidationMessage: .constant(true)) +//}