* Modified the sort for name to be case-insensitive * Added comments for added piece of code sorting members
This commit is contained in:
committed by
Matteo Pagliazzi
parent
0ac12cb6a5
commit
a49f95e1a5
@@ -479,11 +479,19 @@ export default {
|
||||
|
||||
if (!isEmpty(this.sortOption)) {
|
||||
// Use the memberlist filtered by searchTerm
|
||||
sortedMembers = orderBy(
|
||||
sortedMembers,
|
||||
[this.sortOption.value],
|
||||
[this.sortOption.direction],
|
||||
);
|
||||
if (this.sortOption.value === 'profile.name') {
|
||||
// If members are to be sorted by name, use localeCompare for case-
|
||||
// insensitive sort
|
||||
sortedMembers.sort(
|
||||
(a, b) => a.profile.name.localeCompare(b.profile.name),
|
||||
);
|
||||
} else {
|
||||
sortedMembers = orderBy(
|
||||
sortedMembers,
|
||||
[this.sortOption.value],
|
||||
[this.sortOption.direction],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return sortedMembers;
|
||||
|
||||
Reference in New Issue
Block a user