Merge pull request #6078 from tsiegleauq/count-poos-in-statistics

Show point-of-order amount in speaker statistics
This commit is contained in:
Emanuel Schütze 2021-05-26 17:56:09 +02:00 committed by GitHub
commit 79e5b8e337
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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();
}
/**