Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Public/** linguist-vendored=false
Public/** linguist-documentation=false
*.leaf linguist-language=HTML
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct ScheduleAPIControllerV2: RouteCollection {
.query(on: request.db)
.with(\.$days)
.all()
.filter { request.application.conference.rawValue == $0.conference }

guard let event = events.first(where: { $0.shouldBeReturned(by: request) }) else {
throw ScheduleAPIController.ScheduleAPIError.notFound
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ struct ScheduleAPIController: RouteCollection {
let events = try await Event
.query(on: request.db)
.all()
.filter { request.application.conference.rawValue == $0.conference }

guard let event = events.first(where: { $0.shouldBeReturned(by: request) }) else {
throw ScheduleAPIController.ScheduleAPIError.notFound
Expand Down
44 changes: 28 additions & 16 deletions Sources/App/Features/Team/Controllers/TeamAPIController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,83 +13,95 @@
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",
role: "Production Team Lead",
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",
role: nil,
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",
role: nil,
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",
role: nil,
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 { $0.core }.shuffled()

Check warning on line 103 in Sources/App/Features/Team/Controllers/TeamAPIController.swift

View workflow job for this annotation

GitHub Actions / lint

Convert trivial map { $0.foo } closures to keyPath-based syntax. (preferKeyPath)
let dayTeam = teamMembers.filter { !$0.core }.shuffled()
return TeamResponse(teamMembers: coreTeam + dayTeam)
}
}
1 change: 1 addition & 0 deletions Sources/App/Features/Team/Models/TeamResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ struct TeamMember: Content {
let linkedin: String?
let slack: String?
let imageURL: String
let core: Bool
}
7 changes: 6 additions & 1 deletion Sources/App/configure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 it's 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))
Expand Down
Loading