1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-25 16:19:47 +02:00

feat: Filter cards by keyword with advanced capabilities (#713)

Closes #706
This commit is contained in:
Emmanuel Guyot 2024-04-22 23:15:31 +02:00 committed by GitHub
parent 0830db210c
commit 25a7a3bd3b
19 changed files with 267 additions and 1 deletions

View file

@ -359,4 +359,18 @@ export default class extends BaseModel {
},
);
}
static findUsersFromText(filterText, users) {
const selectUser = filterText.toLocaleLowerCase();
const matchingUsers = users.filter(
(user) =>
user.name.toLocaleLowerCase().startsWith(selectUser) ||
user.username.toLocaleLowerCase().startsWith(selectUser),
);
if (matchingUsers.length === 1) {
// Appens the user to the filter
return matchingUsers[0].id;
}
return null;
}
}