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:
parent
0830db210c
commit
25a7a3bd3b
19 changed files with 267 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue