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