ソースを参照

AMBARI-8681 Duplicate Stack Versions are shown in Host Details > Versions tab. (ababiichuk)

aBabiichuk 10 年 前
コミット
439f4a5d0e

+ 2 - 2
ambari-web/app/views/main/host/stack_versions_view.js

@@ -35,8 +35,8 @@ App.MainHostStackVersionsView = App.TableView.extend({
    * @type {Ember.Array}
    */
   content: function () {
-    return App.HostStackVersion.find();
-  }.property(),
+    return this.get('host.stackVersions');
+  }.property('host.stackVersions'),
 
   /**
    * return filtered number of all content number information displayed on the page footer bar

+ 10 - 2
ambari-web/test/views/main/host/stack_versions_view_test.js

@@ -29,9 +29,13 @@ describe('App.MainHostStackVersionsView', function() {
       sinon.stub(App.router, 'get').returns(Em.Object.create({
         id: 1
       }));
+      sinon.stub(view, 'filter').returns([Em.Object.create({
+        id: 1
+      })]);
     });
     after(function () {
       App.router.get.restore();
+      view.filter.restore();
     });
     it("", function () {
       view.propertyDidChange('host');
@@ -43,12 +47,16 @@ describe('App.MainHostStackVersionsView', function() {
 
   describe("#content", function () {
     before(function () {
-      sinon.stub(App.HostStackVersion, 'find').returns([Em.Object.create({
+      sinon.stub(view, 'get').returns([Em.Object.create({
+        id: 1
+      })]);
+      sinon.stub(view, 'filter').returns([Em.Object.create({
         id: 1
       })]);
     });
     after(function () {
-      App.HostStackVersion.find.restore();
+      view.get.restore();
+      view.filter.restore();
     });
     it("", function () {
       view.propertyDidChange('content');