TT#21845 Ngcp CSC - CallForward > Remove FullDay column and related functionality

from timeset grid

Change-Id: I6e276144b8cc4b5457e4a81a38685578741fb7c7
changes/13/15513/3
Carlo 8 years ago
parent 61130f1cea
commit 837856bccf

@ -14,8 +14,6 @@ Ext.define('NgcpCsc.model.CallForwardTimeset', {
name: 'time_to'
}, {
name: 'day'
}, {
name: 'closed'
}]
});

@ -903,13 +903,6 @@ Ext.define('Ngcp.csc.locales', {
fr: 'Move',
sp: 'Move'
},
full_day: {
en: 'Full Day',
it: 'Full Day',
de: 'Full Day',
fr: 'Full Day',
sp: 'Full Day'
},
after_hours: {
en: 'After hours',
it: 'After hours',
@ -938,13 +931,6 @@ Ext.define('Ngcp.csc.locales', {
fr: 'List B',
sp: 'List B'
},
closed: {
en: 'Closed',
it: 'Closed',
de: 'Closed',
fr: 'Closed',
sp: 'Closed'
},
add_new_source: {
en: 'ADD NEW SOURCE',
it: 'ADD NEW SOURCE',
@ -1079,13 +1065,6 @@ Ext.define('Ngcp.csc.locales', {
fr: 'Change time to',
sp: 'Change time to'
},
close_day: {
en: 'Close day',
it: 'Close day',
de: 'Close day',
fr: 'Close day',
sp: 'Close day'
},
save_phone_number: {
en: 'Save phone number',
it: 'Save phone number',

@ -54,8 +54,8 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
};
Ext.each(times, function(timeSlot) {
var days = timeSlot.wday.split('-');
var fromHour = parseInt(timeSlot.hour.split('-')[0]);
var toHour = parseInt(timeSlot.hour.split('-')[1]) || null;
var fromHour = timeSlot.hour ? parseInt(timeSlot.hour.split('-')[0]) : null;
var toHour = timeSlot.hour ? parseInt(timeSlot.hour.split('-')[1]) : null;
if (days.length > 1) {
var fromDay = parseInt(days[0]);
var toDay = parseInt(days[1]);
@ -68,8 +68,8 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
Ext.each(days, function(day) {
retData.push({
day: weekDaysMap[day],
dayArrIndex: day, // needed for sorting
timeFrom: fromHour.toString(),
dayArrIndex: parseInt(day), // needed for sorting
timeFrom: fromHour ? fromHour.toString() : null,
timeTo: toHour ? toHour.toString() : null
});
});
@ -78,7 +78,17 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
},
sortTimeSlots: function(timeSlot1, timeSlot2) {
return timeSlot1.dayArrIndex > timeSlot2.dayArrIndex;
switch(true){
case timeSlot1.dayArrIndex < timeSlot2.dayArrIndex:
return -1;
break;
case timeSlot1.dayArrIndex > timeSlot2.dayArrIndex:
return 1;
break;
default:
return 0;
}
},
cfTimesetStoreLoaded: function(store, data) {
@ -104,10 +114,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
timeset_id: timesetId,
time_from: time.timeFrom,
time_to: time.timeTo,
day: time.day,
closed: false // TODO: (For PUT/PATCH ticket) decide
// if we should keep this, or solve this
// differently, or not at all
day: time.day
});
arrayOfModels.push(cfModel);
});
@ -207,7 +214,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
return mapping.length !== 0;
},
buildArrayOfModels: function (cfMappings, cfType, routeTimeset, cfdestinationsets, cftRingTimeout, arrayOfModels, hasCftAndCfuMappings) {
buildArrayOfModels: function(cfMappings, cfType, routeTimeset, cfdestinationsets, cftRingTimeout, arrayOfModels, hasCftAndCfuMappings) {
var $cf = this;
Ext.each(cfMappings, function(mapping, j) {
var currentMapping = {};
@ -599,7 +606,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
var currentRoute = window.location.hash;
var moduleName = this.getModuleFromRoute(currentRoute);
var store = Ext.getStore(moduleName + '-Timeset');
if (store.getCount() === 0) {
if (store && store.getCount() === 0) {
Ext.each(models, function(model) {
if (moduleName == 'afterhours' && model.get('timeset_name') == 'After Hours') {
store.add(model);
@ -1067,23 +1074,6 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
return [prefix + 'CallForwardOnline', prefix + 'CallForwardBusy', prefix + 'CallForwardOffline'];
},
renderDay: function(value, meta, record) {
if (record.get('closed') === true) {
return Ext.String.format('<div class="cf-deactivate-day">{0}</div>', value);
} else {
return value;
}
},
toggleClosedState: function(grid, rowIndex, colIndex, item, event, record) {
record.set('closed', !record.get('closed'));
this.renderDay(record.get('closed'), null, record);
},
toggleClosedClass: function(val, meta, rec) {
return rec.get('closed') === true ? Ngcp.csc.icons.square_checked : Ngcp.csc.icons.square;
},
removeSourcelistRecord: function(grid, rowIndex) {
var store = grid.getStore();
var rec = grid.getStore().getAt(rowIndex);

@ -16,7 +16,6 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardTimesetGrid', {
items: [{
text: Ngcp.csc.locales.common.day[localStorage.getItem('languageSelected')],
dataIndex: 'day',
renderer: 'renderDay',
flex: 1
}, {
text: Ngcp.csc.locales.common.from[localStorage.getItem('languageSelected')],
@ -28,7 +27,6 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardTimesetGrid', {
xtype: 'timefield',
tooltip: Ngcp.csc.locales.callforward.tooltips.change_time_from[localStorage.getItem('languageSelected')],
bind: {
disabled: '{record.closed}',
value: '{record.time_from}'
}
}
@ -42,21 +40,9 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardTimesetGrid', {
xtype: 'timefield',
tooltip: Ngcp.csc.locales.callforward.tooltips.change_time_to[localStorage.getItem('languageSelected')],
bind: {
disabled: '{record.closed}',
value: '{record.time_to}'
}
}
}, {
text: Ngcp.csc.locales.callforward.full_day[localStorage.getItem('languageSelected')],
dataIndex: 'closed',
xtype: 'actioncolumn',
align: 'center',
width: 80,
items: [{
tooltip: Ngcp.csc.locales.callforward.tooltips.close_day[localStorage.getItem('languageSelected')],
getClass: 'toggleClosedClass',
handler: 'toggleClosedState'
}]
}]
};
this.callParent();

Loading…
Cancel
Save