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-21869. Add Dismiss button on pre-upgrade dialog (alexantonenko)
Date Mon, 04 Sep 2017 08:54:04 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 d2e10b5b1 -> fb64507a4


AMBARI-21869. Add Dismiss button on pre-upgrade dialog (alexantonenko)


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

Branch: refs/heads/branch-2.6
Commit: fb64507a4b14661aef435f8e1fcddfa3e5c4753f
Parents: d2e10b5
Author: Alex Antonenko <aantonenko@hortonworks.com>
Authored: Mon Sep 4 11:53:50 2017 +0300
Committer: Alex Antonenko <aantonenko@hortonworks.com>
Committed: Mon Sep 4 11:53:50 2017 +0300

----------------------------------------------------------------------
 .../controllers/main/admin/stack_and_upgrade_controller.js  | 9 +++++++--
 .../main/admin/stack_and_upgrade_controller_test.js         | 6 ++++++
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fb64507a/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 53b3171..5200ddf 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
@@ -1039,9 +1039,14 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
 
     return App.ModalPopup.show({
       encodeBody: false,
-      showFooter: !preUpgradeShow,
-      primary: isInUpgradeWizard ? Em.I18n.t('ok') : Em.I18n.t('common.proceed'),
+      primary: (function(){
+        if (preUpgradeShow) return false;
+        if (isInUpgradeWizard) return Em.I18n.t('ok');
+        return Em.I18n.t('common.proceed')
+      })(),
       primaryClass: 'btn-success',
+      secondaryClass: preUpgradeShow ? 'btn-success' : '',
+      secondary: preUpgradeShow ? Em.I18n.t('common.dismiss') : Em.I18n.t('common.cancel'),
       classNames: ['upgrade-options-popup'],
       header: preUpgradeShow ? Em.I18n.t('admin.stackVersions.version.preUpgrade.header')
: Em.I18n.t('admin.stackVersions.version.upgrade.upgradeOptions.header'),
       bodyClass: Em.View.extend({

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb64507a/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 e69b3bf..9b2c583 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
@@ -3593,6 +3593,12 @@ describe('App.MainAdminStackAndUpgradeController', function() {
       controller.showUpgradeOptions(version);
       expect(controller.upgradeOptions.calledWith(false, version, true)).to.be.true;
     });
+
+    it("runningCheckRequests has 1 item" + Em.I18n.t('common.dismiss'), function () {
+      var version = Em.Object.create({displayName: 'HDP-2.2'});
+      var popup = controller.upgradeOptions(false, version, true);
+      expect( controller.get('runningCheckRequests')).to.have.length(1);
+    })
   })
 
 });


Mime
View raw message