fixed lint errors
This commit is contained in:
parent
2a6859b584
commit
e8993da266
@ -1,11 +1,11 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Project } from '@redaction/red-ui-http';
|
||||
import { AppStateService, ProjectWrapper } from '../../state/app-state.service';
|
||||
import { UserService } from '../../user/user.service';
|
||||
import { DoughnutChartConfig } from '../../components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { SortingOption } from '../../utils/types';
|
||||
import { groupBy } from '../../utils/functions';
|
||||
import { DialogService } from '../../dialogs/dialog.service';
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {Project} from '@redaction/red-ui-http';
|
||||
import {AppStateService, ProjectWrapper} from '../../state/app-state.service';
|
||||
import {UserService} from '../../user/user.service';
|
||||
import {DoughnutChartConfig} from '../../components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import {SortingOption} from '../../utils/types';
|
||||
import {groupBy} from '../../utils/functions';
|
||||
import {DialogService} from '../../dialogs/dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-project-listing-screen',
|
||||
@ -99,10 +99,14 @@ export class ProjectListingScreenComponent implements OnInit {
|
||||
public getProjectStatusConfig(pw: ProjectWrapper) {
|
||||
const obj = pw.files.reduce((acc, file) => {
|
||||
const status = file.status;
|
||||
acc[status]++ || (acc[status] = 1);
|
||||
if (!acc[status]) {
|
||||
acc[status] = 1;
|
||||
} else {
|
||||
acc[status]++;
|
||||
}
|
||||
return acc;
|
||||
}, {})
|
||||
|
||||
return Object.keys(obj).sort().map(status => ({ length: obj[status], color: status }));
|
||||
return Object.keys(obj).sort().map(status => ({length: obj[status], color: status}));
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ export class AppStateService {
|
||||
const projects = await this._projectControllerService.getProjects().toPromise();
|
||||
if (projects) {
|
||||
|
||||
let mappedProjects = projects.map(p => {
|
||||
const mappedProjects = projects.map(p => {
|
||||
return new ProjectWrapper(p, this._getExistingFiles(p));
|
||||
});
|
||||
|
||||
@ -150,9 +150,9 @@ export class AppStateService {
|
||||
const files = await this._statusControllerService.getProjectStatus(project.project.projectId).toPromise();
|
||||
const oldFiles = [...project.files];
|
||||
|
||||
for (let file of files) {
|
||||
for (const file of files) {
|
||||
let found = false;
|
||||
for (let oldFile of oldFiles) {
|
||||
for (const oldFile of oldFiles) {
|
||||
if (oldFile.fileId === file.fileId) {
|
||||
// emit when analysis count changed
|
||||
if (oldFile.numberOfAnalyses !== file.numberOfAnalyses) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user