ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vivekratna...@apache.org
Subject ambari git commit: AMBARI-22570. Repository Fields missing when register version is clicked (vsubramanian)
Date Fri, 01 Dec 2017 00:32:22 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b2655aa66 -> 7b6fef189


AMBARI-22570. Repository Fields missing when register version is clicked (vsubramanian)


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

Branch: refs/heads/trunk
Commit: 7b6fef189b7fa3090b7a10efcdf5e2427e2e0eac
Parents: b2655aa
Author: Vivek Ratnavel Subramanian <vivekratnavel90@gmail.com>
Authored: Thu Nov 30 16:32:17 2017 -0800
Committer: Vivek Ratnavel Subramanian <vivekratnavel90@gmail.com>
Committed: Thu Nov 30 16:32:17 2017 -0800

----------------------------------------------------------------------
 .../stackVersions/StackVersionsCreateCtrl.js    | 28 +++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7b6fef18/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 8ffb29b..3d93b0d 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
@@ -40,6 +40,16 @@ angular.module('ambariAdminConsole')
     display_name: ''
   };
 
+  $scope.isGPLAccepted = false;
+
+  $scope.isGPLRepo = function (repository) {
+    return repository.Repositories.tags.indexOf('GPL') >= 0;
+  };
+
+  $scope.showRepo = function (repository) {
+    return $scope.isGPLAccepted || !$scope.isGPLRepo(repository);
+  };
+
   $scope.publicOption = {
     index: 1,
     hasError: false
@@ -176,6 +186,15 @@ angular.module('ambariAdminConsole')
   };
 
   /**
+   * Load GPL License Accepted value
+   */
+  $scope.fetchGPLLicenseAccepted = function () {
+    Stack.getGPLLicenseAccepted().then(function (data) {
+      $scope.isGPLAccepted = data === 'true';
+    })
+  };
+
+  /**
    * Load supported OS list
    */
   $scope.afterStackVersionRead = function () {
@@ -350,7 +369,11 @@ angular.module('ambariAdminConsole')
 
   $scope.updateRepoVersions = function () {
     var skip = $scope.skipValidation || $scope.useRedhatSatellite;
-    return Stack.validateBaseUrls(skip, $scope.osList, $scope.upgradeStack).then(function
(invalidUrls) {
+    // Filter out repositories that are not shown in the UI
+    var osList = Object.assign([], $scope.osList).map(function(os) {
+      return Object.assign({}, os, {repositories: os.repositories.filter(function(repo) {
return $scope.showRepo(repo); })});
+    });
+    return Stack.validateBaseUrls(skip, osList, $scope.upgradeStack).then(function (invalidUrls)
{
       if (invalidUrls.length === 0) {
         Stack.updateRepo($scope.upgradeStack.stack_name, $scope.upgradeStack.stack_version,
$scope.id, $scope.updateObj).then(function () {
           Alert.success($t('versions.alerts.versionEdited', {
@@ -477,6 +500,9 @@ angular.module('ambariAdminConsole')
 
     // load supported os type base on stack version
     $scope.afterStackVersionRead();
+
+    // Load GPL license accepted value
+    $scope.fetchGPLLicenseAccepted();
   };
 
   $scope.selectRepoInList = function() {


Mime
View raw message