ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject ambari git commit: AMBARI-21860. Stacks and Versions is displaying unsorted (alexantonenko)
Date Thu, 31 Aug 2017 12:19:58 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 89fcb77e1 -> 2f173260b


AMBARI-21860. Stacks and Versions is displaying unsorted (alexantonenko)


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

Branch: refs/heads/branch-2.6
Commit: 2f173260bcc216c03f8a441d272b3d0b731148ec
Parents: 89fcb77
Author: Alex Antonenko <aantonenko@hortonworks.com>
Authored: Thu Aug 31 15:19:40 2017 +0300
Committer: Alex Antonenko <aantonenko@hortonworks.com>
Committed: Thu Aug 31 15:19:40 2017 +0300

----------------------------------------------------------------------
 .../main/admin/stack_upgrade/versions.hbs       |  2 +-
 .../main/admin/stack_upgrade/versions_view.js   | 23 +----------
 .../admin/stack_upgrade/version_view_test.js    | 42 --------------------
 3 files changed, 2 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2f173260/ambari-web/app/templates/main/admin/stack_upgrade/versions.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/versions.hbs b/ambari-web/app/templates/main/admin/stack_upgrade/versions.hbs
index 6eb1ef8..da7965f 100644
--- a/ambari-web/app/templates/main/admin/stack_upgrade/versions.hbs
+++ b/ambari-web/app/templates/main/admin/stack_upgrade/versions.hbs
@@ -58,7 +58,7 @@
   <div class="span10 versions-slides">
     {{#if isLoaded}}
       <div class="versions-slides-bar">
-        {{#each version in view.sortedRepoVersions}}
+        {{#each version in view.repoVersions}}
           {{#if version.isVisible}}
             {{view App.UpgradeVersionColumnView contentBinding="version"}}
           {{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f173260/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js b/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js
index 6618893..9316f0b 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js
@@ -126,28 +126,7 @@ App.MainAdminStackVersionsView = Em.View.extend({
    * @type {Em.Array}
    */
   repoVersions: App.RepositoryVersion.find(),
-
-  /**
-   * PATCH version should be displayed right after parent STANDARD version
-   */
-  sortedRepoVersions: function () {
-    var allVersions = this.get('repoVersions').filterProperty('isPatch', false).toArray().sort(function
(a, b) {
-      return stringUtils.compareVersions(a.get('repositoryVersion'), b.get('repositoryVersion'));
-    });
-    this.get('repoVersions').filterProperty('isPatch').toArray().sort(function (a, b) {
-      return stringUtils.compareVersions(b.get('repositoryVersion'), a.get('repositoryVersion'));
-    }).forEach(function(patchVersion) {
-      var displayNames = allVersions.mapProperty('displayNameSimple');
-      var index = displayNames.indexOf(patchVersion.get('displayNameSimple'));
-      if (index !== -1) {
-        allVersions.splice(index + 1, 0, patchVersion);
-      } else {
-        allVersions.push(patchVersion);
-      }
-    });
-    return allVersions;
-  }.property('repoVersions'),
-
+  
   /**
    * @type {Em.Array}
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f173260/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js
index 2643eb1..df3d2ef 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js
@@ -563,46 +563,4 @@ describe('App.mainAdminStackVersionsView', function () {
       expect(view.get('controller').load.called).to.be.false;
     });
   });
-
-  describe('#sortedRepoVersions', function() {
-    var repoVersions = [
-      Em.Object.create({
-        isPatch: true,
-        repositoryVersion: '2.5.6.0-9',
-        displayNameSimple: '2.5.6.0'
-      }),
-      Em.Object.create({
-        isPatch: false,
-        repositoryVersion: '2.5.3.0-10',
-        displayNameSimple: '2.5.3.0'
-      }),
-      Em.Object.create({
-        isPatch: false,
-        repositoryVersion: '2.5.4.0-10',
-        displayNameSimple: '2.5.4.0'
-      }),
-      Em.Object.create({
-        isPatch: true,
-        repositoryVersion: '2.5.3.0-9',
-        displayNameSimple: '2.5.3.0'
-      }),
-      Em.Object.create({
-        isPatch: true,
-        repositoryVersion: '2.5.3.0-11',
-        displayNameSimple: '2.5.3.0'
-      }),
-      Em.Object.create({
-        isPatch: false,
-        repositoryVersion: '2.5.4.0-12',
-        displayNameSimple: '2.5.4.0'
-      })
-    ];
-
-    it('should sort repository versions', function() {
-      view.set('repoVersions', repoVersions);
-      expect(view.get('sortedRepoVersions').mapProperty('repositoryVersion')).to.be.eql([
-        '2.5.3.0-10', '2.5.3.0-9', '2.5.3.0-11', '2.5.4.0-10', '2.5.4.0-12', '2.5.6.0-9'
-      ]);
-    });
-  });
 });


Mime
View raw message