From 888c57c5f07783096c5a58f92d340dbf4d82e9e3 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 27 Oct 2020 23:38:48 +0200 Subject: [PATCH] int fixes --- apps/red-ui/src/app/screens/file/service/filters.service.ts | 2 +- apps/red-ui/src/app/state/app-state.service.ts | 4 ++-- apps/red-ui/src/app/utils/functions.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/red-ui/src/app/screens/file/service/filters.service.ts b/apps/red-ui/src/app/screens/file/service/filters.service.ts index a1ab6b48a..6958f9870 100644 --- a/apps/red-ui/src/app/screens/file/service/filters.service.ts +++ b/apps/red-ui/src/app/screens/file/service/filters.service.ts @@ -17,7 +17,7 @@ export class FiltersService { public getFilters(dictionaryData: { [key: string]: TypeValue }): AnnotationFilters { const filtersCopy = JSON.parse(JSON.stringify(this._filters)); - for (let key of Object.keys(dictionaryData)) { + for (const key of Object.keys(dictionaryData)) { const typeValue = dictionaryData[key]; if (typeValue.hint === true) { filtersCopy.hint[key] = false; 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 f42edd9dc..c2e2ec55f 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -355,7 +355,7 @@ export class AppStateService { this._dictionaryData = {}; const typeObs = this._dictionaryControllerService.getAllTypes().pipe( tap((typesResponse) => { - for (let type of typesResponse.types) { + for (const type of typesResponse.types) { this._dictionaryData[type.type] = type; } }) @@ -386,7 +386,7 @@ export class AppStateService { this._dictionaryData['hint'] = { hexColor: '#283241', type: 'hint' }; this._dictionaryData['redaction'] = { hexColor: '#283241', type: 'redaction' }; - for (let key of Object.keys(this._dictionaryData)) { + for (const key of Object.keys(this._dictionaryData)) { this._dictionaryData[key]['label'] = humanize(key); } } else { diff --git a/apps/red-ui/src/app/utils/functions.ts b/apps/red-ui/src/app/utils/functions.ts index 87ebe129c..af69f6ba1 100644 --- a/apps/red-ui/src/app/utils/functions.ts +++ b/apps/red-ui/src/app/utils/functions.ts @@ -6,7 +6,7 @@ export function groupBy(xs: any[], key: string) { } export function humanize(str: string) { - let frags = str.split(/[ \-_]+/); + const frags = str.split(/[ \-_]+/); for (let i = 0; i < frags.length; i++) { frags[i] = frags[i].charAt(0).toUpperCase() + frags[i].slice(1); }