Skip to content
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

Merged
merged 11 commits into from
Jun 9, 2024

Conversation

nilsreichardt
Copy link
Member

@nilsreichardt nilsreichardt commented May 22, 2024

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

@github-actions github-actions bot added feature: timetable / calendar Includes anything regarding lessons (timetable) and events (calendar). feature: sharezone plus Includes everything that is related to the Sharezone Plus subscription labels May 22, 2024
Copy link

github-actions bot commented May 22, 2024

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

Copy link

github-actions bot commented May 22, 2024

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

Copy link

github-actions bot commented May 22, 2024

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

@github-actions github-actions bot added testing w: dashboard-page Page that shows a summary of all important things (homeworks, events, etc.). labels Jun 5, 2024
@github-actions github-actions bot added feature: homework feature: groups:courses Specific to only courses (instead of e.g. classes) feature: groups Groups umbrella term for courses and classes. user: teacher labels Jun 5, 2024
id: id,
date: Date.parse(data['date'] as String),
createdBy: createdBy,
newTeacher: data['newTeacher'] as String,
Copy link
Member Author

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?

Copy link
Collaborator

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 {
Copy link
Member Author

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

@nilsreichardt nilsreichardt marked this pull request as ready for review June 6, 2024 07:38
id: id,
date: Date.parse(data['date'] as String),
createdBy: createdBy,
newTeacher: data['newTeacher'] as String,
Copy link
Collaborator

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.

Comment on lines +182 to +193

@override
Map<String, dynamic> toCreateJson({
required bool notifyGroupMembers,
}) {
return {
...super.toCreateJson(notifyGroupMembers: notifyGroupMembers),
'newTeacher': newTeacher,
};
}
}

Copy link
Collaborator

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?

Copy link
Collaborator

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

Copy link
Member Author

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

@Jonas-Sander
Copy link
Collaborator

Very nice! LGTM

@nilsreichardt nilsreichardt added this pull request to the merge queue Jun 9, 2024
Merged via the queue into main with commit a198fda Jun 9, 2024
37 checks passed
@nilsreichardt nilsreichardt deleted the add-teachers-to-the-substitution-plan branch June 9, 2024 14:25
nilsreichardt added a commit that referenced this pull request Jun 10, 2024
Tests would have prevented adding the bugs in #1647 :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: groups:courses Specific to only courses (instead of e.g. classes) feature: groups Groups umbrella term for courses and classes. feature: homework feature: sharezone plus Includes everything that is related to the Sharezone Plus subscription feature: timetable / calendar Includes anything regarding lessons (timetable) and events (calendar). testing ui: dark-mode ui: light-mode ui / ux user: teacher w: dashboard-page Page that shows a summary of all important things (homeworks, events, etc.).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the option to change the teacher for a substitution
2 participants