-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add teachers to substitution plan #1647
Conversation
Visit the preview URL for this PR (updated for commit fdcff7a): https://sharezone-website-dev--pr1647-add-teachers-to-the-6zmr4ans.web.app (expires Wed, 12 Jun 2024 13:57:24 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 372b0431a96247f908d9a97d5d865de1c8b3b04e |
Visit the preview URL for this PR (updated for commit fdcff7a): https://sharezone-console-dev--pr1647-add-teachers-to-the-pm38kcvg.web.app (expires Wed, 12 Jun 2024 13:57:08 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 471536afe3f6ec4895d9ea75513730b515d17eb6 |
Visit the preview URL for this PR (updated for commit fdcff7a): https://sharezone-test--pr1647-add-teachers-to-the-rndh33ec.web.app (expires Wed, 12 Jun 2024 13:58:30 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 4cb3ae61e1e018abfd9841fd3239f5b49ccc034b |
id: id, | ||
date: Date.parse(data['date'] as String), | ||
createdBy: createdBy, | ||
newTeacher: data['newTeacher'] as String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or should we use substitutionTeacher
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think substitutionTeacher
is better.
@@ -177,6 +179,40 @@ class _SchoolClassLicense extends StatelessWidget { | |||
} | |||
} | |||
|
|||
class _FamilyLicense extends StatelessWidget { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is part of another PR
id: id, | ||
date: Date.parse(data['date'] as String), | ||
createdBy: createdBy, | ||
newTeacher: data['newTeacher'] as String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think substitutionTeacher
is better.
|
||
@override | ||
Map<String, dynamic> toCreateJson({ | ||
required bool notifyGroupMembers, | ||
}) { | ||
return { | ||
...super.toCreateJson(notifyGroupMembers: notifyGroupMembers), | ||
'newTeacher': newTeacher, | ||
}; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You did it like this so that only one class for a Substitution is needed both for creating a new substitution and reading an existing substitution out of a lesson, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean its the pattern you already used, but I can't remember if there was a specific reason why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I correctly understand you, do mean like splitting in into a DTO class or something like this? If yes: I used just one class to keep it simple for now
Very nice! LGTM |
Tests would have prevented adding the bugs in #1647 :(
Demo
v.mp4
Summary
A user can add substitution teachers. Free users can see the teachers now. Substitutions are a list on the client now.
Description
This PR adds the option to add substitution teachers.
I changed that now free users can also see the teachers. Reason for this: It doesn't really makes sense if a user can see the substitution teacher, but not the normal teacher.
Before this PR, a lesson had only one substitution at the time. Now, a lesson can have multiple substitutions (like room substitution and teacher substitution). This not a breaking change thanks to a robust database design.
Related Tickets
Closes #1628