Skip to content

Commit

Permalink
Updated Schedule Page for HackIllinois 2024 (#572)
Browse files Browse the repository at this point in the history
* Updating UI

* Updating UI

* Updating UI

* changes

* changes

* changes

* Merge remote-tracking branch 'origin/dev' into sophia/update-schedule-page

* changes

* fixed event favorites, added in follow and unfollow endpoints

* added functionality to toggle between schedule/shifts

* added functionality to toggle between schedule/shifts

* cleaning up

* started setting up staff shifts

* Added some iPad UI changes

* Fixed iPad potion sizes

* Fix schedule view on iPad, need to fix iPad Pro 12.9

* Trying to add mapImageURL

* Fixed error where events didn't show up, added optional handling

* Added static maps

* editing static map

* replace bg pad img

* Revert "replace bg pad img"

This reverts commit af8858b.

* changed content bg

* improved schedule ui layout for ipad

* Added model and service for staff shifts

* laid out staff shifts ui view, updated staff hiapi to pass in body
  • Loading branch information
s0phialiu authored Feb 11, 2024
1 parent 0c58837 commit 74eac67
Show file tree
Hide file tree
Showing 64 changed files with 687 additions and 129 deletions.
4 changes: 3 additions & 1 deletion HIAPI/Models/Event.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public struct Event: Codable {
case startTime
case points
case isAsync
case mapImageUrl
}

public let id: String
Expand All @@ -85,10 +86,11 @@ public struct Event: Codable {
public let info: String
public let locations: [Location]
public let name: String
public let sponsor: String
public let sponsor: String?
public let startTime: Date
public let points: Int
public let isAsync: Bool
public let mapImageUrl: String?
}

public struct Location: Codable {
Expand Down
11 changes: 8 additions & 3 deletions HIAPI/Models/Staff.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
//
// Staff.swift
// HIAPI
// HackIllinois
//
// Created by Dev Patel on 2/7/24.
// Copyright © 2024 HackIllinois. All rights reserved.
// Created by HackIllinois Team on 2/7/24.
// Copyright © 2017 HackIllinois. All rights reserved.
// This file is part of the Hackillinois iOS App.
// The Hackillinois iOS App is open source software, released under the University of
// Illinois/NCSA Open Source License. You should have received a copy of
// this license in a file with the distribution.
//

import Foundation
import APIManager

Expand Down
5 changes: 5 additions & 0 deletions HIAPI/Models/User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,8 @@ public struct DietaryRestrictions: OptionSet, Codable, APIReturnable {
public struct Token: Codable, APIReturnable {
public let token: String
}

public struct FollowStatus: Codable, APIReturnable {
public let userId: String
public let following: [String]
}
23 changes: 16 additions & 7 deletions HIAPI/Services/StaffService.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
//
// StaffService.swift
// HIAPI
// HackIllinois
//
// Created by Dev Patel on 2/7/24.
// Copyright © 2024 HackIllinois. All rights reserved.
// Created by HackIllinois Team on 2/7/24.
// Copyright © 2017 HackIllinois. All rights reserved.
// This file is part of the Hackillinois iOS App.
// The Hackillinois iOS App is open source software, released under the University of
// Illinois/NCSA Open Source License. You should have received a copy of
// this license in a file with the distribution.
//

import Foundation
Expand All @@ -20,15 +24,20 @@ public final class StaffService: BaseService {
return APIRequest<StaffContainer>(service: self, endpoint: "shift/", headers: headers, method: .GET)
}

public static func recordStaffAttendance(userToken: String) -> APIRequest<StaffAttendanceContainer> {
public static func recordStaffAttendance(userToken: String, eventId: String) -> APIRequest<StaffAttendanceContainer> {
var body = HTTPBody()
body["eventId"] = eventId
var headers = HTTPHeaders()
headers["Authorization"] = userToken
return APIRequest<StaffAttendanceContainer>(service: self, endpoint: "attendance/", headers: headers, method: .POST)
return APIRequest<StaffAttendanceContainer>(service: self, endpoint: "attendance/", body: body, headers: headers, method: .POST)
}

public static func recordUserAttendance(userToken: String) -> APIRequest<UserAttendanceContainer> {
public static func recordUserAttendance(userToken: String, userId: String, eventId: String) -> APIRequest<UserAttendanceContainer> {
var body = HTTPBody()
body["userId"] = userId
body["eventId"] = eventId
var headers = HTTPHeaders()
headers["Authorization"] = userToken
return APIRequest<UserAttendanceContainer>(service: self, endpoint: "scan-attendee/", headers: headers, method: .PUT)
return APIRequest<UserAttendanceContainer>(service: self, endpoint: "scan-attendee/", body: body, headers: headers, method: .PUT)
}
}
16 changes: 16 additions & 0 deletions HIAPI/Services/UserService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,20 @@ public final class UserService: BaseService {
authorizationHeaders["Authorization"] = userToken
return APIRequest<QRData>(service: self, endpoint: "qr/", headers: authorizationHeaders, method: .GET)
}

public static func favoriteEvent(userToken: String, eventID: String) -> APIRequest<FollowStatus> {
var authorizationHeaders = HTTPHeaders()
authorizationHeaders["Authorization"] = userToken
var body = HTTPBody()
body["eventId"] = eventID
return APIRequest<FollowStatus>(service: self, endpoint: "follow/", body: body, headers: authorizationHeaders, method: .PUT)
}

public static func unfavoriteEvent(userToken: String, eventID: String) -> APIRequest<FollowStatus> {
var authorizationHeaders = HTTPHeaders()
authorizationHeaders["Authorization"] = userToken
var body = HTTPBody()
body["eventId"] = eventID
return APIRequest<FollowStatus>(service: self, endpoint: "unfollow/", body: body, headers: authorizationHeaders, method: .PUT)
}
}
12 changes: 12 additions & 0 deletions HackIllinois.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@
D12B40FF2AC0B0BD001BCB05 /* HIScanAttendanceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12B40FE2AC0B0BD001BCB05 /* HIScanAttendanceViewController.swift */; };
D134D30F296B3F56006EA589 /* Montserrat-VariableFont_wght.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D134D30E296B3F56006EA589 /* Montserrat-VariableFont_wght.ttf */; };
D14D3AE3295FBDA200EB7995 /* HIBannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14D3AE2295FBDA100EB7995 /* HIBannerViewController.swift */; };
D187BF582B781A1100AD7356 /* HIShiftCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D187BF572B781A1100AD7356 /* HIShiftCell.swift */; };
D1BBA5682B70AB940017BD13 /* Staff.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1BBA5672B70AB940017BD13 /* Staff.swift */; };
D1BBA56A2B70ACCC0017BD13 /* StaffService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1BBA5692B70ACCC0017BD13 /* StaffService.swift */; };
D187BF5A2B78317600AD7356 /* Mentor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D187BF592B78317600AD7356 /* Mentor.swift */; };
D187BF5C2B78318000AD7356 /* MentorService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D187BF5B2B78318000AD7356 /* MentorService.swift */; };
D1BE81172AC8FC680042C078 /* HIAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95E3142A21FAD5B30092C22E /* HIAPI.framework */; };
Expand Down Expand Up @@ -345,6 +348,9 @@
D12B40FE2AC0B0BD001BCB05 /* HIScanAttendanceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIScanAttendanceViewController.swift; sourceTree = "<group>"; };
D134D30E296B3F56006EA589 /* Montserrat-VariableFont_wght.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Montserrat-VariableFont_wght.ttf"; sourceTree = "<group>"; };
D14D3AE2295FBDA100EB7995 /* HIBannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIBannerViewController.swift; sourceTree = "<group>"; };
D187BF572B781A1100AD7356 /* HIShiftCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIShiftCell.swift; sourceTree = "<group>"; };
D1BBA5672B70AB940017BD13 /* Staff.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Staff.swift; sourceTree = "<group>"; };
D1BBA5692B70ACCC0017BD13 /* StaffService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StaffService.swift; sourceTree = "<group>"; };
D187BF592B78317600AD7356 /* Mentor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Mentor.swift; sourceTree = "<group>"; };
D187BF5B2B78318000AD7356 /* MentorService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MentorService.swift; sourceTree = "<group>"; };
D1C5B6572B732E44000E766D /* refresh.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = refresh.json; sourceTree = "<group>"; };
Expand Down Expand Up @@ -661,6 +667,7 @@
95A7D282203D4F54005EAEAF /* HIAnnouncementCell.swift */,
95A7D29F203D60E9005EAEAF /* HIBubbleCell.swift */,
95A7D281203D4F54005EAEAF /* HIEventCell.swift */,
D187BF572B781A1100AD7356 /* HIShiftCell.swift */,
3CF8DB1223B419980035ECAE /* HIProjectCell.swift */,
);
path = HIBubbleCell;
Expand Down Expand Up @@ -711,6 +718,7 @@
D187BF5B2B78318000AD7356 /* MentorService.swift */,
AC3B620F25E85D18002386A2 /* ProfileService.swift */,
95E3145C21FAF1740092C22E /* PassService.swift */,
D1BBA5692B70ACCC0017BD13 /* StaffService.swift */,
95E3146321FAF1740092C22E /* RegistrationService.swift */,
95B12044220BEAD700E024BB /* TrackingService.swift */,
95E3145D21FAF1740092C22E /* UserService.swift */,
Expand All @@ -728,6 +736,7 @@
95E3146821FAF1740092C22E /* Announcement.swift */,
3521FFA82207C03E00634A63 /* Attendee.swift */,
95E3146521FAF1740092C22E /* Event.swift */,
D1BBA5672B70AB940017BD13 /* Staff.swift */,
2FA73B4F2B58CAC3002658C0 /* Item.swift */,
AC3B620D25E85CAD002386A2 /* Profile.swift */,
95E3146621FAF1740092C22E /* SimpleRequest.swift */,
Expand Down Expand Up @@ -1057,6 +1066,7 @@
E1E4A5DA291C9BF800780BA1 /* HIOnboardingView.swift in Sources */,
95A7D290203D4F54005EAEAF /* HIAnnouncementCell.swift in Sources */,
9515E43722093E1300BCAF92 /* HIEventScannerViewController.swift in Sources */,
D187BF582B781A1100AD7356 /* HIShiftCell.swift in Sources */,
95A7D28F203D4F54005EAEAF /* HIEventCell.swift in Sources */,
ACAA717626017EC4000F42B0 /* HICollectionViewFlowLayout.swift in Sources */,
DF5B27C5299197E80034A8B9 /* Array.swift in Sources */,
Expand Down Expand Up @@ -1132,6 +1142,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D1BBA5682B70AB940017BD13 /* Staff.swift in Sources */,
3521FFA92207C03E00634A63 /* Attendee.swift in Sources */,
95E3147521FAF1740092C22E /* User.swift in Sources */,
2FA73B4E2B58CAA0002658C0 /* ShopService.swift in Sources */,
Expand All @@ -1154,6 +1165,7 @@
95E3147421FAF1740092C22E /* SimpleRequest.swift in Sources */,
D187BF5C2B78318000AD7356 /* MentorService.swift in Sources */,
2FA73B502B58CAC3002658C0 /* Item.swift in Sources */,
D1BBA56A2B70ACCC0017BD13 /* StaffService.swift in Sources */,
A5163FED221F283C003C543E /* StatsService.swift in Sources */,
95B12045220BEAD700E024BB /* TrackingService.swift in Sources */,
3C8F62D6238F9825001A5DAF /* TimeService.swift in Sources */,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Big Selected Bookmark 1x.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Big Selected Bookmark 2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Big Selected Bookmark 3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Big Unselected Bookmark 1x.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Big Unselected Bookmark 2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Big Unselected Bookmark 3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"images" : [
{
"filename" : "Big Selected Bookmark 1x.png",
"idiom" : "universal",
"filename" : "MenuFavorited.png",
"scale" : "1x"
},
{
"filename" : "Big Selected Bookmark 2x.png",
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"filename" : "Big Selected Bookmark 3x.png",
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"images" : [
{
"filename" : "Big Unselected Bookmark 1x.png",
"idiom" : "universal",
"filename" : "MenuUnfavorited.png",
"scale" : "1x"
},
{
"filename" : "Big Unselected Bookmark 2x.png",
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"filename" : "Big Unselected Bookmark 3x.png",
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
23 changes: 23 additions & 0 deletions HackIllinois/Assets.xcassets/Pink Potion.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Pink Potion 1x.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Pink Potion 2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Pink Potion 3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions HackIllinois/Assets.xcassets/PinkPotionPad.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "PinkPotionPad.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "PinkPotionPad2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "PinkPotionPad3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions HackIllinois/Assets.xcassets/Purple Potion.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Purple Potion 1x.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Purple Potion 2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Purple Potion 3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "PurplePotionPad.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "PurplePotionPad2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "PurplePotionPad3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading

0 comments on commit 74eac67

Please sign in to comment.