Просмотр исходного кода

AMBARI-4807. Add Service link is active when all service are installed. (onechiporenko)

Oleg Nechiporenko 11 лет назад
Родитель
Сommit
84a88e5e4a
2 измененных файлов с 3 добавлено и 105 удалено
  1. 3 0
      ambari-web/app/controllers/main/service.js
  2. 0 105
      ambari-web/test/installer/step9_test.js

+ 3 - 0
ambari-web/app/controllers/main/service.js

@@ -41,6 +41,9 @@ App.MainServiceController = Em.ArrayController.extend({
       this.loadAvailableServices();
       availableServices = App.db.getServices();
     }
+    if (!App.supports.hue) {
+      availableServices = availableServices.without('HUE');
+    }
     return this.get('content.content').length == availableServices.length;
   }.property('content.content.@each', 'content.content.length'),
 

+ 0 - 105
ambari-web/test/installer/step9_test.js

@@ -598,7 +598,6 @@ describe('App.InstallerStep9Controller', function () {
       expect(controller.get('hosts.length')).to.equal(0);
       expect(controller.get('status')).to.equal('info');
       expect(controller.get('progress')).to.equal('0');
-      expect(controller.get('isStepCompleted')).to.equal(false);
       expect(controller.get('numPolls')).to.equal(1);
     });
   });
@@ -774,110 +773,6 @@ describe('App.InstallerStep9Controller', function () {
     });
   });
 
-  describe('#setTasksPerHost', function () {
-    var tests = [
-      {
-        hosts: [
-          Em.Object.create({
-            name: 'host1',
-            tasks: [],
-            bootStatus: 'REGISTERED'
-          }),
-          Em.Object.create({
-            name: 'host2',
-            tasks: [],
-            bootStatus: 'REGISTERED'
-          }),
-          Em.Object.create({
-            name: 'host3',
-            tasks: [],
-            bootStatus: 'REGISTERED'
-          })
-        ],
-        polledData: [
-          {Tasks: {host_name: 'host1'}},
-          {Tasks: {host_name: 'host1'}},
-          {Tasks: {host_name: 'host1'}},
-          {Tasks: {host_name: 'host2'}},
-          {Tasks: {host_name: 'host2'}},
-          {Tasks: {host_name: 'host3'}}
-        ],
-        e: {
-          host1: {count: 3},
-          host2: {count: 2},
-          host3: {count: 1}
-        },
-        m: 'Several tasks for each host'
-      },
-      {
-        hosts: [
-          Em.Object.create({
-            name: 'host1',
-            tasks: [],
-            bootStatus: 'REGISTERED'
-          }),
-          Em.Object.create({
-            name: 'host2',
-            tasks: [],
-            bootStatus: 'REGISTERED'
-          }),
-          Em.Object.create({
-            name: 'host3',
-            tasks: [],
-            bootStatus: 'REGISTERED'
-          })
-        ],
-        polledData: [
-          {Tasks: {host_name: 'host1'}},
-          {Tasks: {host_name: 'host2'}}
-        ],
-        e: {
-          host1: {count: 1},
-          host2: {count: 1},
-          host3: {count: 0}
-        },
-        m: 'Some hosts without tasks'
-      },
-      {
-        hosts: Em.A([
-          Em.Object.create({
-            name: 'host1',
-            tasks: [],
-            bootStatus: 'REGISTERED'
-          }),
-          Em.Object.create({
-            name: 'host2',
-            tasks: [],
-            bootStatus: 'REGISTERED'
-          }),
-          Em.Object.create({
-            name: 'host3',
-            tasks: [],
-            bootStatus: 'REGISTERED'
-          })
-        ]),
-        polledData: [],
-        e: {
-          host1: {count: 0},
-          host2: {count: 0},
-          host3: {count: 0}
-        },
-        m: 'No tasks'
-      }
-    ];
-    tests.forEach(function (test) {
-      it(test.m, function () {
-        var controller = App.WizardStep9Controller.create({polledData: test.polledData, hosts: test.hosts});
-        controller.setTasksPerHost();
-        for (var name in test.e.hosts) {
-          if (test.e.hosts.hasOwnProperty(name)) {
-            expect(controller.get('hosts').findProperty('name', name).get('tasks.length')).to.equal(test.e[name].count);
-          }
-        }
-      });
-    });
-  });
-
   describe('#setLogTasksStatePerHost', function () {
     var tests = [
       {