some renaming of variables
All checks were successful
Build, test and publish / verify (push) Successful in 5m55s
All checks were successful
Build, test and publish / verify (push) Successful in 5m55s
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user