4 Commits

Author SHA1 Message Date
Patrick d7f078cc88 Update issue templates 2021-02-17 11:18:09 +01:00
Patrick 805495fb81 Create README.md 2021-02-12 21:57:54 +01:00
Paddy f5756cd650 🐛 Fixed bug where the app would create new RaPlaEvent objects instead of updating the existing ones 2021-02-10 22:20:10 +01:00
Paddy ba0d4da657 Adding lecturer to lecture plan item detail view 2021-02-10 21:27:26 +01:00
8 changed files with 94 additions and 4 deletions
+37
View File
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Device Information:**
- Device: [e.g. iPhone 12]
- OS: [e.g. iOS 14.1]
- App Version [e.g. 1.0]
**Beta Information:**
If you are participating in the TestFlight Beta program, please provide the following information:
- Build No.: [e.g. 1.0.12]
- Have you already submitted feedback via TestFlight? [yes/no]
**Additional context**
Add any other context about the problem here.
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[REQ]"
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
@@ -11,6 +11,7 @@ import CoreData
@objc(Lecturer) @objc(Lecturer)
public class Lecturer: NSManagedObject { public class Lecturer: NSManagedObject {
// MARK: Access methods
@nonobjc public class func getAll() -> [Lecturer] { @nonobjc public class func getAll() -> [Lecturer] {
let managedContext = let managedContext =
PersistenceController.shared.context PersistenceController.shared.context
@@ -41,4 +42,13 @@ public class Lecturer: NSManagedObject {
return [] return []
} }
} }
// MARK: Wrappers
public var wrappedName: String {
name ?? ""
}
public var wrappedEmail: String {
email ?? ""
}
} }
@@ -11,6 +11,8 @@ import CoreData
@objc(RaPlaEvent) @objc(RaPlaEvent)
public class RaPlaEvent: NSManagedObject { public class RaPlaEvent: NSManagedObject {
// MARK: Access methods
@nonobjc public class func getAll() -> [RaPlaEvent] { @nonobjc public class func getAll() -> [RaPlaEvent] {
let managedContext = let managedContext =
PersistenceController.shared.context PersistenceController.shared.context
@@ -41,4 +43,12 @@ public class RaPlaEvent: NSManagedObject {
return [] return []
} }
} }
// MARK: Wrappers
public var lecturerList: [Lecturer] {
let set = lecturers as? Set<Lecturer> ?? []
return set.sorted {
$0.wrappedName < $1.wrappedName
}
}
} }
+2 -2
View File
@@ -156,10 +156,10 @@ class RaPlaFetcher {
// Save the given iCalEvent objects to CoreData // Save the given iCalEvent objects to CoreData
// Updates the events if they already exist and deletes old (/invalid) ones // Updates the events if they already exist and deletes old (/invalid) ones
private class func saveToCoreData(eventObjects: [iCalEvent]) -> Bool{ private class func saveToCoreData(eventObjects: [iCalEvent]) -> Bool{
let existingEvents: [RaPlaEvent] = [] //RaPlaEvent.getAll() let existingEvents: [RaPlaEvent] = RaPlaEvent.getAll()
var existingEventsDict: [String:RaPlaEvent] = [:] var existingEventsDict: [String:RaPlaEvent] = [:]
for event in existingEvents { for event in existingEvents {
existingEventsDict[event.value(forKey: "uid") as! String] = event existingEventsDict[event.uid!] = event
} }
let newEventUIDs = eventObjects.map{$0.uid} let newEventUIDs = eventObjects.map{$0.uid}
+1 -1
View File
@@ -47,7 +47,7 @@ struct ContentView: View {
} }
.onAppear{ .onAppear{
// Called upon the opening of the app // Called upon the opening of the app
RaPlaFetcher.getRaplaFileAndSaveToCoreData(from: "https://rapla.dhbw-karlsruhe.de/rapla?page=ical&user=eisenbiegler&file=TINF20B4") RaPlaFetcher.getRaplaFileAndSaveToCoreData(from: "https://rapla.dhbw-karlsruhe.de/rapla?page=ical&user=eisenbiegler&file=TINF19B4")
} }
} }
} }
@@ -37,7 +37,7 @@ struct LecturePlanItem: View {
.bold() .bold()
Text(event.location!) Text(event.location!)
.bold() .bold()
Text("WIP") Text(!event.lecturerList.isEmpty ? event.lecturerList[0].wrappedName : "")
.bold() .bold()
}.frame(maxWidth: .infinity, alignment: .leading) }.frame(maxWidth: .infinity, alignment: .leading)
} }
+13
View File
@@ -0,0 +1,13 @@
# DHBW-Service-App
## Introduction
This is a project by two students of the Cooperative State University in Karlsruhe (DHBW Karlsruhe).
The goal is to develop a native iOS app providing easy and straightforward access to services like RaPla, Dualis and the canteen plan.
<b>Disclaimer:</b> This project is not affiliated with the DHBW Karlsruhe
## Build it yourself
As the app is not yet available on the App Store, you can build and install it yourself if you have a Mac with Xcode installed.
Just clone the repository, then open the project in Xcode and navigate to the project settings. In the target section, select
the iOS target. Then you have to select your own development team in the dropdown or create a new one.
If you completed these steps, you should be able to install a development version of the app on your own devices.