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

Commit

Permalink
[feature/tca-4.1.1] Minor Version 4.1.1 (#545)
Browse files Browse the repository at this point in the history
* Fix/widget and movie bugs (#511)

* change tabbar items of Widgets & Grades to "outline"

* change studyroom widget icon

* bugfix: show events on same day -> filter past events out before building dict

* Improve MovieCard Design

* Update Version Number

* Make Widgets only available on phone

* Fix/token permissions UI (#512)

* Adding a new warning if not all permissions are granted.

* Spacers and Localizables

* bugfix: fix tower image (#509)

Closes #508

* Design/login (#513)

* Move Calendar Picker to bottom

* Rename Widget Tabbaritem

* Make LecturesView icons outline

* LectureView: reduce Lecture Info Text sizes

* Remove Calendar EventsView

* Fix Movie Title Image gray bar

* - fix TUM logo white pixelation
- calendar picker back to top

* Redesign some stuff for the Login Process

* Remove old tum logo_white images

* A few Login Design changes

* Add Need Help Button to Check Permissions View

* Remove red x from Check Token Button

* Add personal NavigationTitle to Widget View

* Today Btn press in Calendar forwards to day view

* Adjust Login Design to iPad

* Localize Mensa Garching traffic

* Remove icon from Semester List Group Header on Grades & Lectures

* Adjust Grades Info Design to Lectures (-> icon outline, text larger)

* LectureDetails: Add contact btn to lecturer info

* Change Lecturer Search Icon

* Widget View: await name to display navigationTitle

* Add Spacer to Widget Detail sheet top

* Change color check token permission view text

* Open Widget View when logging in

* Generate personalized Widget Navigation Title

* Reorder Code Widget Screen

* Adjust Profile "GET IN CONTACT" Btns to Webview setting

* Move NavTitle loading into recommender loading

* remove request location always use

* A few Login - Token Design changes

* Add compiler directive that disables Crashlytics for development (#520)

* Simple Crashlytics Service (#522)

* implemented simple `CrashlyticsService`

* replaced existing crashlytics usage

* MAIN -> DEV (#533)

* v4.1 (#517)

* Fix/widget and movie bugs (#511)

* change tabbar items of Widgets & Grades to "outline"

* change studyroom widget icon

* bugfix: show events on same day -> filter past events out before building dict

* Improve MovieCard Design

* Update Version Number

* Make Widgets only available on phone

* Fix/token permissions UI (#512)

* Adding a new warning if not all permissions are granted.

* Spacers and Localizables

* bugfix: fix tower image (#509)

Closes #508

* Design/login (#513)

* Move Calendar Picker to bottom

* Rename Widget Tabbaritem

* Make LecturesView icons outline

* LectureView: reduce Lecture Info Text sizes

* Remove Calendar EventsView

* Fix Movie Title Image gray bar

* - fix TUM logo white pixelation
- calendar picker back to top

* Redesign some stuff for the Login Process

* Remove old tum logo_white images

* A few Login Design changes

* Add Need Help Button to Check Permissions View

* Remove red x from Check Token Button

* Add personal NavigationTitle to Widget View

* Today Btn press in Calendar forwards to day view

* Adjust Login Design to iPad

* Localize Mensa Garching traffic

* Remove icon from Semester List Group Header on Grades & Lectures

* Adjust Grades Info Design to Lectures (-> icon outline, text larger)

* LectureDetails: Add contact btn to lecturer info

* Change Lecturer Search Icon

* Widget View: await name to display navigationTitle

* Add Spacer to Widget Detail sheet top

* Change color check token permission view text

* Open Widget View when logging in

* Generate personalized Widget Navigation Title

* Reorder Code Widget Screen

* Adjust Profile "GET IN CONTACT" Btns to Webview setting

* Move NavTitle loading into recommender loading

* remove request location always use

* A few Login - Token Design changes

Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: 14slash12 <[email protected]>
Co-authored-by: Thomas Schuster <[email protected]>

* Bring main up to date (#521)

* Fix/widget and movie bugs (#511)

* change tabbar items of Widgets & Grades to "outline"

* change studyroom widget icon

* bugfix: show events on same day -> filter past events out before building dict

* Improve MovieCard Design

* Update Version Number

* Make Widgets only available on phone

* Fix/token permissions UI (#512)

* Adding a new warning if not all permissions are granted.

* Spacers and Localizables

* bugfix: fix tower image (#509)

Closes #508

* Design/login (#513)

* Move Calendar Picker to bottom

* Rename Widget Tabbaritem

* Make LecturesView icons outline

* LectureView: reduce Lecture Info Text sizes

* Remove Calendar EventsView

* Fix Movie Title Image gray bar

* - fix TUM logo white pixelation
- calendar picker back to top

* Redesign some stuff for the Login Process

* Remove old tum logo_white images

* A few Login Design changes

* Add Need Help Button to Check Permissions View

* Remove red x from Check Token Button

* Add personal NavigationTitle to Widget View

* Today Btn press in Calendar forwards to day view

* Adjust Login Design to iPad

* Localize Mensa Garching traffic

* Remove icon from Semester List Group Header on Grades & Lectures

* Adjust Grades Info Design to Lectures (-> icon outline, text larger)

* LectureDetails: Add contact btn to lecturer info

* Change Lecturer Search Icon

* Widget View: await name to display navigationTitle

* Add Spacer to Widget Detail sheet top

* Change color check token permission view text

* Open Widget View when logging in

* Generate personalized Widget Navigation Title

* Reorder Code Widget Screen

* Adjust Profile "GET IN CONTACT" Btns to Webview setting

* Move NavTitle loading into recommender loading

* remove request location always use

* A few Login - Token Design changes

* Add compiler directive that disables Crashlytics for development (#520)

* Simple Crashlytics Service (#522)

* implemented simple `CrashlyticsService`

* replaced existing crashlytics usage

---------

Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: 14slash12 <[email protected]>
Co-authored-by: Thomas Schuster <[email protected]>
Co-authored-by: Anton Wyrowski <[email protected]>

---------

Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: 14slash12 <[email protected]>
Co-authored-by: Thomas Schuster <[email protected]>
Co-authored-by: Anton Wyrowski <[email protected]>

* MAIN -> DEV (#535)

* v4.1 (#517)

* Fix/widget and movie bugs (#511)

* change tabbar items of Widgets & Grades to "outline"

* change studyroom widget icon

* bugfix: show events on same day -> filter past events out before building dict

* Improve MovieCard Design

* Update Version Number

* Make Widgets only available on phone

* Fix/token permissions UI (#512)

* Adding a new warning if not all permissions are granted.

* Spacers and Localizables

* bugfix: fix tower image (#509)

Closes #508

* Design/login (#513)

* Move Calendar Picker to bottom

* Rename Widget Tabbaritem

* Make LecturesView icons outline

* LectureView: reduce Lecture Info Text sizes

* Remove Calendar EventsView

* Fix Movie Title Image gray bar

* - fix TUM logo white pixelation
- calendar picker back to top

* Redesign some stuff for the Login Process

* Remove old tum logo_white images

* A few Login Design changes

* Add Need Help Button to Check Permissions View

* Remove red x from Check Token Button

* Add personal NavigationTitle to Widget View

* Today Btn press in Calendar forwards to day view

* Adjust Login Design to iPad

* Localize Mensa Garching traffic

* Remove icon from Semester List Group Header on Grades & Lectures

* Adjust Grades Info Design to Lectures (-> icon outline, text larger)

* LectureDetails: Add contact btn to lecturer info

* Change Lecturer Search Icon

* Widget View: await name to display navigationTitle

* Add Spacer to Widget Detail sheet top

* Change color check token permission view text

* Open Widget View when logging in

* Generate personalized Widget Navigation Title

* Reorder Code Widget Screen

* Adjust Profile "GET IN CONTACT" Btns to Webview setting

* Move NavTitle loading into recommender loading

* remove request location always use

* A few Login - Token Design changes

Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: 14slash12 <[email protected]>
Co-authored-by: Thomas Schuster <[email protected]>

* Bring main up to date (#521)

* Fix/widget and movie bugs (#511)

* change tabbar items of Widgets & Grades to "outline"

* change studyroom widget icon

* bugfix: show events on same day -> filter past events out before building dict

* Improve MovieCard Design

* Update Version Number

* Make Widgets only available on phone

* Fix/token permissions UI (#512)

* Adding a new warning if not all permissions are granted.

* Spacers and Localizables

* bugfix: fix tower image (#509)

Closes #508

* Design/login (#513)

* Move Calendar Picker to bottom

* Rename Widget Tabbaritem

* Make LecturesView icons outline

* LectureView: reduce Lecture Info Text sizes

* Remove Calendar EventsView

* Fix Movie Title Image gray bar

* - fix TUM logo white pixelation
- calendar picker back to top

* Redesign some stuff for the Login Process

* Remove old tum logo_white images

* A few Login Design changes

* Add Need Help Button to Check Permissions View

* Remove red x from Check Token Button

* Add personal NavigationTitle to Widget View

* Today Btn press in Calendar forwards to day view

* Adjust Login Design to iPad

* Localize Mensa Garching traffic

* Remove icon from Semester List Group Header on Grades & Lectures

* Adjust Grades Info Design to Lectures (-> icon outline, text larger)

* LectureDetails: Add contact btn to lecturer info

* Change Lecturer Search Icon

* Widget View: await name to display navigationTitle

* Add Spacer to Widget Detail sheet top

* Change color check token permission view text

* Open Widget View when logging in

* Generate personalized Widget Navigation Title

* Reorder Code Widget Screen

* Adjust Profile "GET IN CONTACT" Btns to Webview setting

* Move NavTitle loading into recommender loading

* remove request location always use

* A few Login - Token Design changes

* Add compiler directive that disables Crashlytics for development (#520)

* Simple Crashlytics Service (#522)

* implemented simple `CrashlyticsService`

* replaced existing crashlytics usage

---------

Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: 14slash12 <[email protected]>
Co-authored-by: Thomas Schuster <[email protected]>
Co-authored-by: Anton Wyrowski <[email protected]>

* DEV -> MAIN (#534)

* Fix/widget and movie bugs (#511)

* change tabbar items of Widgets & Grades to "outline"

* change studyroom widget icon

* bugfix: show events on same day -> filter past events out before building dict

* Improve MovieCard Design

* Update Version Number

* Make Widgets only available on phone

* Fix/token permissions UI (#512)

* Adding a new warning if not all permissions are granted.

* Spacers and Localizables

* bugfix: fix tower image (#509)

Closes #508

* Design/login (#513)

* Move Calendar Picker to bottom

* Rename Widget Tabbaritem

* Make LecturesView icons outline

* LectureView: reduce Lecture Info Text sizes

* Remove Calendar EventsView

* Fix Movie Title Image gray bar

* - fix TUM logo white pixelation
- calendar picker back to top

* Redesign some stuff for the Login Process

* Remove old tum logo_white images

* A few Login Design changes

* Add Need Help Button to Check Permissions View

* Remove red x from Check Token Button

* Add personal NavigationTitle to Widget View

* Today Btn press in Calendar forwards to day view

* Adjust Login Design to iPad

* Localize Mensa Garching traffic

* Remove icon from Semester List Group Header on Grades & Lectures

* Adjust Grades Info Design to Lectures (-> icon outline, text larger)

* LectureDetails: Add contact btn to lecturer info

* Change Lecturer Search Icon

* Widget View: await name to display navigationTitle

* Add Spacer to Widget Detail sheet top

* Change color check token permission view text

* Open Widget View when logging in

* Generate personalized Widget Navigation Title

* Reorder Code Widget Screen

* Adjust Profile "GET IN CONTACT" Btns to Webview setting

* Move NavTitle loading into recommender loading

* remove request location always use

* A few Login - Token Design changes

* Add compiler directive that disables Crashlytics for development (#520)

* Simple Crashlytics Service (#522)

* implemented simple `CrashlyticsService`

* replaced existing crashlytics usage

* MAIN -> DEV (#533)

* v4.1 (#517)

* Fix/widget and movie bugs (#511)

* change tabbar items of Widgets & Grades to "outline"

* change studyroom widget icon

* bugfix: show events on same day -> filter past events out before building dict

* Improve MovieCard Design

* Update Version Number

* Make Widgets only available on phone

* Fix/token permissions UI (#512)

* Adding a new warning if not all permissions are granted.

* Spacers and Localizables

* bugfix: fix tower image (#509)

Closes #508

* Design/login (#513)

* Move Calendar Picker to bottom

* Rename Widget Tabbaritem

* Make LecturesView icons outline

* LectureView: reduce Lecture Info Text sizes

* Remove Calendar EventsView

* Fix Movie Title Image gray bar

* - fix TUM logo white pixelation
- calendar picker back to top

* Redesign some stuff for the Login Process

* Remove old tum logo_white images

* A few Login Design changes

* Add Need Help Button to Check Permissions View

* Remove red x from Check Token Button

* Add personal NavigationTitle to Widget View

* Today Btn press in Calendar forwards to day view

* Adjust Login Design to iPad

* Localize Mensa Garching traffic

* Remove icon from Semester List Group Header on Grades & Lectures

* Adjust Grades Info Design to Lectures (-> icon outline, text larger)

* LectureDetails: Add contact btn to lecturer info

* Change Lecturer Search Icon

* Widget View: await name to display navigationTitle

* Add Spacer to Widget Detail sheet top

* Change color check token permission view text

* Open Widget View when logging in

* Generate personalized Widget Navigation Title

* Reorder Code Widget Screen

* Adjust Profile "GET IN CONTACT" Btns to Webview setting

* Move NavTitle loading into recommender loading

* remove request location always use

* A few Login - Token Design changes

Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: 14slash12 <[email protected]>
Co-authored-by: Thomas Schuster <[email protected]>

* Bring main up to date (#521)

* Fix/widget and movie bugs (#511)

* change tabbar items of Widgets & Grades to "outline"

* change studyroom widget icon

* bugfix: show events on same day -> filter past events out before building dict

* Improve MovieCard Design

* Update Version Number

* Make Widgets only available on phone

* Fix/token permissions UI (#512)

* Adding a new warning if not all permissions are granted.

* Spacers and Localizables

* bugfix: fix tower image (#509)

Closes #508

* Design/login (#513)

* Move Calendar Picker to bottom

* Rename Widget Tabbaritem

* Make LecturesView icons outline

* LectureView: reduce Lecture Info Text sizes

* Remove Calendar EventsView

* Fix Movie Title Image gray bar

* - fix TUM logo white pixelation
- calendar picker back to top

* Redesign some stuff for the Login Process

* Remove old tum logo_white images

* A few Login Design changes

* Add Need Help Button to Check Permissions View

* Remove red x from Check Token Button

* Add personal NavigationTitle to Widget View

* Today Btn press in Calendar forwards to day view

* Adjust Login Design to iPad

* Localize Mensa Garching traffic

* Remove icon from Semester List Group Header on Grades & Lectures

* Adjust Grades Info Design to Lectures (-> icon outline, text larger)

* LectureDetails: Add contact btn to lecturer info

* Change Lecturer Search Icon

* Widget View: await name to display navigationTitle

* Add Spacer to Widget Detail sheet top

* Change color check token permission view text

* Open Widget View when logging in

* Generate personalized Widget Navigation Title

* Reorder Code Widget Screen

* Adjust Profile "GET IN CONTACT" Btns to Webview setting

* Move NavTitle loading into recommender loading

* remove request location always use

* A few Login - Token Design changes

* Add compiler directive that disables Crashlytics for development (#520)

* Simple Crashlytics Service (#522)

* implemented simple `CrashlyticsService`

* replaced existing crashlytics usage

---------

Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: 14slash12 <[email protected]>
Co-authored-by: Thomas Schuster <[email protected]>
Co-authored-by: Anton Wyrowski <[email protected]>

---------

Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: 14slash12 <[email protected]>
Co-authored-by: Thomas Schuster <[email protected]>
Co-authored-by: Anton Wyrowski <[email protected]>

---------

Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: 14slash12 <[email protected]>
Co-authored-by: Thomas Schuster <[email protected]>
Co-authored-by: Anton Wyrowski <[email protected]>

---------

Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: 14slash12 <[email protected]>
Co-authored-by: Thomas Schuster <[email protected]>
Co-authored-by: Anton Wyrowski <[email protected]>

* Fix Swift 5.8 compile errors (#538)

* Feature/navigatum-dev (#539)

* Copy over changes to branch with "development" as base.

* Fix overlay images.

* Remove images. Adjust map height.

* API Refactoring (#536)

* Start to refactor the API buy generalizing all the API methods into one MainAPI enum independent of the API (TUMCabe, TUMOnline, CampusOnline, etc.), the respective data type which (i.e. Grades, Movie, StudyRoom, etc.) and independent of the decoder (XML or JSON).

* Created for each API an new enum conforming to the new protocol API to be used with the newly created method makeRequest<T,S> in the enum MainAPI

* Refactored Calendar to work with the Asyn-Await-Pattern, the state enum and the new API. This includes, that Calendar now shows the error screen, if the fetching failed

* Refactored LecturesSearch to the new API and introduced the asnc-await-pattern with the state enum

* Refactored the API for PersonSearch and added the new async-await pattern and error handling for this view.

* Completely rewritten the ProfileDetailView and its ViewModel to adopt to the async-await-pattern, and the state-enum and handling errors properly

* Refactoring the complete Authentication procress to work with the new API and to work with asnc-await

* Refactored the ProfileViewModel, ProfileView, Model, to work with the new API, including async-await pattern and many many adjustments alongside.

* Adding the empty profile image placeholder and removing the old TUMOnlineAPI/CampusOnlineAPI completely.

* Renamed the ProfileView2/ProfileViewModel2 -> to ProfileView/ProfileViewModel

* Refactoring the News for the API including async-await-pattern, error-handling, state-enum

* Renamed the new NewsViewModel, NewsView to the old names

* Extracted the new NewsScreen into a own file

* Refactored the MovieView for the new API, including error-handling, async-await, and state-enum

* Refactored the StudyRoomViewModel for fetching the RoomImageMapping. Adapted for the async-await-patter and enum-state

* Removed the old TUMCabeAPI

* Refactoring the Cafeterias to work with the new API

* Refactored the MealPlanViewModel/View, to work with the new API, adding async-await pattern and error-handling

* Refactored the DishLabels to work with the new API

* Refactored the StudyRoomService to work with the new API for the StudyRoomApiResponse

* Removed the old TUMDevAppAPI completely

* Fixed the links for the TUMSexyView, when using the built in WebView. Refactored to the new API, added async-await-pattern and error-handling

* Removed the EntityImporter the old AuthenticationHanlder, the defualt Session and the Entity-Protocol

* Refactored the Lectures to be a struct instead of the old RowSet-Enum-Construct. This is obsolet since the TUMOnlineAPI response enum can be used for decoding

* Refactored LectureDetails to work with the TUMOnlineAPI.Response instead of its own old LectureDetailsComponents

* Fixing an issue for MealPlan. When next week's menu isn't ready the API throws a 404 error, but we can fetch meals for the current week. Thus, we need to be patient, i.e. no error needs to be thrown. And the this weeks menu can be shown without any error

* Refactoring each view from .onAppear{Task{}} to .task{} since this can be cancled by the view (see https://stackoverflow.com/questions/68114509/what-is-the-difference-between-onappear-and-task-in-swiftui-3)

* Deleted a print out and comment

* Renaming the APIs to its original naming scheme. And creating files for each API and rename all temporarily created ViewModels to their original naming scheme. Fixing the problem with Cafeterias, which do not have any menus and the API is returning a 404 error. Now just a plain 'No Menus available' text shows up instead of an error message. Fixing a problem with the PersonSearch where the pIdentNr for the API was the wrong number, so the response was an error, now the API gets called with the obfuscated_id and the right results are retrieved.

* Fix issue after logout via Profile sheet

* Readding old if clause to fix weird bevaiour; Add comments

* [fix/swift-5.8] Code adjustments for Swift 5.8 compiler (#542)

* Fix swift 5.8 compile errors

* Force refresh of token requests

* Fix auth issues

* Fix loading error. Revert images view since it's not needed.

* Forward to NavigaTUM from Lecture Detail View instead of Roomfinder

* Reduce NavigaTUM Map Span

* Update some Localizables

* Fix studitum fetch link

---------

Co-authored-by: Atharva Mathapati <[email protected]>
Co-authored-by: August Wittgenstein <[email protected]>

* Fix Crash: If links at the bottom of the profile view are clicked, the webview sheet opens twice, hence the app crashes

* Fix Merge Conflicts Issues

---------

Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: August Wittgenstein <[email protected]>
Co-authored-by: 14slash12 <[email protected]>
Co-authored-by: Thomas Schuster <[email protected]>
Co-authored-by: Anton Wyrowski <[email protected]>
Co-authored-by: Moritz Aberle <[email protected]>
Co-authored-by: Atharva <[email protected]>
Co-authored-by: Atharva Mathapati <[email protected]>
  • Loading branch information
9 people authored Jun 5, 2023
1 parent 53e6c2a commit 40d8fe3
Show file tree
Hide file tree
Showing 181 changed files with 5,662 additions and 2,907 deletions.
622 changes: 525 additions & 97 deletions Campus-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Campus-iOS/AnalyticsComponent/AnalyticsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct AnalyticsController {
print("Info: app usage data upload is disabled.")
return

/*
if !didOptIn {
return
}
Expand Down Expand Up @@ -89,5 +90,6 @@ struct AnalyticsController {
request.setValue(postToken, forHTTPHeaderField: "Authorization")
let (_, _) = try await URLSession.shared.data(for: request)
*/
}
}
81 changes: 0 additions & 81 deletions Campus-iOS/AnalyticsComüo/AnalyticsController.swift

This file was deleted.

12 changes: 0 additions & 12 deletions Campus-iOS/AnalyticsComüo/AnalyticsError.swift

This file was deleted.

125 changes: 0 additions & 125 deletions Campus-iOS/AnalyticsComüo/AppUsageData.swift

This file was deleted.

28 changes: 0 additions & 28 deletions Campus-iOS/AnalyticsComüo/AppUsageDataEntity.swift

This file was deleted.

20 changes: 0 additions & 20 deletions Campus-iOS/AnalyticsComüo/HashFunction.swift

This file was deleted.

12 changes: 0 additions & 12 deletions Campus-iOS/AnalyticsComüo/Secrets.xcconfig

This file was deleted.

19 changes: 18 additions & 1 deletion Campus-iOS/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import KVKCalendar
import Firebase

@main
@MainActor
struct CampusApp: App {
@StateObject var model: Model = Model()

Expand Down Expand Up @@ -46,13 +47,29 @@ struct CampusApp: App {
})
.environmentObject(model)
.environment(\.managedObjectContext, persistenceController.container.viewContext)
.task {
guard let credentials = model.loginController.credentials else {
model.isUserAuthenticated = false
model.isLoginSheetPresented = true
return
}

switch credentials {
case .noTumID:
model.isUserAuthenticated = false
model.isLoginSheetPresented = false
case .tumID(tumID: _, token: _), .tumIDAndKey(tumID: _, token: _, key: _):
model.isUserAuthenticated = true
model.isLoginSheetPresented = false
}
}
}
}

func tabViewComponent() -> some View {
TabView(selection: $selectedTab) {
NavigationView {
CalendarContentView(
CalendarScreen(
model: model,
refresh: $model.isUserAuthenticated
)
Expand Down
17 changes: 16 additions & 1 deletion Campus-iOS/Base/Enums/Enums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,22 @@ enum Gender: Decodable, Hashable {
}
}

enum ContactInfo {
enum ContactInfo: Identifiable {
var id: String {
switch self {
case .phone(let phone):
return phone
case .mobilePhone(let mobile):
return mobile
case .fax(let fax):
return fax
case .additionalInfo(let info):
return info
case .homepage(let homepage):
return homepage
}
}

case phone(String)
case mobilePhone(String)
case fax(String)
Expand Down
37 changes: 37 additions & 0 deletions Campus-iOS/Base/Networking/APIErrors/EatAPIError.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// EatAPIError.swift
// Campus-iOS
//
// Created by David Lin on 10.02.23.
//

import Foundation

enum EatAPIError: APIError, LocalizedError {
case unknown(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 = .unknown(error)
}
}

init(message: String) {
self = .unknown(message)
}

public var errorDescription: String? {
switch self {
case let .unknown(message):
return "\("Unkonw error".localized): \(message)"
}
}
}
Loading

0 comments on commit 40d8fe3

Please sign in to comment.