ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [45/50] [abbrv] ambari git commit: AMBARI-18920. Kerberos wizard: Show recommendation API failure message in a popup (akovalenko)
Date Thu, 17 Nov 2016 17:14:01 GMT
AMBARI-18920. Kerberos wizard: Show recommendation API failure message in a popup (akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/46b44d2a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/46b44d2a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/46b44d2a

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 46b44d2a7574b11415dfb88917a906b30624c666
Parents: 6750869
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Thu Nov 17 15:52:10 2016 +0200
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Thu Nov 17 15:52:10 2016 +0200

----------------------------------------------------------------------
 .../main/admin/kerberos/step4_controller.js     | 23 +++++++++++++++++---
 .../main/admin/kerberos/wizard_controller.js    | 15 +++++++++++++
 .../admin/kerberos/step4_controller_test.js     |  4 ++++
 3 files changed, 39 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/46b44d2a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
index eebe133..8e5abd5 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
@@ -17,6 +17,7 @@
  */
 
 var App = require('app');
+var blueprintUtils = require('utils/blueprint');
 require('controllers/wizard/step7_controller');
 
 App.KerberosWizardStep4Controller = App.WizardStep7Controller.extend(App.AddSecurityConfigs,
App.ToggleIsRequiredMixin, App.KDCCredentialsControllerMixin, {
@@ -362,7 +363,7 @@ App.KerberosWizardStep4Controller = App.WizardStep7Controller.extend(App.AddSecu
         stackVersionUrl: App.get('stackVersionURL'),
         dataToSend: {
           recommend: 'configurations',
-          hosts: this.get('hostNames'),
+          hosts: App.get('allHostNames'),
           services: this.get('serviceNames'),
           recommendations: recommendations
         }
@@ -372,6 +373,23 @@ App.KerberosWizardStep4Controller = App.WizardStep7Controller.extend(App.AddSecu
     });
   },
 
+  loadRecommendationsError: function(req, ajaxOpts, error, opt) {
+    var resp;
+    try {
+      resp = $.parseJSON(req.responseText);
+    } catch (e) { }
+    return App.ModalPopup.show({
+      header: Em.I18n.t('common.error'),
+      secondary: false,
+      bodyClass: App.AjaxDefaultErrorPopupBodyView.extend({
+        type: opt.type || 'GET',
+        url: opt.url,
+        status: req.status,
+        message: resp && resp.message || req.responseText
+      })
+    });
+  },
+
   applyServiceConfigs: function(stepConfigs) {
     this.set('isRecommendedLoaded', true);
     this.set('selectedService', stepConfigs[0]);
@@ -474,9 +492,8 @@ App.KerberosWizardStep4Controller = App.WizardStep7Controller.extend(App.AddSecu
    * @returns {object} payload for recommendations request
    */
   getBlueprintPayloadObject: function(configurations, kerberosDescriptor) {
-    var recommendations = this.get('hostGroups');
+    var recommendations = blueprintUtils.generateHostGroups(App.get('allHostNames'));
     var mergedConfigurations = this.mergeDescriptorToConfigurations(configurations, this.createServicesStackDescriptorConfigs(kerberosDescriptor));
-
     recommendations.blueprint.configurations = mergedConfigurations.reduce(function(p, c)
{
       p[c.type] = {};
       p[c.type].properties = c.properties;

http://git-wip-us.apache.org/repos/asf/ambari/blob/46b44d2a/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js b/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
index 918742d..2f07e1f 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
@@ -111,6 +111,21 @@ App.KerberosWizardController = App.WizardController.extend(App.InstallComponent,
     return configs;
   },
 
+  dataLoading: function() {
+    var dfd = $.Deferred();
+    this.connectOutlet('loading');
+    if (App.router.get('clusterController.isLoaded') && App.router.get('clusterController.isComponentsStateLoaded'))
{
+      dfd.resolve();
+    } else {
+      var interval = setInterval(function () {
+        if (App.router.get('clusterController.isLoaded') && App.router.get('clusterController.isComponentsStateLoaded'))
{
+          dfd.resolve();
+          clearInterval(interval);
+        }
+      }, 50);
+    }
+    return dfd.promise();
+  },
   /**
    * save status of the cluster.
    * @param clusterStatus object with status,requestId fields.

http://git-wip-us.apache.org/repos/asf/ambari/blob/46b44d2a/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js b/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
index 86e126e..422ac26 100644
--- a/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
@@ -887,11 +887,15 @@ describe('App.KerberosWizardStep4Controller', function() {
       });
       expect(c.getBlueprintPayloadObject([], {})).to.be.eql({
         "blueprint": {
+          "host_groups": [],
           "configurations": {
             "t1": {
               "properties": []
             }
           }
+        },
+        "blueprint_cluster_binding": {
+          "host_groups": []
         }
       });
     });


Mime
View raw message