Show point-of-order amount in speaker statistics

Shows the amount of point of orders in speaker statistics
This commit is contained in:
Sean 2021-05-26 11:32:32 +02:00 committed by Emanuel Schütze
parent 4d4a3bb0db
commit d4025296fe
3 changed files with 22 additions and 2 deletions

View File

@ -284,6 +284,16 @@ export class ListOfSpeakersRepositoryService extends BaseHasContentObjectReposit
return firstContributions;
}
/**
* @returns the amount of point of orders (sync)
*/
public getPooAmount(): number {
const speakers: ViewSpeaker[] = this.getViewModelList()
.flatMap((los: ViewListOfSpeakers) => los.finishedSpeakers)
.filter(speaker => speaker.point_of_order);
return speakers.length || 0;
}
/**
* Maps structure-level to speaker.
*

View File

@ -10,6 +10,10 @@
<td>{{ 'Number of all requests to speak' | translate }}</td>
<td>{{ numberOfWordRequests }}</td>
</tr>
<tr>
<td>{{ 'Thereof point of orders' | translate }}</td>
<td>{{ numberOfPoo }}</td>
</tr>
<tr>
<td>{{ 'Unique speakers' | translate }}</td>
<td>{{ numberOfUniqueSpeakers }}</td>

View File

@ -30,11 +30,15 @@ export class UserStatisticsComponent extends BaseViewComponentDirective {
}
public get numberOfUniqueSpeakers(): number {
return this.uniqueSpeakers.length;
return this.uniqueSpeakers?.length || 0;
}
public get numberOfWordRequests(): number {
return this._numberOfWordRequests;
return this._numberOfWordRequests || 0;
}
public get numberOfPoo(): number {
return this._numberOfPoo || 0;
}
/**
@ -84,6 +88,7 @@ export class UserStatisticsComponent extends BaseViewComponentDirective {
*/
private uniqueSpeakers: ViewSpeaker[] = [];
private _numberOfWordRequests = 0;
private _numberOfPoo = 0;
private statisticIsOpen = false;
private relationSpeakingTimeStructureLevelSubject = new BehaviorSubject<SpeakingTimeStructureLevelObject[]>([]);
@ -122,6 +127,7 @@ export class UserStatisticsComponent extends BaseViewComponentDirective {
}
this.relationSpeakingTimeStructureLevelSubject.next(list);
this.uniqueSpeakers = this.losRepo.getAllFirstContributions();
this._numberOfPoo = this.losRepo.getPooAmount();
}
/**