TT#17451 Csc implement GET for callforward API

What has been done:
 1. Update endpoints mapping, as callforwards has sources and times,
    but no sourceset or timeset names. Need to perform an ajax
    request in controller to get sourceset name for current cf type
    for subscriber
+--------------+---------------+------+-------------------------+
| Submodule    | Grid          | CRUD | Endpoint                |
+--------------+---------------+------+-------------------------+
| Alw/Aft/Comp | Timeset       | RU   | /api/cftimesets/        |
| Alw/Aft/Comp | Sourceset     | RU   | /api/cfsourcesets/      |
| Alw/Aft/Comp | Onl/Offl/Busy | CRUD | /api/cfmappings/        |
| Alw/Aft/Comp | Onl/Offl/Busy | CR   | /api/cfsourcesets/      |
| Alw/Aft/Comp | Onl/Offl/Busy | CR   | /api/cftimesets/        |
| Alw/Aft/Comp | Onl/Offl/Busy | CRUD | /api/cfdestinationsets/ |
+--------------+---------------+------+-------------------------+
(timeset/sourceset in onl/off/busy CRUD depends on UI implementation)
 2. Implement main store, proxy and controller for destination grids
 3a. implement into view for displaying data based on requested data
 3b. BUG fix. Duplicate destinations when loading several submodules
 4. CANCEL button text does not get reverted back to ADD NEW
    DESTINATION after adding new from empty list, fix
 5. Make timeout field editable
 6. For busy and offline, don't display "first ring" section
 7a. Read and display sourceset and timeset API data
 7b. BUG fix. List A grid is not showing
 8. Fix "Voicemail" rendering
 9. BUG fix. emptyText not showing for CallForwardMainGrid.js grids
 10. Added box-shadow for core-container and cards

Change-Id: I1112969673296150e20a3add427fce81473d7060
changes/55/13755/23
Robert Axelsen 8 years ago
parent 92a3ebf132
commit 348c4cfd3a

@ -2,11 +2,41 @@ Ext.define('NgcpCsc.model.CallForward', {
extend: 'Ext.data.Model',
fields: [{
name: 'phone',
name: 'id',
type: 'string'
}, {
name: 'type',
type: 'auto'
}, {
name: 'destination_cleaned',
type: 'auto'
}, {
name: 'destination_announcement_id',
type: 'auto'
}, {
name: 'destination',
type: 'auto'
}, {
name: 'priority',
type: 'auto'
}, {
name: 'simple_destination',
type: 'auto'
}, {
name: 'ring_for',
type: 'string'
type: 'auto'
}, {
name: 'sourceset',
type: 'auto'
}, {
name: 'timeset',
type: 'auto'
}, {
name: 'destinationset_id',
type: 'auto'
}, {
name: 'destinationset_name',
type: 'auto'
}]
});

@ -2,11 +2,17 @@ Ext.define('NgcpCsc.model.CallForwardSourceset', {
extend: 'Ext.data.Model',
fields: [{
name: 'phone',
name: 'id',
type: 'string'
}, {
name: 'edit',
type: 'boolean'
name: 'sourceset_name',
type: 'auto'
}, {
name: 'sourceset_id',
type: 'auto'
}, {
name: 'source',
type: 'auto'
}]
});

@ -2,17 +2,26 @@ Ext.define('NgcpCsc.model.CallForwardTimeset', {
extend: 'Ext.data.Model',
fields: [{
name: 'day',
name: 'id',
type: 'string'
}, {
name: 'timeset_name',
type: 'auto'
}, {
name: 'timeset_id',
type: 'auto'
}, {
name: 'time_from',
type: 'string'
type: 'auto'
}, {
name: 'time_to',
type: 'string'
type: 'auto'
}, {
name: 'day',
type: 'auto'
}, {
name: 'closed',
type: 'boolean'
type: 'auto'
}]
});

@ -77,4 +77,5 @@ Ext.define('NgcpCsc.model.Reminder', {
route: 'reminders',
params: 'subscriber_id=' + localStorage.getItem('subscriber_id')
}
});

@ -5,6 +5,24 @@ Ext.define('NgcpCsc.store.CallForward', {
model: 'NgcpCsc.model.CallForward',
autoLoad: true
// TODO: (For PUT/PATCH ticket)
// autoSync: true,
proxy: {
type: 'ngcp-api',
route: 'cfmappings',
addSubscriber: true,
actionMethods: {
read: 'GET',
update: 'PATCH'
}
}
// TODO: (For PUT/PATCH ticket)
// ,listeners: {
// beforesync: function(options) {
// this.fireEvent('cfStoreBeforeSync', this, options);
// }
// }
});

@ -5,6 +5,23 @@ Ext.define('NgcpCsc.store.CallForwardSourceset', {
model: 'NgcpCsc.model.CallForwardSourceset',
autoLoad: true
proxy: {
type: 'ngcp-api',
route: 'cfsourcesets',
params: 'subscriber_id=' + localStorage.getItem('subscriber_id'),
actionMethods: {
read: 'GET',
update: 'PATCH'
}
},
listeners: {
load: function(store, recs) {
if (recs[0] && recs[0].data && recs[0].data._embedded) {
this.fireEvent('cfSourcesetStoreLoaded', this, recs[0].data._embedded['ngcp:cfsourcesets']);
}
}
}
});

@ -5,6 +5,22 @@ Ext.define('NgcpCsc.store.CallForwardTimeset', {
model: 'NgcpCsc.model.CallForwardTimeset',
autoLoad: true
autoLoad: true,
proxy: {
type: 'ngcp-api',
route: 'cftimesets',
params: 'subscriber_id=' + localStorage.getItem('subscriber_id'),
actionMethods: {
read: 'GET',
update: 'PATCH'
}
},
listeners: {
load: function(store, recs) {
this.fireEvent('cfTimesetStoreLoaded', this, recs[0].data._embedded['ngcp:cftimesets']);
}
}
});

@ -833,6 +833,13 @@ Ext.define('Ngcp.csc.locales', {
fr: 'then forward to ...',
sp: 'then forward to ...'
},
forward_to: {
en: 'forward to ...',
it: 'forward to ...',
de: 'forward to ...',
fr: 'forward to ...',
sp: 'forward to ...'
},
add_new_destination: {
en: 'ADD NEW DESTINATION',
it: 'ADD NEW DESTINATION',

@ -5,6 +5,7 @@
$ui-border-radius: 1px
);
.x-panel-core-container {
box-shadow: 0px 2px 4px rgba(0,0,0,0.18);
.x-panel-body {
background-color: $body-background-color;
}

@ -23,6 +23,7 @@ $grid-row-cell-focus-border-color: '#fff';
border-radius: 1px;
margin-right: 11px;
padding: 10px;
box-shadow: 0px 2px 4px rgba(0,0,0,0.18);
}
.x-grid-td {

@ -8,7 +8,309 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
'*': {
confirmCFRemoval: 'confirmCFRemoval'
}
},
store: {
'*': {
cfStoreLoaded: 'cfStoreLoaded',
cfTimesetStoreLoaded: 'cfTimesetStoreLoaded',
cfSourcesetStoreLoaded: 'cfSourcesetStoreLoaded'
}
}
},
cfTimesetStoreLoaded: function(store, data) {
var me = this;
var arrayOfModels = [];
store.removeAll();
Ext.each(data, function (timeset) {
var timesetName = timeset.name;
var timesetId = timeset.id;
if (timesetName == 'After Hours' || timesetName == 'Company Hours') {
var times = me.getModelValuesFromTimesData(timeset.times[0]);
Ext.each(times.days, function (weekday) {
var cbModel = Ext.create('NgcpCsc.model.CallForward', {
id: Ext.id(),
timeset_name: timesetName,
timeset_id: timesetId,
time_from: times.timeFrom,
time_to: times.timeTo,
day: weekday,
closed: false // TODO: (For PUT/PATCH ticket) decide
// if we should keep this, or solve this
// differently, or not at all
});
arrayOfModels.push(cbModel);
});
};
});
if (arrayOfModels.length > 0) {
me.populateTimesetStores(arrayOfModels);
};
},
cfSourcesetStoreLoaded: function(store, data) {
var me = this;
var arrayOfModels = [];
store.removeAll();
Ext.each(data, function (sourceset) {
var sourcesetName = sourceset.name;
var sourcesetId = sourceset.id;
Ext.each(sourceset.sources, function (sourceEntry) {
var cbModel = Ext.create('NgcpCsc.model.CallForward', {
id: Ext.id(),
sourceset_name: sourcesetName,
sourceset_id: sourcesetId,
source: sourceEntry.source
});
arrayOfModels.push(cbModel);
});
});
if (arrayOfModels.length > 0) {
me.populateSourcesetStores(arrayOfModels);
};
},
getTimesetFromRoute: function (route) {
switch (route) {
case ('#callforward/always'):
return null;
break;
case ('#callforward/afterhours'):
return 'After Hours';
break;
case ('#callforward/companyhours'):
return 'Company Hours';
break;
};
},
cfStoreLoaded: function(store, data) {
var me = this;
var cfTypeArrayOfObjects = [data.get('cfu'), data.get('cft'), data.get('cfb'), data.get('cfna')];
var cfTypes = ['cfu', 'cft', 'cfb', 'cfna'];
var timeset = store._type;
var arrayOfModels = [];
var currentRoute = window.location.hash;
var routeTimeset = this.getTimesetFromRoute(currentRoute);
if(me.getView()._preventReLoad){
return;
}
store.removeAll();
// TODO optimize, too many nested loops affects performance.
// Ex. Where possible use break Ext.each by return false;
Ext.Ajax.request({
url: window.location.origin + '/api/cfdestinationsets/?subscriber_id=' + localStorage.getItem('subscriber_id'),
success: function(response, opts) {
var decodedResponse = Ext.decode(response.responseText);
var destinationsets = decodedResponse._embedded['ngcp:cfdestinationsets'];
me.getView()._preventReLoad = true; // assumes there is no need to reload the store
Ext.each(cfTypeArrayOfObjects, function (cfTypeObjects, index) {
var cfType = cfTypes[index];
Ext.each(cfTypeObjects, function(cfTypeObject) {
var destinationsetName = cfTypeObject.destinationset;
var sourcesetName = cfTypeObject.sourceset;
var timesetName = cfTypeObject.timeset;
if (timesetName == routeTimeset) {
Ext.each(destinationsets, function(destinationset) {
if (destinationset.name == destinationsetName) {
for (item in destinationset.destinations) {
var destinationToUse = me.getDestinationFromSipId(destinationset.destinations[item].destination);
var destinationAnnouncementId = destinationset.announcement_id;
var destination = destinationset.destinations[item].destination;
var priority = destinationset.destinations[item].priority;
var simpleDestination = destinationset.destinations[item].simple_destination;
var destinationId = destinationset.id;
var destinationName = destinationset.name;
var ringFor = destinationToUse == 'Voicemail' ? '' : destinationset.destinations[item].timeout;
var cbModel = Ext.create('NgcpCsc.model.CallForward', {
type: cfType,
destination_cleaned: destinationToUse,
destination_announcement_id: destinationAnnouncementId,
destination: destination,
priority: priority,
simple_destination: simpleDestination,
ring_for: ringFor,
sourceset: sourcesetName,
timeset: timesetName,
destinationset_id: destinationId,
destinationset_name: destinationName
});
arrayOfModels.push(cbModel);
}
}
});
};
});
});
if (arrayOfModels.length > 0) {
me.populateDestinationStores(arrayOfModels);
}
},
failure: function(response, opts) {
console.log('server-side failure with status code ' + response.status);
}
});
},
cfStoreBeforeSync: function(store, options) {
console.log('cfStoreBeforeSync');
// TODO: (For PUT/PATCH ticket) Base on on CB module implementation
},
getDestinationFromSipId: function (destination) {
var splitDestination = destination.split(/(:|@)/);
if (splitDestination[4] == 'voicebox.local') {
return 'Voicemail';
} else {
return splitDestination[2];
}
},
getGridCategoryFromType: function (type) {
switch (type) {
case 'cft':
case 'cfu':
return 'CallForwardOnline';
break;
case 'cfb':
return 'CallForwardBusy';
break;
case 'cfna':
return 'CallForwardOffline';
break;
}
},
getSourceNameFromSourceSet: function (sourceset) {
switch (sourceset) {
case 'List A':
return 'listA-';
break;
case 'List B':
return 'listB-';
break;
case null:
return 'everybody-';
break;
}
},
getTimeNameFromTimeSet: function (timeset) {
switch (timeset) {
case 'After Hours':
return 'afterHours-';
break;
case 'Company Hours':
return 'companyHours-';
break;
case null:
return 'always-';
break;
}
},
getModuleFromRoute: function(currentRoute) {
switch (currentRoute) {
case '#callforward/always':
return 'always';
break;
case '#callforward/afterhours':
return 'afterHours';
break;
case '#callforward/companyhours':
return 'companyHours';
break;
};
},
getModelValuesFromTimesData: function (timesData) {
var times = {};
var timesFromAndTo = timesData.hour !== null ? timesData.hour.split('-') : [null, null];
var daysFromAndTo = timesData.wday !== null ? timesData.wday.split('-') : [null, null];
var weekdayLiterals = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
var timeFrom = timesFromAndTo[0];
var timeTo = timesFromAndTo[1];
var dayFrom = daysFromAndTo[0];
var dayTo = daysFromAndTo[1];
times.days;
var weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
times.timeFrom = timeFrom;
times.timeTo = timeTo;
if (!!timesData.wday) {
var weekdaysArray = weekdayLiterals.slice(dayFrom-1, dayTo);
times.days = weekdaysArray;
} else {
times.days = null;
};
return times;
},
populateTimesetStores: function (models) {
var vm = this.getViewModel();
var currentRoute = window.location.hash;
var moduleName = this.getModuleFromRoute(currentRoute);
var store = Ext.getStore(moduleName + '-Timeset');
if (store.getCount() === 0 ) {
Ext.each(models, function (model) {
if (moduleName == 'afterHours' && model.get('timeset_name') == 'After Hours') {
store.add(model);
} else if (moduleName == 'companyHours' && model.get('timeset_name') == 'Company Hours') {
store.add(model);
};
});
store.commitChanges();
if (store.getCount() > 0 ) {
vm.set(moduleName + '_hideMessage', true);
};
};
},
populateSourcesetStores: function (models) {
var storeListAAlways = Ext.getStore('CallForwardListA');
var storeListBAlways = Ext.getStore('CallForwardListB');
storeListAAlways.removeAll();
storeListBAlways.removeAll();
Ext.each(models, function (model) {
if (model.get('sourceset_name') == 'List A') {
storeListAAlways.add(model);
} else if (model.get('sourceset_name') == 'List B') {
storeListBAlways.add(model);
};
});
storeListAAlways.commitChanges();
storeListBAlways.commitChanges();
},
populateDestinationStores: function (models) {
var me = this;
var gridName = this.getGridCategoryFromType(models[0].get('type'));
var store;
Ext.each(models, function (model) {
var sourcename = me.getSourceNameFromSourceSet(model.get('sourceset'));
var timename = me.getTimeNameFromTimeSet(model.get('timeset'));
var type = me.getGridCategoryFromType(model.get('type'));
var storeName = sourcename + timename + type;
store = Ext.getStore(storeName);
if (store) {
store.add(model);
}
});
if (store) {
store.commitChanges();
}
},
cfdestinationsetsClick: function () {
console.log('cfdestinationsetsClick');
},
cfsourcesetsClick: function () {
console.log('cfsourcesetsClick');
},
cftimesetsClick: function () {
console.log('cftimesetsClick');
},
editingPhoneDone: function(editor, context) {
@ -149,7 +451,9 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
confirmCFRemoval: function(record) {
var store = record.store;
if(store){
store.remove(record);
}
},
getStoresArrayFromRoute: function(currentRoute, currentSourceset) {
@ -175,27 +479,6 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
vm.set('list_a', true);
vm.set('list_b', false);
};
Ext.Ajax.request({
url: Ext.manifest.resources.path + '/data/callForwardCombinations.json',
success: function(response, opts) {
var obj = Ext.decode(response.responseText);
var combinationStore = obj.data[0];
storesArray.map(function(storeName) {
var store = Ext.getStore(storeName);
var strippedStoreName = storeName.split('-')[2];
// Workaround since tabpanel being in initComponent causes this function to run before we have a route set.
// This short-circuits into evaluating the right hand side only if we have a store that is not undefined
!!store && store.removeAll();
for (node in combinationStore) {
if (me.checkIndexOf(strippedStoreName, node) && me.checkIndexOf(currentTimeset, node) && me.checkIndexOf(currentSourceset, node)) {
var records = combinationStore[node];
store.add(records);
};
};
});
},
failure: function(response, opts) {}
});
},
renderDay: function(value, meta, record) {
@ -224,7 +507,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
this.fireEvent('showconfirmbox', title, question, sucessMsg, 'confirmCFRemoval', rec);
},
renderPhoneColumn: function(value, metaData, record) {
renderDestinationColumn: function(value, metaData, record) {
if (record.get('ring_for') === '' && !Ext.isNumber(parseInt(value))) {
return Ext.String.format('{0}', value);
} else if (Ext.isNumber(parseInt(value))) {
@ -284,12 +567,18 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
switch (storeNameStripped) {
case 'CallForwardOnline':
vm.set('online_add_new_then_hidden', true);
vm.set('online_cancel_button_hidden', true);
vm.set('online_add_button_hidden', false);
break;
case 'CallForwardBusy':
vm.set('busy_add_new_then_hidden', true);
vm.set('busy_cancel_button_hidden', true);
vm.set('busy_add_button_hidden', false);
break;
case 'CallForwardOffline':
vm.set('offline_add_new_then_hidden', true);
vm.set('offline_cancel_button_hidden', true);
vm.set('offline_add_button_hidden', false);
break;
};
},
@ -342,6 +631,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
addNewDestination: function(element) {
var me = this;
var vm = this.getViewModel();
var targetId = element.id;
var splitTargetId = targetId.split('-');
var selectedSourceset = splitTargetId[0];

@ -16,69 +16,40 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
ui: 'cf-mainform',
initComponent: function() {
var storeListA = Ext.getStore('CallForwardListA') || Ext.create('NgcpCsc.store.CallForwardSourceset', {
storeId: 'CallForwardListA'
});
var storeListB = Ext.getStore('CallForwardListB') || Ext.create('NgcpCsc.store.CallForwardSourceset', {
storeId: 'CallForwardListB'
});
if(!storeListA.isLoaded()){
storeListA.load();
}
var callForwardListAGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardSourcesetGrid', {
id: this._firstprefix + this._secondprefix + 'cf-sourceset-list-a-grid',
store: Ext.create('NgcpCsc.store.CallForwardSourceset', {
proxy: {
type: 'ajax',
url: Ext.manifest.resources.path + '/data/callForwardSourcesetListA.json',
reader: {
type: 'json',
rootProperty: 'data'
}
}
})
store: storeListA
});
var callForwardListBGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardSourcesetGrid', {
id: this._firstprefix + this._secondprefix + 'cf-sourceset-list-b-grid',
store: Ext.create('NgcpCsc.store.CallForwardSourceset', {
proxy: {
type: 'ajax',
url: Ext.manifest.resources.path + '/data/callForwardSourcesetListB.json',
reader: {
type: 'json',
rootProperty: 'data'
}
}
})
store: storeListB
});
var busyGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainGrid', {
store: Ext.create('NgcpCsc.store.CallForward', {
storeId: this._firstprefix + this._secondprefix + 'CallForwardBusy',
proxy: {
type: 'ajax',
url: Ext.manifest.resources.path + '/data/callForwardBusy.json',
reader: {
type: 'json',
rootProperty: 'data'
}
}
storeId: this._firstprefix + this._secondprefix + 'CallForwardBusy'
})
});
var onlineGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainGrid', {
store: Ext.create('NgcpCsc.store.CallForward', {
storeId: this._firstprefix + this._secondprefix + 'CallForwardOnline',
proxy: {
type: 'ajax',
url: Ext.manifest.resources.path + '/data/callForwardOnline.json',
reader: {
type: 'json',
rootProperty: 'data'
}
}
storeId: this._firstprefix + this._secondprefix + 'CallForwardOnline'
})
});
var offlineGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainGrid', {
store: Ext.create('NgcpCsc.store.CallForward', {
storeId: this._firstprefix + this._secondprefix + 'CallForwardOffline',
proxy: {
type: 'ajax',
url: Ext.manifest.resources.path + '/data/callForwardOffline.json',
reader: {
type: 'json',
rootProperty: 'data'
}
}
storeId: this._firstprefix + this._secondprefix + 'CallForwardOffline'
})
});
@ -233,7 +204,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
value: '10',
id: this._firstprefix + this._secondprefix + 'onlineFirstTimeout',
allowBlank: false,
editable: false,
editable: true,
flex: 4,
margin: '0 0 0 10',
bind: {
@ -355,58 +326,13 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
xtype: 'container',
userCls: 'cf-text cf-subheader',
html: Ngcp.csc.locales.callforward.when_phone_busy[localStorage.getItem('languageSelected')]
}, {
xtype: 'panel',
layout: 'hbox',
id: this._firstprefix + this._secondprefix + 'busyFirstRingFields',
padding: '0 11 0 0',
margin: '0 0 0 50',
width: 500,
items: [{
xtype: 'combo',
store: 'FirstRingActions',
valueField: 'name',
displayField: 'name',
id: this._firstprefix + this._secondprefix + 'busyFirstDest',
fieldLabel: Ngcp.csc.locales.callforward.first_ring[localStorage.getItem('languageSelected')],
value: 'None',
allowBlank: false,
editable: false,
listeners: {
change: 'selectRing'
},
flex: 5
}, {
xtype: 'numberfield',
step: 10,
minValue:0,
maxValue: 300,
value: '10',
id: this._firstprefix + this._secondprefix + 'busyFirstTimeout',
allowBlank: false,
editable: false,
flex: 4,
margin: '0 0 0 10',
bind: {
hidden: '{busy_first_timeout_hidden}'
},
fieldLabel: Ngcp.csc.locales.callforward.and_ring_for[localStorage.getItem('languageSelected')]
}, {
xtype: 'container',
html: Ngcp.csc.locales.callforward.secs[localStorage.getItem('languageSelected')],
padding: '7 0 0 20',
flex: 1,
bind: {
hidden: '{busy_first_timeout_hidden}'
}
}]
}, {
xtype: 'container',
layout: 'hbox',
margin: '10 0 0 50',
items: [{
xtype: 'container',
html: Ngcp.csc.locales.callforward.then_forward_to[localStorage.getItem('languageSelected')],
html: Ngcp.csc.locales.callforward.forward_to[localStorage.getItem('languageSelected')],
userCls: 'cf-thentext'
},
busyGrid
@ -506,58 +432,13 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
xtype: 'container',
userCls: 'cf-text cf-subheader',
html: Ngcp.csc.locales.callforward.when_phone_offline[localStorage.getItem('languageSelected')]
}, {
xtype: 'panel',
layout: 'hbox',
id: this._firstprefix + this._secondprefix + 'offlineFirstRingFields',
padding: '0 11 0 0',
margin: '0 0 0 50',
width: 500,
items: [{
xtype: 'combo',
store: 'FirstRingActions',
valueField: 'name',
displayField: 'name',
id: this._firstprefix + this._secondprefix + 'offlineFirstDest',
fieldLabel: Ngcp.csc.locales.callforward.first_ring[localStorage.getItem('languageSelected')],
value: 'None',
allowBlank: false,
editable: false,
listeners: {
change: 'selectRing'
},
flex: 5
}, {
xtype: 'numberfield',
step: 10,
minValue:0,
maxValue: 300,
value: '10',
id: this._firstprefix + this._secondprefix + 'offlineFirstTimeout',
allowBlank: false,
editable: false,
flex: 4,
margin: '0 0 0 10',
bind: {
hidden: '{offline_first_timeout_hidden}'
},
fieldLabel: Ngcp.csc.locales.callforward.and_ring_for[localStorage.getItem('languageSelected')]
}, {
xtype: 'container',
html: Ngcp.csc.locales.callforward.secs[localStorage.getItem('languageSelected')],
padding: '7 0 0 20',
flex: 1,
bind: {
hidden: '{offline_first_timeout_hidden}'
}
}]
}, {
xtype: 'container',
layout: 'hbox',
margin: '10 0 0 50',
items: [{
xtype: 'container',
html: Ngcp.csc.locales.callforward.then_forward_to[localStorage.getItem('languageSelected')],
html: Ngcp.csc.locales.callforward.forward_to[localStorage.getItem('languageSelected')],
userCls: 'cf-thentext'
},
offlineGrid

@ -15,9 +15,26 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardMainGrid', {
},
markDirty: false,
emptyText: Ngcp.csc.locales.callforward.nowhere[localStorage.getItem('languageSelected')],
deferEmptyText: false,
stripeRows: false
},
// TODO: Leaving this for PUT/PATCH task, as it might make sense to use
// with unmask triggered in controller
// listeners: {
// render: function(grid) {
// grid.body.mask('Loading...');
// var store = grid.getStore();
// Ext.defer(function() {
// store.load;
// }, 100);
// Ext.defer(function() {
// grid.body.unmask();
// }, 600);
// },
// delay: 200
// },
plugins: {
ptype: 'cellediting',
clicksToEdit: 1
@ -27,9 +44,9 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardMainGrid', {
var me = this;
me.columns = [{
dataIndex: 'phone', // Renderer also uses ring_for value
dataIndex: 'destination_cleaned', // Renderer also uses ring_for value
width: 285,
renderer: 'renderPhoneColumn'
renderer: 'renderDestinationColumn'
}, {
text: Ngcp.csc.locales.common.delete[localStorage.getItem('languageSelected')],
xtype: 'actioncolumn',

@ -36,7 +36,9 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardModel', {
source_lista_title: 'List A',
source_listb_title: 'List B',
hide_lista_titleField: true,
hide_listb_titleField: true
hide_listb_titleField: true,
afterHours_hideMessage: false,
companyHours_hideMessage: false
},
formulas: {

@ -33,7 +33,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardSourcesetGrid', {
},
items: [{
text: Ngcp.csc.locales.callforward.phone[localStorage.getItem('languageSelected')],
dataIndex: 'phone',
dataIndex: 'source',
editor: 'textfield',
flex: 1
}, {

@ -6,17 +6,21 @@ Ext.define('NgcpCsc.view.pages.callforward.afterhours.Afterhours', {
ui: 'cf-mainform',
initComponent: function() {
var cfInitialStore = Ext.create('NgcpCsc.store.CallForward', {
storeId: 'CallForwardAfterHours',
_type: 'afterHours',
autoLoad: true,
listeners: {
load: function(store, recs) {
this.fireEvent('cfStoreLoaded', this, recs[0]);
}
}
});
var callForwardAfterGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardTimesetGrid', {
id: 'cf-timeset-after-grid',
store: Ext.create('NgcpCsc.store.CallForwardTimeset', {
proxy: {
type: 'ajax',
url: Ext.manifest.resources.path + '/data/callForwardTimesetAfter.json',
reader: {
type: 'json',
rootProperty: 'data'
}
}
storeId: 'afterHours-Timeset'
})
});
@ -40,24 +44,27 @@ Ext.define('NgcpCsc.view.pages.callforward.afterhours.Afterhours', {
expand: 'collapsePanel'
},
userCls: 'big-33 small-100 cf-calls-during-section',
items: [
callForwardAfterGrid,
{
items: [{
xtype: 'panel',
margin: '10 0 10 0',
html: 'You have not set your after hours calendar yet.', // TODO: Locales or icon, or both. Will wait for feedback from Andreas in next sync-up
bind: {
hidden: '{afterHours_hideMessage}'
}
},
callForwardAfterGrid, {
text: Ngcp.csc.locales.common.save_caps[localStorage.getItem('languageSelected')],
xtype: 'button',
cls: 'x-btn-left',
id: 'afterHours-saveButton',
width: 135,
margin: '10 0 0 623',
margin: '10 0 10 623',
listeners: {
click: 'saveGrid'
}
}
]
}]
}, {
xtype: 'statusbar',
reference: 'loadingBar'
}, {
xtype: 'panel',
width: '100%',

@ -8,14 +8,21 @@ Ext.define('NgcpCsc.view.pages.callforward.always.Always', {
viewModel: 'callforward',
initComponent: function() {
var cfInitialStore = Ext.create('NgcpCsc.store.CallForward',{
storeId: 'CallForwardAlways',
_type: 'always',
autoLoad: true,
listeners: {
load: function(store, recs) {
this.fireEvent('cfStoreLoaded', this, recs[0]);
}
}
});
this.items = [{
userCls: Ext.os.is.Desktop ? 'big-820' : 'small-100',
xtype: 'core-container',
items: [{
xtype: 'statusbar',
reference: 'loadingBar'
}, {
xtype: 'panel',
width: '100%',
title: Ngcp.csc.locales.callforward.for_calling_parties[localStorage.getItem('languageSelected')]

@ -6,17 +6,24 @@ Ext.define('NgcpCsc.view.pages.callforward.companyhours.Companyhours', {
ui: 'cf-mainform',
initComponent: function() {
var cfInitialStore = Ext.create('NgcpCsc.store.CallForward',{
storeId: 'CallForwardCompanyHours',
_type: 'companyHours',
autoLoad: true,
listeners: {
beforeload: function(store) {
store._preventReLoad = false;
},
load: function(store, recs) {
this.fireEvent('cfStoreLoaded', this, recs[0]);
}
}
});
var callForwardCompanyGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardTimesetGrid', {
id: 'cf-timeset-company-grid',
store: Ext.create('NgcpCsc.store.CallForwardTimeset', {
proxy: {
type: 'ajax',
url: Ext.manifest.resources.path + '/data/callForwardTimesetCompany.json',
reader: {
type: 'json',
rootProperty: 'data'
}
}
storeId: 'companyHours-Timeset'
})
});
@ -40,7 +47,14 @@ Ext.define('NgcpCsc.view.pages.callforward.companyhours.Companyhours', {
expand: 'collapsePanel'
},
userCls: 'big-33 small-100 cf-calls-during-section',
items: [
items: [{
xtype: 'panel',
margin: '10 0 10 0',
html: 'You have not set your company hours calendar yet.', // TODO: Locales or icon, or both. Will wait for feedback from Andreas in next sync-up
bind: {
hidden: '{companyHours_hideMessage}'
}
},
callForwardCompanyGrid,
{
text: Ngcp.csc.locales.common.save_caps[localStorage.getItem('languageSelected')],
@ -48,16 +62,13 @@ Ext.define('NgcpCsc.view.pages.callforward.companyhours.Companyhours', {
cls: 'x-btn-left',
id: 'companyHours-saveButton',
width: 135,
margin: '10 0 0 585',
margin: '10 0 10 585',
listeners: {
click: 'saveGrid'
}
}
]
}]
}, {
xtype: 'statusbar',
reference: 'loadingBar'
}, {
xtype: 'panel',
width: '100%',

@ -101,7 +101,7 @@ Ext.define('NgcpCsc.view.pages.pbxconfig.PbxConfigController', {
plugin.toggleRow(store.indexOf(record), record);
Ext.defer(function() {
view.grid.updateLayout();
view.fireEvent('cardContainerResized', me.getView())
view.fireEvent('cardContainerResized', me.getView());
}, 1);
if (currentRoute == '#pbxconfig/devices') {
var grid = this.lookupReference('devicesGrid');

@ -1,229 +0,0 @@
{
"data": [{
"CallForwardBusy_always_everybody": [{
"phone": "43144159",
"ring_for": "60"
}, {
"phone": "43236655",
"ring_for": "50"
}, {
"phone": "Voicemail",
"ring_for": ""
}],
"CallForwardBusy_always_listA": [{
"phone": "43429008",
"ring_for": "60"
}, {
"phone": "43043042",
"ring_for": "60"
}],
"CallForwardBusy_always_listB": [{
"phone": "43235388",
"ring_for": "60"
}, {
"phone": "43828384",
"ring_for": "50"
}, {
"phone": "43294320",
"ring_for": "60"
}, {
"phone": "Voicemail",
"ring_for": ""
}],
"CallForwardBusy_afterHours_everybody": [{
"phone": "43058597",
"ring_for": "40"
}, {
"phone": "43069072",
"ring_for": "50"
}, {
"phone": "Voicemail",
"ring_for": ""
}],
"CallForwardBusy_afterHours_listA": [{
"phone": "43671959",
"ring_for": "60"
}, {
"phone": "Voicemail",
"ring_for": ""
}],
"CallForwardBusy_afterHours_listB": [{
"phone": "43963808",
"ring_for": "60"
}, {
"phone": "43292626",
"ring_for": "60"
}, {
"phone": "Voicemail",
"ring_for": ""
}],
"CallForwardBusy_companyHours_everybody": [{
"phone": "43506322",
"ring_for": "60"
}, {
"phone": "43438084",
"ring_for": "60"
}, {
"phone": "43503407",
"ring_for": "60"
}, {
"phone": "Voicemail",
"ring_for": ""
}],
"CallForwardBusy_companyHours_listA": [{
"phone": "Voicemail",
"ring_for": ""
}],
"CallForwardBusy_companyHours_listB": [{
"phone": "43115899",
"ring_for": "50"
}, {
"phone": "43163841",
"ring_for": "30"
}, {
"phone": "43453636",
"ring_for": "60"
}, {
"phone": "43623866",
"ring_for": "60"
}],
"CallForwardOnline_always_everybody": [{
"phone": "43792601",
"ring_for": "60"
}, {
"phone": "Voicemail",
"ring_for": ""
}],
"CallForwardOnline_always_listA": [{
"phone": "43346472",
"ring_for": "60"
}, {
"phone": "43191649",
"ring_for": "50"
}],
"CallForwardOnline_always_listB": [{
"phone": "43234068",
"ring_for": "50"
}, {
"phone": "43702431",
"ring_for": "60"
}, {
"phone": "43502814",
"ring_for": "60"
}],
"CallForwardOnline_afterHours_everybody": [{
"phone": "43814887",
"ring_for": "40"
}],
"CallForwardOnline_afterHours_listA": [{
"phone": "43658124",
"ring_for": "40"
}, {
"phone": "43478930",
"ring_for": "20"
}],
"CallForwardOnline_afterHours_listB": [{
"phone": "43805856",
"ring_for": "60"
}, {
"phone": "43321147",
"ring_for": "60"
}, {
"phone": "Voicemail",
"ring_for": ""
}],
"CallForwardOnline_companyHours_everybody": [{
"phone": "Voicemail",
"ring_for": ""
}],
"CallForwardOnline_companyHours_listA": [{
"phone": "43401291",
"ring_for": ""
}, {
"phone": "43393673",
"ring_for": "40"
}, {
"phone": "43228450",
"ring_for": "60"
}, {
"phone": "Voicemail",
"ring_for": ""
}],
"CallForwardOnline_companyHours_listB": [{
"phone": "43544823",
"ring_for": "60"
}, {
"phone": "43380981",
"ring_for": "60"
}],
"CallForwardOffline_always_everybody": [{
"phone": "43131586",
"ring_for": "50"
}],
"CallForwardOffline_always_listA": [{
"phone": "43189843",
"ring_for": "10"
}, {
"phone": "43434117",
"ring_for": "60"
}, {
"phone": "43304032",
"ring_for": "60"
}],
"CallForwardOffline_always_listB": [{
"phone": "43861777",
"ring_for": "40"
}, {
"phone": "43626176",
"ring_for": "50"
}],
"CallForwardOffline_afterHours_everybody": [{
"phone": "43249513",
"ring_for": "40"
}],
"CallForwardOffline_afterHours_listA": [{
"phone": "43828647",
"ring_for": "60"
}],
"CallForwardOffline_afterHours_listB": [{
"phone": "43848070",
"ring_for": "60"
}, {
"phone": "43870457",
"ring_for": "40"
}, {
"phone": "43956620",
"ring_for": "60"
}, {
"phone": "Voicemail",
"ring_for": ""
}],
"CallForwardOffline_companyHours_everybody": [{
"phone": "43109414",
"ring_for": "60"
}, {
"phone": "43643249",
"ring_for": "50"
}],
"CallForwardOffline_companyHours_listA": [{
"phone": "43773031",
"ring_for": "60"
}, {
"phone": "43845534",
"ring_for": "60"
}, {
"phone": "Voicemail",
"ring_for": ""
}],
"CallForwardOffline_companyHours_listB": [{
"phone": "43878682",
"ring_for": "40"
}, {
"phone": "43358997",
"ring_for": "60"
}, {
"phone": "Voicemail",
"ring_for": ""
}]
}]
}

@ -1,6 +0,0 @@
{
"data": [{
"phone": "43131586",
"ring_for": "50"
}]
}

@ -1,9 +0,0 @@
{
"data": [{
"phone": "43792601",
"ring_for": "60"
}, {
"phone": "Voicemail",
"ring_for": ""
}]
}

@ -1,21 +0,0 @@
{
"data": [{
"phone": "43775600",
"edit": false
}, {
"phone": "John Smith",
"edit": false
}, {
"phone": "43770061",
"edit": false
}, {
"phone": "43806402",
"edit": false
}, {
"phone": "Bob Jones",
"edit": false
}, {
"phone": "43806402",
"edit": false
}]
}

@ -1,18 +0,0 @@
{
"data": [{
"phone": "King Cole",
"edit": false
}, {
"phone": "11656143",
"edit": false
}, {
"phone": "Carla James",
"edit": false
}, {
"phone": "43806401",
"edit": false
}, {
"phone": "11656142",
"edit": false
}]
}

@ -1,38 +0,0 @@
{
"data": [{
"day": "Monday",
"time_from": "6:00 PM",
"time_to": "9:00 AM",
"closed": false
}, {
"day": "Tuesday",
"time_from": "6:00 PM",
"time_to": "9:00 AM",
"closed": false
}, {
"day": "Wednesday",
"time_from": "6:00 PM",
"time_to": "9:00 AM",
"closed": false
}, {
"day": "Thursday",
"time_from": "6:00 PM",
"time_to": "9:00 AM",
"closed": false
}, {
"day": "Friday",
"time_from": "6:00 PM",
"time_to": "9:00 AM",
"closed": false
}, {
"day": "Saturday",
"time_from": "6:00 PM",
"time_to": "9:00 AM",
"closed": true
}, {
"day": "Sunday",
"time_from": "6:00 PM",
"time_to": "9:00 AM",
"closed": true
}]
}

@ -1,38 +0,0 @@
{
"data": [{
"day": "Monday",
"time_from": "9:00 AM",
"time_to": "6:00 PM",
"closed": false
}, {
"day": "Tuesday",
"time_from": "9:00 AM",
"time_to": "6:00 PM",
"closed": false
}, {
"day": "Wednesday",
"time_from": "9:00 AM",
"time_to": "6:00 PM",
"closed": false
}, {
"day": "Thursday",
"time_from": "9:00 AM",
"time_to": "6:00 PM",
"closed": false
}, {
"day": "Friday",
"time_from": "9:00 AM",
"time_to": "6:00 PM",
"closed": false
}, {
"day": "Saturday",
"time_from": "9:00 AM",
"time_to": "6:00 PM",
"closed": true
}, {
"day": "Sunday",
"time_from": "9:00 AM",
"time_to": "6:00 PM",
"closed": true
}]
}
Loading…
Cancel
Save