Browse Source

UI-2104: Add warning message when trying to save an empty group:

4.3
Jean-Roch Maitre 10 years ago
parent
commit
d5f89c4935
2 changed files with 15 additions and 5 deletions
  1. +5
    -1
      i18n/en-US.json
  2. +10
    -4
      submodules/groups/groups.js

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

@ -125,7 +125,11 @@
"headline": "Caller ID Prepend",
"cidNameLabel": "Caller ID Name prefix",
"cidNumberLabel": "Caller ID Number prefix"
}
},
"__comment": "UI-2104: Adding a warning when adding a group with no endpoints",
"__version": "3.22",
"emptyEndpointsWarning": "You need to select at least one member to create a group"
},
"devices": {


+ 10
- 4
submodules/groups/groups.js View File

@ -279,11 +279,17 @@ define(function(require){
groupTemplate.find('#create_group').on('click', function() {
if(monster.ui.valid(groupForm)) {
var formattedData = self.groupsCreationMergeData(data, groupTemplate);
self.groupsCreate(formattedData, function(data) {
popup.dialog('close').remove();
self.groupsRender({ groupId: data.id });
});
if(!_.isEmpty(formattedData.group.endpoints)) {
self.groupsCreate(formattedData, function(data) {
popup.dialog('close').remove();
self.groupsRender({ groupId: data.id });
});
}
else {
monster.ui.alert('warning', self.i18n.active().groups.emptyEndpointsWarning);
}
}
});


Loading…
Cancel
Save