|
@@ -499,12 +499,8 @@ App.MainAlertDefinitionConfigsController = Em.Controller.extend({
|
|
|
return c.get('name') !== 'parameter';
|
|
|
});
|
|
|
configs.forEach(function (property) {
|
|
|
- var apiProperties = property.get('apiProperty');
|
|
|
- var apiFormattedValues = property.get('apiFormattedValue');
|
|
|
- if (!Em.isArray(property.get('apiProperty'))) {
|
|
|
- apiProperties = [property.get('apiProperty')];
|
|
|
- apiFormattedValues = [property.get('apiFormattedValue')];
|
|
|
- }
|
|
|
+ var apiProperties = Em.makeArray(property.get('apiProperty'));
|
|
|
+ var apiFormattedValues = Em.makeArray(property.get('apiFormattedValue'));
|
|
|
apiProperties.forEach(function (apiProperty, i) {
|
|
|
if (apiProperty.contains('source.')) {
|
|
|
if (!propertiesToUpdate['AlertDefinition/source']) {
|
|
@@ -531,7 +527,6 @@ App.MainAlertDefinitionConfigsController = Em.Controller.extend({
|
|
|
}
|
|
|
Ember.setFullPath(propertiesToUpdate['AlertDefinition/source'], apiProperty.replace('source.', ''), apiFormattedValues[i]);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
else {
|
|
|
if (apiProperty) {
|
|
@@ -541,6 +536,10 @@ App.MainAlertDefinitionConfigsController = Em.Controller.extend({
|
|
|
}, this);
|
|
|
}, this);
|
|
|
|
|
|
+ if (Em.get(propertiesToUpdate, 'AlertDefinition/source.uri.id')) {
|
|
|
+ delete propertiesToUpdate['AlertDefinition/source'].uri.id;
|
|
|
+ }
|
|
|
+
|
|
|
// `source.parameters` is an array and should be updated separately from other configs
|
|
|
if (this.get('content.parameters.length')) {
|
|
|
propertiesToUpdate['AlertDefinition/source/parameters'] = this.get('content.rawSourceData.parameters');
|