Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@mention with more then 10 user... missing someone? #2380

Closed
1 task
twessman opened this issue Mar 7, 2024 · 2 comments
Closed
1 task

@mention with more then 10 user... missing someone? #2380

twessman opened this issue Mar 7, 2024 · 2 comments

Comments

@twessman
Copy link

twessman commented Mar 7, 2024

What set up are you using

  • Self Hosted

Describe the bug
We now have 11 active user, but the @mention list seems to not show a certain user now. Maybe it is capped at 10?

To Reproduce
Steps to reproduce the behavior:

  1. Anywhere the @mention is supposed to work, 10 of our 11 users show up. The user is active and assigned to a project. (not certain if they post a comment anywhere yet but has been assigned something)

Expected behavior
All users, or better yet as you type @ it will sort/filter what is displayed to quickly select someone

Leantime Version
Was on 3.05, but just update 3.07 and still see it.

Server
Official docker image.

@rimi-itk
Copy link
Contributor

It seems that we're using the default limit of 10 items (cf. https://github.com/StevenDevooght/tinyMCE-mention?tab=readme-ov-file#items). A higher limit can easily be set by defining limit in

var mentionsConfig = {
delimiter: '@',
delay: 20,
source: function (query, process, delimiter) {
// Do your ajax call
// When using multiple delimiters you can alter the query depending on the delimiter used
if (delimiter === '@') {
jQuery.getJSON(leantime.appUrl + '/api/users?projectUsersAccess=current', function (data) {
//call process to show the result
let users = [];
for (let i = 0; i < data.length; i++) {
users[i] = {
"name": data[i].firstname + " " + data[i].lastname,
"id": data[i].id,
"email": data[i].username
};
}
process(users);
});
}
},
highlighter: function (text) {
//make matched block italic
return text.replace(new RegExp('(' + this.query + ')', 'ig'), function ($1, match) {
return '<strong>' + match + '</strong>';
});
},
insert: function (item) {
return '<a class="userMention" data-tagged-user-id="' + item.id + '" href="javascript:void(0)"><img src="' + leantime.appUrl + '/api/users?profileImage=' + item.id + '" alt="' + item.name + ' Image"/>' + item.name.trim() + '</a>&nbsp;';
}
};
.

However, limiting to 10 items seems reasonable, and the real issue here might be that filtering in the underlying library, https://github.com/StevenDevooght/tinyMCE-mention, is broken and that Leantime therefore cannot (and doesn't) filter the user list based in the input (after @).

The solution seems to be hidden inside the pointers:

I'll investigate further and try to come up with a solution.

@rimi-itk rimi-itk mentioned this issue Mar 11, 2024
3 tasks
@marcelfolaron
Copy link
Contributor

Fixed in 3.1.0-beta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants