TT#4313 Implement ngcp-csc fax spool module mockup

Implement ngcp-csc fax spool module mockup with a listing in grid-
form of fax data, and create mockup data.

Change-Id: I6bc59a3eb506b9bd1ff908175aad899835a0aa9e
changes/10/9610/3
Robert Axelsen 9 years ago
parent 48f719a115
commit 354d337e55

@ -748,8 +748,8 @@ Ext.define('Ngcp.csc.locales', {
sp: 'Create new contact'
}
},
webrtc:{
title:{
webrtc: {
title: {
en: 'Webrtc',
it: 'Webrtc',
de: 'Webrtc',
@ -757,6 +757,87 @@ Ext.define('Ngcp.csc.locales', {
sp: 'Webrtc'
}
},
fax_spool: {
title: {
en: 'Your faxes.',
it: 'Your faxes.',
de: 'Your faxes.',
fr: 'Your faxes.',
sp: 'Your faxes.'
},
subtitle: {
en: 'FAX SPOOL',
it: 'FAX SPOOL',
de: 'FAX SPOOL',
fr: 'FAX SPOOL',
sp: 'FAX SPOOL'
},
user_label: {
en: 'Faxes for ',
it: 'Faxes for ',
de: 'Faxes for ',
fr: 'Faxes for ',
sp: 'Faxes for '
},
columns: {
number: {
en: '#',
it: '#',
de: '#',
fr: '#',
sp: '#'
},
timestamp: {
en: 'timestamp',
it: 'timestamp',
de: 'timestamp',
fr: 'timestamp',
sp: 'timestamp'
},
status: {
en: 'status',
it: 'status',
de: 'status',
fr: 'status',
sp: 'status'
},
duration: {
en: 'duration',
it: 'duration',
de: 'duration',
fr: 'duration',
sp: 'duration'
},
direction: {
en: 'direction',
it: 'direction',
de: 'direction',
fr: 'direction',
sp: 'direction'
},
caller: {
en: 'caller',
it: 'caller',
de: 'caller',
fr: 'caller',
sp: 'caller'
},
callee: {
en: 'callee',
it: 'callee',
de: 'callee',
fr: 'callee',
sp: 'callee'
},
pages: {
en: 'pages',
it: 'pages',
de: 'pages',
fr: 'pages',
sp: 'pages'
}
}
},
common: {
today: {
en: 'Today',
@ -807,6 +888,13 @@ Ext.define('Ngcp.csc.locales', {
fr: 'Listen',
sp: 'Listen'
},
view: {
en: 'View',
it: 'View',
de: 'View',
fr: 'View',
sp: 'View'
},
save_success: {
en: 'Successfully saved.',
it: 'Successfully saved.',

@ -0,0 +1,30 @@
Ext.define('NgcpCsc.model.FaxSpool', {
extend: 'Ext.data.Model',
fields: [{
name: 'id',
type: 'string'
}, {
name: 'timestamp',
type: 'string'
}, {
name: 'status',
type: 'string'
}, {
name: 'duration',
type: 'string'
}, {
name: 'direction',
type: 'string'
}, {
name: 'caller',
type: 'string'
}, {
name: 'callee',
type: 'string'
}, {
name: 'pages',
type: 'string'
}]
});

@ -0,0 +1,19 @@
Ext.define('NgcpCsc.store.FaxSpool', {
extend: 'Ext.data.Store',
storeId: 'FaxSpool',
model: 'NgcpCsc.model.FaxSpool',
autoLoad: true,
proxy: {
type: 'ajax',
url: '/resources/data/faxspool.json',
reader: {
type: 'json',
rootProperty: 'data'
}
}
});

@ -58,6 +58,13 @@ Ext.define('NgcpCsc.store.NavigationTree', {
viewType: 'callbarring',
acl: ['administrator'],
leaf: true
}, {
text: 'Fax Spool',
iconCls: 'x-fa fa-fax',
viewType: 'faxspool',
routeId: 'faxspool',
acl: ['administrator'],
leaf: true
}, {
text: 'Reminder',
iconCls: 'x-fa fa-sticky-note',

@ -0,0 +1,4 @@
// custom rules
.faxspool-heading {
font-size: 24px;
}

@ -25,7 +25,8 @@ Ext.define('NgcpCsc.Application', {
'Languages',
'CallBarringOutgoing',
'CallBarringIncoming',
'Addressbook'
'Addressbook',
'FaxSpool'
],
launch: function() {

@ -0,0 +1,36 @@
Ext.define('NgcpCsc.view.pages.faxspool.FaxSpool', {
extend: 'Ext.panel.Panel',
xtype: 'faxspool',
controller: 'faxspool',
title: Ngcp.csc.locales.fax_spool.title[localStorage.getItem('languageSelected')],
layout: {
type: 'hbox',
align: 'stretch'
},
initComponent: function() {
this.items = [{
flex: 4,
items: [{
height: 60,
padding: '20 0 5 20',
html: Ngcp.csc.locales.fax_spool.subtitle[localStorage.getItem('languageSelected')]
}, {
height: 60,
padding: '5 0 0 20',
html: Ext.String.format('<div class="faxspool-heading">{0} {1}</div>', Ngcp.csc.locales.fax_spool.user_label[localStorage.getItem('languageSelected')], localStorage.getItem('username'))
}, {
xtype: 'faxspool-grid'
}]
}, {
flex: 1,
xtype: 'gridfilters',
_linkedStoreId: 'FaxSpool'
}];
this.callParent();
}
});

@ -0,0 +1,17 @@
Ext.define('NgcpCsc.view.pages.faxspool.FaxSpoolController', {
extend: 'Ext.app.ViewController',
alias: 'controller.faxspool',
reproduceFax: function (val, rec) {
this.fireEvent('showmessage', false, 'Todo');
},
removeFax: function(grid, rowIndex, colIndex) {
var store = grid.getStore();
var rec = grid.getStore().getAt(rowIndex);
store.remove(rec);
this.fireEvent('showmessage', true, Ngcp.csc.locales.common.remove_success[localStorage.getItem('languageSelected')]);
}
});

@ -0,0 +1,73 @@
Ext.define('NgcpCsc.view.pages.faxspool.FaxSpoolGrid', {
extend: 'Ext.grid.Panel',
xtype: 'faxspool-grid',
layout: 'fit',
store: 'FaxSpool',
padding: 10,
columns: {
defaults: {
menuDisabled: true,
resizable: false
},
items: [{
xtype: 'actioncolumn',
width: 30,
items: [{
glyph: 'xf0f6@FontAwesome',
tooltip: Ngcp.csc.locales.common.view[localStorage.getItem('languageSelected')],
handler: 'reproduceFax'
}]
}, {
dataIndex: 'id',
text: '#',
width: 60
}
, {
flex: 1,
xtype:'datecolumn',
dataIndex: 'timestamp',
text: 'timestamp',
format: 'd.m.Y h:i:s'
}
, {
flex: 1,
dataIndex: 'status',
text: 'status'
}, {
flex: 1,
dataIndex: 'duration',
text: 'duration'
}, {
flex: 1,
dataIndex: 'direction',
text: 'direction'
}, {
flex: 1,
dataIndex: 'caller',
text: 'caller'
}, {
flex: 1,
dataIndex: 'callee',
text: 'callee'
}, {
flex: 1,
dataIndex: 'pages',
text: 'pages',
align: 'right'
}, {
xtype: 'actioncolumn',
width: 30,
align: 'right',
items: [{
glyph: 'xf00d@FontAwesome',
tooltip: Ngcp.csc.locales.common.delete[localStorage.getItem('languageSelected')],
handler: 'removeFax'
}]
}]
}
})

@ -0,0 +1,84 @@
{
"data": [{
"id": "1",
"timestamp": "2016-10-08T17:41:12",
"status": "FAILED",
"duration": "19.488",
"direction": "out",
"caller": "43991001",
"callee": "11228844",
"pages": "7"
}, {
"id": "2",
"timestamp": "2016-10-08T11:14:12",
"status": "SUCCESS",
"duration": "43.144",
"direction": "in",
"caller": "11223344",
"callee": "43991001",
"pages": "4"
}, {
"id": "3",
"timestamp": "2016-10-03T07:23:43",
"status": "SUCCESS",
"duration": "231.743",
"direction": "in",
"caller": "11223344",
"callee": "43991001",
"pages": "34"
}, {
"id": "4",
"timestamp": "2016-09-31T03:41:12",
"status": "FAILED",
"duration": "09.488",
"direction": "out",
"caller": "43991001",
"callee": "11228844",
"pages": "1"
}, {
"id": "5",
"timestamp": "2016-09-31T03:41:40",
"status": "SUCCESS",
"duration": "04.144",
"direction": "in",
"caller": "11223344",
"callee": "43991001",
"pages": "4"
}, {
"id": "6",
"timestamp": "2016-09-27T09:11:43",
"status": "FAILED",
"duration": "17.793",
"direction": "in",
"caller": "11223344",
"callee": "43991001",
"pages": "1"
}, {
"id": "7",
"timestamp": "2016-09-18T13:12:53",
"status": "FAILED",
"duration": "14.468",
"direction": "out",
"caller": "43991001",
"callee": "11228844",
"pages": "1"
}, {
"id": "8",
"timestamp": "2016-09-14T11:11:17",
"status": "SUCCESS",
"duration": "123.144",
"direction": "in",
"caller": "11223344",
"callee": "43991001",
"pages": "4"
}, {
"id": "9",
"timestamp": "2016-09-14T11:23:53",
"status": "SUCCESS",
"duration": "31.743",
"direction": "in",
"caller": "11223344",
"callee": "43991001",
"pages": "2"
}]
}
Loading…
Cancel
Save