From 3675b70004e47d5730ce6ae4061ec249eae1e06e Mon Sep 17 00:00:00 2001 From: Baddi86 Date: Sun, 13 Sep 2026 23:58:38 +0200 Subject: [PATCH] feat: exclude group from untis hub --- LehrerApp.Core/Models/LearningGroup.cs | 8 ++++++++ LehrerApp.Desktop/Services/UntisHubService.cs | 2 +- .../ViewModels/Groups/GroupViewModels.cs | 3 +++ LehrerApp.Desktop/Views/Groups/AddGroupDialog.axaml | 3 +++ TODO.md | 11 +++++++++++ 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/LehrerApp.Core/Models/LearningGroup.cs b/LehrerApp.Core/Models/LearningGroup.cs index a4a0a89..bf6c2a9 100644 --- a/LehrerApp.Core/Models/LearningGroup.cs +++ b/LehrerApp.Core/Models/LearningGroup.cs @@ -27,6 +27,14 @@ public class LearningGroup /// public int? WebUntisLessonId { get; set; } /// + /// Blendet diese Lerngruppe im UntisHub (siehe -Layer im Desktop-Projekt: + /// UntisHubService) aus, auch wenn gesetzt ist - z.B. für + /// Klassenrat/AGs, die zwar eine WebUntis-Unterrichtsnummer haben, aber nicht auf + /// Fehlzeiten/offene Periods hin überwacht werden sollen. Default false (alte Datensätze + /// verhalten sich unverändert wie bisher). + /// + public bool ExcludedFromUntisHub { get; set; } + /// /// Vorgängergruppe aus dem Hochstufen () — /// ermöglicht einen Schuljahresvergleich (z.B. Klausurschnitt) über die Kette hinweg. /// Wird ausschließlich beim Hochstufen automatisch gesetzt; vor Einführung dieses Felds diff --git a/LehrerApp.Desktop/Services/UntisHubService.cs b/LehrerApp.Desktop/Services/UntisHubService.cs index 1142960..837cb42 100644 --- a/LehrerApp.Desktop/Services/UntisHubService.cs +++ b/LehrerApp.Desktop/Services/UntisHubService.cs @@ -40,7 +40,7 @@ public sealed class UntisHubService( public List GetRows() { var eligibleGroups = groups.GetBySchoolYear(schoolYears.CurrentSchoolYear()) - .Where(g => g.WebUntisLessonId is not null) + .Where(g => g.WebUntisLessonId is not null && !g.ExcludedFromUntisHub) .OrderBy(g => g.Name) .ToList(); return BuildRows(eligibleGroups, jobStates.GetAll(), DateTime.UtcNow); diff --git a/LehrerApp.Desktop/ViewModels/Groups/GroupViewModels.cs b/LehrerApp.Desktop/ViewModels/Groups/GroupViewModels.cs index 54a6b7b..175c256 100644 --- a/LehrerApp.Desktop/ViewModels/Groups/GroupViewModels.cs +++ b/LehrerApp.Desktop/ViewModels/Groups/GroupViewModels.cs @@ -826,6 +826,7 @@ public partial class AddGroupDialogViewModel : ObservableObject [ObservableProperty] private bool _isDifferentiated; [ObservableProperty] private bool _requiresLessonPlanning = true; [ObservableProperty] private int? _webUntisLessonId; + [ObservableProperty] private bool _excludedFromUntisHub; [ObservableProperty] private string _nameError = ""; [ObservableProperty] private string _gradeLevelError = ""; @@ -866,6 +867,7 @@ public partial class AddGroupDialogViewModel : ObservableObject IsDifferentiated = group.IsDifferentiated; RequiresLessonPlanning = group.RequiresLessonPlanning; WebUntisLessonId = group.WebUntisLessonId; + ExcludedFromUntisHub = group.ExcludedFromUntisHub; OnPropertyChanged(nameof(DialogTitle)); OnPropertyChanged(nameof(SaveButtonText)); } @@ -913,6 +915,7 @@ public partial class AddGroupDialogViewModel : ObservableObject Result.IsDifferentiated = IsDifferentiated; Result.RequiresLessonPlanning = RequiresLessonPlanning; Result.WebUntisLessonId = WebUntisLessonId; + Result.ExcludedFromUntisHub = ExcludedFromUntisHub; _groups.Save(Result); } } diff --git a/LehrerApp.Desktop/Views/Groups/AddGroupDialog.axaml b/LehrerApp.Desktop/Views/Groups/AddGroupDialog.axaml index fd63de9..d98b768 100644 --- a/LehrerApp.Desktop/Views/Groups/AddGroupDialog.axaml +++ b/LehrerApp.Desktop/Views/Groups/AddGroupDialog.axaml @@ -84,6 +84,9 @@ ToolTip.Tip="lsid aus WebUntis (Unterricht -> Mein Unterricht -> Berichte-Symbol der Zeile). Wird von WebUntis pro Schuljahr neu vergeben und muss deshalb jedes Schuljahr aktualisiert werden."/> + + diff --git a/TODO.md b/TODO.md index df4c25e..b8e8a87 100644 --- a/TODO.md +++ b/TODO.md @@ -2117,6 +2117,17 @@ vollständig enthält. der DB stehen (gleiches akzeptiertes v1-Verhalten wie bei anderen Entitäten ohne serverseitige Merge-Logik, siehe TODO 10.3). + **Nachtrag (Nutzer-Feedback, 2026-09-13):** Manche Lerngruppen mit `WebUntisLessonId` (z.B. + Klassenrat, AGs) sollen trotzdem nie im Untis-Hub auftauchen. Neues Feld + `LearningGroup.ExcludedFromUntisHub` (Default `false`, siehe + [LehrerApp.Core/Models/LearningGroup.cs](LehrerApp.Core/Models/LearningGroup.cs)) — + `UntisHubService.GetRows()` filtert damit zusätzlich zu `WebUntisLessonId is not null`. Checkbox + "Nicht im Untis-Hub verfolgen" im Gruppendialog + ([AddGroupDialog.axaml](LehrerApp.Desktop/Views/Groups/AddGroupDialog.axaml)). Kein eigener + Sync-Aufwand nötig, da `LearningGroup` bereits als Ganzes synchronisiert wird + (`EventApplier.Simple`); `get_untis_hub_status` (MCP) profitiert automatisch mit, + da es nur an `GetRows()` delegiert. + ### 4.4 Wochen-/Tagesansicht - [x] **4.4.1** Kalenderansicht über alle Gruppen: Woche und Tag — siehe Nachtrag zu 4.3 ("Heute"-Tab: Tagesliste unten angedockt, gruppenübergreifendes Wochenraster darüber, inkl.