From 276b5fa52694933e0ba6206b052a6df6f7229560 Mon Sep 17 00:00:00 2001 From: Philipp Zagar Date: Wed, 26 Apr 2023 15:41:34 +0200 Subject: [PATCH 1/8] Fix swift 5.8 compile errors --- .../Views/TokenConfirmationView.swift | 20 +++++++++---------- .../View/Cafeterias/CafeteriaWidgetView.swift | 5 ++--- .../View/Cafeterias/MealPlanView.swift | 6 +++++- Campus-iOS/NewsComponent/Views/NewsView.swift | 4 +--- .../ProfileComponent/View/ProfileView.swift | 4 +--- .../TUMSexyComponent/Views/TUMSexyView.swift | 2 +- 6 files changed, 19 insertions(+), 22 deletions(-) diff --git a/Campus-iOS/LoginComponent/Views/TokenConfirmationView.swift b/Campus-iOS/LoginComponent/Views/TokenConfirmationView.swift index 486f327c..de12945d 100644 --- a/Campus-iOS/LoginComponent/Views/TokenConfirmationView.swift +++ b/Campus-iOS/LoginComponent/Views/TokenConfirmationView.swift @@ -178,17 +178,15 @@ struct TokenConfirmationView: View { } } case .active: - if let model = self.viewModel.model { - NavigationLink(destination: TokenPermissionsView(viewModel: TokenPermissionsViewModel(model: model)).navigationTitle("Check Permissions"), isActive: $isActive) { - Text("Next") - .lineLimit(1) - .font(.body) - .frame(width: 200, height: 48, alignment: .center) - .foregroundColor(.white) - .background(.green) - .cornerRadius(10) - .buttonStyle(.plain) - } + NavigationLink(destination: TokenPermissionsView(viewModel: TokenPermissionsViewModel(model: self.viewModel.model)).navigationTitle("Check Permissions"), isActive: $isActive) { + Text("Next") + .lineLimit(1) + .font(.body) + .frame(width: 200, height: 48, alignment: .center) + .foregroundColor(.white) + .background(.green) + .cornerRadius(10) + .buttonStyle(.plain) } } } diff --git a/Campus-iOS/MapComponent/View/Cafeterias/CafeteriaWidgetView.swift b/Campus-iOS/MapComponent/View/Cafeterias/CafeteriaWidgetView.swift index 3f89366f..eed863f5 100644 --- a/Campus-iOS/MapComponent/View/Cafeterias/CafeteriaWidgetView.swift +++ b/Campus-iOS/MapComponent/View/Cafeterias/CafeteriaWidgetView.swift @@ -33,13 +33,12 @@ struct CafeteriaWidgetView: View { WidgetLoadingView(text: "Searching nearby cafeteria") default: if let cafeteria = viewModel.cafeteria, - let title = cafeteria.title, - let coordinate = cafeteria.coordinate { + let title = cafeteria.title { CafeteriaWidgetContent( size: size, cafeteria: title, dishes: viewModel.menu?.getDishes() ?? [], - coordinate: coordinate + coordinate: cafeteria.coordinate ) } else { TextWidgetView(text: "There was an error getting the menu from the nearest cafeteria.") diff --git a/Campus-iOS/MapComponent/View/Cafeterias/MealPlanView.swift b/Campus-iOS/MapComponent/View/Cafeterias/MealPlanView.swift index 7cc6fea1..b7b3a6a9 100644 --- a/Campus-iOS/MapComponent/View/Cafeterias/MealPlanView.swift +++ b/Campus-iOS/MapComponent/View/Cafeterias/MealPlanView.swift @@ -44,12 +44,16 @@ struct MealPlanView: View { } .padding(.horizontal, 5.0) + MenuView(menu: selectedMenu) + + /* if let menu = selectedMenu { - MenuView(menu: menu) + } else { Spacer().frame(height: 20) Text("No Menu available today").foregroundColor(colorScheme == .dark ? .init(UIColor.lightGray) : .init(UIColor.darkGray)) } + */ } } else { Text("No Menus available") diff --git a/Campus-iOS/NewsComponent/Views/NewsView.swift b/Campus-iOS/NewsComponent/Views/NewsView.swift index 54a1c2c1..ce4c6ef0 100644 --- a/Campus-iOS/NewsComponent/Views/NewsView.swift +++ b/Campus-iOS/NewsComponent/Views/NewsView.swift @@ -45,9 +45,7 @@ struct NewsView: View { // adjust height Spacer(minLength: 1) }.sheet(item: $selectedLink) { selectedLink in - if let link = selectedLink { - SFSafariViewWrapper(url: link) - } + SFSafariViewWrapper(url: selectedLink) } Spacer() }.padding() diff --git a/Campus-iOS/ProfileComponent/View/ProfileView.swift b/Campus-iOS/ProfileComponent/View/ProfileView.swift index c5b594e3..2f1d2d0d 100644 --- a/Campus-iOS/ProfileComponent/View/ProfileView.swift +++ b/Campus-iOS/ProfileComponent/View/ProfileView.swift @@ -206,9 +206,7 @@ struct ProfileView: View { } .sheet(item: $selectedLink) { selectedLink in // This if clause is needed since after logout via the ProfileView an issue occured. This fixes the weird behaviour. - if let link = selectedLink { - SFSafariViewWrapper(url: link) - } + SFSafariViewWrapper(url: selectedLink) } }.task { await vm.getProfile(forcedRefresh: false) diff --git a/Campus-iOS/TUMSexyComponent/Views/TUMSexyView.swift b/Campus-iOS/TUMSexyComponent/Views/TUMSexyView.swift index a0a49836..3899a3b7 100644 --- a/Campus-iOS/TUMSexyComponent/Views/TUMSexyView.swift +++ b/Campus-iOS/TUMSexyComponent/Views/TUMSexyView.swift @@ -38,7 +38,7 @@ struct TUMSexyView: View { .searchable(text: $searchText) .navigationTitle("Useful Links") .sheet(item: $shownLink) { link in - if let link = link, let target = link.target, let url = URL(string: target) { + if let target = link.target, let url = URL(string: target) { SFSafariViewWrapper(url: url) } } From cd2a35e2e94d44f37f6d454a460e8e96ee6b6138 Mon Sep 17 00:00:00 2001 From: Philipp Zagar Date: Mon, 1 May 2023 12:04:58 +0200 Subject: [PATCH 2/8] Force refresh of token requests --- Campus-iOS/LoginComponent/Service/AuthenticationHandler.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Campus-iOS/LoginComponent/Service/AuthenticationHandler.swift b/Campus-iOS/LoginComponent/Service/AuthenticationHandler.swift index d920434f..8d0f0429 100644 --- a/Campus-iOS/LoginComponent/Service/AuthenticationHandler.swift +++ b/Campus-iOS/LoginComponent/Service/AuthenticationHandler.swift @@ -64,7 +64,7 @@ class AuthenticationHandler { do { let tokenName = "TCA - \(await UIDevice.current.name)" - let token: Token = try await MainAPI.makeRequest(endpoint: TUMOnlineAPI.tokenRequest(tumID: tumID, tokenName: tokenName)) + let token: Token = try await MainAPI.makeRequest(endpoint: TUMOnlineAPI.tokenRequest(tumID: tumID, tokenName: tokenName), forcedRefresh: true) print(token.value) self.credentials = Credentials.tumID(tumID: tumID, token: token.value) completion(.success(token.value)) @@ -82,7 +82,7 @@ class AuthenticationHandler { case .tumID(tumID: _, token: let token), .tumIDAndKey(tumID: _, token: let token, key: _): do { - let confirmation: Confirmation = try await MainAPI.makeRequest(endpoint: TUMOnlineAPI.tokenConfirmation, token: token) + let confirmation: Confirmation = try await MainAPI.makeRequest(endpoint: TUMOnlineAPI.tokenConfirmation, token: token, forcedRefresh: true) if confirmation.value { callback(.success(true)) } else { From 720d0d80bc075acd12ae395e699d906758272132 Mon Sep 17 00:00:00 2001 From: Philipp Zagar Date: Mon, 1 May 2023 14:03:10 +0200 Subject: [PATCH 3/8] Fix auth issues --- .../AnalyticsController.swift | 2 ++ Campus-iOS/App.swift | 33 +++++++------------ .../Service/AuthenticationHandler.swift | 25 +++++++------- .../ViewModel/LoginViewModel.swift | 12 +++---- .../Views/TokenConfirmationView.swift | 2 +- .../Views/TokenPermissionsView.swift | 2 +- Campus-iOS/Model/Model.swift | 15 +-------- 7 files changed, 36 insertions(+), 55 deletions(-) diff --git a/Campus-iOS/AnalyticsComponent/AnalyticsController.swift b/Campus-iOS/AnalyticsComponent/AnalyticsController.swift index 8a037fca..9ba5ebde 100644 --- a/Campus-iOS/AnalyticsComponent/AnalyticsController.swift +++ b/Campus-iOS/AnalyticsComponent/AnalyticsController.swift @@ -33,6 +33,7 @@ struct AnalyticsController { print("Info: app usage data upload is disabled.") return + /* if !didOptIn { return } @@ -89,5 +90,6 @@ struct AnalyticsController { request.setValue(postToken, forHTTPHeaderField: "Authorization") let (_, _) = try await URLSession.shared.data(for: request) + */ } } diff --git a/Campus-iOS/App.swift b/Campus-iOS/App.swift index dd0b82d1..7045d8f8 100644 --- a/Campus-iOS/App.swift +++ b/Campus-iOS/App.swift @@ -48,28 +48,19 @@ struct CampusApp: App { .environmentObject(model) .environment(\.managedObjectContext, persistenceController.container.viewContext) .task { - if model.loginController.credentials == Credentials.noTumID { + guard let credentials = model.loginController.credentials else { model.isUserAuthenticated = false - } else { - await model.loginController.confirmToken() { result in - switch result { - case .success: - #if !targetEnvironment(macCatalyst) - Analytics.logEvent("token_confirmed", parameters: nil) - #endif - DispatchQueue.main.async { - model.isLoginSheetPresented = false - model.isUserAuthenticated = true - } - -// model.loadProfile() - case .failure(_): - model.isUserAuthenticated = false - if !model.showProfile { - model.isLoginSheetPresented = true - } - } - } + 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 } } } diff --git a/Campus-iOS/LoginComponent/Service/AuthenticationHandler.swift b/Campus-iOS/LoginComponent/Service/AuthenticationHandler.swift index 8d0f0429..45988c1a 100644 --- a/Campus-iOS/LoginComponent/Service/AuthenticationHandler.swift +++ b/Campus-iOS/LoginComponent/Service/AuthenticationHandler.swift @@ -75,24 +75,27 @@ class AuthenticationHandler { } - func confirmToken(callback: @escaping (Result) -> Void) async { - if let credentials = credentials { - switch credentials { - case .noTumID: callback(.failure(LoginError.missingToken)) - case .tumID(tumID: _, token: let token), - .tumIDAndKey(tumID: _, token: let token, key: _): + func confirmToken() async -> Result { + guard let credentials else { + return .failure(TUMOnlineAPIError.invalidToken) + } + + switch credentials { + case .noTumID: + return .failure(LoginError.missingToken) + case .tumID(tumID: _, token: let token), .tumIDAndKey(tumID: _, token: let token, key: _): do { let confirmation: Confirmation = try await MainAPI.makeRequest(endpoint: TUMOnlineAPI.tokenConfirmation, token: token, forcedRefresh: true) + if confirmation.value { - callback(.success(true)) + return .success(true) } else { - callback(.failure(TUMOnlineAPIError.tokenNotConfirmed)) + return .failure(TUMOnlineAPIError.tokenNotConfirmed) } } catch { print(error.localizedDescription) - callback(.failure(LoginError.serverError(message: error.localizedDescription))) + return .failure(LoginError.serverError(message: error.localizedDescription)) } - } } } @@ -100,7 +103,7 @@ class AuthenticationHandler { #if !targetEnvironment(macCatalyst) Analytics.logEvent("logout", parameters: nil) #endif - // deletes uthenticationHandler.keychain[data: "credentials"] + // deletes authenticationHandler.keychain[data: "credentials"] credentials = nil } diff --git a/Campus-iOS/LoginComponent/ViewModel/LoginViewModel.swift b/Campus-iOS/LoginComponent/ViewModel/LoginViewModel.swift index a0a940d4..0c71a3e0 100644 --- a/Campus-iOS/LoginComponent/ViewModel/LoginViewModel.swift +++ b/Campus-iOS/LoginComponent/ViewModel/LoginViewModel.swift @@ -63,25 +63,23 @@ class LoginViewModel: ObservableObject { } func checkAuthorization(callback: @escaping (Result) -> Void) async { - await loginController.confirmToken { result in - switch result { + switch await model.loginController.confirmToken() { case .success: #if !targetEnvironment(macCatalyst) Analytics.logEvent("token_confirmed", parameters: nil) #endif - //wself?.model?.isLoginSheetPresented = false + DispatchQueue.main.async { self.model.isUserAuthenticated = true self.model.showProfile = false } -// self.model?.loadProfile() - + callback(.success(true)) - case let .failure(error): + case .failure(let error): self.model.isUserAuthenticated = false self.alertMessage = error.localizedDescription + callback(.failure(error)) - } } } } diff --git a/Campus-iOS/LoginComponent/Views/TokenConfirmationView.swift b/Campus-iOS/LoginComponent/Views/TokenConfirmationView.swift index de12945d..1a9b5518 100644 --- a/Campus-iOS/LoginComponent/Views/TokenConfirmationView.swift +++ b/Campus-iOS/LoginComponent/Views/TokenConfirmationView.swift @@ -132,7 +132,7 @@ struct TokenConfirmationView: View { if !tokenPermissionButton { Button(action: { Task { - await self.viewModel.checkAuthorization() { result in + await self.viewModel.checkAuthorization() { result in switch result { case .success: withAnimation { diff --git a/Campus-iOS/LoginComponent/Views/TokenPermissionsView.swift b/Campus-iOS/LoginComponent/Views/TokenPermissionsView.swift index 7f1e3abe..8f20cbee 100644 --- a/Campus-iOS/LoginComponent/Views/TokenPermissionsView.swift +++ b/Campus-iOS/LoginComponent/Views/TokenPermissionsView.swift @@ -49,7 +49,7 @@ struct TokenPermissionsView: View { .padding() VStack { - HStack (){ + HStack { Button { self.showTUMOnline = true self.doneButton = false diff --git a/Campus-iOS/Model/Model.swift b/Campus-iOS/Model/Model.swift index fb98951b..9d578de8 100644 --- a/Campus-iOS/Model/Model.swift +++ b/Campus-iOS/Model/Model.swift @@ -55,21 +55,8 @@ public class Model: ObservableObject { func logout() { DispatchQueue.main.async { self.loginController.logout() - self.isLoginSheetPresented = self.showProfile ? false : true + self.isLoginSheetPresented = true self.isUserAuthenticated = false -// self.unloadProfile() } } - -// func unloadProfile() { -// DispatchQueue.main.async { -// self.profile = ProfileViewModel() -// } -// } -// -// func loadProfile() { -// DispatchQueue.main.async { -// self.profile = ProfileViewModel(model: self) -// } -// } } From 131489bd450fef26acac951a6fc1b237e12c513d Mon Sep 17 00:00:00 2001 From: Atharva Mathapati Date: Tue, 9 May 2023 01:06:56 +0200 Subject: [PATCH 4/8] Fix loading error. Revert images view since it's not needed. --- .../HelperViews/ImageFullScreenView.swift | 39 +++++++------------ .../StudyRooms/StudyRoomDetailsScreen.swift | 4 +- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/Campus-iOS/HelperViews/ImageFullScreenView.swift b/Campus-iOS/HelperViews/ImageFullScreenView.swift index f11b0c75..2a2066b0 100644 --- a/Campus-iOS/HelperViews/ImageFullScreenView.swift +++ b/Campus-iOS/HelperViews/ImageFullScreenView.swift @@ -10,34 +10,21 @@ import SwiftUI struct ImageFullScreenView: View { @State var image: Image - @State var zoomScale: CGFloat = 1.0 - @State private var lastScale: CGFloat = 1.0 + @State var scale: CGFloat = 1.0 @State var viewState = CGSize.zero - + var body: some View { - GeometryReader { imageWrapper in - self.image - .resizable() - .aspectRatio(contentMode: .fit) - .scaleEffect(self.zoomScale) - .animation(.spring(), value: self.viewState) - - .offset(x: self.viewState.width, y: self.viewState.height) - .gesture(DragGesture().onChanged { val in - self.viewState = val.translation - }) - .gesture(MagnificationGesture() - .onChanged { val in - let delta = val / self.lastScale - self.lastScale = val - if delta > 0.94 { // if statement to minimize jitter - let newScale = self.zoomScale * delta - self.zoomScale = newScale - } - } - .onEnded { _ in - self.lastScale = 1.0}) - } + self.image + .resizable() + .aspectRatio(contentMode: .fit) + .offset(x: self.viewState.width, y: self.viewState.height) + .scaleEffect(self.scale) + .gesture(DragGesture().onChanged { val in + self.viewState = val.translation + }) + .gesture(MagnificationGesture().onChanged { val in + self.scale = val.magnitude + }) } } diff --git a/Campus-iOS/MapComponent/View/StudyRooms/StudyRoomDetailsScreen.swift b/Campus-iOS/MapComponent/View/StudyRooms/StudyRoomDetailsScreen.swift index 0a5eebf8..aaa980ee 100644 --- a/Campus-iOS/MapComponent/View/StudyRooms/StudyRoomDetailsScreen.swift +++ b/Campus-iOS/MapComponent/View/StudyRooms/StudyRoomDetailsScreen.swift @@ -25,6 +25,8 @@ struct StudyRoomDetailsScreen: View { Spacer() LoadingView(text: "Fetching RoomImages") Spacer() + }.task { + await vm.getRoomImageMapping(for: room) } case .failed(let error): VStack { @@ -45,8 +47,6 @@ struct StudyRoomDetailsScreen: View { .padding() } } - }.task { - await vm.getRoomImageMapping(for: self.room) }.alert( "Error while fetching Room Images", isPresented: $vm.hasError, From 6ce1636122bab051953364153ff194805524be57 Mon Sep 17 00:00:00 2001 From: August Wittgenstein Date: Thu, 11 May 2023 15:04:23 +0200 Subject: [PATCH 5/8] Forward to NavigaTUM from Lecture Detail View instead of Roomfinder --- .../LectureDetailsViews/LectureDetailsEventInfoView.swift | 4 +++- Campus-iOS/RoomFinder/ViewNavigaTum/NavigaTumView.swift | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Campus-iOS/LectureComponent/Views/LectureDetailsViews/LectureDetailsEventInfoView.swift b/Campus-iOS/LectureComponent/Views/LectureDetailsViews/LectureDetailsEventInfoView.swift index 09df0bee..90bb5443 100644 --- a/Campus-iOS/LectureComponent/Views/LectureDetailsViews/LectureDetailsEventInfoView.swift +++ b/Campus-iOS/LectureComponent/Views/LectureDetailsViews/LectureDetailsEventInfoView.swift @@ -47,7 +47,9 @@ struct LectureDetailsEventInfoView: View { ) HStack { Spacer() - NavigationLink(destination: RoomFinderView(model: viewModel.model, viewModel: RoomFinderViewModel(), searchText: extract(room: self.location))) { + NavigationLink(destination: NavigaTumView(model: viewModel.model, searchText: extract(room: self.location)) + .navigationTitle(Text("Roomfinder")) + .navigationBarTitleDisplayMode(.large)) { HStack { Text("Open in RoomFinder") Image(systemName: "arrow.right.circle") diff --git a/Campus-iOS/RoomFinder/ViewNavigaTum/NavigaTumView.swift b/Campus-iOS/RoomFinder/ViewNavigaTum/NavigaTumView.swift index f1ae088c..57a10a12 100644 --- a/Campus-iOS/RoomFinder/ViewNavigaTum/NavigaTumView.swift +++ b/Campus-iOS/RoomFinder/ViewNavigaTum/NavigaTumView.swift @@ -9,7 +9,7 @@ import SwiftUI struct NavigaTumView: View { @ObservedObject var model: Model @StateObject var viewModel = NavigaTumViewModel() - @State private var searchText = "" + @State var searchText = "" var body: some View { NavigaTumListView(model: self.model, viewModel: self.viewModel) From 3f3ac241718336e65ab90b9328b2129b4f870816 Mon Sep 17 00:00:00 2001 From: August Wittgenstein Date: Thu, 11 May 2023 15:07:36 +0200 Subject: [PATCH 6/8] Reduce NavigaTUM Map Span --- Campus-iOS/RoomFinder/ViewNavigaTum/NavigaTumMapView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Campus-iOS/RoomFinder/ViewNavigaTum/NavigaTumMapView.swift b/Campus-iOS/RoomFinder/ViewNavigaTum/NavigaTumMapView.swift index f91c53f6..1b231d36 100644 --- a/Campus-iOS/RoomFinder/ViewNavigaTum/NavigaTumMapView.swift +++ b/Campus-iOS/RoomFinder/ViewNavigaTum/NavigaTumMapView.swift @@ -30,7 +30,7 @@ struct NavigaTumMapView: View { } ) { let coords = CLLocationCoordinate2D(latitude: chosenRoom.coordinates.latitude, longitude: chosenRoom.coordinates.longitude) - let mapRegion = MKCoordinateRegion(center: coords , span: MKCoordinateSpan(latitudeDelta: 0.2, longitudeDelta: 0.2)) + let mapRegion = MKCoordinateRegion(center: coords , span: MKCoordinateSpan(latitudeDelta: 0.003, longitudeDelta: 0.003)) Map(coordinateRegion: .constant(mapRegion), showsUserLocation: true, annotationItems: [RoomFinderLocation(coordinate: coords)]) { location in MapMarker(coordinate: location.coordinate) } From 390f26df506eadaa104955b8e82cbb7eb0dce5de Mon Sep 17 00:00:00 2001 From: August Wittgenstein Date: Thu, 11 May 2023 15:18:53 +0200 Subject: [PATCH 7/8] Update some Localizables --- Campus-iOS.xcodeproj/project.pbxproj | 4 --- .../Campus-iOS/Base.lproj/Localizable.strings | 2 +- .../Campus-iOS/de.lproj/Localizable.strings | 4 +-- Campus-iOS/MapComponent/View/MapView.swift | 28 ------------------- 4 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 Campus-iOS/MapComponent/View/MapView.swift diff --git a/Campus-iOS.xcodeproj/project.pbxproj b/Campus-iOS.xcodeproj/project.pbxproj index 18c59f08..fe4bbe91 100644 --- a/Campus-iOS.xcodeproj/project.pbxproj +++ b/Campus-iOS.xcodeproj/project.pbxproj @@ -159,7 +159,6 @@ 36108BE727A304B5007DC62D /* MenuViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36108BD427A304B5007DC62D /* MenuViewModel.swift */; }; 36108BE927A304B5007DC62D /* MenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36108BD627A304B5007DC62D /* MenuView.swift */; }; 36108BEB27A304B6007DC62D /* CafeteriaRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36108BD927A304B5007DC62D /* CafeteriaRowView.swift */; }; - 36108BED27A304B6007DC62D /* MapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36108BDB27A304B5007DC62D /* MapView.swift */; }; 36108BEF27A304B6007DC62D /* MapContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36108BDD27A304B5007DC62D /* MapContentView.swift */; }; 36108BF027A304B6007DC62D /* PanelContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36108BDE27A304B5007DC62D /* PanelContentView.swift */; }; 36108BFA27A30517007DC62D /* Movie.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36108BF327A30516007DC62D /* Movie.swift */; }; @@ -486,7 +485,6 @@ 36108BD427A304B5007DC62D /* MenuViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuViewModel.swift; sourceTree = ""; }; 36108BD627A304B5007DC62D /* MenuView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuView.swift; sourceTree = ""; }; 36108BD927A304B5007DC62D /* CafeteriaRowView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CafeteriaRowView.swift; sourceTree = ""; }; - 36108BDB27A304B5007DC62D /* MapView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MapView.swift; sourceTree = ""; }; 36108BDD27A304B5007DC62D /* MapContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MapContentView.swift; sourceTree = ""; }; 36108BDE27A304B5007DC62D /* PanelContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PanelContentView.swift; sourceTree = ""; }; 36108BF327A30516007DC62D /* Movie.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Movie.swift; sourceTree = ""; }; @@ -1151,7 +1149,6 @@ children = ( 3654F382285171F6008AD5DC /* StudyRooms */, 36108BD127A304B5007DC62D /* Cafeterias */, - 36108BDB27A304B5007DC62D /* MapView.swift */, 1FAF9F0B284D2ABC000ABE93 /* MapScreenView.swift */, 36108BDD27A304B5007DC62D /* MapContentView.swift */, 36108BDE27A304B5007DC62D /* PanelContentView.swift */, @@ -2194,7 +2191,6 @@ 3654F38628517BB4008AD5DC /* CafeteriaView.swift in Sources */, 36BB6F8D27B3F25A00F224AB /* NSMutableString+Extensions.swift in Sources */, 1F04F175297AD4280085F273 /* CalendarScreen.swift in Sources */, - 36108BED27A304B6007DC62D /* MapView.swift in Sources */, 36AF61E827A2FD7800FEBD98 /* AlertErrorHandler.swift in Sources */, 36BB6F5327AFCCB500F224AB /* PersonDetailedView.swift in Sources */, 3654F37E2851710E008AD5DC /* RoomFinderDetailsView.swift in Sources */, diff --git a/Campus-iOS/Campus-iOS/Base.lproj/Localizable.strings b/Campus-iOS/Campus-iOS/Base.lproj/Localizable.strings index b3eb4857..93aa1990 100644 --- a/Campus-iOS/Campus-iOS/Base.lproj/Localizable.strings +++ b/Campus-iOS/Campus-iOS/Base.lproj/Localizable.strings @@ -43,7 +43,7 @@ "No Links" = "No Links"; "Cafeteria Map" = "Cafeteria Map"; "Search Rooms" = "Search Rooms"; -"Room Finder" = "Room Finder"; +"Roomfinder" = "Roomfinder"; "Unable to find room" = "Unable to find room '%@'"; "No Menu" = "No Menu"; "List View" = "List View"; diff --git a/Campus-iOS/Campus-iOS/de.lproj/Localizable.strings b/Campus-iOS/Campus-iOS/de.lproj/Localizable.strings index 84e059e0..29a06e5a 100644 --- a/Campus-iOS/Campus-iOS/de.lproj/Localizable.strings +++ b/Campus-iOS/Campus-iOS/de.lproj/Localizable.strings @@ -43,7 +43,7 @@ "No Links" = "Keine Links"; "Cafeteria Map" = "Mensa Landkarte"; "Search Rooms" = "Räume suchen"; -"Room Finder" = "Room Finder"; +"Roomfinder" = "Roomfinder"; "Unable to find room" = "Raum '%@' konnte nicht gefunden werden"; "No Menu" = "Kein Menü"; "List View" = "Listenansicht"; @@ -163,7 +163,7 @@ "Unknown" = "Unbekannt"; // Roomfinder -"Roomfinder" = "Raum Finder"; +"Roomfinder" = "Roomfinder"; "Building" = "Gebäude"; "Room" = "Raum"; "Detail" = "Detail"; diff --git a/Campus-iOS/MapComponent/View/MapView.swift b/Campus-iOS/MapComponent/View/MapView.swift deleted file mode 100644 index b36b3ee1..00000000 --- a/Campus-iOS/MapComponent/View/MapView.swift +++ /dev/null @@ -1,28 +0,0 @@ -//// -//// MapView.swift -//// Campus-iOS -//// -//// Created by August Wittgenstein on 16.12.21. -//// -// -//import SwiftUI -//import MapKit -// -//struct MapView: View { -// @StateObject var vm: MapViewModel -// -// var body: some View { -// ZStack { -//// MapContentView(vm: self.vm) -// //PanelView(vm: self.vm) -// PanelContentView(vm: self.vm) -// } -// -// } -//} -// -//struct MapView_Previews: PreviewProvider { -// static var previews: some View { -// MapView(vm: MapViewModel(cafeteriaService: CafeteriasService(), studyRoomsService: StudyRoomsService())) -// } -//} From c4f2e5d6590ab63b516bd242467496c16b13c620 Mon Sep 17 00:00:00 2001 From: Atharva Mathapati Date: Thu, 11 May 2023 22:04:02 +0200 Subject: [PATCH 8/8] Fix studitum fetch link --- Campus-iOS/Base/Networking/APIs/TUMCabeAPI.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Campus-iOS/Base/Networking/APIs/TUMCabeAPI.swift b/Campus-iOS/Base/Networking/APIs/TUMCabeAPI.swift index 557ab1f7..40638e9a 100644 --- a/Campus-iOS/Base/Networking/APIs/TUMCabeAPI.swift +++ b/Campus-iOS/Base/Networking/APIs/TUMCabeAPI.swift @@ -46,7 +46,7 @@ enum TUMCabeAPI: API { case .newsSources: return "news/sources" case .newsAlert: return "news/alert" case .roomSearch(let room): return "roomfinder/room/search/\(room.addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? "")" - case .roomMaps(let room): return "roomfinder/room/availableMaps/\(room)" + case .roomMaps(let room): return "roomfinder/room/availableMaps/\(room.addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? "")" case .roomCoordinates(let room): return "roomfinder/room/coordinates/\(room)" case .defaultMap(let room): return "roomfinder/room/defaultMap/\(room)" case .mapImage(let room, let id): return "roomfinder/room/map/\(room)/\(id)"