浏览代码

AMBARI-11091. unable to see complete non-master node name at step 6 (Assign Slaves and Clients) if more than 23 characters. (jaimin)

Jaimin Jetly 10 年之前
父节点
当前提交
54e22bc941
共有 2 个文件被更改,包括 12 次插入14 次删除
  1. 10 12
      ambari-web/app/views/wizard/step6_view.js
  2. 2 2
      ambari-web/test/views/wizard/step6_view_test.js

+ 10 - 12
ambari-web/app/views/wizard/step6_view.js

@@ -119,17 +119,15 @@ App.WizardStep6HostView = Em.View.extend({
    */
    */
   didInsertElement: function () {
   didInsertElement: function () {
     var components = this.get('controller').getMasterComponentsForHost(this.get('host.hostName'));
     var components = this.get('controller').getMasterComponentsForHost(this.get('host.hostName'));
-    if (components && components.length > 0) {
-      components = components.map(function (_component) {
-        return App.format.role(_component);
-      });
-      components = components.join(" /\n");
-      App.popover(this.$(), {
-        title: Em.I18n.t('installer.step6.wizardStep6Host.title').format(this.get('host.hostName')),
-        content: components,
-        placement: 'right',
-        trigger: 'hover'
-      });
-    }
+    components = components.map(function (_component) {
+      return App.format.role(_component);
+    });
+    components = components.join(" /\n");
+    App.popover(this.$(), {
+      title: Em.I18n.t('installer.step6.wizardStep6Host.title').format(this.get('host.hostName')),
+      content: components,
+      placement: 'right',
+      trigger: 'hover'
+    });
   }
   }
 });
 });

+ 2 - 2
ambari-web/test/views/wizard/step6_view_test.js

@@ -136,11 +136,11 @@ describe('App.WizardStep6HostView', function() {
       expect(App.popover.calledOnce).to.equal(true);
       expect(App.popover.calledOnce).to.equal(true);
       view.get('controller').getMasterComponentsForHost.restore();
       view.get('controller').getMasterComponentsForHost.restore();
     });
     });
-    it('shouldn\'t create popover if controller.getMasterComponentsForHost returns empty array', function() {
+    it('should create popover even if controller.getMasterComponentsForHost is an empty array', function() {
       sinon.stub(view.get('controller'), 'getMasterComponentsForHost', function() {return [];});
       sinon.stub(view.get('controller'), 'getMasterComponentsForHost', function() {return [];});
       view.set('controller.isMasters', true);
       view.set('controller.isMasters', true);
       view.didInsertElement();
       view.didInsertElement();
-      expect(App.popover.called).to.equal(false);
+      expect(App.popover.calledOnce).to.equal(true);
       view.get('controller').getMasterComponentsForHost.restore();
       view.get('controller').getMasterComponentsForHost.restore();
     });
     });
   });
   });