Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Gias/search view #540

Merged
merged 84 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from 76 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
a5a9787
Added a SearchView to the HomeScreen i.e. the WidgetScreen. This allo…
14slash12 Nov 26, 2022
212f66f
Integration of the MLModel with Data Augmentation and a visual repses…
14slash12 Dec 5, 2022
5c9bff1
Search Algorithm for Grades: First implementation of the Levenshtein …
14slash12 Dec 9, 2022
605c614
Refactoring the levenshtein distance implementation. Adding a lot of …
14slash12 Dec 10, 2022
abdb933
1) Abstract the token search to a generic method. 2) Add Cafeterias t…
14slash12 Dec 22, 2022
52ecc53
Refactoring/Adding DocC to many methods. Implementing a way of showin…
14slash12 Dec 23, 2022
9bd2d6c
Sorting Results by best levensheit distance; In the future the best r…
14slash12 Dec 27, 2022
4684587
Sorting the result data types by the ML model and refactoring/restruc…
14slash12 Dec 27, 2022
ef5456d
Adjusted the tokenSearch algorithm to consider not only the best matc…
14slash12 Dec 28, 2022
2d3384d
Finished study rooms. Started to make calendar/lectures searchable co…
14slash12 Dec 28, 2022
fb7b01e
Making Calendar/Lectures searchable by combining them both into a new…
14slash12 Dec 29, 2022
8aa5eda
Adding Events (Lectures and the respective CalendarEvents if they do …
14slash12 Jan 6, 2023
f050a7f
Testing methods added
14slash12 Jan 9, 2023
2f93b93
New ML-Models added and now the ML-Model works in German and in English
14slash12 Jan 11, 2023
f12dad6
Added News to the Search
14slash12 Jan 13, 2023
38791ee
1) Fixed an issue: Views of search results did not loaded, since they…
14slash12 Jan 14, 2023
4ee7b77
PersonSearch was added to GIAS
14slash12 Jan 14, 2023
76be641
Adding Movies to GIAS
14slash12 Jan 14, 2023
5acafd3
Start to refactor the API buy generalizing all the API methods into o…
14slash12 Jan 16, 2023
1842c5d
Created for each API an new enum conforming to the new protocol API t…
14slash12 Jan 19, 2023
a7991e0
Refactored Calendar to work with the Asyn-Await-Pattern, the state en…
14slash12 Jan 20, 2023
7d108de
Refactored LecturesSearch to the new API and introduced the asnc-awai…
14slash12 Jan 20, 2023
b8b3bf1
Refactored the API for PersonSearch and added the new async-await pat…
14slash12 Jan 21, 2023
8f33d94
Completely rewritten the ProfileDetailView and its ViewModel to adopt…
14slash12 Jan 21, 2023
aff9f1f
Refactoring the complete Authentication procress to work with the new…
14slash12 Jan 21, 2023
048fa99
Refactored the ProfileViewModel, ProfileView, Model, to work with the…
14slash12 Jan 22, 2023
089e458
Adding the empty profile image placeholder and removing the old TUMOn…
14slash12 Jan 22, 2023
89e6130
Renamed the ProfileView2/ProfileViewModel2 -> to ProfileView/ProfileV…
14slash12 Jan 22, 2023
f3d81d7
Refactoring the News for the API including async-await-pattern, error…
14slash12 Jan 22, 2023
127735e
Renamed the new NewsViewModel, NewsView to the old names
14slash12 Jan 22, 2023
5c28de2
Extracted the new NewsScreen into a own file
14slash12 Jan 22, 2023
7fd7fdd
Refactored the MovieView for the new API, including error-handling, a…
14slash12 Jan 22, 2023
2f4ae88
Refactored the StudyRoomViewModel for fetching the RoomImageMapping. …
14slash12 Jan 22, 2023
8e7687e
Removed the old TUMCabeAPI
14slash12 Jan 22, 2023
f79937b
Refactoring the Cafeterias to work with the new API
14slash12 Jan 23, 2023
9a3343e
Refactored the MealPlanViewModel/View, to work with the new API, addi…
14slash12 Jan 23, 2023
96b9395
Refactored the DishLabels to work with the new API
14slash12 Jan 23, 2023
e1de88b
Refactored the StudyRoomService to work with the new API for the Stud…
14slash12 Jan 23, 2023
4ba8b61
Removed the old TUMDevAppAPI completely
14slash12 Jan 23, 2023
797b1e3
Fixed the links for the TUMSexyView, when using the built in WebView.…
14slash12 Jan 23, 2023
d6c2a0c
Removed the EntityImporter the old AuthenticationHanlder, the defualt…
14slash12 Jan 23, 2023
38f45fb
Refactored the Lectures to be a struct instead of the old RowSet-Enum…
14slash12 Jan 30, 2023
523470c
Refactored LectureDetails to work with the TUMOnlineAPI.Response inst…
14slash12 Jan 30, 2023
49fcb74
Fixing an issue for MealPlan. When next week's menu isn't ready the A…
14slash12 Feb 1, 2023
4587f1b
Refactoring each view from .onAppear{Task{}} to .task{} since this ca…
14slash12 Feb 1, 2023
1653e18
Performance test were refactored and added for new algorithms
14slash12 Feb 1, 2023
983bdc0
Added a test function
14slash12 Feb 5, 2023
0f0b08d
Deleted a print out and comment
14slash12 Feb 10, 2023
fc80ced
Renaming the APIs to its original naming scheme. And creating files f…
14slash12 Feb 10, 2023
0d7e2d2
Started to implement previews for SearchResultViews and implemented t…
14slash12 Feb 11, 2023
fd9f5ce
Implemented the UI for CafeteriaSearchResultView
14slash12 Feb 11, 2023
db8d1e6
Implemented the UI for NewsSearchResultView and MovieSearchResultView
14slash12 Feb 11, 2023
fcf483a
Commenting
14slash12 Feb 11, 2023
4a65613
Implemented the UI for NewsSearchResultView and EventSearchResultView
14slash12 Feb 12, 2023
a4d9b82
Added a button to EventSearchResultView to control the amount of resu…
14slash12 Feb 12, 2023
87bf530
Implementing the UI for StudyRoomSearchResultView
14slash12 Feb 12, 2023
0b0a685
Make the expanding button work in the StudyRoomSearchResultView
14slash12 Feb 12, 2023
787f129
Make the expanding button work in the RoomFinderRoomSearchResultView
14slash12 Feb 12, 2023
a18abff
Make the expanding button work in the LectureSearchResultView
14slash12 Feb 12, 2023
b3b5479
Make the expanding button work in the PersonSearchResultView
14slash12 Feb 12, 2023
bec838a
Start implementing a Bar for selecting the search result type
14slash12 Feb 12, 2023
1759573
Removed the ML-result text and readapted the padding of the bartypes
14slash12 Feb 27, 2023
8d9ed08
Add filter function to the bar buttons. Fix the RoomFinder by making …
14slash12 Feb 27, 2023
699a062
Remove the nested ViewModel inside the GradeSearchResultViewModel
14slash12 Feb 28, 2023
1e1756a
Add Recommendation View
14slash12 Mar 1, 2023
5f09c68
Removing comments
14slash12 Mar 1, 2023
ac3f9a1
Adapt padding
14slash12 Mar 1, 2023
854fada
Adding the Async-Await-Pattern to the GradeSearchResultView/Screen; C…
14slash12 Mar 7, 2023
eaa8230
Applying the Async-Await-Pattern to all SearchResultViews/Screens and…
14slash12 Mar 7, 2023
ee812c8
Merge commit; Changing the error message for the studyroom details du…
14slash12 Mar 24, 2023
77205df
Merge Commit: Merge the current development branch into GIAS/SearchVi…
14slash12 Apr 6, 2023
00ed57f
Moved all Tution files into TuitionComponent; Fixed some error messag…
14slash12 Apr 9, 2023
cf7ad04
Merge commit: Refactored all to make merge possible and fixed an issu…
14slash12 Apr 10, 2023
c70707b
Integrated NavigaTUM into GIAS
14slash12 Apr 10, 2023
d6f929d
Removed legacy code
14slash12 Apr 10, 2023
e00c637
Fixing a bug, when checking conformation of token after first the tok…
14slash12 Apr 11, 2023
24b36ff
Resolving requested changes: Adding view modifier and generalizing/ex…
14slash12 May 6, 2023
958e71b
Resolving requested changes: Adding view modifier and generalizing/ex…
14slash12 May 6, 2023
7b44f50
Extract ExpandIcon in own file
14slash12 May 6, 2023
c4cafc7
Adding a comment
14slash12 May 6, 2023
86c70bd
Resolving conflicts
14slash12 May 24, 2023
4ac9983
Merge branch 'development' into GIAS/SearchView
timothymaxwellsummers Jun 19, 2023
663b5b1
Merge branch 'development' into GIAS/SearchView
timothymaxwellsummers Jul 17, 2023
8b88be0
Adapted to merged changes
timothymaxwellsummers Jul 17, 2023
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
1,186 changes: 763 additions & 423 deletions Campus-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>classNames</key>
<dict>
<key>Campus_iOSTests</key>
<dict>
<key>testPerformanceExample()</key>
<dict>
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
<dict>
<key>baselineAverage</key>
<real>0.005971</real>
<key>baselineIntegrationDisplayName</key>
<string>Local Baseline</string>
</dict>
</dict>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>runDestinationsByUUID</key>
<dict>
<key>3439EAFF-1FCF-41B1-96A9-2FD6666B9105</key>
<dict>
<key>localComputer</key>
<dict>
<key>busSpeedInMHz</key>
<integer>0</integer>
<key>cpuCount</key>
<integer>1</integer>
<key>cpuKind</key>
<string>Apple M1</string>
<key>cpuSpeedInMHz</key>
<integer>0</integer>
<key>logicalCPUCoresPerPackage</key>
<integer>8</integer>
<key>modelCode</key>
<string>MacBookAir10,1</string>
<key>physicalCPUCoresPerPackage</key>
<integer>8</integer>
<key>platformIdentifier</key>
<string>com.apple.platform.macosx</string>
</dict>
<key>targetArchitecture</key>
<string>arm64</string>
<key>targetDevice</key>
<dict>
<key>modelCode</key>
<string>iPhone15,2</string>
<key>platformIdentifier</key>
<string>com.apple.platform.iphonesimulator</string>
</dict>
</dict>
</dict>
</dict>
</plist>
72 changes: 0 additions & 72 deletions Campus-iOS/Base/Entity/EntityImporter.swift

This file was deleted.

164 changes: 41 additions & 123 deletions Campus-iOS/Base/Networking/APIResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,127 +9,45 @@
import Foundation
import FirebaseCrashlytics

struct APIResponse<ResponseType: Decodable, ErrorType: APIError>: Decodable {
var response: ResponseType

init(from decoder: Decoder) throws {
if let error = try? ErrorType(from: decoder) {
throw error
} else {
let response = try ResponseType(from: decoder)
self.response = response
}
}
}

struct TUMOnlineAPIResponse<T: Decodable>: Decodable {
var rows: [T]?

enum CodingKeys: String, CodingKey {
case rows = "row"
}

init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.rows = try container.decode([Throwable<T>].self, forKey: .rows).compactMap {
do {
return try $0.result.get()
}
catch {
CrashlyticsService.log(error)
return nil
}
}
}
}

struct Throwable<T: Decodable>: Decodable {
let result: Result<T, Error>

init(from decoder: Decoder) throws {
result = Result(catching: { try T(from: decoder) })
}
}

protocol APIError: Error, Decodable { }

enum TUMOnlineAPIError: APIError, LocalizedError {
case noPermission
case tokenNotConfirmed
case invalidToken
case unkown(String)

enum CodingKeys: String, CodingKey {
case message = "message"
}

init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
let error = try container.decode(String.self, forKey: .message)

switch error {
case let str where str.contains("Keine Rechte für Funktion"):
self = .noPermission
case "Token ist nicht bestätigt!":
self = .tokenNotConfirmed
case "Token ist ungültig!":
self = .invalidToken
default:
self = .unkown(error)
}
}

public var errorDescription: String? {
switch self {
case .noPermission:
return "No Permission".localized
case .tokenNotConfirmed:
return "Token not confirmed".localized
case .invalidToken:
return "Token invalid".localized
case let .unkown(message):
return "\("Unkonw error".localized): \(message)"

}
}

public var recoverySuggestion: String? {
switch self {
case .noPermission:
return "Make sure to enable the right permissions for your token.".localized
case .tokenNotConfirmed:
return "Go to TUMonline and confirm your token.".localized
case .invalidToken:
return "Try creating a new token.".localized
default:
return nil
}
}
}


enum TUMCabeAPIError: APIError, LocalizedError {
case unkown(String)

enum CodingKeys: String, CodingKey {
case message
}

init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
let error = try container.decode(String.self, forKey: .message)

switch error {
default:
self = .unkown(error)
}
}

public var errorDescription: String? {
switch self {
case let .unkown(message):
return "\("Unkonw error".localized): \(message)"
}
}
}
//struct APIResponse<ResponseType: Decodable, ErrorType: APIError>: Decodable {
// var response: ResponseType
//
// init(from decoder: Decoder) throws {
// if let error = try? ErrorType(from: decoder) {
// throw error
// } else {
// let response = try ResponseType(from: decoder)
// self.response = response
// }
// }
//}
//
//struct TUMOnlineAPIResponse<T: Decodable>: Decodable {
// var rows: [T]?
//
// enum CodingKeys: String, CodingKey {
// case rows = "row"
// }
//
// init(from decoder: Decoder) throws {
// let container = try decoder.container(keyedBy: CodingKeys.self)
// self.rows = try container.decode([Throwable<T>].self, forKey: .rows).compactMap {
// do {
// return try $0.result.get()
// }
// catch {
// CrashlyticsService.log(error)
// return nil
// }
// }
// }
//}
//
//struct Throwable<T: Decodable>: Decodable {
// let result: Result<T, Error>
//
// init(from decoder: Decoder) throws {
// result = Result(catching: { try T(from: decoder) })
// }
//}

Loading