diff --git a/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.html b/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.html
index 8ad371c0c..575c05df9 100644
--- a/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.html
+++ b/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.html
@@ -54,6 +54,16 @@
}}
+
+
+
+
+
diff --git a/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.spec.ts b/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.spec.ts
index 9508f92cd..dd137216a 100644
--- a/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.spec.ts
+++ b/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.spec.ts
@@ -16,6 +16,7 @@ describe("EditAbsencesHeaderComponent", () => {
{
provide: EditAbsencesStateService,
useValue: {
+ weekdays$: of([]),
absenceConfirmationStates$: of([]),
presenceTypes$: of([]),
selected: [{ lessonIds: [1, 2, 3], personIds: [4, 5, 6] }],
diff --git a/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.ts b/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.ts
index e46e24d7c..3a6235bb3 100644
--- a/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.ts
+++ b/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.ts
@@ -64,6 +64,7 @@ export class EditAbsencesHeaderComponent {
teacher: null,
dateFrom: null,
dateTo: null,
+ weekdays: null,
presenceTypes: null,
confirmationStates: null,
incidentTypes: null,
@@ -71,6 +72,15 @@ export class EditAbsencesHeaderComponent {
@Output() filterChange = new EventEmitter();
+ weekdaysGrouped$ = this.state.weekdays$.pipe(
+ map((weekdays) =>
+ addGroupToDropdownItem(
+ weekdays,
+ this.translate.instant("shared.multiselect.all-option"),
+ ),
+ ),
+ );
+
absenceConfirmationStatesGrouped$ =
this.state.absenceConfirmationStates$.pipe(
map((i) =>
diff --git a/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.spec.ts b/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.spec.ts
index 81479bd99..5399efcff 100644
--- a/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.spec.ts
+++ b/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.spec.ts
@@ -22,6 +22,7 @@ describe("EditAbsencesListComponent", () => {
setFilter: jasmine.createSpy("setFilter"),
isFilterValid$: of(true),
validFilter$: of({}),
+ weekdays$: of([]),
presenceTypes$: of([]),
absenceConfirmationStates$: of([]),
} as unknown as EditAbsencesStateService;
diff --git a/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.ts b/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.ts
index 6ed9d7e98..f143d6e4d 100644
--- a/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.ts
+++ b/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.ts
@@ -117,6 +117,7 @@ function createFilterFromParams(params: Params): EditAbsencesFilter {
teacher: params["teacher"] ?? null,
dateFrom: params["dateFrom"] ? parseISOLocalDate(params["dateFrom"]) : null,
dateTo: params["dateTo"] ? parseISOLocalDate(params["dateTo"]) : null,
+ weekdays: params["weekdays"] ? params["weekdays"].split(",") : null,
presenceTypes: params["presenceTypes"]
? params["presenceTypes"].split(",").map(Number)
: null,
diff --git a/src/app/edit-absences/services/edit-absences-state.service.ts b/src/app/edit-absences/services/edit-absences-state.service.ts
index 32f35cdf9..5afad63e9 100644
--- a/src/app/edit-absences/services/edit-absences-state.service.ts
+++ b/src/app/edit-absences/services/edit-absences-state.service.ts
@@ -30,9 +30,10 @@ export interface EditAbsencesFilter {
teacher: Option;
dateFrom: Option;
dateTo: Option;
- presenceTypes: Option;
- confirmationStates: Option;
- incidentTypes: Option;
+ weekdays: Option>;
+ presenceTypes: Option>;
+ confirmationStates: Option>;
+ incidentTypes: Option>;
}
@Injectable()
@@ -42,6 +43,7 @@ export class EditAbsencesStateService
{
confirmBackLinkParams?: Params;
+ weekdays$ = this.loadWeekdays().pipe(shareReplay(1));
presenceTypes$ = this.loadPresenceTypes().pipe(shareReplay(1));
absenceConfirmationStates$ = this.loadAbsenceConfirmationStates().pipe(
map(sortDropDownItemsByValue),
@@ -96,6 +98,7 @@ export class EditAbsencesStateService
teacher: null,
dateFrom: null,
dateTo: null,
+ weekdays: null,
presenceTypes: null,
confirmationStates: null,
incidentTypes: null,
@@ -110,6 +113,7 @@ export class EditAbsencesStateService
filterValue.teacher ||
filterValue.dateFrom ||
filterValue.dateTo ||
+ filterValue.weekdays ||
filterValue.presenceTypes ||
filterValue.confirmationStates ||
filterValue.incidentTypes,
@@ -135,6 +139,10 @@ export class EditAbsencesStateService
return buildParamsFromAbsenceFilter(filterValue);
}
+ private loadWeekdays(): Observable> {
+ return this.loadingService.load(this.dropDownItemsService.getWeekdays());
+ }
+
private loadPresenceTypes(): Observable> {
return this.loadingService.load(
this.presenceTypesService.activePresenceTypes$,
diff --git a/src/app/presence-control/models/presence-control-entry.model.ts b/src/app/presence-control/models/presence-control-entry.model.ts
index 677505e32..087181eea 100644
--- a/src/app/presence-control/models/presence-control-entry.model.ts
+++ b/src/app/presence-control/models/presence-control-entry.model.ts
@@ -41,8 +41,8 @@ export class PresenceControlEntry {
this.studentFullName = lessonPresence.StudentFullName;
}
- get id(): number {
- return this.lessonPresence.StudentRef.Id;
+ get id(): string {
+ return `${this.lessonPresence.LessonRef.Id}-${this.lessonPresence.StudentRef.Id}`;
}
get presenceCategory(): PresenceCategory {
diff --git a/src/app/shared/components/multiselect/multiselect.component.ts b/src/app/shared/components/multiselect/multiselect.component.ts
index a48012c26..67526c95b 100644
--- a/src/app/shared/components/multiselect/multiselect.component.ts
+++ b/src/app/shared/components/multiselect/multiselect.component.ts
@@ -3,6 +3,7 @@ import { FormsModule } from "@angular/forms";
import { NgSelectModule } from "@ng-select/ng-select";
import { TranslateModule } from "@ngx-translate/core";
import { DropDownGroupedItem } from "../../models/drop-down-grouped-item.model";
+import { DropDownItem } from "../../models/drop-down-item.model";
@Component({
selector: "bkd-multiselect",
@@ -13,8 +14,10 @@ import { DropDownGroupedItem } from "../../models/drop-down-grouped-item.model";
})
export class MultiselectComponent {
@Input() options: ReadonlyArray = [];
- @Input() values: Option = [];
- @Output() valuesChange = new EventEmitter