mirror of https://github.com/sipwise/ngcp-csc.git
- chat users are now grouped in teams - user can add/remove chat channels and add/remove users with both drag and drop or bulk selection - message textarea now accepts line breaks (enter + shift) - added icons to trigger call/videocalls (will be implemented in separat ticket) Change-Id: Ibc48ff24fbe85c8462ae035970826756d6f56d73changes/16/9316/1
parent
39a2ef8168
commit
6fcfcbfbd7
@ -1,25 +1,17 @@
|
||||
Ext.define('NgcpCsc.store.ChatList', {
|
||||
extend: 'Ext.data.Store',
|
||||
extend: 'Ext.data.TreeStore',
|
||||
|
||||
alias: 'store.chatlist',
|
||||
|
||||
storeId: 'ChatList',
|
||||
|
||||
model: 'NgcpCsc.model.ChatList',
|
||||
|
||||
autoLoad: true,
|
||||
|
||||
proxy: {
|
||||
type: 'ajax',
|
||||
url: '/resources/data/chatlist.json',
|
||||
reader: {
|
||||
type: 'json',
|
||||
rootProperty: 'data'
|
||||
}
|
||||
url: 'resources/data/chatlist.json'
|
||||
},
|
||||
|
||||
sorters: {
|
||||
direction: 'DESC',
|
||||
property: 'online'
|
||||
}
|
||||
sorters: [{
|
||||
property: 'online',
|
||||
direction: 'DESC'
|
||||
}]
|
||||
});
|
||||
|
@ -1,23 +1,91 @@
|
||||
Ext.define('NgcpCsc.view.pages.chat.ChatList', {
|
||||
extend: 'Ext.menu.Menu',
|
||||
extend: 'Ext.tree.Panel',
|
||||
|
||||
alias: 'widget.chatlist',
|
||||
|
||||
viewModel: {
|
||||
type: 'chatlist'
|
||||
},
|
||||
|
||||
controller: 'chatlist',
|
||||
|
||||
itemId:'chatlist',
|
||||
|
||||
title: Ngcp.csc.locales.chat.title[localStorage.getItem('languageSelected')],
|
||||
|
||||
hideHeaders: true,
|
||||
|
||||
cls: 'navigation-email',
|
||||
|
||||
iconCls: 'x-fa fa-group',
|
||||
store: 'ChatList',
|
||||
|
||||
rootVisible: false,
|
||||
|
||||
floating: false,
|
||||
viewConfig: {
|
||||
plugins: {
|
||||
ptype: 'treeviewdragdrop',
|
||||
sortOnDrop: true,
|
||||
containerScroll: true
|
||||
},
|
||||
listeners: {
|
||||
beforecellclick: 'preventTabOpen'
|
||||
}
|
||||
},
|
||||
|
||||
tools: [{
|
||||
type: 'plus',
|
||||
tooltip: Ngcp.csc.locales.chat.new_group[localStorage.getItem('languageSelected')],
|
||||
callback: 'showTabBar'
|
||||
}],
|
||||
|
||||
dockedItems: [{
|
||||
xtype: 'toolbar',
|
||||
dock: 'top',
|
||||
hidden: true,
|
||||
items: [{
|
||||
xtype: 'textfield',
|
||||
name: 'newChatName',
|
||||
width: '80%',
|
||||
emptyText: Ngcp.csc.locales.chat.provide_name[localStorage.getItem('languageSelected')],
|
||||
minLength: 1
|
||||
}, {
|
||||
xtype: 'button',
|
||||
text: Ngcp.csc.locales.common.add[localStorage.getItem('languageSelected')],
|
||||
handler: 'createNewChannel'
|
||||
}]
|
||||
}],
|
||||
listeners: {
|
||||
click: 'itemListClicked'
|
||||
}
|
||||
beforeitemclick: 'nodeClicked',
|
||||
beforedrop: 'onBeforeUserDropped'
|
||||
},
|
||||
|
||||
defaults: {
|
||||
menuDisabled: true
|
||||
},
|
||||
|
||||
columns: [{
|
||||
xtype: 'treecolumn',
|
||||
dataIndex: 'name',
|
||||
renderer: 'renderStatus',
|
||||
flex: 2
|
||||
}, {
|
||||
xtype: 'actioncolumn',
|
||||
text: 'actions',
|
||||
flex: 1,
|
||||
items: [{
|
||||
tooltip: Ngcp.csc.locales.common.call[localStorage.getItem('languageSelected')],
|
||||
getClass: function(value, context) {
|
||||
return (context.record && context.record.get('leaf')) ? 'x-phone-display' : '';
|
||||
},
|
||||
handler: 'startCall'
|
||||
}, {
|
||||
tooltip: Ngcp.csc.locales.common.videocall[localStorage.getItem('languageSelected')],
|
||||
getClass: function(value, context) {
|
||||
return (context.record && context.record.get('leaf')) ? 'x-video-display' : '';
|
||||
},
|
||||
handler: 'startVideoCall'
|
||||
}, {
|
||||
//tooltip: Ngcp.csc.locales.common.delete[localStorage.getItem('languageSelected')],
|
||||
getClass: function(value, context) {
|
||||
return (context.record && !context.record.get('leaf')) ? 'x-drop-display' : '';
|
||||
},
|
||||
handler: 'deleteNode'
|
||||
}]
|
||||
}]
|
||||
});
|
||||
|
@ -1,27 +1,76 @@
|
||||
{
|
||||
"data": [{
|
||||
"id": 840,
|
||||
[{
|
||||
"name": "Buddies",
|
||||
"iconCls": "x-fa fa-group",
|
||||
"expanded": true,
|
||||
"children": [{
|
||||
"uid": 840,
|
||||
"online": true,
|
||||
"name": "Jil Sanchez"
|
||||
"name": "Jil Sanchez",
|
||||
"leaf": true
|
||||
}, {
|
||||
"id": 1,
|
||||
"uid": 1,
|
||||
"online": false,
|
||||
"name": "Oneill Franklin"
|
||||
"name": "Oneill Franklin",
|
||||
"leaf": true
|
||||
}, {
|
||||
"id": 3,
|
||||
"uid": 3,
|
||||
"online": false,
|
||||
"name": "Branch Allison"
|
||||
"name": "Branch Allison",
|
||||
"leaf": true
|
||||
}, {
|
||||
"id": 252,
|
||||
"uid": 252,
|
||||
"online": true,
|
||||
"name": "Ben Wright"
|
||||
"name": "Ben Wright",
|
||||
"leaf": true
|
||||
}, {
|
||||
"id": 162,
|
||||
"uid": 162,
|
||||
"online": true,
|
||||
"name": "Allen Morris"
|
||||
"name": "Allen Morris",
|
||||
"leaf": true
|
||||
}, {
|
||||
"id": 5,
|
||||
"uid": 5,
|
||||
"online": false,
|
||||
"name": "Suzette Powell"
|
||||
"name": "Suzette Powell",
|
||||
"leaf": true
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
"name": "Development",
|
||||
"iconCls": "x-fa fa-wechat",
|
||||
"expanded": true,
|
||||
"children": [{
|
||||
"uid": 162,
|
||||
"online": true,
|
||||
"name": "Allen Morris",
|
||||
"leaf": true
|
||||
},{
|
||||
"uid": 840,
|
||||
"online": true,
|
||||
"name": "Jil Sanchez",
|
||||
"leaf": true
|
||||
},{
|
||||
"uid": 252,
|
||||
"online": true,
|
||||
"name": "Ben Wright",
|
||||
"leaf": true
|
||||
}, {
|
||||
"uid": 5,
|
||||
"online": false,
|
||||
"name": "Suzette Powell",
|
||||
"leaf": true
|
||||
}]
|
||||
}, {
|
||||
"name": "Operations",
|
||||
"iconCls": "x-fa fa-wechat",
|
||||
"expanded": true,
|
||||
"children": [{
|
||||
"uid": 162,
|
||||
"online": true,
|
||||
"name": "Allen Morris",
|
||||
"leaf": true
|
||||
}, {
|
||||
"uid": 5,
|
||||
"online": false,
|
||||
"name": "Suzette Powell",
|
||||
"leaf": true
|
||||
}]
|
||||
}]
|
||||
|
Loading…
Reference in new issue