Repository: ambari Updated Branches: refs/heads/branch-2.0.maint 8d695f495 -> 15d3f0d29
AMBARI-11026. Alerts: do not expose subject + body for SNMP traps (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/15d3f0d2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/15d3f0d2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/15d3f0d2 Branch: refs/heads/branch-2.0.maint Commit: 15d3f0d29889c6672dafb08829356fc0b7b12c6c Parents: 8d695f4 Author: Aleksandr Kovalenko <[email protected]> Authored: Sat May 9 02:11:44 2015 +0300 Committer: Aleksandr Kovalenko <[email protected]> Committed: Sat May 9 02:15:19 2015 +0300 ---------------------------------------------------------------------- .../manage_alert_notifications_controller.js | 16 ++------------ ambari-web/app/messages.js | 4 +--- .../main/alerts/create_alert_notification.hbs | 14 ------------- ...anage_alert_notifications_controller_test.js | 22 -------------------- 4 files changed, 3 insertions(+), 53 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/15d3f0d2/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js index d415036..6d0fad2 100644 --- a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js +++ b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js @@ -126,16 +126,6 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ value: '', defaultValue: '' }, - OIDSubject: { - label: Em.I18n.t('alerts.actions.manage_alert_notifications_popup.OIDSubject'), - value: '', - defaultValue: '' - }, - OIDBody: { - label: Em.I18n.t('alerts.actions.manage_alert_notifications_popup.OIDBody'), - value: '', - defaultValue: '' - }, community: { label: Em.I18n.t('alerts.actions.manage_alert_notifications_popup.community'), value: '', @@ -315,8 +305,6 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ inputFields.set('emailFrom.value', selectedAlertNotification.get('properties')['mail.smtp.from']); inputFields.set('version.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.version']); inputFields.set('OIDs.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.oids.trap']); - inputFields.set('OIDSubject.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.oids.subject']); - inputFields.set('OIDBody.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.oids.body']); inputFields.set('community.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.community']); inputFields.set('host.value', selectedAlertNotification.get('properties')['ambari.dispatch.recipients'] ? selectedAlertNotification.get('properties')['ambari.dispatch.recipients'].join(', ') : ''); @@ -616,8 +604,8 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ } else { properties['ambari.dispatch.snmp.version'] = inputFields.get('version.value'); properties['ambari.dispatch.snmp.oids.trap'] = inputFields.get('OIDs.value'); - properties['ambari.dispatch.snmp.oids.subject'] = inputFields.get('OIDSubject.value'); - properties['ambari.dispatch.snmp.oids.body'] = inputFields.get('OIDBody.value'); + properties['ambari.dispatch.snmp.oids.subject'] = inputFields.get('OIDs.value'); + properties['ambari.dispatch.snmp.oids.body'] = inputFields.get('OIDs.value'); properties['ambari.dispatch.snmp.community'] = inputFields.get('community.value'); properties['ambari.dispatch.recipients'] = inputFields.get('host.value').replace(/\s/g, '').split(','); properties['ambari.dispatch.snmp.port'] = inputFields.get('port.value'); http://git-wip-us.apache.org/repos/asf/ambari/blob/15d3f0d2/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 17015a4..dbecf08 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -1923,9 +1923,7 @@ Em.I18n.translations = { 'alerts.actions.manage_alert_notifications_popup.SMTPSTARTTLS':'Start TLS', 'alerts.actions.manage_alert_notifications_popup.emailFrom':'Email From', 'alerts.actions.manage_alert_notifications_popup.version':'Version', - 'alerts.actions.manage_alert_notifications_popup.OIDs':'OIDs', - 'alerts.actions.manage_alert_notifications_popup.OIDSubject':'OID Subject', - 'alerts.actions.manage_alert_notifications_popup.OIDBody':'OID Body', + 'alerts.actions.manage_alert_notifications_popup.OIDs':'OID', 'alerts.actions.manage_alert_notifications_popup.community':'Community', 'alerts.actions.manage_alert_notifications_popup.host':'Hosts', 'alerts.actions.manage_alert_notifications_popup.port':'Port', http://git-wip-us.apache.org/repos/asf/ambari/blob/15d3f0d2/ambari-web/app/templates/main/alerts/create_alert_notification.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/alerts/create_alert_notification.hbs b/ambari-web/app/templates/main/alerts/create_alert_notification.hbs index e38d216..647ba98 100644 --- a/ambari-web/app/templates/main/alerts/create_alert_notification.hbs +++ b/ambari-web/app/templates/main/alerts/create_alert_notification.hbs @@ -200,20 +200,6 @@ {{view Em.TextField valueBinding="controller.inputFields.OIDs.value" class="input-xlarge"}} </div> </div> - <div class="control-group"> - <label class="control-label">{{controller.inputFields.OIDSubject.label}}</label> - - <div class="controls"> - {{view Em.TextField valueBinding="controller.inputFields.OIDSubject.value" class="input-xlarge"}} - </div> - </div> - <div class="control-group"> - <label class="control-label">{{controller.inputFields.OIDBody.label}}</label> - - <div class="controls"> - {{view Em.TextField valueBinding="controller.inputFields.OIDBody.value" class="input-xlarge"}} - </div> - </div> <div class="control-group"> <label class="control-label">{{controller.inputFields.community.label}}</label> http://git-wip-us.apache.org/repos/asf/ambari/blob/15d3f0d2/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js b/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js index 4d3f68d..92fb0a7 100644 --- a/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js +++ b/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js @@ -249,12 +249,6 @@ describe('App.ManageAlertNotificationsController', function () { OIDs: { value: '' }, - OIDSubject: { - value: '' - }, - OIDBody: { - value: '' - }, community: { value: '' }, @@ -324,8 +318,6 @@ describe('App.ManageAlertNotificationsController', function () { }, version: {}, OIDs: {}, - OIDSubject: {}, - OIDBody: {}, community: {}, host: { value: '[email protected], [email protected]' @@ -355,8 +347,6 @@ describe('App.ManageAlertNotificationsController', function () { 'customName': 'customValue', 'ambari.dispatch.snmp.version': 'SNMPv1', 'ambari.dispatch.snmp.oids.trap': '1', - 'ambari.dispatch.snmp.oids.subject': 'OID Subject', - 'ambari.dispatch.snmp.oids.body': 'OID Body', 'ambari.dispatch.snmp.community': 'snmp', 'ambari.dispatch.snmp.port': 161 @@ -418,12 +408,6 @@ describe('App.ManageAlertNotificationsController', function () { OIDs: { value: '' }, - OIDSubject: { - value: '' - }, - OIDBody: { - value: '' - }, community: { value: '' }, @@ -485,12 +469,6 @@ describe('App.ManageAlertNotificationsController', function () { OIDs: { value: '1' }, - OIDSubject: { - value: 'OID Subject' - }, - OIDBody: { - value:'OID Body' - }, community: { value: 'snmp' },
