You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by xi...@apache.org on 2016/02/04 22:56:51 UTC

[1/4] ambari git commit: AMBARI-14795. Register Version: add ability to load new version definition file.

Repository: ambari
Updated Branches:
  refs/heads/branch-dev-patch-upgrade c72dc41db -> 0f9da4282


AMBARI-14795. Register Version: add ability to load new version definition file.


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: e4d03b5b5879aff474abdbb3a9d571215383a6c4
Parents: c72dc41
Author: Xi Wang <xi...@apache.org>
Authored: Fri Jan 22 17:24:01 2016 -0800
Committer: Xi Wang <xi...@apache.org>
Committed: Wed Feb 3 13:55:05 2016 -0800

----------------------------------------------------------------------
 .../app/assets/data/version/version.json        |  38 ++++++-
 .../stackVersions/StackVersionsCreateCtrl.js    | 100 +++++++++++++++++++
 .../ui/admin-web/app/scripts/i18n.config.js     |   4 +
 .../ui/admin-web/app/scripts/services/Stack.js  |  38 +++++++
 .../resources/ui/admin-web/app/styles/main.css  |  16 ++-
 .../views/stackVersions/stackVersionPage.html   |  31 ++++++
 6 files changed, 225 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e4d03b5b/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json b/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json
index 7c604f1..b5b3601 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json
@@ -14,7 +14,43 @@
             "id" : 15,
             "repository_version" : "2.2.0.1-901",
             "stack_name" : "HDP",
-            "stack_version" : "2.2"
+            "stack_version" : "2.2",
+            "release": {
+              "type": "PATCH",
+              "stack_id": "HDP-2.2",
+              "version": "2.2.0.1",
+              "build": "901",
+              "compatible_with": "2.2.0.1-[1-9]",
+              "release_notes": "http://someurl"
+            },
+            "services": [
+              {
+                "name": "HDFS",
+                "versions": [
+                  {
+                    "version": "2.1.1",
+                    "version_id": "10",
+                    "components": [ "NAMENODE"]
+                  }
+                ]
+              },
+              {
+                "name": "HIVE",
+                "versions": [
+                  {
+                    "version": "1.2.1"
+                  }
+                ]
+              },
+              {
+                "name": "ZOOKEEPER",
+                "versions": [
+                  {
+                    "version": "3.4.5"
+                  }
+                ]
+              }
+            ]
           },
           "operating_systems" : [
             {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e4d03b5b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
index a817d88..40aa103 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
@@ -151,4 +151,104 @@ angular.module('ambariAdminConsole')
     $location.path('/stackVersions');
   };
 
+  // two options to upload version definition file
+  $scope.option1 = {
+    index: 1,
+    displayName: 'Upload Version Definition File',
+    url: 'files://',
+    selected: true,
+    hasError: true
+  };
+  $scope.option2 = {
+    index: 2,
+    displayName: 'Version Definition File URL',
+    url: 'https://',
+    selected: false,
+    hasError: false
+  };
+  $scope.selectedOption = 1;
+
+  /**
+   * User can select ONLY one option to upload version definition file
+   */
+  $scope.toggleOptionSelect = function () {
+    $scope.option1.selected = $scope.selectedOption == $scope.option1.index;
+    $scope.option2.selected = $scope.selectedOption == $scope.option2.index;
+    $scope.option1.hasError = false;
+    $scope.option2.hasError = false;
+  };
+  $scope.clearOptionsError = function () {
+    $scope.option1.hasError = false;
+    $scope.option2.hasError = false;
+  };
+  $scope.readInfoButtonDisabled = function () {
+    return $scope.option1.selected ? !$scope.option1.url : !$scope.option2.url;
+  };
+
+  $scope.onFileSelect = function(){
+    return {
+      link: function($scope,el){
+        el.bind("change", function(e){
+          $scope.file = (e.srcElement || e.target).files[0];
+          $scope.getFile();
+        })
+      }
+    }
+  };
+
+//  $scope.uploadFile = function(){
+//    var file = $scope.myFile;
+//    console.log('file is ' );
+//    console.dir(file);
+//    var uploadUrl = "/fileUpload";
+//    fileUpload.uploadFileToUrl(file, uploadUrl);
+//  };
+
+  /**
+   * Load selected file to current page content
+   */
+  $scope.readVersionInfo = function(){
+    if ($scope.option2.selected) {
+      var url = $scope.option2.url;
+    }
+    /// POST url first then get the version definition info
+    return Stack.getLatestRepo('HDP').then(function (response) {
+      $scope.id = response.id;
+      $scope.isPatch = response.type == 'PATCH';
+      $scope.stackNameVersion = response.stackNameVersion;
+      $scope.displayName = response.displayName;
+      $scope.version = response.version;
+      $scope.actualVersion = response.actualVersion;
+      $scope.services = response.services;
+      //save default values of repos to check if they were changed
+      $scope.defaulfOSRepos = {};
+      response.updateObj.operating_systems.forEach(function(os) {
+        $scope.defaulfOSRepos[os.OperatingSystems.os_type] = {
+          defaultBaseUrl: os.repositories[0].Repositories.base_url,
+          defaultUtilsUrl: os.repositories[1].Repositories.base_url
+        };
+      });
+      $scope.repoVersionFullName = response.repoVersionFullName;
+      angular.forEach(response.osList, function (os) {
+        os.selected = true;
+      });
+      $scope.selectedOS = response.osList.length;
+      $scope.osList = response.osList;
+      // if user reach here from UI click, repo status should be cached
+      // otherwise re-fetch repo status from cluster end point.
+      $scope.repoStatus = Cluster.repoStatusCache[$scope.id];
+      if (!$scope.repoStatus) {
+        $scope.fetchClusters()
+          .then(function () {
+            return $scope.fetchRepoClusterStatus();
+          })
+          .then(function () {
+            $scope.deleteEnabled = $scope.isDeletable();
+          });
+      } else {
+        $scope.deleteEnabled = $scope.isDeletable();
+      }
+      $scope.addMissingOSList();
+    });
+  };
 }]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e4d03b5b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
index 086bc13..21622b5 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
@@ -293,6 +293,10 @@ angular.module('ambariAdminConsole')
       'current': 'Current',
       'inUse': 'In Use',
       'installed': 'Installed',
+      'uploadFile': 'Upload Version Definition File',
+      'enterURL': 'Version Definition File URL',
+      'readInfo': 'Read Version Info',
+      'browse': 'Browse',
       'installOn': 'Install on...',
       'register': 'Register Version',
       'deregister': 'Deregister Version',

http://git-wip-us.apache.org/repos/asf/ambari/blob/e4d03b5b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
index ffed3cc..a28943c 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
@@ -173,6 +173,44 @@ angular.module('ambariAdminConsole')
       return deferred.promise;
     },
 
+    getLatestRepo: function (stack_name) {
+      var url = Settings.baseUrl + '/stacks/' + stack_name + '/versions?' +
+        'fields=repository_versions/operating_systems/repositories/*' +
+        ',repository_versions/RepositoryVersions/*';
+      var deferred = $q.defer();
+      $http.get(url, {mock: 'version/version.json'})
+        .success(function (data) {
+          data = data.items[0];
+          var response = {
+            id : data.repository_versions[0].RepositoryVersions.id,
+            stackVersion : data.Versions.stack_version,
+            stackName: data.Versions.stack_name,
+            type: data.repository_versions[0].RepositoryVersions.release.type,
+            stackNameVersion: data.Versions.stack_name + '-' + data.Versions.stack_version, /// HDP-2.3
+            actualVersion: data.repository_versions[0].RepositoryVersions.repository_version, /// 2.3.4.0-3846
+            version: data.repository_versions[0].RepositoryVersions.release.version, /// 2.3.4.0
+            displayName: data.Versions.stack_name + '-' + data.repository_versions[0].RepositoryVersions.release.version, //HDP-2.3.4.0
+            repoVersionFullName : data.Versions.stack_name + '-' + data.repository_versions[0].RepositoryVersions.repository_version,
+            osList: data.repository_versions[0].operating_systems,
+            updateObj: data.repository_versions[0]
+          };
+          var services = [];
+          angular.forEach(data.repository_versions[0].RepositoryVersions.services, function (service) {
+            services.push({
+              name: service.name,
+              version: service.versions[0].version,
+              components: service.versions[0].components
+            });
+          });
+          response.services = services;
+          deferred.resolve(response);
+        })
+        .error(function (data) {
+          deferred.reject(data);
+        });
+      return deferred.promise;
+    },
+
     updateRepo: function (stackName, stackVersion, id, payload) {
       var url = Settings.baseUrl + '/stacks/' + stackName + '/versions/' + stackVersion + '/repository_versions/' + id;
       var deferred = $q.defer();

http://git-wip-us.apache.org/repos/asf/ambari/blob/e4d03b5b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
index cc57fa3..de3d526 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
@@ -1383,4 +1383,18 @@ thead.view-permission-header > tr > th {
 
 .test-ldap-icon.ng-hide-add-active, .test-ldap-icon.ng-hide-remove {
   display: inline-block!important;
-}
\ No newline at end of file
+}
+
+.register-version-options .read-info-button {
+  margin-bottom: 10px;
+}
+
+.register-version-options .option-radio-button {
+  padding-top: 5px;
+}
+
+.register-version-options .choose-file-input {
+  padding-top: 6px;
+  padding-bottom: 20px;
+}
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/e4d03b5b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
index 9b7e032..e23aecb 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
@@ -29,6 +29,37 @@
   </div>
 </div>
 <hr>
+
+
+
+<div class="clearfix register-version-options">
+  <div class="col-sm-5 option-radio-button">
+    <label class="option-label">
+      <input type="radio" ng-model="selectedOption" value="{{option1.index}}" ng-change="toggleOptionSelect()"> {{'versions.uploadFile' | translate}}
+    </label>
+  </div>
+  <div class="col-sm-7">
+    <input type="file" class="choose-file-input" ng-file-select="onFileSelect($files)"/>
+  </div>
+</div>
+<div class="clearfix register-version-options border-bottom bottom-margin">
+  <div class="col-sm-5 option-radio-button">
+    <label class="option-label">
+      <input type="radio" ng-model="selectedOption" value="{{option2.index}}" ng-change="toggleOptionSelect()"> {{'versions.enterURL' | translate}}
+    </label>
+  </div>
+    <div class="col-sm-7">
+      <div class="form-group {{option2.name}}" ng-class="{'has-error': option2.url.hasError }">
+        <div class=""><input type="text" class="form-control" ng-model="option2.url" ng-change="clearOptionsError()" ng-disabled="!option2.selected"></div>
+      </div>
+    </div>
+    <div class="col-sm-12 read-info-button">
+    <button class="btn btn-primary pull-right" ng-click="readVersionInfo()"
+        ng-disabled="readInfoButtonDisabled()">{{'versions.readInfo' | translate}}</button>
+    </div>
+</div>
+
+
 <form class="form-horizontal register-version-form" role="form" name="repoRegForm" novalidate>
   <div class="panel panel-default" ng-if="createController">
     <div class="panel-heading">


[4/4] ambari git commit: AMBARI-14837. Versions: display all versions as tabs on left side, version details on selecting.(xiwang)

Posted by xi...@apache.org.
AMBARI-14837. Versions: display all versions as tabs on left side, version details on selecting.(xiwang)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0f9da42829c5d7118284d09e98190403bfdce41e
Parents: efc3a07
Author: Xi Wang <xi...@apache.org>
Authored: Wed Feb 3 16:15:24 2016 -0800
Committer: Xi Wang <xi...@apache.org>
Committed: Wed Feb 3 16:15:24 2016 -0800

----------------------------------------------------------------------
 .../stackVersions/StackVersionsCreateCtrl.js    |  35 +--
 .../stackVersions/StackVersionsEditCtrl.js      | 241 ++++++++++++-------
 .../stackVersions/StackVersionsListCtrl.js      | 127 +++-------
 .../ui/admin-web/app/scripts/i18n.config.js     |   1 +
 .../ui/admin-web/app/scripts/services/Stack.js  |  30 ++-
 .../resources/ui/admin-web/app/styles/main.css  |  80 +++++-
 .../admin-web/app/views/stackVersions/list.html | 105 +++-----
 .../views/stackVersions/stackVersionPage.html   |  50 +++-
 .../stackVersions/StackversionsListCtrl_test.js | 152 ------------
 9 files changed, 357 insertions(+), 464 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0f9da428/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
index 37f9c34..df76c15 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
@@ -23,7 +23,6 @@ angular.module('ambariAdminConsole')
   $scope.createController = true;
   $scope.osList = [];
   $scope.skipValidation = false;
-  $scope.repoSubversion = "";
 
   $scope.clusterName = $routeParams.clusterName;
   $scope.subversionPattern = /^\d+\.\d+(-\d+)?$/;
@@ -111,10 +110,8 @@ angular.module('ambariAdminConsole')
         };
       });
       $scope.repoVersionFullName = response.repoVersionFullName;
-      $scope.selectedOS = [];
       angular.forEach(response.osList, function (os) {
         os.selected = true;
-        $scope.selectedOS.push(os.OperatingSystems.os_type);
       });
       $scope.osList = response.osList;
       // load supported os type base on stack version
@@ -130,8 +127,12 @@ angular.module('ambariAdminConsole')
       .then(function (data) {
         var operatingSystems = data.operating_systems;
         operatingSystems.map(function (os) {
-          // os not in the list, mark as un-selected, add this to the osList
-          if ($scope.selectedOS.indexOf(os.OperatingSystems.os_type) < 0) {
+          var existingOSHash = {};
+          angular.forEach($scope.osList, function (os) {
+            existingOSHash[os.OperatingSystems.os_type] = os;
+          });
+          // if os not in the list, mark as un-selected, add this to the osList
+          if (!existingOSHash[os.OperatingSystems.os_type]) {
             os.selected = false;
             os.repositories.forEach(function(repo) {
               repo.Repositories.base_url = '';
@@ -183,9 +184,10 @@ angular.module('ambariAdminConsole')
       if (invalidUrls.length === 0) {
         Stack.addRepo($scope.upgradeStack, $scope.actualVersion, $scope.osList)
           .success(function () {
-            var versionName = $scope.actualVersion + '';
-            var stackName = $scope.upgradeStack.stack_name;
-            Alert.success($t('versions.alerts.versionCreated'), {stackName: stackName, versionName: versionName});
+            Alert.success($t('versions.alerts.versionCreated', {
+              stackName: $scope.upgradeStack.stack_name,
+              versionName: $scope.actualVersion
+            }));
             $location.path('/stackVersions');
           })
           .error(function (data) {
@@ -196,19 +198,12 @@ angular.module('ambariAdminConsole')
       }
     });
   };
-  /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
-   */
+
   $scope.cancel = function () {
     $scope.editVersionDisabled = true;
     $location.path('/stackVersions');
   };
 
-  /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
-   */
   $scope.clearErrors = function() {
     if ($scope.osList) {
       $scope.osList.forEach(function(os) {
@@ -221,18 +216,10 @@ angular.module('ambariAdminConsole')
     }
   };
 
-  /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
-   */
   $scope.clearError = function() {
     this.repository.hasError = false;
   };
 
-  /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
-   */
   $scope.hasValidationErrors = function() {
     var hasErrors = false;
     if ($scope.osList) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f9da428/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
index 0763726..9c5b2eb 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
@@ -24,17 +24,27 @@ angular.module('ambariAdminConsole')
   $scope.osList = [];
   $scope.skipValidation = false;
   $scope.selectedOS = 0;
+  $scope.upgradeStack = {
+    stack_name: '',
+    stack_version: '',
+    display_name: ''
+  };
 
   $scope.loadStackVersionInfo = function () {
     return Stack.getRepo($routeParams.versionId, $routeParams.stackName).then(function (response) {
       $scope.id = response.id;
-      $scope.stack = response.stack;
-      $scope.stackName = response.stackName;
-      $scope.versionName = response.versionName;
-      $scope.displayName = response.displayName;
-      $scope.stackVersion = response.stackVersion;
+      $scope.isPatch = response.type == 'PATCH';
+      $scope.stackNameVersion = response.stackNameVersion || 'n/a';
+      $scope.displayName = response.displayName || 'n/a';
+      $scope.version = response.version || 'n/a';
+      $scope.actualVersion = response.actualVersion || 'n/a';
       $scope.updateObj = response.updateObj;
-      $scope.subversion = response.versionName.substring(4); // cut off stack version
+      $scope.upgradeStack = {
+        stack_name: response.stackName,
+        stack_version: response.stackVersion,
+        display_name: response.displayName
+      };
+      $scope.services = response.services || [];
       //save default values of repos to check if they were changed
       $scope.defaulfOSRepos = {};
       response.updateObj.operating_systems.forEach(function(os) {
@@ -47,8 +57,10 @@ angular.module('ambariAdminConsole')
       angular.forEach(response.osList, function (os) {
         os.selected = true;
       });
-      $scope.selectedOS = response.osList.length;
       $scope.osList = response.osList;
+      // load supported os type base on stack version
+      $scope.afterStackVersionRead();
+
       // if user reach here from UI click, repo status should be cached
       // otherwise re-fetch repo status from cluster end point.
       $scope.repoStatus = Cluster.repoStatusCache[$scope.id];
@@ -63,50 +75,40 @@ angular.module('ambariAdminConsole')
       } else {
         $scope.deleteEnabled = $scope.isDeletable();
       }
-      $scope.addMissingOSList();
+      // fetch all repos to display the left menu
+      $scope.fetchRepos();
     });
   };
 
-  $scope.isDeletable = function() {
-    return !($scope.repoStatus == 'current' || $scope.repoStatus == 'installed');
+  /**
+   * Load supported OS list
+   */
+  $scope.afterStackVersionRead = function () {
+    Stack.getSupportedOSList($scope.upgradeStack.stack_name, $scope.upgradeStack.stack_version)
+      .then(function (data) {
+        var operatingSystems = data.operating_systems;
+        operatingSystems.map(function (os) {
+          var existingOSHash = {};
+          angular.forEach($scope.osList, function (os) {
+            existingOSHash[os.OperatingSystems.os_type] = os;
+          });
+          // if os not in the list, mark as un-selected, add this to the osList
+          if (!existingOSHash[os.OperatingSystems.os_type]) {
+            os.selected = false;
+            os.repositories.forEach(function(repo) {
+              repo.Repositories.base_url = '';
+            });
+            $scope.osList.push(os);
+          }
+        });
+      })
+      .catch(function (data) {
+        Alert.error($t('versions.alerts.osListError'), data.message);
+      });
   };
 
-  $scope.addMissingOSList = function() {
-    Stack.getSupportedOSList($scope.stackName, $scope.stackVersion)
-    .then(function (data) {
-      var existingOSHash = {};
-      angular.forEach($scope.osList, function (os) {
-        existingOSHash[os.OperatingSystems.os_type] = os;
-      });
-      var osList = data.operating_systems.map(function (os) {
-        return existingOSHash[os.OperatingSystems.os_type] || {
-          OperatingSystems: {
-            os_type : os.OperatingSystems.os_type
-          },
-          repositories: [
-            {
-              Repositories: {
-                base_url: '',
-                repo_id: 'HDP-' + $routeParams.versionId,
-                repo_name: 'HDP'
-              }
-            },
-            {
-              Repositories: {
-                base_url: '',
-                repo_id: 'HDP-UTILS-' + $routeParams.versionId,
-                repo_name: 'HDP-UTILS'
-              }
-            }
-          ],
-          selected: false
-        };
-      });
-      $scope.osList = osList;
-    })
-    .catch(function (data) {
-      Alert.error($t('versions.alerts.osListError'), data.message);
-    });
+  $scope.isDeletable = function() {
+    return !($scope.repoStatus == 'current' || $scope.repoStatus == 'installed');
   };
 
   $scope.defaulfOSRepos = {};
@@ -143,17 +145,13 @@ angular.module('ambariAdminConsole')
   };
 
   $scope.updateRepoVersions = function () {
-    var upgradeStack = {
-      stack_name: $scope.stackName,
-      stack_version: $scope.stackVersion
-    };
-    return Stack.validateBaseUrls($scope.skipValidation, $scope.osList, upgradeStack).then(function (invalidUrls) {
+    return Stack.validateBaseUrls($scope.skipValidation, $scope.osList, $scope.upgradeStack).then(function (invalidUrls) {
       if (invalidUrls.length === 0) {
-        Stack.updateRepo($scope.stackName, $scope.stackVersion, $scope.id, $scope.updateObj).then(function () {
+        Stack.updateRepo($scope.upgradeStack.stack_name, $scope.upgradeStack.stack_version, $scope.id, $scope.updateObj).then(function () {
           Alert.success($t('versions.alerts.versionEdited', {
-            stackName: $scope.stackName,
-            versionName: $scope.versionName,
-            displayName: $scope.displayName
+            stackName: $scope.upgradeStack.stack_name,
+            versionName: $scope.actualVersion,
+            displayName: $scope.repoVersionFullName
           }));
           $location.path('/stackVersions');
         }).catch(function (data) {
@@ -187,22 +185,56 @@ angular.module('ambariAdminConsole')
       $t('versions.deregister'),
       {
         "url": 'views/modals/BodyForDeregisterVersion.html',
-        "scope": {"displayName": $scope.displayName }
+        "scope": {"displayName": $scope.repoVersionFullName }
       }
     ).then(function() {
-      Stack.deleteRepo($scope.stackName, $scope.stackVersion, $scope.id).then( function () {
-        $location.path('/stackVersions');
-      }).catch(function (data) {
-        Alert.error($t('versions.alerts.versionDeleteError'), data.message);
+        Stack.deleteRepo($scope.upgradeStack.stack_name, $scope.upgradeStack.stack_version, $scope.id).then( function () {
+          $location.path('/stackVersions');
+        }).catch(function (data) {
+            Alert.error($t('versions.alerts.versionDeleteError'), data.message);
+          });
       });
-    });
   };
   $scope.loadStackVersionInfo();
-    
+
+  /**
+   * On click handler for removing OS
+   */
+  $scope.removeOS = function() {
+    this.os.selected = false;
+    if (this.os.repositories) {
+      this.os.repositories.forEach(function(repo) {
+        repo.hasError = false;
+      });
+    }
+  };
   /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
+   * On click handler for adding new OS
    */
+  $scope.addOS = function() {
+    this.os.selected = true;
+    if (this.os.repositories) {
+      this.os.repositories.forEach(function(repo) {
+        repo.hasError = false;
+      });
+    }
+  };
+
+  $scope.isSaveButtonDisabled = function() {
+    var enabled = false;
+    $scope.osList.forEach(function(os) {
+      if (os.selected) {
+        enabled = true
+      }
+    });
+    return !enabled;
+  }
+
+  $scope.cancel = function () {
+    $scope.editVersionDisabled = true;
+    $location.path('/stackVersions');
+  };
+
   $scope.clearErrors = function() {
     if ($scope.osList) {
       $scope.osList.forEach(function(os) {
@@ -214,29 +246,11 @@ angular.module('ambariAdminConsole')
       });
     }
   };
-  /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
-   */
+
   $scope.clearError = function () {
     this.repository.hasError = false;
   };
 
-  /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
-   */
-  $scope.toggleOSSelect = function () {
-    this.os.repositories.forEach(function (repo) {
-      repo.hasError = false;
-    });
-    this.os.selected ? $scope.selectedOS++ : $scope.selectedOS--;
-  };
-
-  /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
-   */
   $scope.hasValidationErrors = function () {
     var hasErrors = false;
     if ($scope.osList) {
@@ -253,13 +267,62 @@ angular.module('ambariAdminConsole')
     return hasErrors;
   };
 
+
+  // add all repos list
+  $scope.filter = {
+    version: '',
+    cluster: {
+      options: [],
+      current: null
+    }
+  };
+
+  $scope.pagination = {
+    totalRepos: 100,
+    maxVisiblePages: 1,
+    itemsPerPage: 100,
+    currentPage: 1
+  };
+  $scope.allRepos = [];
+  $scope.stackVersions = [];
+
+
+
   /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
+   *  Formatted object to display all repos:
+   *
+   *  [{ 'name': 'HDP-2.3',
+   *     'repos': ['2.3.6.0-2343', '2.3.4.1', '2.3.4.0-56']
+   *   },
+   *   { 'name': 'HDP-2.2',
+   *     'repos': ['2.2.6.0', '2.2.4.5', '2.2.4.0']
+   *   }
+   *  ]
+   *
    */
-  $scope.cancel = function () {
-    $scope.editVersionDisabled = true;
-    $location.path('/stackVersions');
+  $scope.fetchRepos = function () {
+    return Stack.allRepos($scope.filter, $scope.pagination).then(function (repos) {
+      $scope.allRepos = repos.items.sort(function(a, b){return a.repository_version < b.repository_version});
+      var existingStackHash = {};
+      var stackVersions = [];
+      angular.forEach($scope.allRepos, function (repo) {
+        var stackVersionName = repo.stack_name + '-' + repo.stack_version;
+        var currentStackVersion = $scope.upgradeStack.stack_name + '-' + $scope.upgradeStack.stack_version;
+        repo.isActive = $scope.actualVersion == repo.repository_version;
+        if (!existingStackHash[stackVersionName]) {
+          existingStackHash[stackVersionName] = true;
+          stackVersions.push({
+            'name': stackVersionName,
+            'isOpened': stackVersionName == currentStackVersion,
+            'repos': [repo]
+          });
+        } else {
+          if (stackVersions[stackVersions.length -1].repos) {
+            stackVersions[stackVersions.length -1].repos.push(repo);
+          }
+        }
+      });
+      $scope.stackVersions = stackVersions;
+    });
   };
-
 }]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f9da428/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsListCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsListCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsListCtrl.js
index 010ec1b..3a8233a 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsListCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsListCtrl.js
@@ -24,6 +24,7 @@ angular.module('ambariAdminConsole')
     return $t('common.' + key).toLowerCase();
   }
   $scope.clusterName = $routeParams.clusterName;
+
   $scope.filter = {
     version: '',
     cluster: {
@@ -31,106 +32,52 @@ angular.module('ambariAdminConsole')
       current: null
     }
   };
-  $scope.isNotEmptyFilter = true;
 
   $scope.pagination = {
-    totalRepos: 10,
-    maxVisiblePages: 20,
-    itemsPerPage: 10,
+    totalRepos: 100,
+    maxVisiblePages: 1,
+    itemsPerPage: 100,
     currentPage: 1
   };
+  $scope.allRepos = [];
+  $scope.stackVersions = [];
 
-  $scope.tableInfo = {
-    total: 0,
-    showed: 0,
-    filtered: 0
-  };
-
-  $scope.stacks = [];
-  $scope.dropDownClusters = [];
-  $scope.selectedCluster = $scope.dropDownClusters[0];
-
-  $scope.resetPagination = function () {
-    $scope.pagination.currentPage = 1;
-    $scope.loadAllData();
-  };
-
-  $scope.pageChanged = function () {
-    $scope.loadAllData();
-  };
-
-  $scope.goToCluster = function() {
-    window.location.replace('/#/main/admin/stack/versions');
-  };
-
-  $scope.clearFilters = function () {
-    $scope.filter.version = '';
-    $scope.filter.cluster.current = $scope.filter.cluster.options[0];
-    $scope.resetPagination();
-  };
-
-  $scope.fetchRepoClusterStatus = function () {
-    var clusterName = ($scope.clusters && $scope.clusters.length > 0) ? $scope.clusters[0].Clusters.cluster_name : null; // only support one cluster at the moment
-    if (clusterName) {
-      angular.forEach($scope.repos, function (repo) {
-        Cluster.getRepoVersionStatus(clusterName, repo.id).then(function (response) {
-          repo.status = response.status;
-          repo.totalHosts = response.totalHosts;
-          repo.currentHosts = response.currentHosts;
-          repo.installedHosts = response.installedHosts;
-          repo.stackVersionId = response.stackVersionId;
-          repo.cluster = (repo.status == 'current' || repo.status == 'installed')? clusterName : '';
-        });
-      });
-    }
-  };
-
+  /**
+   *  Formatted object to display all repos:
+   *
+   *  [{ 'name': 'HDP-2.3',
+   *     'repos': ['2.3.6.0-2343', '2.3.4.1', '2.3.4.0-56']
+   *   },
+   *   { 'name': 'HDP-2.2',
+   *     'repos': ['2.2.6.0', '2.2.4.5', '2.2.4.0']
+   *   }
+   *  ]
+   *
+   */
   $scope.fetchRepos = function () {
     return Stack.allRepos($scope.filter, $scope.pagination).then(function (repos) {
-      $scope.pagination.totalRepos = repos.itemTotal;
-      $scope.repos = repos.items;
-      $scope.tableInfo.total = repos.itemTotal;
-      $scope.tableInfo.showed = repos.showed;
-    });
-  };
-
-    $scope.fillClusters = function (clusters) {
-      $scope.dropDownClusters = [].concat(clusters);
-      var options = [{label: $t('common.all'), value: ''}];
-      angular.forEach(clusters, function (cluster) {
-        options.push({
-          label: cluster.Clusters.cluster_name,
-          value: cluster.Clusters.cluster_name
-        });
+      $scope.allRepos = repos.items.sort(function(a, b){return a.repository_version < b.repository_version});
+      var existingStackHash = {};
+      var stackVersions = [];
+      angular.forEach($scope.allRepos, function (repo) {
+        var stackVersionName = repo.stack_name + '-' + repo.stack_version;
+        if (!existingStackHash[stackVersionName]) {
+          existingStackHash[stackVersionName] = true;
+          stackVersions.push({
+            'name': stackVersionName,
+            'isOpened': true,
+            'repos': [repo]
+          });
+        } else {
+          if (stackVersions[stackVersions.length -1].repos) {
+            stackVersions[stackVersions.length -1].repos.push(repo);
+          }
+        }
       });
-      $scope.filter.cluster.options = options;
-      if (!$scope.filter.cluster.current) {
-        $scope.filter.cluster.current = options[0];
-      }
-    };
-
-  $scope.fetchClusters = function () {
-    return Cluster.getAllClusters().then(function (clusters) {
-      if (clusters && clusters.length > 0) {
-        $scope.clusters = clusters;
-        $scope.fillClusters(clusters);
-      }
-    });
-  };
-
-  $scope.loadAllData = function () {
-    $scope.fetchClusters()
-    .then(function () {
-      return $scope.fetchRepos();
-    })
-    .then(function () {
-      $scope.fetchRepoClusterStatus();
+      $scope.stackVersions = stackVersions;
     });
   };
 
-  $scope.loadAllData();
+  $scope.fetchRepos();
 
-  $scope.$watch('filter', function (filter) {
-    $scope.isNotEmptyFilter = Boolean(filter.version || (filter.cluster.current && filter.cluster.current.value));
-  }, true);
 }]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f9da428/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
index 9f6add0..afc2f44 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
@@ -306,6 +306,7 @@ angular.module('ambariAdminConsole')
       'os': 'OS',
       'baseURL': 'Base URL',
       'skipValidation': 'Skip Repository Base URL validation (Advanced)',
+      'noVersions': 'Select version to display details.',
       'contents': {
         'title': 'Contents',
         'empty': 'No contents to display'

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f9da428/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
index a12b430..20781b6 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
@@ -157,14 +157,27 @@ angular.module('ambariAdminConsole')
         var response = {
           id : data.repository_versions[0].RepositoryVersions.id,
           stackVersion : data.Versions.stack_version,
-          stack: data.Versions.stack_name + '-' + data.Versions.stack_version,
           stackName: data.Versions.stack_name,
-          versionName: data.repository_versions[0].RepositoryVersions.repository_version,
-          displayName : data.repository_versions[0].RepositoryVersions.display_name,
+          type: data.repository_versions[0].RepositoryVersions.release? data.repository_versions[0].RepositoryVersions.release.type: null,
+          stackNameVersion: data.Versions.stack_name + '-' + data.Versions.stack_version, /// HDP-2.3
+          actualVersion: data.repository_versions[0].RepositoryVersions.repository_version, /// 2.3.4.0-3846
+          version: data.repository_versions[0].RepositoryVersions.release ? data.repository_versions[0].RepositoryVersions.release.version: null, /// 2.3.4.0
+          releaseNotes: data.repository_versions[0].RepositoryVersions.release ? data.repository_versions[0].RepositoryVersions.release.release_notes: null,
+          displayName: data.repository_versions[0].RepositoryVersions.release ? data.Versions.stack_name + '-' + data.repository_versions[0].RepositoryVersions.release.version :
+            data.Versions.stack_name + '-' + data.repository_versions[0].RepositoryVersions.repository_version.split('-')[0], //HDP-2.3.4.0
           repoVersionFullName : data.Versions.stack_name + '-' + data.repository_versions[0].RepositoryVersions.repository_version,
           osList: data.repository_versions[0].operating_systems,
           updateObj: data.repository_versions[0]
         };
+        var services = [];
+        angular.forEach(data.repository_versions[0].RepositoryVersions.services, function (service) {
+          services.push({
+            name: service.name,
+            version: service.versions[0].version,
+            components: service.versions[0].components
+          });
+        });
+        response.services = services;
         deferred.resolve(response);
       })
       .error(function (data) {
@@ -286,12 +299,13 @@ angular.module('ambariAdminConsole')
             id : data.repository_versions[0].RepositoryVersions.id,
             stackVersion : data.Versions.stack_version,
             stackName: data.Versions.stack_name,
-            type: data.repository_versions[0].RepositoryVersions.release.type,
+            type: data.repository_versions[0].RepositoryVersions.type,
             stackNameVersion: data.Versions.stack_name + '-' + data.Versions.stack_version, /// HDP-2.3
             actualVersion: data.repository_versions[0].RepositoryVersions.repository_version, /// 2.3.4.0-3846
-            version: data.repository_versions[0].RepositoryVersions.release.version, /// 2.3.4.0
-            releaseNotes: data.repository_versions[0].RepositoryVersions.release.release_notes,
-            displayName: data.Versions.stack_name + '-' + data.repository_versions[0].RepositoryVersions.release.version, //HDP-2.3.4.0
+            version: data.repository_versions[0].RepositoryVersions.release ? data.repository_versions[0].RepositoryVersions.release.version: null, /// 2.3.4.0
+            releaseNotes: data.repository_versions[0].RepositoryVersions.release ? data.repository_versions[0].RepositoryVersions.release.release_notes: null,
+            displayName: data.repository_versions[0].RepositoryVersions.release ? data.Versions.stack_name + '-' + data.repository_versions[0].RepositoryVersions.release.version :
+              data.Versions.stack_name + '-' + data.repository_versions[0].RepositoryVersions.repository_version.split('-')[0], //HDP-2.3.4.0
             repoVersionFullName : data.Versions.stack_name + '-' + data.repository_versions[0].RepositoryVersions.repository_version,
             osList: data.repository_versions[0].operating_systems,
             updateObj: data.repository_versions[0]
@@ -299,7 +313,7 @@ angular.module('ambariAdminConsole')
           var services = [];
           angular.forEach(data.repository_versions[0].RepositoryVersions.services, function (service) {
             services.push({
-              name: service.name,
+              name: service.display_name,
               version: service.versions[0].version,
               components: service.versions[0].components
             });

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f9da428/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
index 83d4ffa..93f2271 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
@@ -1378,11 +1378,57 @@ thead.view-permission-header > tr > th {
 }
 
 .enable-ldap input[type="checkbox"] {
-  margin-top: 10px;
+    margin-top: 10px;
 }
 
 .test-ldap-icon.ng-hide-add-active, .test-ldap-icon.ng-hide-remove {
-  display: inline-block!important;
+    display: inline-block!important;
+}
+
+.left-menu-all-repos {
+  padding-left: 5px;
+  padding-right: 5px;
+}
+
+.left-menu-all-repos .glyphicon.glyphicon-chevron-right{
+  -webkit-transition: all 0.3s;
+  -o-transition: all 0.3s;
+  transition: all 0.3s;
+}
+.left-menu-all-repos .glyphicon.glyphicon-chevron-right.opened{
+  -webkit-transform: rotateZ(90deg);
+  -ms-transform: rotateZ(90deg);
+  -o-transform: rotateZ(90deg);
+  transform: rotateZ(90deg);
+}
+
+.left-menu-all-repos .stack-version-title {
+  font-size: 14px;
+  cursor: pointer;
+  text-decoration: none;
+  padding-left: 10px;
+}
+
+.left-menu-all-repos .repos-table {
+  margin-bottom: 0px;
+}
+
+.left-menu-all-repos .panel-body {
+  padding: 15px 0px;
+}
+
+.left-menu-all-repos .repos-table .repos-td{
+  border-top: none;
+  padding: 5px 10px;
+}
+.left-menu-all-repos .repos-table .repos-td > a {
+  text-decoration: none;
+}
+.left-menu-all-repos .repos-table .repos-td.active{
+  background-color: #666;;
+}
+.left-menu-all-repos .repos-table .repos-td.active > a {
+  color: white;
 }
 
 .register-version-options .read-info-button {
@@ -1398,11 +1444,24 @@ thead.view-permission-header > tr > th {
   padding-bottom: 20px;
 }
 
-.register-version-form .patch-icon {
+.register-version-form .details-panel .patch-icon {
   color: #ff4500;
 }
+.register-version-form .deregister-button {
+    margin-top: -23px;
+}
+.register-version-form .version-info {
+    padding-top: 7px;
+    margin-top: 0;
+    margin-bottom: 0;
+}
+
+.register-version-form .contents-panel .version-contents-body {
+    max-height: 150px;
+    overflow: scroll;
+}
 
-.register-version-form .remove-icon {
+.register-version-form .repos-panel .remove-icon {
   color: red;
   margin: 20px 0px;
   padding: 0px;
@@ -1410,14 +1469,13 @@ thead.view-permission-header > tr > th {
   cursor: pointer;
 }
 
-.register-version-form .version-info {
-  padding-top: 7px;
-  margin-top: 0;
-  margin-bottom: 0;
+.register-version-form .repos-panel .os-type-label {
+  margin-top: 27px;;
 }
 
-.version-contents-body {
-  max-height: 150px;
-  overflow: scroll;
+#stack-versions .no-version-alert {
+  text-align: center;
 }
 
+
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f9da428/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
index 5f5421b..3de92c1 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/list.html
@@ -29,85 +29,34 @@
     </div>
   </div>
   <hr/>
-  <table class="table table-striped table-hover">
-    <thead>
-    <tr>
-      <th class="col-medium">
-        <label>{{'common.name' | translate}}</label>
-        <input type="text" class="form-control" ng-change="resetPagination()" ng-model="filter.version" placeholder="{{'common.any' | translate}}">
-      </th>
-      <th class="col-small">
-        <label>{{'common.cluster' | translate}}</label>
-        <select class="form-control"
-                ng-change="resetPagination()"
-                ng-model="filter.cluster.current"
-                ng-options="item.label for item in filter.cluster.options track by item.value"
-          ></select>
-      </th>
-      <th></th>
-    </tr>
-    </thead>
-    <tbody>
-    <tr ng-repeat="repo in repos">
-      <td class="col-medium">
-        <a href="#/stackVersions/{{repo.stack_name}}/{{repo.repository_version}}/edit">{{repo.display_name}}</a>
-      </td>
-      <td class="col-small">
-        <a href="/#/main/admin/stack/versions" ng-show="repo.cluster">
-          {{repo.cluster}}
-        </a>
-        <span ng-show="!repo.cluster">
-          {{'common.none' | translate}}
-        </span>
-      </td>
-      <td class="verison-label-row">
-        <div ng-show="repo.status == 'current'">
-          <span class="label {{'status-' + repo.status}}">{{'versions.current' | translate}}:&nbsp;{{repo.currentHosts}}/{{repo.totalHosts}}</span>
-        </div>
-        <div ng-show="repo.status == 'installed'">
-          <span class="label {{'status-' + repo.status}}">{{'versions.installed' | translate}}:&nbsp;{{repo.installedHosts}}/{{repo.totalHosts}}</span>
-        </div>
-        <div ng-show="!repo.cluster">
-          <div class="btn-group display-inline-block" dropdown is-open="viewsdropdown.isopen" ng-mouseover="viewsdropdown.isopen=true" ng-mouseout="viewsdropdown.isopen=false" ng-init="viewsdropdown.isopen=false">
-            <a class="btn dropdown-toggle">
-              <span>{{'versions.installOn' | translate}}</span>
-            </a>
-            <ul class="dropdown-menu" ng-show="viewsdropdown.isopen">
-              <li ng-repeat="cluster in dropDownClusters">
-                <a href="javascript:void(null)" ng-click="goToCluster()">
-                    <span>{{cluster.Clusters.cluster_name}}</span>
-                </a>
-              </li>
-            </ul>
-          </div>
+
+  <accordion close-others="false" class="col-sm-2 left-menu-all-repos">
+    <accordion-group ng-repeat="stackVersion in stackVersions" is-open="stackVersion.isOpened">
+      <accordion-heading>
+        <div class="row stack-version-title">
+          <i class="glyphicon glyphicon-chevron-right" ng-class="{'opened': stackVersion.isOpened}"></i>
+          {{stackVersion.name}}
         </div>
-      </td>
-    </tr>
-    </tbody>
-  </table>
-  <div class="alert alert-info col-sm-12" ng-show="!repos.length">
-    {{'common.alerts.nothingToDisplay' | translate: '{term: getConstant("version")}'}}
-  </div>
-  <div class="col-sm-12 table-bar">
-    <div class="pull-left filtered-info">
-      <span>{{'common.filterInfo' | translate: '{showed: tableInfo.showed, total: tableInfo.total, term: getConstant("versions")}'}}</span>
-      <span ng-show="isNotEmptyFilter">- <a href ng-click="clearFilters()">{{'common.controls.clearFilters' | translate}}</a></span>
+      </accordion-heading>
+      <table class="table repos-table">
+        <tbody>
+        <tr ng-repeat="repo in stackVersion.repos">
+          <td class="repos-td">
+            <a href="#/stackVersions/{{repo.stack_name}}/{{repo.repository_version}}/edit">{{repo.repository_version}}</a>
+          </td>
+        </tr>
+        </tbody>
+        </table>
+    </accordion-group>
+    <div class="alert alert-info" ng-show="stackVersions && !stackVersions.length">
+      {{'versions.contents.empty' | translate}}
     </div>
-    <div class="pull-right left-margin">
-      <pagination class="paginator"
-                  total-items="pagination.totalRepos"
-                  max-size="pagination.maxVisiblePages"
-                  items-per-page="pagination.itemsPerPage"
-                  ng-model="pagination.currentPage"
-                  ng-change="pageChanged()"
-        ></pagination>
-    </div>
-    <div class="pull-right">
-      <select class="form-control"
-              ng-model="pagination.itemsPerPage"
-              ng-options="item for item in [10, 25, 50, 100]"
-              ng-change="resetPagination()"
-        ></select>
+  </accordion>
+
+  <form class="col-sm-10 form-horizontal" role="form"novalidate>
+    <div class="alert alert-info no-version-alert">
+      {{'versions.noVersions' | translate}}
     </div>
-  </div>
+  </form>
+
 </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f9da428/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
index 61d2d8d..1fad9a3 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
@@ -23,14 +23,15 @@
     <li class="active" ng-if="createController">{{'versions.register' | translate}}</li>
   </ol>
 
-  <div class="pull-right top-margin-4" ng-switch="deleteEnabled"  ng-if="editController">
-    <button ng-switch-when="false" class="btn disabled btn-default" tooltip="Cannot delete version already installed.">{{'versions.deregister' | translate}}</button>
-    <button ng-switch-when="true" class="btn btn-danger" ng-click="delete()">{{'versions.deregister' | translate}}</button>
+  <div class="pull-right top-margin-4">
+    <a href="#/stackVersions/create" class="btn btn-primary">
+      <span class="glyphicon glyphicon-plus"></span>
+        {{'versions.register' | translate}}
+    </a>
   </div>
 </div>
 <hr>
 
-
 <div id="upload-definition-file-panel" ng-if="createController">
   <div class="clearfix register-version-options">
     <div class="col-sm-5 option-radio-button">
@@ -60,10 +61,37 @@
   </div>
 </div>
 
-<form class="form-horizontal register-version-form" role="form" name="repoRegForm" novalidate>
-  <div class="panel panel-default">
+<accordion close-others="false" class="col-sm-2 left-menu-all-repos" ng-if="editController">
+  <accordion-group ng-repeat="stackVersion in stackVersions" is-open="stackVersion.isOpened">
+    <accordion-heading>
+      <div class="row stack-version-title">
+        <i class="glyphicon glyphicon-chevron-right" ng-class="{'opened': stackVersion.isOpened}"></i>
+          {{stackVersion.name}}
+      </div>
+    </accordion-heading>
+    <table class="table repos-table">
+      <tbody>
+      <tr ng-repeat="repo in stackVersion.repos">
+        <td class="repos-td" ng-class="{'active': repo.isActive}">
+            <a href="#/stackVersions/{{repo.stack_name}}/{{repo.repository_version}}/edit">{{repo.repository_version}}</a>
+        </td>
+      </tr>
+      </tbody>
+    </table>
+  </accordion-group>
+  <div class="alert alert-info" ng-show="stackVersions && !stackVersions.length">
+    {{'versions.contents.empty' | translate}}
+  </div>
+</accordion>
+
+<form ng-class="{'col-sm-10': editController}" class="form-horizontal register-version-form" role="form" name="repoRegForm" novalidate>
+  <div class="panel panel-default details-panel">
     <div class="panel-heading">
       <h3 class="panel-title">{{'common.details' | translate}}</h3>
+        <div class="pull-right deregister-button" ng-switch="deleteEnabled"  ng-if="editController">
+            <button ng-switch-when="false" class="btn disabled btn-default" tooltip="Cannot delete version already installed.">{{'versions.deregister' | translate}}</button>
+            <button ng-switch-when="true" class="btn btn-danger" ng-click="delete()">{{'versions.deregister' | translate}}</button>
+        </div>
     </div>
     <div class="panel-body">
       <div class="clearfix">
@@ -85,7 +113,7 @@
       </div>
     </div>
   </div>
-  <div class="panel panel-default">
+  <div class="panel panel-default contents-panel">
     <div class="panel-heading">
       <h3 class="panel-title">{{'versions.contents.title' | translate}}</h3>
     </div>
@@ -97,7 +125,7 @@
       </div>
     </div>
   </div>
-  <div class="panel panel-default">
+  <div class="panel panel-default repos-panel">
     <div class="panel-heading">
       <h3 class="panel-title">{{'versions.repos' | translate}}</h3>
     </div>
@@ -114,10 +142,8 @@
         <div ng-if="os.selected==true">
           <div class="clearfix border-bottom bottom-margin">
             <!-- show selected os in list table-->
-            <div class="col-sm-2">
-              <div class="">
-                <label>{{os.OperatingSystems.os_type}}</label>
-              </div>
+            <div class="col-sm-2 os-type-label">
+              <label>{{os.OperatingSystems.os_type}}</label>
             </div>
             <div class="col-sm-9">
               <div class="form-group {{repository.Repositories.repo_name}}" ng-class="{'has-error': repository.hasError }" ng-repeat="repository in os.repositories">

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f9da428/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/stackVersions/StackversionsListCtrl_test.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/stackVersions/StackversionsListCtrl_test.js b/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/stackVersions/StackversionsListCtrl_test.js
index 1e47c20..6f168db 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/stackVersions/StackversionsListCtrl_test.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/stackVersions/StackversionsListCtrl_test.js
@@ -40,157 +40,5 @@ describe('#Cluster', function () {
 
     });
 
-    describe('#fillClusters()', function () {
-
-      var clusters = [
-          {
-            Clusters: {
-              cluster_name: 'c0'
-            }
-          }
-        ],
-        cases = [
-          {
-            prev: null,
-            current: {
-              label: 'All',
-              value: ''
-            },
-            title: 'no cluster selected before'
-          },
-          {
-            prev: {
-              label: 'c0',
-              value: 'c0'
-            },
-            current: {
-              label: 'c0',
-              value: 'c0'
-            },
-            title: 'cluster was selected before'
-          }
-        ];
-
-      angular.forEach(cases, function (item) {
-        it(item.title, function() {
-          scope.filter.cluster.current = item.prev;
-          scope.fillClusters(clusters);
-          expect(scope.dropDownClusters).toEqual(clusters);
-          expect(scope.filter.cluster.current).toEqual(item.current);
-        });
-      });
-
-    });
-
-    describe('#isNotEmptyFilter', function () {
-
-      var cases = [
-        {
-          filter: {
-            version: '',
-            cluster: {
-              current: null
-            }
-          },
-          isNotEmptyFilter: false,
-          title: 'no filters'
-        },
-        {
-          filter: {
-            version: '',
-            cluster: {
-              current: {
-                value: ''
-              }
-            }
-          },
-          isNotEmptyFilter: false,
-          title: 'empty filters'
-        },
-        {
-          filter: {
-            version: 'a',
-            cluster: {
-              current: {
-                value: ''
-              }
-            }
-          },
-          isNotEmptyFilter: true,
-          title: 'version filter'
-        },
-        {
-          filter: {
-            version: '0',
-            cluster: {
-              current: {
-                value: ''
-              }
-            }
-          },
-          isNotEmptyFilter: true,
-          title: 'version filter with "0" as string'
-        },
-        {
-          filter: {
-            version: '',
-            cluster: {
-              current: {
-                value: 'a'
-              }
-            }
-          },
-          isNotEmptyFilter: true,
-          title: 'cluster filter'
-        },
-        {
-          filter: {
-            version: '',
-            cluster: {
-              current: {
-                value: '0'
-              }
-            }
-          },
-          isNotEmptyFilter: true,
-          title: 'cluster filter with "0" as string'
-        },
-        {
-          filter: {
-            version: 'a',
-            cluster: {
-              current: {
-                value: 'a'
-              }
-            }
-          },
-          isNotEmptyFilter: true,
-          title: 'both filters'
-        },
-        {
-          filter: {
-            version: '0',
-            cluster: {
-              current: {
-                value: '0'
-              }
-            }
-          },
-          isNotEmptyFilter: true,
-          title: 'both filters with "0" as string'
-        }
-      ];
-
-      cases.forEach(function (item) {
-        it(item.title, function () {
-          $httpBackend.expectGET(/\/api\/v1\/clusters\?_=\d+/).respond(200);
-          scope.filter = item.filter;
-          scope.$digest();
-          expect(scope.isNotEmptyFilter).toEqual(item.isNotEmptyFilter);
-        });
-      });
-
-    });
-
   });
 });


[2/4] ambari git commit: AMBARI-14797. Register Version: display loaded version definition info in different categories and Save them.(XIWANG)

Posted by xi...@apache.org.
AMBARI-14797. Register Version: display loaded version definition info in different categories and Save them.(XIWANG)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0b47564002b295efb6be1b41aa66381561dbe7e4
Parents: e4d03b5
Author: Xi Wang <xi...@apache.org>
Authored: Wed Feb 3 15:58:18 2016 -0800
Committer: Xi Wang <xi...@apache.org>
Committed: Wed Feb 3 16:02:48 2016 -0800

----------------------------------------------------------------------
 .../app/assets/data/version/version.json        |   3 +
 .../stackVersions/StackVersionsCreateCtrl.js    |  46 ++---
 .../ui/admin-web/app/scripts/i18n.config.js     |  12 +-
 .../ui/admin-web/app/scripts/services/Stack.js  | 170 ++++++++++++++++++-
 .../resources/ui/admin-web/app/styles/main.css  |  15 ++
 .../views/stackVersions/stackVersionPage.html   |  87 +++++-----
 6 files changed, 269 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0b475640/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json b/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json
index b5b3601..d6530e2 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json
@@ -26,6 +26,7 @@
             "services": [
               {
                 "name": "HDFS",
+                "display_name": "HDFS",
                 "versions": [
                   {
                     "version": "2.1.1",
@@ -36,6 +37,7 @@
               },
               {
                 "name": "HIVE",
+                "display_name": "Hive",
                 "versions": [
                   {
                     "version": "1.2.1"
@@ -44,6 +46,7 @@
               },
               {
                 "name": "ZOOKEEPER",
+                "display_name": "ZooKeeper",
                 "versions": [
                   {
                     "version": "3.4.5"

http://git-wip-us.apache.org/repos/asf/ambari/blob/0b475640/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
index 40aa103..81ad7f7 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
@@ -156,14 +156,14 @@ angular.module('ambariAdminConsole')
     index: 1,
     displayName: 'Upload Version Definition File',
     url: 'files://',
-    selected: true,
-    hasError: true
+    //selected: true,
+    hasError: false
   };
   $scope.option2 = {
     index: 2,
     displayName: 'Version Definition File URL',
     url: 'https://',
-    selected: false,
+    //selected: false,
     hasError: false
   };
   $scope.selectedOption = 1;
@@ -172,8 +172,8 @@ angular.module('ambariAdminConsole')
    * User can select ONLY one option to upload version definition file
    */
   $scope.toggleOptionSelect = function () {
-    $scope.option1.selected = $scope.selectedOption == $scope.option1.index;
-    $scope.option2.selected = $scope.selectedOption == $scope.option2.index;
+    //$scope.option1.selected = $scope.selectedOption == $scope.option1.index;
+    //$scope.option2.selected = $scope.selectedOption == $scope.option2.index;
     $scope.option1.hasError = false;
     $scope.option2.hasError = false;
   };
@@ -215,11 +215,11 @@ angular.module('ambariAdminConsole')
     return Stack.getLatestRepo('HDP').then(function (response) {
       $scope.id = response.id;
       $scope.isPatch = response.type == 'PATCH';
-      $scope.stackNameVersion = response.stackNameVersion;
-      $scope.displayName = response.displayName;
-      $scope.version = response.version;
-      $scope.actualVersion = response.actualVersion;
-      $scope.services = response.services;
+      $scope.stackNameVersion = response.stackNameVersion || 'n/a';
+      $scope.displayName = response.displayName || 'n/a';
+      $scope.version = response.version || 'n/a';
+      $scope.actualVersion = response.actualVersion || 'n/a';
+      $scope.services = response.services || [];
       //save default values of repos to check if they were changed
       $scope.defaulfOSRepos = {};
       response.updateObj.operating_systems.forEach(function(os) {
@@ -236,19 +236,19 @@ angular.module('ambariAdminConsole')
       $scope.osList = response.osList;
       // if user reach here from UI click, repo status should be cached
       // otherwise re-fetch repo status from cluster end point.
-      $scope.repoStatus = Cluster.repoStatusCache[$scope.id];
-      if (!$scope.repoStatus) {
-        $scope.fetchClusters()
-          .then(function () {
-            return $scope.fetchRepoClusterStatus();
-          })
-          .then(function () {
-            $scope.deleteEnabled = $scope.isDeletable();
-          });
-      } else {
-        $scope.deleteEnabled = $scope.isDeletable();
-      }
-      $scope.addMissingOSList();
+//      $scope.repoStatus = Cluster.repoStatusCache[$scope.id];
+//      if (!$scope.repoStatus) {
+//        $scope.fetchClusters()
+//          .then(function () {
+//            return $scope.fetchRepoClusterStatus();
+//          })
+//          .then(function () {
+//            $scope.deleteEnabled = $scope.isDeletable();
+//          });
+//      } else {
+//        $scope.deleteEnabled = $scope.isDeletable();
+//      }
+      //$scope.addMissingOSList();
     });
   };
 }]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/0b475640/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
index 21622b5..ed42b45 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
@@ -306,7 +306,17 @@ angular.module('ambariAdminConsole')
       'os': 'OS',
       'baseURL': 'Base URL',
       'skipValidation': 'Skip Repository Base URL validation (Advanced)',
-
+      'contents': {
+        'title': 'Contents',
+        'empty': 'No contents to display'
+      },
+      'details': {
+        'stackName': 'Stack Name',
+        'displayName': 'Display Name',
+        'version': 'Version',
+        'actualVersion': 'Actual Version',
+        'releaseNotes': 'Release Notes'
+      },
       'changeBaseURLConfirmation': {
         'title': 'Confirm Base URL Change',
         'message': 'You are about to change repository Base URLs that are already in use. Please confirm that you intend to make this change and that the new Base URLs point to the same exact Stack version and build'

http://git-wip-us.apache.org/repos/asf/ambari/blob/0b475640/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
index a28943c..aa81b5d 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
@@ -176,11 +176,176 @@ angular.module('ambariAdminConsole')
     getLatestRepo: function (stack_name) {
       var url = Settings.baseUrl + '/stacks/' + stack_name + '/versions?' +
         'fields=repository_versions/operating_systems/repositories/*' +
-        ',repository_versions/RepositoryVersions/*';
+        ',repository_versions/RepositoryVersions/*';  // tbd
       var deferred = $q.defer();
       $http.get(url, {mock: 'version/version.json'})
         .success(function (data) {
-          data = data.items[0];
+          //data = data.items[0];
+          data = {
+            "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2",
+            "Versions" : {
+              "stack_name" : "HDP",
+              "stack_version" : "2.2"
+            },
+            "repository_versions" : [
+              {
+                "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15",
+                "RepositoryVersions" : {
+                  "id" : 15,
+                  "repository_version" : "2.2.0.1-901",
+                  "stack_name" : "HDP",
+                  "stack_version" : "2.2",
+                  "release": {
+                    "type": "PATCH",
+                    "stack_id": "HDP-2.2",
+                    "version": "2.2.0.1",
+                    "build": "901",
+                    "compatible_with": "2.2.0.1-[1-9]",
+                    "release_notes": "http://someurl"
+                  },
+                  "services": [
+                    {
+                      "name": "HDFS",
+                      "display_name": "HDFS",
+                      "versions": [
+                        {
+                          "version": "2.1.1",
+                          "version_id": "10",
+                          "components": [ "NAMENODE"]
+                        }
+                      ]
+                    },
+                    {
+                      "name": "HIVE",
+                      "display_name": "Hive",
+                      "versions": [
+                        {
+                          "version": "1.2.1"
+                        }
+                      ]
+                    },
+                    {
+                      "name": "ZOOKEEPER",
+                      "display_name": "ZooKeeper",
+                      "versions": [
+                        {
+                          "version": "3.4.5"
+                        }
+                      ]
+                    },
+                    {
+                      "name": "YARN",
+                      "versions": [
+                        {
+                          "version": "2.7.1"
+                        }
+                      ]
+                    },
+                    {
+                      "name": "SPARK",
+                      "versions": [
+                        {
+                          "version": "1.4.1"
+                        }
+                      ]
+                    },
+                    {
+                      "name": "SPARK",
+                      "versions": [
+                        {
+                          "version": "1.5.2"
+                        }
+                      ]
+                    }
+                  ]
+                },
+                "operating_systems" : [
+                  {
+                    "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat5",
+                    "OperatingSystems" : {
+                      "os_type" : "redhat5",
+                      "repository_version_id" : 15,
+                      "stack_name" : "HDP",
+                      "stack_version" : "2.2"
+                    },
+                    "repositories" : [
+                      {
+                        "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat5/repositories/HDP-2.2.0.1-901",
+                        "Repositories" : {
+                          "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
+                          "default_base_url" : "",
+                          "latest_base_url" : "",
+                          "mirrors_list" : "",
+                          "os_type" : "redhat5",
+                          "repo_id" : "HDP-2.2.0.1-901",
+                          "repo_name" : "HDP",
+                          "repository_version_id" : 15,
+                          "stack_name" : "HDP",
+                          "stack_version" : "2.2"
+                        }
+                      },
+                      {
+                        "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat5/repositories/HDP-UTILS-2.2.0.1-901",
+                        "Repositories" : {
+                          "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
+                          "default_base_url" : "",
+                          "latest_base_url" : "",
+                          "mirrors_list" : "",
+                          "os_type" : "redhat5",
+                          "repo_id" : "HDP-UTILS-2.2.0.1-901",
+                          "repo_name" : "HDP-UTILS",
+                          "repository_version_id" : 15,
+                          "stack_name" : "HDP",
+                          "stack_version" : "2.2"
+                        }
+                      }
+                    ]
+                  },
+                  {
+                    "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat6",
+                    "OperatingSystems" : {
+                      "os_type" : "redhat6",
+                      "repository_version_id" : 15,
+                      "stack_name" : "HDP",
+                      "stack_version" : "2.2"
+                    },
+                    "repositories" : [
+                      {
+                        "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat6/repositories/HDP-2.2.0.1-901",
+                        "Repositories" : {
+                          "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
+                          "default_base_url" : "",
+                          "latest_base_url" : "",
+                          "mirrors_list" : "",
+                          "os_type" : "redhat6",
+                          "repo_id" : "HDP-2.2.0.1-901",
+                          "repo_name" : "HDP",
+                          "repository_version_id" : 15,
+                          "stack_name" : "HDP",
+                          "stack_version" : "2.2"
+                        }
+                      },
+                      {
+                        "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat6/repositories/HDP-UTILS-2.2.0.1-901",
+                        "Repositories" : {
+                          "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
+                          "default_base_url" : "",
+                          "latest_base_url" : "",
+                          "mirrors_list" : "",
+                          "os_type" : "redhat6",
+                          "repo_id" : "HDP-UTILS-2.2.0.1-901",
+                          "repo_name" : "HDP-UTILS",
+                          "repository_version_id" : 15,
+                          "stack_name" : "HDP",
+                          "stack_version" : "2.2"
+                        }
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          };
           var response = {
             id : data.repository_versions[0].RepositoryVersions.id,
             stackVersion : data.Versions.stack_version,
@@ -189,6 +354,7 @@ angular.module('ambariAdminConsole')
             stackNameVersion: data.Versions.stack_name + '-' + data.Versions.stack_version, /// HDP-2.3
             actualVersion: data.repository_versions[0].RepositoryVersions.repository_version, /// 2.3.4.0-3846
             version: data.repository_versions[0].RepositoryVersions.release.version, /// 2.3.4.0
+            releaseNotes: data.repository_versions[0].RepositoryVersions.release.release_notes,
             displayName: data.Versions.stack_name + '-' + data.repository_versions[0].RepositoryVersions.release.version, //HDP-2.3.4.0
             repoVersionFullName : data.Versions.stack_name + '-' + data.repository_versions[0].RepositoryVersions.repository_version,
             osList: data.repository_versions[0].operating_systems,

http://git-wip-us.apache.org/repos/asf/ambari/blob/0b475640/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
index de3d526..8385e48 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
@@ -1398,3 +1398,18 @@ thead.view-permission-header > tr > th {
   padding-bottom: 20px;
 }
 
+.register-version-form .patch-icon {
+  color: #ff4500;
+}
+
+.register-version-form .version-info {
+  padding-top: 7px;
+  margin-top: 0;
+  margin-bottom: 0;
+}
+
+.version-contents-body {
+  max-height: 150px;
+  overflow: scroll;
+}
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/0b475640/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
index e23aecb..488f077 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
@@ -31,58 +31,69 @@
 <hr>
 
 
-
-<div class="clearfix register-version-options">
-  <div class="col-sm-5 option-radio-button">
-    <label class="option-label">
-      <input type="radio" ng-model="selectedOption" value="{{option1.index}}" ng-change="toggleOptionSelect()"> {{'versions.uploadFile' | translate}}
-    </label>
-  </div>
-  <div class="col-sm-7">
-    <input type="file" class="choose-file-input" ng-file-select="onFileSelect($files)"/>
-  </div>
-</div>
-<div class="clearfix register-version-options border-bottom bottom-margin">
-  <div class="col-sm-5 option-radio-button">
-    <label class="option-label">
-      <input type="radio" ng-model="selectedOption" value="{{option2.index}}" ng-change="toggleOptionSelect()"> {{'versions.enterURL' | translate}}
-    </label>
+<div id="upload-definition-file-panel" ng-if="createController">
+  <div class="clearfix register-version-options">
+    <div class="col-sm-5 option-radio-button">
+      <label class="option-label">
+        <input type="radio" ng-model="selectedOption" value="{{option1.index}}" ng-change="toggleOptionSelect()"> {{'versions.uploadFile' | translate}}
+      </label>
+    </div>
+    <div class="col-sm-7">
+      <input type="file" class="choose-file-input" ng-file-select="onFileSelect($files)"/>
+    </div>
   </div>
+  <div class="clearfix register-version-options border-bottom bottom-margin">
+    <div class="col-sm-5 option-radio-button">
+      <label class="option-label">
+        <input type="radio" ng-model="selectedOption" value="{{option2.index}}" ng-change="toggleOptionSelect()"> {{'versions.enterURL' | translate}}
+      </label>
+    </div>
     <div class="col-sm-7">
       <div class="form-group {{option2.name}}" ng-class="{'has-error': option2.url.hasError }">
-        <div class=""><input type="text" class="form-control" ng-model="option2.url" ng-change="clearOptionsError()" ng-disabled="!option2.selected"></div>
+        <div class=""><input type="text" class="form-control" ng-model="option2.url" ng-change="clearOptionsError()" ng-disabled="!(selectedOption==2)"></div>
       </div>
     </div>
     <div class="col-sm-12 read-info-button">
-    <button class="btn btn-primary pull-right" ng-click="readVersionInfo()"
-        ng-disabled="readInfoButtonDisabled()">{{'versions.readInfo' | translate}}</button>
+      <button class="btn btn-primary pull-right" ng-click="readVersionInfo()"
+            ng-disabled="readInfoButtonDisabled()">{{'versions.readInfo' | translate}}</button>
     </div>
+  </div>
 </div>
 
-
 <form class="form-horizontal register-version-form" role="form" name="repoRegForm" novalidate>
-  <div class="panel panel-default" ng-if="createController">
+  <div class="panel panel-default">
     <div class="panel-heading">
       <h3 class="panel-title">{{'common.details' | translate}}</h3>
     </div>
     <div class="panel-body">
-      <div class="form-inline repo-version-inline">
-        <label class="control-label col-sm-2 repo-version-label">{{'common.name' | translate}}</label>
-        <div class="col-sm-10">
-          <select class="form-control repo-version-select"
-                  ng-model="$parent.upgradeStack.selected"
-                  ng-options="o as o.displayName for o in upgradeStack.options"
-                  ng-change="afterStackVersionChange()">
-          </select>
-          <span class="bold-dot">.</span>
-          <div class="form-group" ng-class="{'has-error' : repoRegForm.version.$error.pattern}">
-            <input class="form-control" name="version" type="text" ng-model="$parent.repoSubversion" ng-pattern="subversionPattern"
-                   placeholder="{{'versions.placeholder' | translate}}" ng-change="updateCurrentVersionInput()" required/>
-            <span class="text-danger" ng-show="repoRegForm.version.$error.pattern">
-              &nbsp{{'common.alerts.isInvalid' | translate: '{term: currentVersionInput}'}}
-            </span>
-          </div>
-        </div>
+      <div class="clearfix">
+        <label class="control-label col-sm-3">{{'versions.details.stackName' | translate}}</label>
+        <div class="version-info col-sm-7">{{stackNameVersion}}</div>
+        <div class="col-sm-2 patch-icon" ng-if="isPatch"><span class="glyphicon glyphicon-tree-deciduous">Patch</span></div>
+      </div>
+      <div class="clearfix">
+        <label class="control-label col-sm-3">{{'versions.details.displayName' | translate}}</label>
+        <div class="version-info col-sm-9">{{displayName}}</div>
+      </div>
+      <div class="clearfix">
+        <label class="control-label col-sm-3">{{'versions.details.version' | translate}}</label>
+        <div class="version-info col-sm-9">{{version}}</div>
+      </div>
+      <div class="clearfix">
+        <label class="control-label col-sm-3">{{'versions.details.actualVersion' | translate}}</label>
+        <div class="version-info col-sm-9">{{actualVersion}}</div>
+      </div>
+    </div>
+  </div>
+  <div class="panel panel-default">
+    <div class="panel-heading">
+      <h3 class="panel-title">{{'versions.contents.title' | translate}}</h3>
+    </div>
+    <div class="panel-body version-contents-body">
+      <div class="alert alert-info hide-soft" ng-class="{'visible' : !services || !services.length}" role="alert">{{'versions.contents.empty' | translate}}</div>
+      <div class="clearfix" ng-repeat="service in services">
+        <label class="control-label col-sm-3">{{service.name}}</label>
+        <div class="version-info col-sm-9">{{service.version}}</div>
       </div>
     </div>
   </div>


[3/4] ambari git commit: AMBARI-14834. Register Version: make the 'Repositories' category editable and addable.(XIWANG)

Posted by xi...@apache.org.
AMBARI-14834. Register Version: make the 'Repositories' category editable and addable.(XIWANG)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: efc3a07da28857221e21592a6b62210b41dffdbb
Parents: 0b47564
Author: Xi Wang <xi...@apache.org>
Authored: Wed Feb 3 16:07:04 2016 -0800
Committer: Xi Wang <xi...@apache.org>
Committed: Wed Feb 3 16:07:04 2016 -0800

----------------------------------------------------------------------
 .../app/assets/data/version/version.json        |  83 ++----
 .../stackVersions/StackVersionsCreateCtrl.js    | 281 +++++++++----------
 .../ui/admin-web/app/scripts/i18n.config.js     |   2 +-
 .../ui/admin-web/app/scripts/services/Stack.js  | 110 ++------
 .../resources/ui/admin-web/app/styles/main.css  |   8 +
 .../views/stackVersions/stackVersionPage.html   |  40 ++-
 6 files changed, 218 insertions(+), 306 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/efc3a07d/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json b/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json
index d6530e2..95c063a 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/assets/data/version/version.json
@@ -1,26 +1,26 @@
 {
-  "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions?fields=repository_versions/operatingSystems/repositories/*&repository_versions/RepositoryVersions/repository_version=2.2.0.1-901",
+  "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions?fields=repository_versions/operatingSystems/repositories/*&repository_versions/RepositoryVersions/repository_version=2.3.6.0-3509",
   "items" : [
     {
-      "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2",
+      "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.3",
       "Versions" : {
         "stack_name" : "HDP",
-        "stack_version" : "2.2"
+        "stack_version" : "2.3"
       },
       "repository_versions" : [
         {
-          "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15",
+          "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.3/repository_versions/15",
           "RepositoryVersions" : {
             "id" : 15,
-            "repository_version" : "2.2.0.1-901",
+            "repository_version" : "2.3.6.0-3509",
             "stack_name" : "HDP",
-            "stack_version" : "2.2",
+            "stack_version" : "2.3",
+            "type": "PATCH",
             "release": {
-              "type": "PATCH",
-              "stack_id": "HDP-2.2",
-              "version": "2.2.0.1",
-              "build": "901",
-              "compatible_with": "2.2.0.1-[1-9]",
+              "stack_id": "HDP-2.3",
+              "version": "2.3.6.0",
+              "build": "3509",
+              "compatible_with": "2.3.6.0-[1-9]",
               "release_notes": "http://someurl"
             },
             "services": [
@@ -57,83 +57,42 @@
           },
           "operating_systems" : [
             {
-              "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat5",
-              "OperatingSystems" : {
-                "os_type" : "redhat5",
-                "repository_version_id" : 15,
-                "stack_name" : "HDP",
-                "stack_version" : "2.2"
-              },
-              "repositories" : [
-                {
-                  "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat5/repositories/HDP-2.2.0.1-901",
-                  "Repositories" : {
-                    "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
-                    "default_base_url" : "",
-                    "latest_base_url" : "",
-                    "mirrors_list" : "",
-                    "os_type" : "redhat5",
-                    "repo_id" : "HDP-2.2.0.1-901",
-                    "repo_name" : "HDP",
-                    "repository_version_id" : 15,
-                    "stack_name" : "HDP",
-                    "stack_version" : "2.2"
-                  }
-                },
-                {
-                  "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat5/repositories/HDP-UTILS-2.2.0.1-901",
-                  "Repositories" : {
-                    "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
-                    "default_base_url" : "",
-                    "latest_base_url" : "",
-                    "mirrors_list" : "",
-                    "os_type" : "redhat5",
-                    "repo_id" : "HDP-UTILS-2.2.0.1-901",
-                    "repo_name" : "HDP-UTILS",
-                    "repository_version_id" : 15,
-                    "stack_name" : "HDP",
-                    "stack_version" : "2.2"
-                  }
-                }
-              ]
-            },
-            {
-              "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat6",
+              "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.3/repository_versions/15/operating_systems/redhat6",
               "OperatingSystems" : {
                 "os_type" : "redhat6",
                 "repository_version_id" : 15,
                 "stack_name" : "HDP",
-                "stack_version" : "2.2"
+                "stack_version" : "2.3"
               },
               "repositories" : [
                 {
-                  "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat6/repositories/HDP-2.2.0.1-901",
+                  "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.3/repository_versions/15/operating_systems/redhat6/repositories/HDP-2.3.6.0-3509",
                   "Repositories" : {
-                    "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
+                    "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos6/2.x/BUILDS/2.3.6.0-3509",
                     "default_base_url" : "",
                     "latest_base_url" : "",
                     "mirrors_list" : "",
                     "os_type" : "redhat6",
-                    "repo_id" : "HDP-2.2.0.1-901",
+                    "repo_id" : "HDP-2.3.6.0-3509",
                     "repo_name" : "HDP",
                     "repository_version_id" : 15,
                     "stack_name" : "HDP",
-                    "stack_version" : "2.2"
+                    "stack_version" : "2.3"
                   }
                 },
                 {
-                  "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat6/repositories/HDP-UTILS-2.2.0.1-901",
+                  "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.3/repository_versions/15/operating_systems/redhat6/repositories/HDP-UTILS-2.3.6.0-3509",
                   "Repositories" : {
-                    "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
+                    "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos6",
                     "default_base_url" : "",
                     "latest_base_url" : "",
                     "mirrors_list" : "",
                     "os_type" : "redhat6",
-                    "repo_id" : "HDP-UTILS-2.2.0.1-901",
+                    "repo_id" : "HDP-UTILS-2.3.6.0-3509",
                     "repo_name" : "HDP-UTILS",
                     "repository_version_id" : 15,
                     "stack_name" : "HDP",
-                    "stack_version" : "2.2"
+                    "stack_version" : "2.3"
                   }
                 }
               ]

http://git-wip-us.apache.org/repos/asf/ambari/blob/efc3a07d/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
index 81ad7f7..37f9c34 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
@@ -23,147 +23,26 @@ angular.module('ambariAdminConsole')
   $scope.createController = true;
   $scope.osList = [];
   $scope.skipValidation = false;
-  $scope.selectedOS = 0;
   $scope.repoSubversion = "";
 
   $scope.clusterName = $routeParams.clusterName;
   $scope.subversionPattern = /^\d+\.\d+(-\d+)?$/;
   $scope.upgradeStack = {
-    selected: null,
-    options: []
-  };
-  $scope.fetchStackVersionFilterList = function () {
-    return Stack.allStackVersions()
-    .then(function (allStackVersions) {
-      var versions = [];
-      angular.forEach(allStackVersions, function (version) {
-        if (version.upgrade_packs.length > 0 && version.active) {
-          versions.push(version);
-        }
-      });
-      $scope.upgradeStack.options = versions;
-      $scope.upgradeStack.selected = versions[versions.length - 1];
-      $scope.afterStackVersionChange();
-    })
-    .catch(function (data) {
-      Alert.error($t('versions.alerts.filterListError'), data.message);
-    });
-  };
-  $scope.fetchStackVersionFilterList();
-
-  $scope.save = function () {
-    return Stack.validateBaseUrls($scope.skipValidation, $scope.osList, $scope.upgradeStack.selected).then(function (invalidUrls) {
-      if (invalidUrls.length === 0) {
-        Stack.addRepo($scope.upgradeStack.selected, $scope.repoSubversion, $scope.osList)
-          .success(function () {
-            var versionName = $scope.upgradeStack.selected.stack_version + '.' + $scope.repoSubversion;
-            var stackName = $scope.upgradeStack.selected.stack_name;
-            Alert.success($t('versions.alerts.versionCreated'), {stackName: stackName, versionName: versionName});
-            $location.path('/stackVersions');
-          })
-          .error(function (data) {
-              Alert.error($t('versions.alerts.versionCreationError'), data.message);
-          });
-      } else {
-        Stack.highlightInvalidUrls(invalidUrls);
-      }
-    });
+    stack_name: '',
+    stack_version: '',
+    display_name: ''
   };
 
-  $scope.afterStackVersionChange = function () {
-    Stack.getSupportedOSList($scope.upgradeStack.selected.stack_name, $scope.upgradeStack.selected.stack_version)
-    .then(function (data) {
-      var operatingSystems = data.operating_systems;
-        $scope.osList = operatingSystems.map(function (os) {
-          os.selected = false;
-          os.repositories.forEach(function(repo) {
-            repo.Repositories.base_url = '';
-          });
-          return os;
-        });
-    })
-    .catch(function (data) {
-      Alert.error($t('versions.alerts.osListError'), data.message);
-    });
-  };
-
-  $scope.updateCurrentVersionInput = function () {
-    $scope.currentVersionInput = $scope.upgradeStack.selected.displayName + '.' + angular.element('[name="version"]')[0].value;
-  };
-
-  /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
-   */
-  $scope.clearErrors = function() {
-    if ($scope.osList) {
-      $scope.osList.forEach(function(os) {
-        if (os.repositories) {
-          os.repositories.forEach(function(repo) {
-            repo.hasError = false;
-          })
-        }
-      });
-    }
-  };
-  /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
-   */
-  $scope.clearError = function() {
-    this.repository.hasError = false;
-  };
-  /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
-   */
-  $scope.toggleOSSelect = function () {
-    this.os.repositories.forEach(function(repo) {
-      repo.hasError = false;
-    });
-    this.os.selected ? $scope.selectedOS++ : $scope.selectedOS--;
-  };
-  /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
-   */
-  $scope.hasValidationErrors = function() {
-    var hasErrors = false;
-    if ($scope.osList) {
-      $scope.osList.forEach(function(os) {
-        if (os.repositories) {
-          os.repositories.forEach(function(repo) {
-            if (repo.hasError) {
-              hasErrors = true;
-            }
-          })
-        }
-      });
-    }
-    return hasErrors;
-  };
-  /**
-   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
-   * move this method to it
-   */
-  $scope.cancel = function () {
-    $scope.editVersionDisabled = true;
-    $location.path('/stackVersions');
-  };
-
-  // two options to upload version definition file
   $scope.option1 = {
     index: 1,
     displayName: 'Upload Version Definition File',
     url: 'files://',
-    //selected: true,
     hasError: false
   };
   $scope.option2 = {
     index: 2,
     displayName: 'Version Definition File URL',
     url: 'https://',
-    //selected: false,
     hasError: false
   };
   $scope.selectedOption = 1;
@@ -172,8 +51,6 @@ angular.module('ambariAdminConsole')
    * User can select ONLY one option to upload version definition file
    */
   $scope.toggleOptionSelect = function () {
-    //$scope.option1.selected = $scope.selectedOption == $scope.option1.index;
-    //$scope.option2.selected = $scope.selectedOption == $scope.option2.index;
     $scope.option1.hasError = false;
     $scope.option2.hasError = false;
   };
@@ -219,6 +96,11 @@ angular.module('ambariAdminConsole')
       $scope.displayName = response.displayName || 'n/a';
       $scope.version = response.version || 'n/a';
       $scope.actualVersion = response.actualVersion || 'n/a';
+      $scope.upgradeStack = {
+        stack_name: response.stackName,
+        stack_version: response.stackVersion,
+        display_name: response.displayName
+      };
       $scope.services = response.services || [];
       //save default values of repos to check if they were changed
       $scope.defaulfOSRepos = {};
@@ -229,26 +111,141 @@ angular.module('ambariAdminConsole')
         };
       });
       $scope.repoVersionFullName = response.repoVersionFullName;
+      $scope.selectedOS = [];
       angular.forEach(response.osList, function (os) {
         os.selected = true;
+        $scope.selectedOS.push(os.OperatingSystems.os_type);
       });
-      $scope.selectedOS = response.osList.length;
       $scope.osList = response.osList;
-      // if user reach here from UI click, repo status should be cached
-      // otherwise re-fetch repo status from cluster end point.
-//      $scope.repoStatus = Cluster.repoStatusCache[$scope.id];
-//      if (!$scope.repoStatus) {
-//        $scope.fetchClusters()
-//          .then(function () {
-//            return $scope.fetchRepoClusterStatus();
-//          })
-//          .then(function () {
-//            $scope.deleteEnabled = $scope.isDeletable();
-//          });
-//      } else {
-//        $scope.deleteEnabled = $scope.isDeletable();
-//      }
-      //$scope.addMissingOSList();
+      // load supported os type base on stack version
+      $scope.afterStackVersionRead();
     });
   };
+
+  /**
+   * Load supported OS list
+   */
+  $scope.afterStackVersionRead = function () {
+    Stack.getSupportedOSList($scope.upgradeStack.stack_name, $scope.upgradeStack.stack_version)
+      .then(function (data) {
+        var operatingSystems = data.operating_systems;
+        operatingSystems.map(function (os) {
+          // os not in the list, mark as un-selected, add this to the osList
+          if ($scope.selectedOS.indexOf(os.OperatingSystems.os_type) < 0) {
+            os.selected = false;
+            os.repositories.forEach(function(repo) {
+              repo.Repositories.base_url = '';
+            });
+            $scope.osList.push(os);
+          }
+        });
+      })
+      .catch(function (data) {
+        Alert.error($t('versions.alerts.osListError'), data.message);
+      });
+  };
+
+  /**
+   * On click handler for removing OS
+   */
+  $scope.removeOS = function() {
+    this.os.selected = false;
+    if (this.os.repositories) {
+      this.os.repositories.forEach(function(repo) {
+        repo.hasError = false;
+      });
+    }
+  };
+  /**
+   * On click handler for adding new OS
+   */
+  $scope.addOS = function() {
+    this.os.selected = true;
+    if (this.os.repositories) {
+      this.os.repositories.forEach(function(repo) {
+        repo.hasError = false;
+      });
+    }
+  };
+
+  $scope.isSaveButtonDisabled = function() {
+    var enabled = false;
+    $scope.osList.forEach(function(os) {
+      if (os.selected) {
+        enabled = true
+      }
+    });
+    return !enabled;
+  }
+
+  $scope.save = function () {
+    return Stack.validateBaseUrls($scope.skipValidation, $scope.osList, $scope.upgradeStack).then(function (invalidUrls) {
+      if (invalidUrls.length === 0) {
+        Stack.addRepo($scope.upgradeStack, $scope.actualVersion, $scope.osList)
+          .success(function () {
+            var versionName = $scope.actualVersion + '';
+            var stackName = $scope.upgradeStack.stack_name;
+            Alert.success($t('versions.alerts.versionCreated'), {stackName: stackName, versionName: versionName});
+            $location.path('/stackVersions');
+          })
+          .error(function (data) {
+              Alert.error($t('versions.alerts.versionCreationError'), data.message);
+          });
+      } else {
+        Stack.highlightInvalidUrls(invalidUrls);
+      }
+    });
+  };
+  /**
+   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
+   * move this method to it
+   */
+  $scope.cancel = function () {
+    $scope.editVersionDisabled = true;
+    $location.path('/stackVersions');
+  };
+
+  /**
+   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
+   * move this method to it
+   */
+  $scope.clearErrors = function() {
+    if ($scope.osList) {
+      $scope.osList.forEach(function(os) {
+        if (os.repositories) {
+          os.repositories.forEach(function(repo) {
+            repo.hasError = false;
+          })
+        }
+      });
+    }
+  };
+
+  /**
+   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
+   * move this method to it
+   */
+  $scope.clearError = function() {
+    this.repository.hasError = false;
+  };
+
+  /**
+   * TODO create parent controller for StackVersionsEditCtrl and StackVersionsCreateCtrl and
+   * move this method to it
+   */
+  $scope.hasValidationErrors = function() {
+    var hasErrors = false;
+    if ($scope.osList) {
+      $scope.osList.forEach(function(os) {
+        if (os.repositories) {
+          os.repositories.forEach(function(repo) {
+            if (repo.hasError) {
+              hasErrors = true;
+            }
+          })
+        }
+      });
+    }
+    return hasErrors;
+  };
 }]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/efc3a07d/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
index ed42b45..9f6add0 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
@@ -323,7 +323,7 @@ angular.module('ambariAdminConsole')
       },
 
       'alerts': {
-        'baseURLs': 'Provide Base URLs for the Operating Systems you are configuring. Uncheck all other Operating Systems.',
+        'baseURLs': 'Provide Base URLs for the Operating Systems you are configuring.',
         'validationFailed': 'Some of the repositories failed validation. Make changes to the base url or skip validation if you are sure that urls are correct',
         'skipValidationWarning': '<b>Warning:</b> This is for advanced users only. Use this option if you want to skip validation for Repository Base URLs.',
         'filterListError': 'Fetch stack version filter list error',

http://git-wip-us.apache.org/repos/asf/ambari/blob/efc3a07d/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
index aa81b5d..a12b430 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
@@ -116,11 +116,11 @@ angular.module('ambariAdminConsole')
       return deferred.promise;
     },
 
-    addRepo: function (stack, repoSubversion, osList) {
+    addRepo: function (stack, actualVersion, osList) {
       var url = '/stacks/' + stack.stack_name + '/versions/' + stack.stack_version + '/repository_versions/';
       var payload = {};
       var payloadWrap = { RepositoryVersions : payload };
-      payload.repository_version = stack.stack_version + '.' + repoSubversion;
+      payload.repository_version = actualVersion;
       payload.display_name = stack.stack_name + '-' + payload.repository_version;
       payloadWrap.operating_systems = [];
       osList.forEach(function (osItem) {
@@ -182,25 +182,25 @@ angular.module('ambariAdminConsole')
         .success(function (data) {
           //data = data.items[0];
           data = {
-            "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2",
+            "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.3",
             "Versions" : {
               "stack_name" : "HDP",
-              "stack_version" : "2.2"
+              "stack_version" : "2.3"
             },
             "repository_versions" : [
               {
-                "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15",
+                "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.3/repository_versions/15",
                 "RepositoryVersions" : {
                   "id" : 15,
-                  "repository_version" : "2.2.0.1-901",
+                  "repository_version" : "2.3.6.0-3509",
                   "stack_name" : "HDP",
-                  "stack_version" : "2.2",
+                  "stack_version" : "2.3",
+                  "type": "PATCH",
                   "release": {
-                    "type": "PATCH",
-                    "stack_id": "HDP-2.2",
-                    "version": "2.2.0.1",
-                    "build": "901",
-                    "compatible_with": "2.2.0.1-[1-9]",
+                    "stack_id": "HDP-2.3",
+                    "version": "2.3.6.0",
+                    "build": "3509",
+                    "compatible_with": "2.3.6.0-[1-9]",
                     "release_notes": "http://someurl"
                   },
                   "services": [
@@ -232,112 +232,47 @@ angular.module('ambariAdminConsole')
                           "version": "3.4.5"
                         }
                       ]
-                    },
-                    {
-                      "name": "YARN",
-                      "versions": [
-                        {
-                          "version": "2.7.1"
-                        }
-                      ]
-                    },
-                    {
-                      "name": "SPARK",
-                      "versions": [
-                        {
-                          "version": "1.4.1"
-                        }
-                      ]
-                    },
-                    {
-                      "name": "SPARK",
-                      "versions": [
-                        {
-                          "version": "1.5.2"
-                        }
-                      ]
                     }
                   ]
                 },
                 "operating_systems" : [
                   {
-                    "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat5",
-                    "OperatingSystems" : {
-                      "os_type" : "redhat5",
-                      "repository_version_id" : 15,
-                      "stack_name" : "HDP",
-                      "stack_version" : "2.2"
-                    },
-                    "repositories" : [
-                      {
-                        "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat5/repositories/HDP-2.2.0.1-901",
-                        "Repositories" : {
-                          "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
-                          "default_base_url" : "",
-                          "latest_base_url" : "",
-                          "mirrors_list" : "",
-                          "os_type" : "redhat5",
-                          "repo_id" : "HDP-2.2.0.1-901",
-                          "repo_name" : "HDP",
-                          "repository_version_id" : 15,
-                          "stack_name" : "HDP",
-                          "stack_version" : "2.2"
-                        }
-                      },
-                      {
-                        "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat5/repositories/HDP-UTILS-2.2.0.1-901",
-                        "Repositories" : {
-                          "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
-                          "default_base_url" : "",
-                          "latest_base_url" : "",
-                          "mirrors_list" : "",
-                          "os_type" : "redhat5",
-                          "repo_id" : "HDP-UTILS-2.2.0.1-901",
-                          "repo_name" : "HDP-UTILS",
-                          "repository_version_id" : 15,
-                          "stack_name" : "HDP",
-                          "stack_version" : "2.2"
-                        }
-                      }
-                    ]
-                  },
-                  {
-                    "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat6",
+                    "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.3/repository_versions/15/operating_systems/redhat6",
                     "OperatingSystems" : {
                       "os_type" : "redhat6",
                       "repository_version_id" : 15,
                       "stack_name" : "HDP",
-                      "stack_version" : "2.2"
+                      "stack_version" : "2.3"
                     },
                     "repositories" : [
                       {
-                        "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat6/repositories/HDP-2.2.0.1-901",
+                        "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.3/repository_versions/15/operating_systems/redhat6/repositories/HDP-2.3.6.0-3509",
                         "Repositories" : {
-                          "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
+                          "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos6/2.x/BUILDS/2.3.6.0-3509",
                           "default_base_url" : "",
                           "latest_base_url" : "",
                           "mirrors_list" : "",
                           "os_type" : "redhat6",
-                          "repo_id" : "HDP-2.2.0.1-901",
+                          "repo_id" : "HDP-2.3.6.0-3509",
                           "repo_name" : "HDP",
                           "repository_version_id" : 15,
                           "stack_name" : "HDP",
-                          "stack_version" : "2.2"
+                          "stack_version" : "2.3"
                         }
                       },
                       {
-                        "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/15/operating_systems/redhat6/repositories/HDP-UTILS-2.2.0.1-901",
+                        "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.3/repository_versions/15/operating_systems/redhat6/repositories/HDP-UTILS-2.3.6.0-3509",
                         "Repositories" : {
-                          "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
+                          "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos6",
                           "default_base_url" : "",
                           "latest_base_url" : "",
                           "mirrors_list" : "",
                           "os_type" : "redhat6",
-                          "repo_id" : "HDP-UTILS-2.2.0.1-901",
+                          "repo_id" : "HDP-UTILS-2.3.6.0-3509",
                           "repo_name" : "HDP-UTILS",
                           "repository_version_id" : 15,
                           "stack_name" : "HDP",
-                          "stack_version" : "2.2"
+                          "stack_version" : "2.3"
                         }
                       }
                     ]
@@ -346,6 +281,7 @@ angular.module('ambariAdminConsole')
               }
             ]
           };
+
           var response = {
             id : data.repository_versions[0].RepositoryVersions.id,
             stackVersion : data.Versions.stack_version,

http://git-wip-us.apache.org/repos/asf/ambari/blob/efc3a07d/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
index 8385e48..83d4ffa 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
@@ -1402,6 +1402,14 @@ thead.view-permission-header > tr > th {
   color: #ff4500;
 }
 
+.register-version-form .remove-icon {
+  color: red;
+  margin: 20px 0px;
+  padding: 0px;
+  text-align: center;
+  cursor: pointer;
+}
+
 .register-version-form .version-info {
   padding-top: 7px;
   margin-top: 0;

http://git-wip-us.apache.org/repos/asf/ambari/blob/efc3a07d/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
index 488f077..61d2d8d 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
@@ -69,7 +69,7 @@
       <div class="clearfix">
         <label class="control-label col-sm-3">{{'versions.details.stackName' | translate}}</label>
         <div class="version-info col-sm-7">{{stackNameVersion}}</div>
-        <div class="col-sm-2 patch-icon" ng-if="isPatch"><span class="glyphicon glyphicon-tree-deciduous">Patch</span></div>
+        <div class="col-sm-2 patch-icon" ng-if="isPatch"><span class="glyphicon glyphicon-tree-deciduous"></span>Patch</div>
       </div>
       <div class="clearfix">
         <label class="control-label col-sm-3">{{'versions.details.displayName' | translate}}</label>
@@ -109,22 +109,34 @@
         <div class="name-label-adjust col-sm-2"><h5><label>{{'common.name' | translate}}</label></h5></div>
         <div class="col-sm-7"><h5><label >{{'versions.baseURL' | translate}}</label></h5></div>
       </div>
-      <div class="clearfix border-bottom bottom-margin" ng-repeat="os in osList">
-        <div class="col-sm-2 os-checkbox">
-          <div class="checkbox">
-            <label>
-              <input type="checkbox" ng-model="os.selected" ng-change="toggleOSSelect()"> {{os.OperatingSystems.os_type}}
-            </label>
-          </div>
-        </div>
-        <div class="col-sm-10">
-          <div class="form-group {{repository.Repositories.repo_name}}" ng-class="{'has-error': repository.hasError }" ng-repeat="repository in os.repositories">
-            <div class="col-sm-3"><label class="control-label">{{repository.Repositories.repo_name}}</label></div>
-            <div class="col-sm-9"><input type="text" class="form-control" ng-model="repository.Repositories.base_url"
+      <div class="alert alert-info hide-soft" ng-class="{'visible' : !osList || !osList.length}" role="alert">{{'versions.contents.empty' | translate}}</div>
+      <div class="" ng-repeat="os in osList">
+        <div ng-if="os.selected==true">
+          <div class="clearfix border-bottom bottom-margin">
+            <!-- show selected os in list table-->
+            <div class="col-sm-2">
+              <div class="">
+                <label>{{os.OperatingSystems.os_type}}</label>
+              </div>
+            </div>
+            <div class="col-sm-9">
+              <div class="form-group {{repository.Repositories.repo_name}}" ng-class="{'has-error': repository.hasError }" ng-repeat="repository in os.repositories">
+                <div class="col-sm-3"><label class="control-label">{{repository.Repositories.repo_name}}</label></div>
+                <div class="col-sm-9"><input type="text" class="form-control" ng-model="repository.Repositories.base_url"
                                          ng-change="clearError()" ng-disabled="!os.selected"></div>
+              </div>
+            </div>
+            <div class="col-sm-1 remove-icon" ng-click="removeOS()"><span class="glyphicon glyphicon-minus"></span>Remove</div>
           </div>
         </div>
       </div>
+        <div class="btn-group pull-right" dropdown>
+          <button class="btn dropdown-toggle">
+            <span class="glyphicon glyphicon-plus"></span> Add OS &nbsp;<span class="caret"></span></button>
+          <ul class="dropdown-menu">
+            <li ng-repeat="os in osList"><a ng-if="os.selected==false" ng-click="addOS()">{{os.OperatingSystems.os_type}}</a></li>
+          </ul>
+        </div>
       <div class="clearfix">
         <div class="col-sm-12" id="skip-validation">
           <div class="checkbox">
@@ -139,7 +151,7 @@
   </div>
   <div class="col-sm-12">
     <button class="btn btn-primary pull-right left-margin" ng-click="save()"
-            ng-disabled="(createController && repoRegForm.version.$invalid) || selectedOS === 0">{{'common.controls.save' | translate}}</button>
+            ng-disabled="isSaveButtonDisabled()">{{'common.controls.save' | translate}}</button>
     <button class="btn btn-default pull-right" ng-click="cancel()">{{'common.controls.cancel' | translate}}</button>
   </div>
 </form>