1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-08-02 20:15:27 +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 8747aa59de
commit eb56b2147b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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;
}
}