int fixes

This commit is contained in:
Timo Bejan 2020-10-27 23:38:48 +02:00
parent f1f3dda4e3
commit 888c57c5f0
3 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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 {

View File

@ -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);
}