Skip to content

Commit

Permalink
Merge pull request #413 from bkd-mba-fbi/feature/333-mobile-final-grade
Browse files Browse the repository at this point in the history
Bugfixes: Finale Note in Mobile View
  • Loading branch information
mburri authored May 24, 2022
2 parents f18b185 + 00d1c96 commit 64c66ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
<th
class="secondary-column-width border-right sticky sticky-col-3 desktop"
(click)="state.sortBy('TestsMean')"
[ngClass]="{ selected: selectedTest === undefined }"
>
<div class="d-flex">
<div class="column-title">
Expand Down Expand Up @@ -164,10 +163,7 @@
(gradeIdSelected)="state.overwriteFinalGrade($event)"
></erz-grade-select>
</td>
<td
class="grade border-right sticky sticky-col-3"
[ngClass]="{ selected: selectedTest === undefined }"
>
<td class="grade border-right sticky sticky-col-3">
{{ studentGrade.finalGrade.average | number: '1.0-3' }}
</td>
<td
Expand All @@ -192,13 +188,23 @@
></erz-grade>
</td>
</tr>
<!-- course and test averages -->
<tr>
<td class="sticky">
<div class="d-flex flex-column">
<div>{{ 'tests.average' | translate }}</div>
<div class="mobile mean">
{{ 'tests.mean' | translate }}:
{{
state.meanOfStudentGradesForCourse$ | async | number: '1.0-3'
}}
</div>
</div>
</td>
<td class="desktop sticky sticky sticky-col-2">
<td
class="desktop sticky sticky sticky-col-2"
[ngClass]="{ selected: selectedTest === undefined }"
>
{{ state.meanOfFinalGradesForCourse$ | async | number: '1.0-3' }}
</td>
<td class="desktop border-right sticky sticky-col-3">
Expand Down
5 changes: 4 additions & 1 deletion src/app/events/components/tests-list/tests-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export class TestsListComponent {

selectedTestId$ = merge(
this.selectTest$,
this.state.tests$.pipe(map((tests) => tests[0]?.Id))
this.state.tests$.pipe(
take(1),
map((tests) => tests[0]?.Id)
)
).pipe(distinctUntilChanged());

selectedTest$: Observable<Test | undefined> = this.selectedTestId$.pipe(
Expand Down

0 comments on commit 64c66ed

Please sign in to comment.