diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e1fdfcf --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +Public/** linguist-vendored=false +Public/** linguist-documentation=false +*.leaf linguist-language=HTML \ No newline at end of file diff --git a/Sources/App/Features/Schedule/ScheduleAPIController+V2.swift b/Sources/App/Features/Schedule/ScheduleAPIController+V2.swift index a7bd8f1..f46b3ff 100644 --- a/Sources/App/Features/Schedule/ScheduleAPIController+V2.swift +++ b/Sources/App/Features/Schedule/ScheduleAPIController+V2.swift @@ -15,6 +15,7 @@ struct ScheduleAPIControllerV2: RouteCollection { let events = try await Event .query(on: request.db) .with(\.$days) + .filter(\.$conference == request.application.conference.rawValue) .all() guard let event = events.first(where: { $0.shouldBeReturned(by: request) }) else { diff --git a/Sources/App/Features/Schedule/ScheduleAPIController.swift b/Sources/App/Features/Schedule/ScheduleAPIController.swift index 99f7694..23f4189 100644 --- a/Sources/App/Features/Schedule/ScheduleAPIController.swift +++ b/Sources/App/Features/Schedule/ScheduleAPIController.swift @@ -9,6 +9,7 @@ struct ScheduleAPIController: RouteCollection { @Sendable private func onGet(request: Request) async throws -> Response { let events = try await Event .query(on: request.db) + .filter(\.$conference == request.application.conference.rawValue) .all() guard let event = events.first(where: { $0.shouldBeReturned(by: request) }) else { diff --git a/Sources/App/Features/Team/Controllers/TeamAPIController.swift b/Sources/App/Features/Team/Controllers/TeamAPIController.swift index 3e7d27b..b1c378c 100644 --- a/Sources/App/Features/Team/Controllers/TeamAPIController.swift +++ b/Sources/App/Features/Team/Controllers/TeamAPIController.swift @@ -13,7 +13,8 @@ struct TeamAPIController: RouteCollection { twitter: "https://twitter.com/Adam9Rush", linkedin: "https://www.linkedin.com/in/swiftlyrush/", slack: "https://swiftleedsworkspace.slack.com/archives/D05RK6AAV29", - imageURL: "/img/team/rush.jpg" + imageURL: "/img/team/rush.jpg", + core: true ), TeamMember( name: "James Sherlock", @@ -21,31 +22,35 @@ struct TeamAPIController: RouteCollection { twitter: "https://twitter.com/JamesSherlouk", linkedin: "https://www.linkedin.com/in/jamessherlockdeveloper/", slack: "https://swiftleedsworkspace.slack.com/archives/D05RK6AAV29", - imageURL: "/img/team/sherlock.jpg" + imageURL: "/img/team/sherlock.jpg", + core: true ), TeamMember( name: "Matthew Gallagher", - role: "Registration and Mobile App", + role: "Registration", twitter: "https://twitter.com/pdamonkey", linkedin: "https://www.linkedin.com/in/pdamonkey/", slack: "https://swiftleedsworkspace.slack.com/archives/D030PN528UA", - imageURL: "/img/team/matt.jpg" + imageURL: "/img/team/matt.jpg", + core: true ), TeamMember( name: "Adam Oxley", - role: nil, + role: "iOS Application", twitter: "https://twitter.com/admoxly", linkedin: "https://www.linkedin.com/in/adam-oxley-41183a82/", slack: "https://swiftleedsworkspace.slack.com/team/U02DRL7KUCS", - imageURL: "/img/team/oxley.jpg" + imageURL: "/img/team/oxley.jpg", + core: true ), TeamMember( name: "Noam Efergan", - role: "Camera Operator and Social Media", + role: "Production and Social Media", twitter: "https://twitter.com/No_Wham", linkedin: "https://www.linkedin.com/in/noamefergan/", slack: "https://swiftleedsworkspace.slack.com/archives/D05RK6AAV29", - imageURL: "/img/team/noam.jpg" + imageURL: "/img/team/noam.jpg", + core: true ), TeamMember( name: "Kannan Prasad", @@ -53,7 +58,8 @@ struct TeamAPIController: RouteCollection { twitter: nil, linkedin: "https://www.linkedin.com/in/kannanprasad/", slack: "https://swiftleedsworkspace.slack.com/archives/D0477TRS28G", - imageURL: "/img/team/kannan.jpg" + imageURL: "/img/team/kannan.jpg", + core: false ), TeamMember( name: "Muralidharan Kathiresan", @@ -61,7 +67,8 @@ struct TeamAPIController: RouteCollection { twitter: "https://twitter.com/Muralidharan_K", linkedin: "https://www.linkedin.com/in/muralidharankathiresan/", slack: "https://swiftleedsworkspace.slack.com/archives/D05RK6AAV29", - imageURL: "/img/team/mural.jpg" + imageURL: "/img/team/mural.jpg", + core: false ), TeamMember( name: "Preeti Thombare", @@ -69,27 +76,32 @@ struct TeamAPIController: RouteCollection { twitter: nil, linkedin: nil, slack: "https://swiftleedsworkspace.slack.com/archives/D05RK6AAV29", - imageURL: "/img/team/preeti.jpg" + imageURL: "/img/team/preeti.jpg", + core: false ), TeamMember( name: "Paul Willis", - role: nil, + role: "iOS Application", twitter: nil, linkedin: "https://www.linkedin.com/in/paulrobertwillis/", slack: "https://swiftleedsworkspace.slack.com/archives/D05RK6AAV29", - imageURL: "/img/team/paul.jpg" + imageURL: "/img/team/paul.jpg", + core: true ), TeamMember( name: "Joe Williams", - role: "Camera Operator", + role: nil, twitter: "https://twitter.com/joedub_dev", linkedin: "https://www.linkedin.com/in/joe-williams-1676b871/", slack: "https://swiftleedsworkspace.slack.com/archives/C05N7JZE2NP", - imageURL: "/img/team/joe.jpg" + imageURL: "/img/team/joe.jpg", + core: false ), ] // Shuffle the team members to avoid bias, just like the web page does - return TeamResponse(teamMembers: teamMembers.shuffled()) + let coreTeam = teamMembers.filter(\.core).shuffled() + let dayTeam = teamMembers.filter { !$0.core }.shuffled() + return TeamResponse(teamMembers: coreTeam + dayTeam) } } diff --git a/Sources/App/Features/Team/Models/TeamResponse.swift b/Sources/App/Features/Team/Models/TeamResponse.swift index 4f66e4d..c98c7a1 100644 --- a/Sources/App/Features/Team/Models/TeamResponse.swift +++ b/Sources/App/Features/Team/Models/TeamResponse.swift @@ -12,4 +12,5 @@ struct TeamMember: Content { let linkedin: String? let slack: String? let imageURL: String + let core: Bool } diff --git a/Sources/App/configure.swift b/Sources/App/configure.swift index 7474480..b3fb3c8 100644 --- a/Sources/App/configure.swift +++ b/Sources/App/configure.swift @@ -14,7 +14,12 @@ public func configure(_ app: Application) async throws { // Middleware app.middleware = .init() - app.middleware.use(RouteLoggingMiddleware(logLevel: .info)) + + if app.environment != .production { + // GCR does its own route logging, so let's not double up + app.middleware.use(RouteLoggingMiddleware(logLevel: .info)) + } + app.middleware.use(ErrorFileMiddleware()) app.middleware.use(AppleAppSiteAssociationMiddleware()) app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory))