Merge pull request #6078 from tsiegleauq/count-poos-in-statistics
Show point-of-order amount in speaker statistics
This commit is contained in:
commit
79e5b8e337
@ -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.
|
||||
*
|
||||
|
@ -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>
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user