From ba585fcb87f2c30fe52dd97cf6673a315460a755 Mon Sep 17 00:00:00 2001 From: Jesse Washburn Date: Fri, 15 Nov 2024 11:06:30 -0500 Subject: [PATCH] linting fix --- src/app/courses/add-courses/courses-add.component.ts | 2 +- src/app/resources/resources-add.component.ts | 2 +- src/app/shared/table-helpers.ts | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/courses/add-courses/courses-add.component.ts b/src/app/courses/add-courses/courses-add.component.ts index f73bb9e699..36b3fce0ab 100644 --- a/src/app/courses/add-courses/courses-add.component.ts +++ b/src/app/courses/add-courses/courses-add.component.ts @@ -109,7 +109,7 @@ export class CoursesAddComponent implements OnInit, OnDestroy { this.setDocumentInfo(saved); this.pageType = 'Edit'; } else { - this.pageType = 'Add'; + this.pageType = 'Add'; } const doc = draft === undefined ? saved : draft; this.setInitialTags(tags, this.documentInfo, draft); diff --git a/src/app/resources/resources-add.component.ts b/src/app/resources/resources-add.component.ts index c0114165f4..df12cbc83e 100644 --- a/src/app/resources/resources-add.component.ts +++ b/src/app/resources/resources-add.component.ts @@ -97,7 +97,7 @@ export class ResourcesAddComponent implements OnInit { console.log(error); }); } else { - this.pageType = 'Add'; + this.pageType = 'Add'; } this.filteredZipFiles = this.resourceForm.controls.openWhichFile.valueChanges diff --git a/src/app/shared/table-helpers.ts b/src/app/shared/table-helpers.ts index 6671ae4eb9..28e1793244 100644 --- a/src/app/shared/table-helpers.ts +++ b/src/app/shared/table-helpers.ts @@ -36,7 +36,7 @@ export const filterSpecificFields = (filterFields: string[]): any => { const normalizedFilter = filter.trim().toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, ''); for (let i = 0; i < filterFields.length; i++) { const fieldValue = getProperty(data, filterFields[i]); - if (typeof fieldValue === 'string' && + if (typeof fieldValue === 'string' && fieldValue.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '').indexOf(normalizedFilter) > -1) { return true; } @@ -47,7 +47,8 @@ export const filterSpecificFields = (filterFields: string[]): any => { export const filterSpecificFieldsByWord = (filterFields: string[]): any => { return (data: any, filter: string) => { - const words = filter.split(' ').map(value => value.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '')); // Normalize each word + // Normalize each word + const words = filter.split(' ').map(value => value.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '')); return words.every(word => { return filterFields.some(field => { const fieldValue = getProperty(data, field);