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-20841. Pause Button Appears After Successful Downgrade (alexantonenko)
Date Tue, 25 Apr 2017 15:13:07 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk e8e997a36 -> 26484a8f7


AMBARI-20841. Pause Button Appears After Successful Downgrade (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 26484a8f72ab4f895e472e11fa69330ccaf6f5af
Parents: e8e997a
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Tue Apr 25 13:03:37 2017 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Tue Apr 25 18:13:00 2017 +0300

----------------------------------------------------------------------
 ambari-web/app/app.js                             |  6 ++++++
 .../main/admin/stack_and_upgrade_controller.js    |  5 +++++
 .../admin/stack_upgrade/stack_upgrade_wizard.hbs  | 18 +++++++++---------
 3 files changed, 20 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/26484a8f/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index e32084c..6d02603 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -75,6 +75,12 @@ module.exports = Em.Application.create({
   upgradeInProgress: Em.computed.equal('upgradeState', 'IN_PROGRESS'),
 
   /**
+   * Checks if update process is completed
+   * @type {boolean}
+   */
+  upgradeCompleted: Em.computed.equal('upgradeState', 'COMPLETED'),
+
+  /**
    * flag is true when upgrade process is waiting for user action
    * to proceed, retry, perform manual steps etc.
    * @returns {boolean}

http://git-wip-us.apache.org/repos/asf/ambari/blob/26484a8f/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 238b4bc..94cdf1c 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
@@ -70,6 +70,11 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
 
   /**
    * @type {boolean}
+   */
+  showPauseButton: Em.computed.and('!App.upgradeSuspended', '!App.upgradeCompleted'),
+
+  /**
+   * @type {boolean}
    * @default true
    */
   downgradeAllowed: true,

http://git-wip-us.apache.org/repos/asf/ambari/blob/26484a8f/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs b/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs
index 6fceeb1..a5525be 100644
--- a/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs
+++ b/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs
@@ -39,15 +39,15 @@
     {{#if view.isLoaded}}
       <div>
         <div class="row">
-          {{#unless App.upgradeSuspended}}
-              {{#if isDowngrade}}
-                <button
-                  class="btn btn-default" {{action confirmPauseDowngrade target="view"}}>{{t
admin.stackUpgrade.pauseDowngrade}}</button>
-              {{else}}
-                <button
-                  class="btn btn-default" {{action confirmPauseUpgrade target="view"}}>{{t
admin.stackUpgrade.pauseUpgrade}}</button>
-              {{/if}}
-          {{/unless}}
+          {{#if showPauseButton}}
+            {{#if isDowngrade}}
+              <button
+                class="btn btn-default" {{action confirmPauseDowngrade target="view"}}>{{t
admin.stackUpgrade.pauseDowngrade}}</button>
+            {{else}}
+              <button
+                class="btn btn-default" {{action confirmPauseUpgrade target="view"}}>{{t
admin.stackUpgrade.pauseUpgrade}}</button>
+            {{/if}}
+          {{/if}}
         </div>
         {{#if view.runningItem}}
           <div class="panel panel-default details-box row">


Mime
View raw message