Browse Source

UI-819: Showing an error popup when group data is outdated

4.3
Maxime Roux 11 years ago
parent
commit
c4a5d99a1a
3 changed files with 38 additions and 26 deletions
  1. +3
    -1
      i18n/en-US.json
  2. +3
    -1
      i18n/fr-FR.json
  3. +32
    -24
      submodules/groups/groups.js

+ 3
- 1
i18n/en-US.json View File

@ -88,7 +88,9 @@
"mainMenu": "Main Menu (Open hours)",
"voicemails": "Voicemail Boxes",
"users": "Users"
}
},
"__comment": "UI-819, v3.19_s1: Showing an error popup when group data is outdated.",
"outdatedGroupsError": "Your User Groups data is outdated and can not be rendered. Please contact your administrator to update your data."
},
"devices": {


+ 3
- 1
i18n/fr-FR.json View File

@ -88,7 +88,9 @@
"mainMenu": "Menu principal",
"voicemails": "Répondeurs",
"users": "Utilisateurs"
}
},
"__comment": "UI-819, v3.19_s1: Showing an error popup when group data is outdated.",
"outdatedGroupsError": "Les données de vos Groupes sont obsolètes et ne peuvent être affichées. Veuillez contacter votre administrateur afin de mettre à jour vos données."
},
"devices": {


+ 32
- 24
submodules/groups/groups.js View File

@ -26,38 +26,46 @@ define(function(require){
self.groupsRemoveOverlay();
self.groupsGetData(function(data) {
var dataTemplate = self.groupsFormatListData(data),
template = $(monster.template(self, 'groups-layout', { countGroups: Object.keys(dataTemplate.groups).length })),
templateGroup;
var hasOldData = _.find(data.callflows, function(callflow) {
return !callflow.hasOwnProperty('type');
});
_.each(dataTemplate.groups, function(group) {
templateGroup = monster.template(self, 'groups-row', group);
if(hasOldData) {
monster.ui.alert('error', self.i18n.active().groups.outdatedGroupsError);
} else {
var dataTemplate = self.groupsFormatListData(data),
template = $(monster.template(self, 'groups-layout', { countGroups: Object.keys(dataTemplate.groups).length })),
templateGroup;
template.find('.groups-rows').append(templateGroup);
});
_.each(dataTemplate.groups, function(group) {
templateGroup = monster.template(self, 'groups-row', group);
self.groupsBindEvents(template, parent);
template.find('.groups-rows').append(templateGroup);
});
parent
.empty()
.append(template);
self.groupsBindEvents(template, parent);
if(_groupId) {
var cells = parent.find('.grid-row[data-id=' + _groupId + '] .grid-cell');
parent
.empty()
.append(template);
monster.ui.fade(cells);
}
if(_groupId) {
var cells = parent.find('.grid-row[data-id=' + _groupId + '] .grid-cell');
for (var group in dataTemplate.groups) {
noGroup = ( typeof dataTemplate.groups[group] === 'undefined' ) ? true : false;
}
monster.ui.fade(cells);
}
if ( noGroup ) {
parent.find('.grid-row.title').css('display', 'none');
parent.find('.no-groups-row').css('display', 'block');
} else {
parent.find('.grid-row.title').css('display', 'block');
parent.find('.no-groups-row').css('display', 'none');
for (var group in dataTemplate.groups) {
noGroup = ( typeof dataTemplate.groups[group] === 'undefined' ) ? true : false;
}
if ( noGroup ) {
parent.find('.grid-row.title').css('display', 'none');
parent.find('.no-groups-row').css('display', 'block');
} else {
parent.find('.grid-row.title').css('display', 'block');
parent.find('.no-groups-row').css('display', 'none');
}
}
});
},


Loading…
Cancel
Save