ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject ambari git commit: AMBARI-21725. Web Client Doesn't Display MAINT Repos Correctly (alexantonenko)
Date Wed, 30 Aug 2017 11:14:48 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 5e399daeb -> a92d868b7


AMBARI-21725. Web Client Doesn't Display MAINT Repos Correctly (alexantonenko)


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

Branch: refs/heads/trunk
Commit: a92d868b7f1e1bf4415e40db08e120f98d40a6f3
Parents: 5e399da
Author: Alex Antonenko <aantonenko@hortonworks.com>
Authored: Wed Aug 30 14:14:31 2017 +0300
Committer: Alex Antonenko <aantonenko@hortonworks.com>
Committed: Wed Aug 30 14:14:31 2017 +0300

----------------------------------------------------------------------
 .../controllers/stackVersions/StackVersionsCreateCtrl.js |  1 +
 .../controllers/stackVersions/StackVersionsEditCtrl.js   |  1 +
 .../resources/ui/admin-web/app/scripts/services/Stack.js |  5 +++--
 .../ui/admin-web/app/views/stackVersions/list.html       |  1 +
 .../app/views/stackVersions/stackVersionPage.html        |  1 +
 .../main/admin/stack_and_upgrade_controller.js           | 11 +++++++----
 ambari-web/app/messages.js                               |  2 ++
 .../app/models/stack_version/repository_version.js       |  4 ++++
 .../common/modal_popups/install_repo_confirmation.hbs    |  2 +-
 .../main/admin/stack_upgrade/upgrade_version_box.hbs     |  7 +++++--
 .../main/admin/stack_upgrade/upgrade_version_column.hbs  |  6 +++---
 .../main/admin/stack_upgrade/upgrade_version_box_view.js |  4 ----
 .../app/views/main/admin/stack_upgrade/versions_view.js  |  4 ++--
 .../main/admin/stack_and_upgrade_controller_test.js      |  7 ++++++-
 14 files changed, 37 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/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 b26ce28..5e914d0 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
@@ -454,6 +454,7 @@ angular.module('ambariAdminConsole')
     var stackVersion = response.updateObj.RepositoryVersions || response.updateObj.VersionDefinition;
     $scope.id = response.id;
     $scope.isPatch = stackVersion.type === 'PATCH';
+    $scope.isMaint = stackVersion.type === 'MAINT';
     $scope.stackNameVersion = response.stackNameVersion || $t('common.NA');
     $scope.displayName = response.displayName || $t('common.NA');
     $scope.actualVersion = response.repositoryVersion || response.actualVersion || $t('common.NA');

http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/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 9c870aa..09e3c28 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
@@ -40,6 +40,7 @@ angular.module('ambariAdminConsole')
       $scope.activeStackVersion = response;
       $scope.id = response.id;
       $scope.isPatch = stackVersion.type === 'PATCH';
+      $scope.isMaint = stackVersion.type === 'MAINT';
       $scope.stackNameVersion = response.stackNameVersion || $t('common.NA');
       $scope.displayName = response.displayName || $t('common.NA');
       $scope.version = response.version || $t('common.NA');

http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/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 bca7ed5..0ad6a09 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
@@ -207,6 +207,7 @@ angular.module('ambariAdminConsole')
         });
         repos = repos.map(function (stack) {
           stack.RepositoryVersions.isPatch = stack.RepositoryVersions.type === 'PATCH';
+          stack.RepositoryVersions.isMaint = stack.RepositoryVersions.type === 'MAINT';
           return stack.RepositoryVersions;
         });
         // prepare response data with client side pagination
@@ -444,8 +445,8 @@ angular.module('ambariAdminConsole')
 
     filterAvailableServices: function (response) {
       var stackVersion = response.updateObj.RepositoryVersions || response.updateObj.VersionDefinition;
-      var patchOrService = stackVersion.type === 'PATCH' || stackVersion.type === 'SERVICE';
-      var availableServices = (patchOrService ? stackVersion.services : response.services).map(function
(s) {
+      var nonStandardVersion = stackVersion.type !== 'STANDARD';
+      var availableServices = (nonStandardVersion ? stackVersion.services : response.services).map(function
(s) {
         return s.name;
       });
       return response.services.filter(function (service) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/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 ccde1f3..70212c0 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
@@ -70,6 +70,7 @@
         <a href="#/stackVersions/{{repo.stack_name}}/{{repo.repository_version}}/edit">
           {{repo.display_name}}
           <span ng-if="repo.isPatch" class="badge btn-warning">{{'versions.patch' |
translate}}</span>
+          <span ng-if="repo.isMaint" class="badge btn-warning">{{'versions.maint' |
translate}}</span>
         </a>
       </td>
       <td class="col-medium">

http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/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 cb81d5c..85d659d 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,6 +23,7 @@
       {{displayName}}&nbsp;
       <span class="sub-text">({{repoVersionFullName}})</span>
       <span ng-if="isPatch" class="badge btn-warning">{{'versions.patch' | translate}}</span>
+      <span ng-if="isMaint" class="badge btn-warning">{{'versions.maint' | translate}}</span>
     </li>
     <li class="active" ng-if="createController">{{'versions.register.title' | translate}}</li>
   </ol>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
index e0aeb09..8e9ce86 100644
--- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
@@ -156,7 +156,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
       this.get('upgradeTypeDisplayName'),
       this.get('upgradeVersion'),
       this.get('isDowngrade'),
-      repoVersion && repoVersion.get('isPatch')
+      repoVersion
     );
   }.property('upgradeTypeDisplayName', 'upgradeVersion', 'isDowngrade'),
 
@@ -168,13 +168,16 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
    * @param {boolean} isPatch
    * @returns {string}
    */
-  getUpgradeDowngradeHeader: function(upgradeType, upgradeVersion, isDowngrade, isPatch)
{
+  getUpgradeDowngradeHeader: function(upgradeType, upgradeVersion, isDowngrade, repoVersion)
{
     if (isDowngrade) {
       return Em.I18n.t('admin.stackUpgrade.dialog.downgrade.header').format(upgradeVersion);
     }
-    if (isPatch) {
+    if (repoVersion && repoVersion.get('isPatch')) {
       return Em.I18n.t('admin.stackUpgrade.dialog.upgrade.patch.header').format(upgradeType,
upgradeVersion);
     }
+    if (repoVersion && repoVersion.get('isMaint')) {
+      return Em.I18n.t('admin.stackUpgrade.dialog.upgrade.maint.header').format(upgradeType,
upgradeVersion);
+    }
     return Em.I18n.t('admin.stackUpgrade.dialog.upgrade.header').format(upgradeType, upgradeVersion);
   },
 
@@ -1510,7 +1513,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
       bodyClass: Em.View.extend({
         classNames: ['install-repo-confirmation'],
         content: availableServices,
-        isPatch: repo.get('isPatch'),
+        showAvailableServices: repo.get('isPatch') || repo.get('isMaint'),
         templateName: require('templates/common/modal_popups/install_repo_confirmation')
       }),
       onPrimary: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 17a791e..0982562 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -229,6 +229,7 @@ Em.I18n.translations = {
   'common.resume': 'Resume',
   'common.path': 'Path',
   'common.patch': 'Patch',
+  'common.maint': 'Maint',
   'common.package': 'Package',
   'common.proceed': 'Proceed',
   'common.proceedAnyway': 'Proceed Anyway',
@@ -1874,6 +1875,7 @@ Em.I18n.translations = {
   'admin.stackUpgrade.state.completed.downgrade': "Downgrade Finished",
   'admin.stackUpgrade.dialog.upgrade.header': "{0} Upgrade to {1}",
   'admin.stackUpgrade.dialog.upgrade.patch.header': "{0} Patch Upgrade to {1}",
+  'admin.stackUpgrade.dialog.upgrade.maint.header': "{0} Maint Upgrade to {1}",
   'admin.stackUpgrade.dialog.downgrade.header': "Downgrade from {0}",
   'admin.stackUpgrade.dialog.operationFailed': "This operation failed.",
   'admin.stackUpgrade.dialog.stop': "Stop Upgrade",

http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/ambari-web/app/models/stack_version/repository_version.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_version/repository_version.js b/ambari-web/app/models/stack_version/repository_version.js
index b99bb6f..51b9ab8 100644
--- a/ambari-web/app/models/stack_version/repository_version.js
+++ b/ambari-web/app/models/stack_version/repository_version.js
@@ -37,6 +37,10 @@ App.RepositoryVersion = DS.Model.extend({
 
   isPatch: Em.computed.equal('type', 'PATCH'),
 
+  isMaint: Em.computed.equal('type', 'MAINT'),
+
+  isService: Em.computed.equal('type', 'SERVICE'),
+
   isStandard: Em.computed.equal('type', 'STANDARD'),
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/ambari-web/app/templates/common/modal_popups/install_repo_confirmation.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/modal_popups/install_repo_confirmation.hbs b/ambari-web/app/templates/common/modal_popups/install_repo_confirmation.hbs
index 9bb9533..1576268 100644
--- a/ambari-web/app/templates/common/modal_popups/install_repo_confirmation.hbs
+++ b/ambari-web/app/templates/common/modal_popups/install_repo_confirmation.hbs
@@ -16,7 +16,7 @@
 * limitations under the License.
 }}
 <p>{{{popupBody}}}</p>
-{{#if view.isPatch}}
+{{#if view.showAvailableServices}}
   <div class="available-services-list">
       {{#each service in view.content}}
           <p class="service-version-info">

http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
index 0772215..8ce441d 100644
--- a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
+++ b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
@@ -29,10 +29,13 @@
 <p class="repository-name">({{view.content.repositoryVersion}})</p>
 
 <p class="patch-icon">
-  {{#if view.isPatch}}
+  {{#if view.content.isMaint}}
+    <i class="glyphicon glyphicon-umbrella"></i>&nbsp;{{t common.maint}}
+  {{/if}}
+  {{#if view.content.isPatch}}
     <i class="glyphicon glyphicon-umbrella"></i>&nbsp;{{t common.patch}}
   {{/if}}
-  {{#if view.isService}}
+  {{#if view.content.isService}}
     <i class="glyphicon glyphicon-umbrella"></i>&nbsp;{{t common.service}}
   {{/if}}
 </p>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_column.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_column.hbs
b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_column.hbs
index 2ec0d7c..b6a30fc 100644
--- a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_column.hbs
+++ b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_column.hbs
@@ -21,10 +21,10 @@
 {{/if}}
 
 <p class="version-column-display-name">
-  {{#if view.content.isPatch}}
-    <span>{{view.content.displayName}}</span>
-  {{else}}
+  {{#if view.content.isStandard}}
     <span>{{view.content.displayNameSimple}}</span>
+  {{else}}
+    <span>{{view.content.displayName}}</span>
   {{/if}}
 </p>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
index 84612ab..9518c52 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
@@ -71,10 +71,6 @@ App.UpgradeVersionBoxView = Em.View.extend({
     return this.get('content.status') === 'CURRENT' ? 'current-version-box' : '';
   }.property('content.status'),
 
-  isPatch: Em.computed.equal('content.type', 'PATCH'),
-
-  isService: Em.computed.equal('content.type', 'SERVICE'),
-
   /**
    * @type {boolean}
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js b/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js
index 3166066..eadd265 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js
@@ -171,8 +171,8 @@ App.MainAdminStackVersionsView = Em.View.extend({
     } else {
       return versions.filterProperty('hidden', false).filter(function(v) {
         if (v.get('stackVersionType') === Em.get(currentVersion, 'stack_name')) {
-          // PATCH version should be visible even if patch number lower than current
-          return v.get('isPatch') || stringUtils.compareVersions(v.get('repositoryVersion'),
Em.get(currentVersion, 'repository_version')) >= 0;
+          // PATCH or MAINT version should be visible even if patch number lower than current
+          return v.get('isPatch') || v.get('isMaint') || stringUtils.compareVersions(v.get('repositoryVersion'),
Em.get(currentVersion, 'repository_version')) >= 0;
         }
         return v.get('isCompatible');
       }).toArray();

http://git-wip-us.apache.org/repos/asf/ambari/blob/a92d868b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
index 0c70f16..1d2306e 100644
--- a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
@@ -3520,10 +3520,15 @@ describe('App.MainAdminStackAndUpgradeController', function() {
       );
     });
     it('should return patch upgrade header', function() {
-      expect(controller.getUpgradeDowngradeHeader('t1', 'v1', false, true)).to.be.equal(
+      expect(controller.getUpgradeDowngradeHeader('t1', 'v1', false, Em.Object.create({isPatch:
true}))).to.be.equal(
         Em.I18n.t('admin.stackUpgrade.dialog.upgrade.patch.header').format('t1', 'v1')
       );
     });
+    it('should return maint upgrade header', function() {
+      expect(controller.getUpgradeDowngradeHeader('t1', 'v1', false, Em.Object.create({isMaint:
true}))).to.be.equal(
+        Em.I18n.t('admin.stackUpgrade.dialog.upgrade.maint.header').format('t1', 'v1')
+      );
+    });
     it('should return upgrade header', function() {
       expect(controller.getUpgradeDowngradeHeader('t1', 'v1', false, false)).to.be.equal(
         Em.I18n.t('admin.stackUpgrade.dialog.upgrade.header').format('t1', 'v1')


Mime
View raw message