From a3558288ef5fe69555fb4a5777b822325588e11e Mon Sep 17 00:00:00 2001 From: Yang Li Date: Sat, 12 Oct 2024 15:29:36 +1100 Subject: [PATCH] Fix lint errors --- .../question-submission-form.component.spec.ts | 6 ++++-- .../question-submission-form.component.ts | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/web/app/components/question-submission-form/question-submission-form.component.spec.ts b/src/web/app/components/question-submission-form/question-submission-form.component.spec.ts index b0cb8c24e22..56e516a7890 100644 --- a/src/web/app/components/question-submission-form/question-submission-form.component.spec.ts +++ b/src/web/app/components/question-submission-form/question-submission-form.component.spec.ts @@ -498,12 +498,14 @@ describe('QuestionSubmissionFormComponent', () => { expect(component.filterRecipientsBySearchText('', recipients)).toStrictEqual(recipients); expect(component.filterRecipientsBySearchText(' ', recipients)).toStrictEqual(recipients); expect(component.filterRecipientsBySearchText('Lucy', recipients)).toStrictEqual([doubleLucy, lucy]); - expect(component.filterRecipientsBySearchText('s', recipients)).toStrictEqual([sally, snoopy, linus, benny, charlieDavis, francis]); + expect(component.filterRecipientsBySearchText('s', recipients)) + .toStrictEqual([sally, snoopy, linus, benny, charlieDavis, francis]); expect(component.filterRecipientsBySearchText('Brow', recipients)).toStrictEqual([charlie, sally]); expect(component.filterRecipientsBySearchText('van pel', recipients)).toStrictEqual([lucy, linus]); expect(component.filterRecipientsBySearchText('van Pelt', recipients)).toStrictEqual([lucy, linus]); expect(component.filterRecipientsBySearchText('cy', recipients)).toStrictEqual([doubleLucy, lucy]); - expect(component.filterRecipientsBySearchText('char', recipients)).toStrictEqual([charlie, benny, charlieDavis]); + expect(component.filterRecipientsBySearchText('char', recipients)) + .toStrictEqual([charlie, benny, charlieDavis]); expect(component.filterRecipientsBySearchText('is', recipients)).toStrictEqual([charlieDavis, francis]); }); diff --git a/src/web/app/components/question-submission-form/question-submission-form.component.ts b/src/web/app/components/question-submission-form/question-submission-form.component.ts index 55ff46fb737..0cfa6a13965 100644 --- a/src/web/app/components/question-submission-form/question-submission-form.component.ts +++ b/src/web/app/components/question-submission-form/question-submission-form.component.ts @@ -331,7 +331,6 @@ export class QuestionSubmissionFormComponent implements DoCheck { if (searchName.includes(' ')) { return recipients.filter((s) => s.recipientName.toLowerCase().includes(searchName)); } - return recipients.filter((r) => r.recipientName.split(' ').some((s) => s.toLowerCase().includes(searchName))); } @@ -380,7 +379,7 @@ export class QuestionSubmissionFormComponent implements DoCheck { * Triggers the changes of the recipient selection */ triggerRecipientIdentifierChange(index: number, data: any): void { - this.searchNameTexts[index] = ""; + this.searchNameTexts[index] = ''; this.triggerRecipientSubmissionFormChange(index, 'recipientIdentifier', data); }