some renaming of variables
All checks were successful
Build, test and publish / verify (push) Successful in 5m55s

This commit is contained in:
2026-11-03 12:58:15 +01:00
parent a7f7730ea0
commit 3a5203eb47
17 changed files with 98 additions and 54 deletions

View File

@@ -185,7 +185,16 @@ export class EntityEditor implements OnInit {
readonly today = new Date().toLocaleDateString('en-CA');
private readonly api = inject(SchoolApi);
dayParts: DayPart[] = [];
preferredDayParts = 2;
private preferredDayPartsValue = 2;
private preferredDayPartsEdited = false;
get preferredDayParts(): number {
return this.preferredDayPartsValue;
}
set preferredDayParts(value: number) {
this.preferredDayPartsValue = value;
this.preferredDayPartsEdited = true;
}
name = '';
date = '';
type: GroupType = 'REGULAR';
@@ -218,7 +227,8 @@ export class EntityEditor implements OnInit {
addPart(): void {
if (this.dayParts.length >= 6) return;
this.dayParts.push({ date: '', type: 'AFTERNOON', danceGroupIds: [] });
if (!this.target().value) this.preferredDayParts = Math.min(2, this.dayParts.length);
if (!this.target().value && !this.preferredDayPartsEdited)
this.preferredDayPartsValue = Math.min(2, this.dayParts.length);
}
removePart(index: number): void {
this.dayParts.splice(index, 1);