Skip to content

Commit

Permalink
Remove School from codebase. (#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas-Sander authored Aug 8, 2023
1 parent 44de3cd commit fa8b990
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 232 deletions.
1 change: 0 additions & 1 deletion app/lib/groups/src/pages/course/group_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class GroupPageState extends State<GroupPage> {
builder: (context, snapshot) {
final data = snapshot.hasData ? snapshot.data : null;
final isEmpty = (data?.courses == null || data.courses.isEmpty) &&
data?.school == null &&
(data?.schoolClass == null || data.schoolClass.isEmpty);

if (isEmpty) return _EmptyGroupList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ class _SharecodeBox extends StatelessWidget {
return 'des Kurses';
case GroupType.schoolclass:
return 'der Schulklasse';
case GroupType.school:
return 'der Schule';
default:
return '';
}
Expand Down
4 changes: 0 additions & 4 deletions app/lib/util/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import 'package:sharezone/util/api/connections_gateway.dart';
import 'package:sharezone/util/api/course_gateway.dart';
import 'package:sharezone/util/api/homework_api.dart';
import 'package:sharezone/util/api/school_class_gateway.dart';
import 'package:sharezone/util/api/school_gateway.dart';
import 'package:sharezone/util/api/timetable_gateway.dart';
import 'package:sharezone/util/api/user_api.dart';
import 'package:sharezone_common/references.dart';
Expand All @@ -35,7 +34,6 @@ class SharezoneGateway {
final ConnectionsGateway connectionsGateway;
final CourseGateway course;
final SchoolClassGateway schoolClassGateway;
final SchoolGateway schoolGateway;
final TimetableGateway timetable;

factory SharezoneGateway({
Expand All @@ -51,7 +49,6 @@ class SharezoneGateway {
course: CourseGateway(references, memberID, connectionsGateway),
schoolClassGateway:
SchoolClassGateway(references, memberID, connectionsGateway),
schoolGateway: SchoolGateway(references, memberID, connectionsGateway),
authUser: authUser,
timetable: TimetableGateway(references, memberID),
user: UserGateway(references, authUser),
Expand All @@ -65,7 +62,6 @@ class SharezoneGateway {
@required this.references,
@required this.course,
@required this.schoolClassGateway,
@required this.schoolGateway,
@required this.timetable,
@required this.user,
}) : _authUser = authUser,
Expand Down
2 changes: 0 additions & 2 deletions app/lib/util/api/connections_gateway.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ class ConnectionsGateway implements MyConnectionsAccesor {
return 'Courses';
case GroupType.schoolclass:
return 'SchoolClasses';
case GroupType.school:
return 'School';
}
throw UnimplementedError('There is no string for $groupType');
}
Expand Down
81 changes: 0 additions & 81 deletions app/lib/util/api/school_gateway.dart

This file was deleted.

1 change: 0 additions & 1 deletion lib/group_domain_models/lib/group_domain_models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ export 'src/models/group_type.dart';
export 'src/models/member_role.dart';
export 'src/models/member.dart';
export 'src/models/school_class.dart';
export 'src/models/school.dart';
export 'src/models/sharecode.dart';
export 'src/models/write_permissions.dart';
13 changes: 1 addition & 12 deletions lib/group_domain_models/lib/src/models/connections_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,22 @@ import 'package:sharezone_common/helper_functions.dart';
import 'package:sharezone_common/references.dart';

class ConnectionsData {
final School school;
final Map<String, SchoolClass> schoolClass;
final Map<String, Course> courses;

const ConnectionsData._(
{@required this.school,
@required this.schoolClass,
@required this.courses});
const ConnectionsData._({@required this.schoolClass, @required this.courses});

factory ConnectionsData.fromData({@required Map<String, dynamic> data}) {
if (data == null) {
return const ConnectionsData._(
school: null,
schoolClass: null,
courses: {},
);
}
Map<String, School> schools = decodeMap(data[CollectionNames.schools],
(key, data) => School.fromData(data, id: key));
Map<String, SchoolClass> schoolClasses = decodeMap(
data[CollectionNames.schoolClasses],
(key, data) => SchoolClass.fromData(data, id: key));
School school;
if (schools.length == 1) school = schools.values.first;
return ConnectionsData._(
school: school,
schoolClass: schoolClasses,
courses: decodeMap(data[CollectionNames.courses],
(key, data) => Course.fromData(data, id: key)),
Expand All @@ -53,7 +43,6 @@ class ConnectionsData {
}
return ConnectionsData._(
schoolClass: schoolClass,
school: school,
courses: courseMap,
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/group_domain_models/lib/src/models/group_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import 'package:sharezone_common/helper_functions.dart';

enum GroupType { course, schoolclass, school }
enum GroupType { course, schoolclass }

GroupType groupTypeFromString(String data) =>
enumFromString(GroupType.values, data, orElse: GroupType.course);
Expand Down
128 changes: 0 additions & 128 deletions lib/group_domain_models/lib/src/models/school.dart

This file was deleted.

0 comments on commit fa8b990

Please sign in to comment.