Browse Source

AMBARI-8759. Basic Alerts Notification isn't available on the installer (stack 1.3) (onechiporenko)

Oleg Nechiporenko 10 years ago
parent
commit
18e831deab

+ 2 - 2
ambari-web/app/controllers/wizard/step7_controller.js

@@ -721,8 +721,8 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
         serviceConfigs.findProperty('serviceName', 'HDFS').configs = c;
       }
 
-      // Remove Notifications from MISC if it isn't Installer Controller or stack is < 2.0
-      if (this.get('wizardController.name') !== 'installerController' || !App.get('isHadoop2Stack')) {
+      // Remove Notifications from MISC if it isn't Installer Controller
+      if (this.get('wizardController.name') !== 'installerController') {
         var miscService = serviceConfigs.findProperty('serviceName', 'MISC');
         if (miscService) {
           c = miscService.configs;

+ 1 - 1
ambari-web/app/controllers/wizard/step8_controller.js

@@ -1824,7 +1824,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
    * @method createNotification
    */
   createNotification: function () {
-    if (this.get('content.controllerName') !== 'installerController' || !App.get('isHadoop2Stack')) return;
+    if (this.get('content.controllerName') !== 'installerController') return;
     var miscConfigs = this.get('configs').filterProperty('serviceName', 'MISC'),
       createNotification = miscConfigs.findProperty('name', 'create_notification').value;
     if (createNotification === 'yes') {

+ 126 - 0
ambari-web/app/data/site_properties.js

@@ -2378,6 +2378,132 @@ module.exports =
       "serviceName": "MISC",
       "filename": "cluster-env.xml",
       "category": "Users and Groups"
+    },
+    {
+      "id": "puppet var",
+      "name": "create_notification",
+      "displayName": "Create Notification",
+      "isRequired": true,
+      "isReconfigurable": true,
+      "isOverridable": false,
+      "isVisible": false,
+      "serviceName": "MISC",
+      "category": "Notifications",
+      "defaultValue": "no"
+    },
+    {
+      "id": "puppet var",
+      "name": "mail.smtp.host",
+      "displayName": "SMTP Host",
+      "displayType": "host",
+      "isRequired": false,
+      "isReconfigurable": true,
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "MISC",
+      "category": "Notifications",
+      "rowStyleClass": "indent-1"
+    },
+    {
+      "id": "puppet var",
+      "name": "mail.smtp.port",
+      "displayName": "SMTP Port",
+      "displayType": "int",
+      "isRequired": false,
+      "isReconfigurable": true,
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "MISC",
+      "category": "Notifications",
+      "rowStyleClass": "indent-1"
+    },
+    {
+      "id": "puppet var",
+      "name": "mail.smtp.from",
+      "displayName": "FROM Email Address",
+      "displayType": "email",
+      "isRequired": false,
+      "isReconfigurable": true,
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "MISC",
+      "category": "Notifications",
+      "rowStyleClass": "indent-1"
+    },
+    {
+      "id": "puppet var",
+      "name": "ambari.dispatch.recipients",
+      "displayName": " TO Email Address",
+      "displayType": "email",
+      "isRequired": false,
+      "isReconfigurable": true,
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "MISC",
+      "category": "Notifications",
+      "rowStyleClass": "indent-1"
+    },
+    {
+      "id": "puppet var",
+      "name": "smtp_use_auth",
+      "displayName": "SMTP server requires authentication",
+      "displayType": "checkbox",
+      "isRequired": false,
+      "isReconfigurable": true,
+      "isOverridable": false,
+      "defaultValue": true,
+      "isVisible": true,
+      "serviceName": "MISC",
+      "category": "Notifications",
+      "rowStyleClass": "indent-1"
+    },
+    {
+      "id": "puppet var",
+      "name": "ambari.dispatch.credential.username",
+      "displayName": "SMTP Username",
+      "displayType": "string",
+      "isRequired": false,
+      "isReconfigurable": true,
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "MISC",
+      "category": "Notifications",
+      "rowStyleClass": "indent-2"
+    },
+    {
+      "id": "puppet var",
+      "name": "ambari.dispatch.credential.password",
+      "displayName": "SMTP Password",
+      "displayType": "string",
+      "isRequired": false,
+      "isReconfigurable": true,
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "MISC",
+      "category": "Notifications",
+      "rowStyleClass": "indent-2"
+    },
+    {
+      "id": "puppet var",
+      "name": "mail.smtp.starttls.enable",
+      "isRequired": false,
+      "isReconfigurable": true,
+      "isOverridable": false,
+      "isVisible": false,
+      "serviceName": "MISC",
+      "category": "Notifications",
+      "rowStyleClass": "indent-1"
+    },
+    {
+      "id": "puppet var",
+      "name": "mail.smtp.startssl.enable",
+      "isRequired": false,
+      "isReconfigurable": true,
+      "isOverridable": false,
+      "isVisible": false,
+      "serviceName": "MISC",
+      "category": "Notifications",
+      "rowStyleClass": "indent-1"
     }
   ]
 };

+ 0 - 3
ambari-web/app/views/common/configs/services_config.js

@@ -802,9 +802,6 @@ App.ServiceConfigContainerView = Em.ContainerView.extend({
       var categoriesToPush = [];
       this.get('controller.selectedService.configCategories').forEach(function (item) {
 
-        // stack 1.3 doesn't need customView
-        if (!App.get('isHadoop2Stack') && item.get('isCustomView')) return;
-
         var categoryView = item.get('isCustomView') ? item.get('customView') : App.ServiceConfigsByCategoryView;
         if (categoryView !== null) {
           categoriesToPush.pushObject(categoryView.extend({

+ 1 - 9
ambari-web/test/controllers/wizard/step8_test.js

@@ -1404,16 +1404,8 @@ describe('App.WizardStep8Controller', function () {
           {name: 'mail.smtp.from', value: 'from@f.c', serviceName: 'MISC'},
           {name: 'mail.smtp.starttls.enable', value: true, serviceName: 'MISC'},
           {name: 'mail.smtp.startssl.enable', value: false, serviceName: 'MISC'},
-          {name: 'smtp_use_auth', value: 'false', serviceName: 'MISC'},
+          {name: 'smtp_use_auth', value: 'false', serviceName: 'MISC'}
         ]);
-        sinon.stub(App, 'get', function (k) {
-          if ('isHadoop2Stack' === k) return true;
-          return Em.get(App, k);
-        });
-      });
-
-      afterEach(function () {
-        App.get.restore();
       });
 
       it('should add request to queue', function () {