Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class AccountListSearchService extends ListSearchService<ViewUser> {
public constructor() {
super(
[`short_name`, `username`, `email`, `saml_id`, `member_number`, `externalString`, `homeCommitteeName`],
[]
[`first_name`]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes sense to put this here.

);
}
}
12 changes: 10 additions & 2 deletions client/src/app/ui/modules/list/services/list-search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ export class ListSearchService<V extends Identifiable> implements SearchService<
return true;
}

if (this.isIncludedInProperty(item, trimmedInput, this.alsoFilterByProperties)) {
if (
this.isIncludedInProperty(item, trimmedInput, this.alsoFilterByProperties) ||
this.isIncludedInProperty(item, trimmedInput, this.filterProps)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be added here

) {
return true;
}

Expand All @@ -88,7 +91,12 @@ export class ListSearchService<V extends Identifiable> implements SearchService<
private isIncludedInProperty(item: V, trimmedInput: string, properties: string[]): boolean {
if (properties.length > 0 && !!item[properties[0]]) {
const propertyValueString = `` + item[properties[0]];
const foundPropertyValue = propertyValueString.trim().toLowerCase().indexOf(trimmedInput) !== -1;
const foundPropertyValue = propertyValueString
.trim()
.toLowerCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.includes(trimmedInput);
if (foundPropertyValue) {
return true;
}
Expand Down
Loading