cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
438
Views
0
Helpful
2
Replies

Cisco Finesse Team Users Dialogs handlers (custom Team Gadget)

jozefnad
Level 1
Level 1

Hello,
do you know how to subscribe with finesse js api to users dialogs as it has Team Performance gadget?
I am able to get all users info with updated, but I cannot handle new dialogs and process calls of supervised users.

Is there any way to do it?

 

 

 

    handleUserLoad = function (userevent) {  
        var supervisedTeams = user.getSupervisedTeams()

        for (i = 0; i < supervisedTeams.length; i++) {
            var team = supervisedTeams[i];
            var teamObj = new finesse.restservices.Team({
                id: team.id,
                onLoad: _onTeamLoad
            });
        }
    },
    
    _onTeamLoad = function (team) {
        var users = team.getUsers({
            onLoad: _onTeamUsersLoad,
            onError: _onError
        });
    },
    
    _onTeamUsersLoad = function(users) {
        var usersCollection = users.getCollection();

        var usersDialogs = {}

        for (var userId in usersCollection) {
            var teamUser = usersCollection[userId]; 
            
            teamUser.addHandler('change', _onTeamUserChange);
            
//THIS IS NOT WORKING
            // usersDialogs[userId] = usersCollection[userId].getDialogs();
            // usersDialogs[userId].addHandler("collectionAdd", handleNewDialog);
            // usersDialogs[userId].addHandler("onCollectionDelete", handleEndDialog);

//THIS IS NOT WORKING
           //usersDialogs[userId] = usersCollection[userId].getDialogsNoCache({ onLoad: handleLoadDialogs, onCollectionAdd: handleNewDialog, onCollectionDelete: handleEndDialog, onError: onErrorHandler });
        }
    },

 

 

 

 Thanks for any help

2 Replies 2

bmachado
Cisco Employee
Cisco Employee

Hi jozefnad,

Could you please try 

 

 

user.getDialogs({
            onLoad : _handleDialogsLoaded,
            onCollectionAdd:_handleDialogsAdd,
            onCollectionDelete:_handleDialogsDelete
        });

 

 

in   

handleUserLoad

fn and check if that works for you?

Hello,
thank you for your reply, but this works just for logged user, not for team users.

You can see, that I tried that code with no success at the bottom of my code section in the topic.