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