From e8993da266e9d0fe4eb98b3546b00887aab2f602 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 27 Oct 2020 15:40:18 +0200 Subject: [PATCH] fixed lint errors --- .../project-listing-screen.component.ts | 24 +++++++++++-------- .../red-ui/src/app/state/app-state.service.ts | 6 ++--- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts index cdcb496e8..29d82bae9 100644 --- a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts +++ b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts @@ -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})); } } diff --git a/apps/red-ui/src/app/state/app-state.service.ts b/apps/red-ui/src/app/state/app-state.service.ts index 92a90e2b8..5a7c7b17b 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -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) {