-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: dashboard widgets all using generalized dashboard-list-widg…
…et code (#2170) closes #1629 --------- Co-authored-by: Sebastian Leidig <sebastian@aam-digital.com>
- Loading branch information
Showing
13 changed files
with
166 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 44 additions & 61 deletions
105
...ance/dashboard-widgets/attendance-week-dashboard/attendance-week-dashboard.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,59 @@ | ||
<app-dashboard-widget | ||
<app-dashboard-list-widget | ||
icon="exclamation-triangle" | ||
theme="attendance" | ||
[title]="tableDataSource.data.length" | ||
[subtitle]="label" | ||
explanation="Cases absent multiple times in the given week" | ||
i18n-explanation="Dashboard attendance component explanation tooltip" | ||
[loading]="!loadingDone" | ||
[entries]="entries" | ||
> | ||
<app-widget-content> | ||
<div *ngIf="tableDataSource.data.length > 0" class="table-wrapper"> | ||
<table | ||
mat-table | ||
[dataSource]="tableDataSource" | ||
i18n-aria-label | ||
aria-label="cases absent multiple times" | ||
> | ||
<!-- Table header only for assistive technologies like screen readers --> | ||
<tr hidden="true"> | ||
<th scope="col" i18n="The participant of a group, e.g. a school"> | ||
Participant | ||
</th> | ||
<th | ||
scope="col" | ||
i18n="The attendance of a participant, e.g. a student" | ||
> | ||
Attendance | ||
</th> | ||
</tr> | ||
<ng-container matColumnDef="child"> | ||
<td | ||
*matCellDef="let rowGroup" | ||
(click)="goToChild(rowGroup[0].childId)" | ||
class="pointer" | ||
<div class="table-wrapper"> | ||
<table mat-table i18n-aria-label aria-label="cases absent multiple times"> | ||
<!-- Table header only for assistive technologies like screen readers --> | ||
<tr hidden="true"> | ||
<th scope="col" i18n="The participant of a group, e.g. a school"> | ||
Participant | ||
</th> | ||
<th scope="col" i18n="The attendance of a participant, e.g. a student"> | ||
Attendance | ||
</th> | ||
</tr> | ||
<ng-container matColumnDef="child"> | ||
<td | ||
*matCellDef="let rowGroup" | ||
(click)="goToChild(rowGroup[0].childId)" | ||
class="pointer" | ||
> | ||
<app-display-entity | ||
[entityId]="rowGroup[0].childId" | ||
entityType="Child" | ||
></app-display-entity> | ||
</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="attendance"> | ||
<td *matCellDef="let rowGroup"> | ||
<div | ||
*ngFor="let activityRecord of rowGroup" | ||
class="activities-record" | ||
> | ||
<app-display-entity | ||
[entityId]="rowGroup[0].childId" | ||
entityType="Child" | ||
></app-display-entity> | ||
</td> | ||
</ng-container> | ||
<ng-container *ngFor="let day of activityRecord.attendanceDays"> | ||
<app-attendance-day-block | ||
[attendance]="day" | ||
></app-attendance-day-block> | ||
</ng-container> | ||
</div> | ||
</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="attendance"> | ||
<td *matCellDef="let rowGroup"> | ||
<div | ||
*ngFor="let activityRecord of rowGroup" | ||
class="activities-record" | ||
> | ||
<ng-container *ngFor="let day of activityRecord.attendanceDays"> | ||
<app-attendance-day-block | ||
[attendance]="day" | ||
></app-attendance-day-block> | ||
</ng-container> | ||
</div> | ||
</td> | ||
</ng-container> | ||
<tr mat-row *matRowDef="let row; columns: ['child', 'attendance']"></tr> | ||
</table> | ||
|
||
<tr mat-row *matRowDef="let row; columns: ['child', 'attendance']"></tr> | ||
</table> | ||
</div> | ||
<div | ||
*ngIf="tableDataSource.data.length === 0 && loadingDone" | ||
*ngIf="entries?.length === 0" | ||
i18n="Placeholder if no absences are visible in dashboar" | ||
class="headline" | ||
> | ||
no absences recorded | ||
</div> | ||
<mat-paginator | ||
[style.display]="paginator.getNumberOfPages() === 0 ? 'none' : ''" | ||
#paginator | ||
[pageSizeOptions]="[5]" | ||
[hidePageSize]="true" | ||
> | ||
</mat-paginator> | ||
</app-widget-content> | ||
</app-dashboard-widget> | ||
</div> | ||
</app-dashboard-list-widget> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.