Skip to content

Commit 883c51e

Browse files
authored
Display Study Room Utilization Percentages using IRIS (#289)
1 parent 2d54414 commit 883c51e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+731
-480
lines changed

assets/translations/de.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"done": "Fertig",
3434
"studyRoom": "Lernraum",
3535
"studyRooms": "Lernräume",
36+
"unknownStudyRoom": "Unbekannter Lernraum",
3637
"nearestStudyRooms": "Nächste Lernräume",
3738
"noNearFreeStudyRoomsFound": "Keine Lernräume in deiner Nähe gefunden",
3839
"mostSearchedRooms": "Meist gesuchte Räume",
@@ -131,6 +132,9 @@
131132
"wednesday": "Mittwoch",
132133
"thursday": "Donnerstag",
133134
"friday": "Freitag",
135+
"saturday": "Samstag",
136+
"sunday": "Sonntag",
137+
"fromTo": "{} - {}",
134138
"weekend": "Wochenende",
135139
"openingHours": "Öffnungszeiten",
136140
"open": "{} offen von {} - {}",
@@ -195,8 +199,8 @@
195199
"selectAction": "Wähle eine Aktion",
196200
"openIn": "In {} öffnen",
197201
"unknownDirection": "Unbekannte Richtung",
198-
"showWeekends": "Wochenenden anzeigen",
199-
"showHiddenCalendarEntries": "Versteckte Kalendareintrage anzeigen",
202+
"showWeekends": "Wochenenden",
203+
"showHiddenCalendarEntries": "Versteckte Kalendareintrage",
200204
"color": "Farbe",
201205
"resetLogin": "Zurücksetzen & Anmelden",
202206
"resetPreferences": "Einstellungen zurücksetzen",
@@ -227,5 +231,6 @@
227231
"studies": "Studium",
228232
"suggested": "Interessante {}",
229233
"more": "Mehr",
230-
"visibility": "Sichtbarkeit"
234+
"visibility": "Sichtbarkeit",
235+
"utilizationAt": "Auslastung bei {}%"
231236
}

assets/translations/en.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"done": "Done",
3434
"studyRoom": "Study Room",
3535
"studyRooms": "Study Rooms",
36+
"unknownStudyRoom": "Unknown Study Room",
3637
"nearestStudyRooms": "Nearest Study Rooms",
3738
"noNearFreeStudyRoomsFound": "No Study Rooms Near You Found!",
3839
"mostSearchedRooms": "Most Searched Rooms",
@@ -131,6 +132,9 @@
131132
"wednesday": "Wednesday",
132133
"thursday": "Thursday",
133134
"friday": "Friday",
135+
"saturday": "Saturday",
136+
"sunday": "Sunday",
137+
"fromTo": "{} - {}",
134138
"weekend": "Weekend",
135139
"openingHours": "Opening Hours",
136140
"open": "Open {} from {} - {}",
@@ -195,8 +199,8 @@
195199
"selectAction": "Select an action",
196200
"openIn": "Open in {}",
197201
"unknownDirection": "Unknown Direction",
198-
"showWeekends": "Show Weekends",
199-
"showHiddenCalendarEntries": "Show Hidden Calendar Entries",
202+
"showWeekends": "Weekends",
203+
"showHiddenCalendarEntries": "Hidden Calendar Entries",
200204
"color": "Color",
201205
"resetLogin": "Reset & Login",
202206
"resetPreferences": "Reset Preferences",
@@ -227,5 +231,6 @@
227231
"studies": "Studies",
228232
"suggested": "Suggested {}",
229233
"more": "More",
230-
"visibility": "Visibility"
234+
"visibility": "Visibility",
235+
"utilizationAt": "Utilization at {}%"
231236
}

ios/Podfile.lock

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
PODS:
22
- device_info_plus (0.0.1):
33
- Flutter
4-
- Firebase/CoreOnly (11.2.0):
5-
- FirebaseCore (= 11.2.0)
6-
- Firebase/Crashlytics (11.2.0):
4+
- Firebase/CoreOnly (11.4.0):
5+
- FirebaseCore (= 11.4.0)
6+
- Firebase/Crashlytics (11.4.0):
77
- Firebase/CoreOnly
8-
- FirebaseCrashlytics (~> 11.2.0)
9-
- Firebase/RemoteConfig (11.2.0):
8+
- FirebaseCrashlytics (~> 11.4.0)
9+
- Firebase/RemoteConfig (11.4.0):
1010
- Firebase/CoreOnly
11-
- FirebaseRemoteConfig (~> 11.2.0)
12-
- firebase_core (3.6.0):
13-
- Firebase/CoreOnly (= 11.2.0)
11+
- FirebaseRemoteConfig (~> 11.4.0)
12+
- firebase_core (3.8.0):
13+
- Firebase/CoreOnly (= 11.4.0)
1414
- Flutter
15-
- firebase_crashlytics (4.1.3):
16-
- Firebase/Crashlytics (= 11.2.0)
15+
- firebase_crashlytics (4.1.5):
16+
- Firebase/Crashlytics (= 11.4.0)
1717
- firebase_core
1818
- Flutter
19-
- firebase_remote_config (5.1.3):
20-
- Firebase/RemoteConfig (= 11.2.0)
19+
- firebase_remote_config (5.1.5):
20+
- Firebase/RemoteConfig (= 11.4.0)
2121
- firebase_core
2222
- Flutter
2323
- FirebaseABTesting (11.4.0):
2424
- FirebaseCore (~> 11.0)
25-
- FirebaseCore (11.2.0):
25+
- FirebaseCore (11.4.0):
2626
- FirebaseCoreInternal (~> 11.0)
2727
- GoogleUtilities/Environment (~> 8.0)
2828
- GoogleUtilities/Logger (~> 8.0)
2929
- FirebaseCoreExtension (11.4.1):
3030
- FirebaseCore (~> 11.0)
31-
- FirebaseCoreInternal (11.4.2):
31+
- FirebaseCoreInternal (11.5.0):
3232
- "GoogleUtilities/NSData+zlib (~> 8.0)"
33-
- FirebaseCrashlytics (11.2.0):
34-
- FirebaseCore (~> 11.0)
33+
- FirebaseCrashlytics (11.4.0):
34+
- FirebaseCore (~> 11.4)
3535
- FirebaseInstallations (~> 11.0)
3636
- FirebaseRemoteConfigInterop (~> 11.0)
3737
- FirebaseSessions (~> 11.0)
@@ -44,25 +44,25 @@ PODS:
4444
- GoogleUtilities/Environment (~> 8.0)
4545
- GoogleUtilities/UserDefaults (~> 8.0)
4646
- PromisesObjC (~> 2.4)
47-
- FirebaseRemoteConfig (11.2.0):
47+
- FirebaseRemoteConfig (11.4.0):
4848
- FirebaseABTesting (~> 11.0)
4949
- FirebaseCore (~> 11.0)
5050
- FirebaseInstallations (~> 11.0)
5151
- FirebaseRemoteConfigInterop (~> 11.0)
5252
- FirebaseSharedSwift (~> 11.0)
5353
- GoogleUtilities/Environment (~> 8.0)
5454
- "GoogleUtilities/NSData+zlib (~> 8.0)"
55-
- FirebaseRemoteConfigInterop (11.4.0)
56-
- FirebaseSessions (11.3.0):
57-
- FirebaseCore (~> 11.0)
58-
- FirebaseCoreExtension (~> 11.0)
55+
- FirebaseRemoteConfigInterop (11.5.0)
56+
- FirebaseSessions (11.4.0):
57+
- FirebaseCore (~> 11.4)
58+
- FirebaseCoreExtension (~> 11.4)
5959
- FirebaseInstallations (~> 11.0)
6060
- GoogleDataTransport (~> 10.0)
6161
- GoogleUtilities/Environment (~> 8.0)
6262
- GoogleUtilities/UserDefaults (~> 8.0)
6363
- nanopb (~> 3.30910.0)
6464
- PromisesSwift (~> 2.1)
65-
- FirebaseSharedSwift (11.4.0)
65+
- FirebaseSharedSwift (11.5.0)
6666
- Flutter (1.0.0)
6767
- flutter_native_splash (0.0.1):
6868
- Flutter
@@ -234,20 +234,20 @@ EXTERNAL SOURCES:
234234

235235
SPEC CHECKSUMS:
236236
device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
237-
Firebase: 98e6bf5278170668a7983e12971a66b2cd57fc8c
238-
firebase_core: 2bedc3136ec7c7b8561c6123ed0239387b53f2af
239-
firebase_crashlytics: 37d104d457b51760b48504a93a12b3bf70995d77
240-
firebase_remote_config: d522653d828836503715498f1662901a6efcd809
237+
Firebase: cf1b19f21410b029b6786a54e9764a0cacad3c99
238+
firebase_core: 9efc3ecf689cdbc90f13f4dc58108c83ea46b266
239+
firebase_crashlytics: 72a8b504422ba8bb435a7a0c0a9341320cbcbe29
240+
firebase_remote_config: 96a9b7e79624c5d9d16befdef60791966bb83919
241241
FirebaseABTesting: aef1719704fade00b200827e7973f352efc4caee
242-
FirebaseCore: a282032ae9295c795714ded2ec9c522fc237f8da
242+
FirebaseCore: e0510f1523bc0eb21653cac00792e1e2bd6f1771
243243
FirebaseCoreExtension: f1bc67a4702931a7caa097d8e4ac0a1b0d16720e
244-
FirebaseCoreInternal: 35731192cab10797b88411be84940d2beb33a238
245-
FirebaseCrashlytics: cfc69af5b53565dc6a5e563788809b5778ac4eac
244+
FirebaseCoreInternal: f47dd28ae7782e6a4738aad3106071a8fe0af604
245+
FirebaseCrashlytics: 41bbdd2b514a8523cede0c217aee6ef7ecf38401
246246
FirebaseInstallations: 6ef4a1c7eb2a61ee1f74727d7f6ce2e72acf1414
247-
FirebaseRemoteConfig: fca0b2d017fc1de52b28a4e5bcf2007c1a840457
248-
FirebaseRemoteConfigInterop: e76f46ffa4d6a65e273d4dfebb6a79e588cec136
249-
FirebaseSessions: 655ff17f3cc1a635cbdc2d69b953878001f9e25b
250-
FirebaseSharedSwift: 505dae2d05969dbf6d43749a642bb1bf230f0252
247+
FirebaseRemoteConfig: 7655681d02417bc9b287338edb9d721ff79e1a4a
248+
FirebaseRemoteConfigInterop: 7a7aebb9342d53913a5c890efa88e289d9e5c1bc
249+
FirebaseSessions: 3f56f177d9e53a85021d16b31f9a111849d1dd8b
250+
FirebaseSharedSwift: 302ac5967857ad7e7388b15382d705b8c8d892aa
251251
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
252252
flutter_native_splash: edf599c81f74d093a4daf8e17bd7a018854bc778
253253
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
@@ -267,12 +267,12 @@ SPEC CHECKSUMS:
267267
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
268268
quick_actions_ios: 56f3cbaa71e94f212838d1f9fe354bd0734779bf
269269
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
270-
sqflite_darwin: a553b1fd6fe66f53bbb0fe5b4f5bab93f08d7a13
270+
sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
271271
sqlite3: 0aa20658a9b238a3b1ff7175eb7bdd863b0ab4fd
272272
sqlite3_flutter_libs: b55ef23cfafea5318ae5081e0bf3fbbce8417c94
273273
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
274274
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
275275

276276
PODFILE CHECKSUM: f5f6fa56ec332013222699049ea868939deda084
277277

278-
COCOAPODS: 1.15.2
278+
COCOAPODS: 1.16.2

lib/base/networking/apis/eatApi/eat_api.dart

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
import 'package:campus_flutter/base/networking/apis/eatApi/eat_api_service.dart';
1+
import 'package:campus_flutter/base/networking/apis/eatApi/eat_api_endpoint.dart';
22
import 'package:campus_flutter/base/networking/protocols/api.dart';
33

44
class EatApi extends Api {
5-
final EatApiService eatApiService;
5+
final EatApiEndpoint eatApiEndpoint;
66

7-
EatApi(this.eatApiService);
7+
EatApi(this.eatApiEndpoint);
88

99
@override
10-
String get baseURL => "tum-dev.github.io";
10+
String get domain => "tum-dev.github.io";
1111

1212
@override
13-
String get path => "/eat-api/";
13+
String get path => "eat-api/";
1414

1515
@override
16-
String get paths {
17-
switch (eatApiService) {
18-
case EatApiServiceCanteens _:
19-
return "${path}enums/canteens.json";
20-
case EatApiServiceLanguages _:
21-
return "${path}enums/languages.json";
22-
case EatApiServiceLabels _:
23-
return "${path}enums/labels.json";
24-
case EatApiServiceAll _:
25-
return "${path}all.json";
26-
case EatApiServiceAllRef _:
27-
return "${path}all_ref.json";
28-
case EatApiServiceMenu menu:
29-
return "$path${menu.location}/${menu.year}/${menu.week.toString().padLeft(1, "0")}.json";
16+
String get slug {
17+
switch (eatApiEndpoint) {
18+
case EatApiEndpointCanteens _:
19+
return "enums/canteens.json";
20+
case EatApiEndpointLanguages _:
21+
return "enums/languages.json";
22+
case EatApiEndpointLabels _:
23+
return "enums/labels.json";
24+
case EatApiEndpointAll _:
25+
return "all.json";
26+
case EatApiEndpointAllRef _:
27+
return "all_ref.json";
28+
case EatApiEndpointMenu menu:
29+
return "${menu.location}/${menu.year}/${menu.week.toString().padLeft(1, "0")}.json";
3030
}
3131
}
3232

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import 'package:campus_flutter/base/extensions/date_time.dart';
2+
3+
sealed class EatApiEndpoint {}
4+
5+
class EatApiEndpointCanteens extends EatApiEndpoint {}
6+
7+
class EatApiEndpointLanguages extends EatApiEndpoint {}
8+
9+
class EatApiEndpointLabels extends EatApiEndpoint {}
10+
11+
class EatApiEndpointAll extends EatApiEndpoint {}
12+
13+
class EatApiEndpointAllRef extends EatApiEndpoint {}
14+
15+
class EatApiEndpointMenu extends EatApiEndpoint {
16+
final String location;
17+
final int year;
18+
final String week;
19+
20+
EatApiEndpointMenu({required this.location, int? year, String? week})
21+
: year = year ?? DateTime.now().year,
22+
week = week ?? DateTime.now().weekNumber();
23+
}

lib/base/networking/apis/eatApi/eat_api_service.dart

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import 'package:campus_flutter/base/networking/apis/irisApi/iris_api_endpoint.dart';
2+
import 'package:campus_flutter/base/networking/protocols/api.dart';
3+
4+
class IrisApi extends Api {
5+
final IrisApiEndpoint irisApiEndpoint;
6+
7+
IrisApi({required this.irisApiEndpoint});
8+
9+
@override
10+
String get domain => "iris.asta.tum.de";
11+
12+
@override
13+
bool get needsAuth => false;
14+
15+
@override
16+
Map<String, String> get parameters => irisApiEndpoint.getParameters();
17+
18+
@override
19+
String get path => "";
20+
21+
@override
22+
String get slug => "api";
23+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sealed class IrisApiEndpoint {
2+
Map<String, String> getParameters() => {};
3+
}
4+
5+
class IrisApiEndpointRooms extends IrisApiEndpoint {}

lib/base/networking/apis/mvvDeparturesApi/mvv_departures_api.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class MvvDeparturesApi extends Api {
77
MvvDeparturesApi({required this.station, required this.walkingTime});
88

99
@override
10-
String get baseURL => "efa.mvv-muenchen.de";
10+
String get domain => "efa.mvv-muenchen.de";
1111

1212
@override
1313
bool get needsAuth => false;
@@ -31,8 +31,8 @@ class MvvDeparturesApi extends Api {
3131
};
3232

3333
@override
34-
String get path => "/ng/";
34+
String get path => "ng/";
3535

3636
@override
37-
String get paths => "${path}XML_DM_REQUEST";
37+
String get slug => "XML_DM_REQUEST";
3838
}

0 commit comments

Comments
 (0)