linked total people
This commit is contained in:
parent
7967ca4b93
commit
60947f8d75
@ -120,7 +120,7 @@
|
||||
<div class="project-stats-item">
|
||||
<mat-icon svgIcon="red:user"></mat-icon>
|
||||
<div>
|
||||
<div class="heading">240</div>
|
||||
<div class="heading">{{totalPeople}}</div>
|
||||
<div translate="project-listing.stats.total-people.label"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -93,6 +93,10 @@ export class ProjectListingScreenComponent implements OnInit {
|
||||
return this.appStateService.totalAnalysedPages;
|
||||
}
|
||||
|
||||
get totalPeople(){
|
||||
return this.appStateService.totalPeople;
|
||||
}
|
||||
|
||||
documentCount(project: ProjectWrapper) {
|
||||
return project.files.length;
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ export interface AppState {
|
||||
activeFile: FileStatus;
|
||||
totalAnalysedPages?: number;
|
||||
totalDocuments?: number;
|
||||
totalPeople?: number;
|
||||
}
|
||||
|
||||
export class ProjectWrapper {
|
||||
@ -31,6 +32,7 @@ export class AppStateService {
|
||||
|
||||
private _appState: AppState;
|
||||
|
||||
|
||||
constructor(
|
||||
private readonly _router: Router,
|
||||
private readonly _projectControllerService: ProjectControllerService,
|
||||
@ -45,8 +47,8 @@ export class AppStateService {
|
||||
}
|
||||
|
||||
get aggregatedFiles(): FileStatus[] {
|
||||
const result : FileStatus[] =[];
|
||||
this._appState.projects.forEach(p =>{
|
||||
const result: FileStatus[] = [];
|
||||
this._appState.projects.forEach(p => {
|
||||
result.push(...p.files);
|
||||
})
|
||||
return result;
|
||||
@ -55,6 +57,7 @@ export class AppStateService {
|
||||
get activeProjectId(): string {
|
||||
return this._appState.activeProject?.project?.projectId;
|
||||
}
|
||||
|
||||
get activeProject(): ProjectWrapper {
|
||||
return this._appState.activeProject;
|
||||
}
|
||||
@ -71,6 +74,10 @@ export class AppStateService {
|
||||
return this._appState.totalAnalysedPages;
|
||||
}
|
||||
|
||||
get totalPeople() {
|
||||
return this._appState.totalPeople;
|
||||
}
|
||||
|
||||
get totalDocuments() {
|
||||
return this._appState.totalDocuments;
|
||||
}
|
||||
@ -150,13 +157,18 @@ export class AppStateService {
|
||||
private _computeStats() {
|
||||
let totalAnalysedPages = 0;
|
||||
let totalDocuments = 0;
|
||||
const totalPeople = new Set<string>();
|
||||
this._appState.projects.forEach(p => {
|
||||
totalDocuments += p.files.length;
|
||||
if (p.project.memberIds) {
|
||||
p.project.memberIds.forEach(m => totalPeople.add(m));
|
||||
}
|
||||
p.files.forEach(f => {
|
||||
totalAnalysedPages += f.numberOfPages;
|
||||
})
|
||||
})
|
||||
|
||||
this._appState.totalPeople = totalPeople.size;
|
||||
this._appState.totalAnalysedPages = totalAnalysedPages;
|
||||
this._appState.totalDocuments = totalDocuments;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user