mirror of
https://github.com/plankanban/planka.git
synced 2025-12-25 01:11:49 +03:00
feat: Filter cards by keyword with advanced capabilities (#713)
Closes #706
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user