Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
  • Community
  • Answers Developer Questions
  • Questions
  • @Mentions Autocomplete not working for Usernames with just one letter (confluence) => Howto fix this myself? (in WYSIWYG editor javascript? Or in the sourcecode of Plugin-Package MNTS?)

@Mentions Autocomplete not working for Usernames with just one letter (confluence) => Howto fix this myself? (in WYSIWYG editor javascript? Or in the sourcecode of Plugin-Package MNTS?)

Sven
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 12, 2012

Hello,

we have a lot of users like this:
------------------------------------------
User: Hans
Full Name: H
Email: hans@mycompany.com
Directory: Active Directory server
------------------------------------------

As you can see they are synchronized from Active Directory, so we can't change them for confluence.
And these very short Names (like "H" here) are used for internal communication since more than 20 years now.

When you click on the share-Button on a page and type "Ha" you'll get the suggestion for the user "H (Hans)".
But if you do the same when adding a mention somewhere by typing "@Ha" you'll get NOTHING AT ALL.

This looks like in Mentions you are searching for "Full Name" only instead of for the "Username" (like in the Share-Autocomplete).

Confluence-Support confirmed this behaviour and added a feature request (please vote for it ;-:

https://jira.atlassian.com/browse/CONF-24409

But I need this change as fast as possible...

I already looked into the source-code of the plugin-package "MNTS"

https://studio.plugins.atlassian.com/svn/MNTS/trunk

especially in:

java\com\atlassian\confluence\plugins\mentions\rest\NetworkService.java

But there is only the code to retrieve the persons who are "followed" on the users network.

The REST-Call to search for users must be in the javascript-part, but I couldn't find it here neither:

MNTS\src\main\resources\js\editor_plugin_src.js

Any hint how to fix this is really appreciated!

Thanks a lot in advance.

Sven


PS: It is not possible for us that everybody follows everybody (this way the names figures immediately in the Mentions-Autocomplete-Box) and you have also a limit to show a maximum of 10 "followed" people in the Mentions-Autocomplete-Dropdown.

PS2: In

MNTS\src\main\resources\js\tinyMce-autocomplete-settings-mentions.js

AJS.toInit(function ($) {
    var autoComplete = tinymce.confluence.Autocompleter,

    getUrl = function(val) {
        if (val) {
            return AJS.params.contextPath + "/rest/prototype/1/search.json";
        } else if (AJS.Meta.get('remote-user')) {
            return AJS.params.contextPath + "/rest/mentions/1/network.json";
        }

        return null;
    },

    getParams = function(autoCompleteControl, val) {
        var params = {
            "max-results": autoCompleteControl.maxResults || 10
        };
        if (val) {
            params.query =  Confluence.unescapeEntities(val);
            params.search = "name";
            params.type = "userinfo";
        }
        return params;  
    };

There is only the switch if network is searched or just usernames, but where to change the intended behaviour.

Perhaps I'll have to compare it with the Share-Button-Source-Code?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Sven
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2012

We have found a workaround (by accident):

After typing the @-sign, followed by the one-character-name of the collegue, we have to type a (-sign "(" and the dropdown pops up.

Great! ;-)

0 votes
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 12, 2012

A workaround would be to put the user's full name in the Full Name field and thus in the AD too. It seems somewhat bizarre to turn this into a single letter abbreviation, and I'm guessing that it's not that scalable.

This would not only fix the @Mentions "bug", but also enhance the usability of all your AD dependant systems.

An aside: I don't know anyone with a single letter full name, except perhaps (embarrassingly) H, but it turns out that he has a longer real name ;-)

Sven
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 12, 2012

Sure that would be ok. But it is so brilliant and effective to have in the dashboards, the checklists and so on just one or two or three letters instead of "Full" names... takes a lot more space and fills the screen "for nothing" ;-)

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 12, 2012

Not only H, less embarrasingly, M and Q.

David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 12, 2012
Also, 6 from The Prisoner.
Sven
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2012

Thanks anyway for all the hints!

TAGS
AUG Leaders

Atlassian Community Events