Pārlūkot izejas kodu

AMBARI-9346 Kerberos Wizard: UI cleanup #5. (ababiichuk)

aBabiichuk 10 gadi atpakaļ
vecāks
revīzija
e44e73ed8d

+ 16 - 0
ambari-web/app/controllers/main/admin/kerberos/step1_controller.js

@@ -39,6 +39,10 @@ App.KerberosWizardStep1Controller = Em.Controller.extend({
         Em.Object.create({
           displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc.condition.2'),
           checked: false
+        }),
+        Em.Object.create({
+          displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc.condition.3'),
+          checked: false
         })
       ]
     }),
@@ -53,6 +57,18 @@ App.KerberosWizardStep1Controller = Em.Controller.extend({
         Em.Object.create({
           displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.2'),
           checked: false
+        }),
+        Em.Object.create({
+          displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.3'),
+          checked: false
+        }),
+        Em.Object.create({
+          displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.4'),
+          checked: false
+        }),
+        Em.Object.create({
+          displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.5'),
+          checked: false
         })
       ]
     })

+ 5 - 3
ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js

@@ -278,11 +278,13 @@ App.KerberosWizardController = App.WizardController.extend({
   /**
    * shows popup with to warn user
    * @param primary
+   * @param isCritical
    */
-  warnBeforeExitPopup: function(primary) {
+  warnBeforeExitPopup: function(primary, isCritical) {
     var primaryText = Em.I18n.t('common.exitAnyway');
-    var msg = Em.I18n.t('admin.kerberos.wizard.exit.msg');
-    return App.showConfirmationPopup(primary, msg, null, null, primaryText)
+    var msg = isCritical ? Em.I18n.t('admin.kerberos.wizard.exit.critical.msg')
+      : Em.I18n.t('admin.kerberos.wizard.exit.warning.msg');
+    return App.showConfirmationPopup(primary, msg, null, null, primaryText, isCritical);
   },
   /**
    * Clear all temporary data

+ 2 - 2
ambari-web/app/data/HDP2/site_properties.js

@@ -4483,13 +4483,13 @@ var hdp2properties = [
 /************************************************Kerberos Descriptor******************************************/
   {
     "name": "smokeuser_principal_name",
-    "displayName": "Smokeuser principal",
+    "displayName": "Smoke user principal",
     "category": "Ambari Principals",
     "index": 1
   },
   {
     "name": "smokeuser_keytab",
-    "displayName": "Smokeuser keytab",
+    "displayName": "Smoke user keytab",
     "category": "Ambari Principals",
     "index": 2
   },

+ 11 - 8
ambari-web/app/messages.js

@@ -977,9 +977,8 @@ Em.I18n.translations = {
   'admin.kerberos.wizard.header':'Enable Kerberos Wizard',
   'admin.kerberos.button.enable': 'Enable Kerberos',
   'admin.kerberos.button.disable': 'Disable Kerberos',
-  'admin.kerberos.wizard.exit.msg': 'Enable Security is in progress. You must allow the wizard to complete for Ambari to be in usable state. ' +
-    'If you choose to quit, you must follow manual instructions to activate or disable security as documented in the Ambari User Guide. ' +
-    'Do you really want to exit Kerberos Security Wizard?',
+  'admin.kerberos.wizard.exit.warning.msg': 'Configuring Kerberos is in progress. Do you really want to exit the Enable Kerberos Wizard?',
+  'admin.kerberos.wizard.exit.critical.msg': 'Configuring Kerberos is in progress. <strong>Before dismissing, you should complete the wizard.</strong> Do you really want to exit the Enable Kerberos Wizard?',
   'admin.kerberos.wizard.step1.header': 'Get Started',
   'admin.kerberos.wizard.step2.header': 'Configure Kerberos',
   'admin.kerberos.wizard.step3.header': 'Install and Test Kerberos Client',
@@ -991,16 +990,20 @@ Em.I18n.translations = {
   'admin.kerberos.wizard.step1.alert.body': 'Note: This process requires services to be restarted and cluster downtime. As well, depending on the options you select, might require support from your Security administrators. Please plan accordingly.',
   'admin.kerberos.wizard.step1.body.text': 'What type of KDC do you plan on using?',
   'admin.kerberos.wizard.step1.option.kdc': 'Existing MIT KDC',
-  'admin.kerberos.wizard.step1.option.kdc.condition.1': 'An administrative principal is created in the MIT KDC to be shared with Ambari when prompted.',
-  'admin.kerberos.wizard.step1.option.kdc.condition.2': 'Java Cryptography Extension (JCE) is installed on ambari server host.',
+  'admin.kerberos.wizard.step1.option.kdc.condition.1': 'Ambari Server and cluster hosts have network access to both the KDC and KDC admin hosts.',
+  'admin.kerberos.wizard.step1.option.kdc.condition.2': 'KDC administrative credentials are on-hand.',
+  'admin.kerberos.wizard.step1.option.kdc.condition.3': 'The Java Cryptography Extensions (JCE) have been setup on the Ambari Server host.',
   'admin.kerberos.wizard.step1.option.ad': 'Existing Active Directory',
-  'admin.kerberos.wizard.step1.option.ad.condition.1': 'An administrative principal is created in the Active Directory to be shared with Ambari when prompted.',
-  'admin.kerberos.wizard.step1.option.ad.condition.2': 'Java Cryptography Extension (JCE) is installed on ambari server host.',
+  'admin.kerberos.wizard.step1.option.ad.condition.1': 'Ambari Server and cluster hosts have network access to the Domain Controllers.',
+  'admin.kerberos.wizard.step1.option.ad.condition.2': 'Active Directory secure LDAP (LDAPS) connectivity has been configured.',
+  'admin.kerberos.wizard.step1.option.ad.condition.3': 'Active Directory User container for principals has been created and is on-hand (e.g. OU=Hadoop,OU=People,dc=apache,dc=org)',
+  'admin.kerberos.wizard.step1.option.ad.condition.4': 'Active Directory administrative credentials with delegated control of “Create, delete, and manage user accounts” on the previously mentioned User container are on-hand.',
+  'admin.kerberos.wizard.step1.option.ad.condition.5': 'The Java Cryptography Extensions (JCE) have been setup on the Ambari Server host.',
   'admin.kerberos.wizard.step1.prerequisites.label': 'Following prerequisites needs to be checked to progress ahead in the wizard.',
   'admin.kerberos.wizard.step2.info.body': 'Please configure kerberos related properties.',
   'admin.kerberos.wizard.step3.task0.title': 'Install Kerberos Client',
   'admin.kerberos.wizard.step3.task1.title': 'Test Kerberos Client',
-  'admin.kerberos.wizard.step3.notice.inProgress': 'Please wait while kerberos is being installed and tested.',
+  'admin.kerberos.wizard.step3.notice.inProgress': 'Please wait while the Kerberos clients are being installed and tested.',
   'admin.kerberos.wizard.step3.notice.completed': 'Kerberos service has been installed and tested successfully.',
   'admin.kerberos.wizard.progressPage.notice.inProgress': 'Please wait while cluster is being kerberized',
   'admin.kerberos.wizard.step4.info.body': 'Configure principal name and keytab location for service users and hadoop service components.',

+ 13 - 6
ambari-web/app/routes/add_kerberos_routes.js

@@ -36,23 +36,30 @@ module.exports = App.WizardRoute.extend({
         onClose: function () {
           var self = this;
           switch(kerberosWizardController.get('currentStep')) {
-            case "1":
-              self.exitWizard();
-              break;
             case "2":
               var step2Controller = router.get('kerberosWizardStep2Controller');
               if (step2Controller.get('testConnectionInProgress')) {
                 step2Controller.showConnectionInProgressPopup(function() {
-                  self.exitWizard();
+                  kerberosWizardController.warnBeforeExitPopup(function() {
+                    self.exitWizard();
+                  }, false);
                 });
               } else {
-                self.exitWizard();
+                kerberosWizardController.warnBeforeExitPopup(function() {
+                  self.exitWizard();
+                }, false);
               }
               break;
+            case "6":
+            case "7":
+              kerberosWizardController.warnBeforeExitPopup(function() {
+                self.exitWizard();
+              }, true);
+              break;
             default:
               kerberosWizardController.warnBeforeExitPopup(function() {
                 self.exitWizard();
-              });
+              }, false);
           }
         },
         didInsertElement: function () {

+ 3 - 1
ambari-web/app/views/common/modal_popups/confirmation_popup.js

@@ -26,9 +26,10 @@ var App = require('app');
  * @param {Function} secondary
  * @param {String} header
  * @param {String} primaryText
+ * @param {Boolean} isCritical
  * @return {*}
  */
-App.showConfirmationPopup = function (primary, body, secondary, header, primaryText) {
+App.showConfirmationPopup = function (primary, body, secondary, header, primaryText, isCritical) {
   if (!primary) {
     return false;
   }
@@ -37,6 +38,7 @@ App.showConfirmationPopup = function (primary, body, secondary, header, primaryT
     primary: primaryText || Em.I18n.t('ok'),
     header: header || Em.I18n.t('popup.confirmation.commonHeader'),
     body: body || Em.I18n.t('question.sure'),
+    primaryClass: isCritical ? 'btn-danger' : 'btn-success',
     onPrimary: function () {
       this.hide();
       primary();

+ 9 - 3
ambari-web/test/controllers/main/admin/kerberos/kerberos_wizard_controler_test.js

@@ -28,10 +28,16 @@ describe('App.KerberosWizardController', function() {
     afterEach(function () {
       App.showConfirmationPopup.restore();
     });
-    it('should open confirmation popup', function () {
+    it('should open warning confirmation popup', function () {
       var f = Em.K;
-      var popup = controller.warnBeforeExitPopup(f);
-      expect(App.showConfirmationPopup.calledWith(f, Em.I18n.t('admin.kerberos.wizard.exit.msg'), null, null, Em.I18n.t('common.exitAnyway'))).to.be.true;
+      var popup = controller.warnBeforeExitPopup(f, false);
+      expect(App.showConfirmationPopup.calledWith(f, Em.I18n.t('admin.kerberos.wizard.exit.warning.msg'), null, null, Em.I18n.t('common.exitAnyway'), false)).to.be.true;
+    });
+
+    it('should open critical confirmation popup', function () {
+      var f = Em.K;
+      var popup = controller.warnBeforeExitPopup(f, true);
+      expect(App.showConfirmationPopup.calledWith(f, Em.I18n.t('admin.kerberos.wizard.exit.critical.msg'), null, null, Em.I18n.t('common.exitAnyway'), true)).to.be.true;
     });
   });