Kapitel 3.1: Mitarbeit-Aspekte pro Gruppe verwalten (3.1.1/3.1.2/3.1.4)
Neuer Button "Aspekte verwalten" im Mitarbeit-Tab öffnet ParticipationAspectsDialog: Anlegen, Bezeichnung/Typ/Gewichtung/Aktiv-Status bearbeiten (speichert sofort, gleiches Muster wie die bestehende Gewichtungs-Bearbeitung in 3.2.1), Hoch/Runter-Reihenfolge, Löschen mit Rückfrage. Verwaltet bewusst nur die gruppenspezifischen Aspekte, nicht den bislang nirgends befüllten globalen Standardkatalog. Schlüssel ist nur beim Neuanlegen editierbar - er verknüpft AspectRating mit dem Aspekt per Key, ein nachträgliches Umbenennen würde historische Bewertungen unauffindbar machen. IParticipationAspectRepository.Save validiert jetzt Pflichtfelder und Schlüssel-Eindeutigkeit gegen globale Standards UND eigene Gruppen-Aspekte zusammen, da beide im Bewertungsraster kombiniert verwendet werden. Neue GetAllByGroup-Methode (inkl. inaktiver) für die Verwaltungsansicht. 3.1.3 (Scale3/Binary/Points im Bewertungsraster selbst) bewusst nicht angefasst - eigener, größerer Eingriff in die Bewertungs-UI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -87,10 +87,25 @@ public class FakeEntries : IParticipationRepository
|
||||
|
||||
public class FakeAspects : IParticipationAspectRepository
|
||||
{
|
||||
public List<ParticipationAspect> GetDefaults() => [];
|
||||
public List<ParticipationAspect> GetByGroup(Guid groupId) => [];
|
||||
public void Save(ParticipationAspect aspect) { }
|
||||
public void Delete(Guid id) { }
|
||||
private readonly List<ParticipationAspect> _all = [];
|
||||
public List<ParticipationAspect> GetDefaults() =>
|
||||
_all.Where(a => a.GroupId == null && a.IsActive).OrderBy(a => a.SortOrder).ToList();
|
||||
public List<ParticipationAspect> GetByGroup(Guid groupId) =>
|
||||
_all.Where(a => a.GroupId == groupId && a.IsActive).OrderBy(a => a.SortOrder).ToList();
|
||||
public List<ParticipationAspect> GetAllByGroup(Guid groupId) =>
|
||||
_all.Where(a => a.GroupId == groupId).OrderBy(a => a.SortOrder).ToList();
|
||||
public void Save(ParticipationAspect a)
|
||||
{
|
||||
a.Key = a.Key.Trim(); a.Label = a.Label.Trim();
|
||||
if (a.Key.Length == 0) throw new ArgumentException("Der Schlüssel darf nicht leer sein.");
|
||||
if (a.Label.Length == 0) throw new ArgumentException("Die Bezeichnung darf nicht leer sein.");
|
||||
var duplicate = _all.Where(x => x.GroupId == null || x.GroupId == a.GroupId)
|
||||
.FirstOrDefault(x => x.Id != a.Id && string.Equals(x.Key, a.Key, StringComparison.OrdinalIgnoreCase));
|
||||
if (duplicate is not null) throw new InvalidOperationException("Ein Aspekt mit diesem Schlüssel existiert für diese Gruppe bereits.");
|
||||
_all.RemoveAll(x => x.Id == a.Id);
|
||||
_all.Add(a);
|
||||
}
|
||||
public void Delete(Guid id) => _all.RemoveAll(a => a.Id == id);
|
||||
}
|
||||
|
||||
public class FakeGrades : IGradeRepository
|
||||
|
||||
Reference in New Issue
Block a user