|
@@ -53,6 +53,7 @@ App.alertGroupsMapper = App.QuickDataMapper.create({
|
|
|
|
|
|
var alertGroups = [],
|
|
var alertGroups = [],
|
|
self = this,
|
|
self = this,
|
|
|
|
+ groupsToDelete = App.AlertGroup.find().mapProperty('id'),
|
|
typesMap = this.get('typesMap'),
|
|
typesMap = this.get('typesMap'),
|
|
/**
|
|
/**
|
|
* AlertGroups-map for <code>App.AlertDefinitionsMappers</code>
|
|
* AlertGroups-map for <code>App.AlertDefinitionsMappers</code>
|
|
@@ -70,6 +71,7 @@ App.alertGroupsMapper = App.QuickDataMapper.create({
|
|
|
|
|
|
json.items.forEach(function(item) {
|
|
json.items.forEach(function(item) {
|
|
var group = self.parseIt(item, self.get('config'));
|
|
var group = self.parseIt(item, self.get('config'));
|
|
|
|
+ groupsToDelete = groupsToDelete.without(group.id);
|
|
Em.keys(typesMap).forEach(function(k) {
|
|
Em.keys(typesMap).forEach(function(k) {
|
|
group[typesMap[k]] = [];
|
|
group[typesMap[k]] = [];
|
|
});
|
|
});
|
|
@@ -88,6 +90,10 @@ App.alertGroupsMapper = App.QuickDataMapper.create({
|
|
alertGroups.push(group);
|
|
alertGroups.push(group);
|
|
}, this);
|
|
}, this);
|
|
|
|
|
|
|
|
+ groupsToDelete.forEach(function(groupId) {
|
|
|
|
+ self.deleteRecord(App.AlertGroup.find(groupId));
|
|
|
|
+ });
|
|
|
|
+
|
|
App.cache['previousAlertGroupsMap'] = alertDefinitionsGroupsMap;
|
|
App.cache['previousAlertGroupsMap'] = alertDefinitionsGroupsMap;
|
|
App.store.loadMany(this.get('model'), alertGroups);
|
|
App.store.loadMany(this.get('model'), alertGroups);
|
|
App.store.commit();
|
|
App.store.commit();
|