ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-19085 Host Ordered upgrade should not show as an Upgrade option in UI. (atkach)
Date Tue, 06 Dec 2016 10:46:11 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 14c39691e -> a2f7a0308


AMBARI-19085 Host Ordered upgrade should not show as an Upgrade option in UI. (atkach)


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

Branch: refs/heads/trunk
Commit: a2f7a03088f553c51be40c16c1b56948a19a15b6
Parents: 14c3969
Author: Andrii Tkach <atkach@apache.org>
Authored: Tue Dec 6 12:20:50 2016 +0200
Committer: Andrii Tkach <atkach@apache.org>
Committed: Tue Dec 6 12:45:18 2016 +0200

----------------------------------------------------------------------
 .../main/admin/stack_and_upgrade_controller.js  | 13 ++++-
 .../admin/stack_upgrade/upgrade_options.hbs     | 58 ++++++++++----------
 .../admin/stack_upgrade/upgrade_wizard_view.js  |  6 +-
 .../stack_upgrade/upgrade_wizard_view_test.js   |  2 +-
 4 files changed, 48 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a2f7a030/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 35756cd..6d97205 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
@@ -52,6 +52,16 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
   upgradeType: null,
 
   /**
+   * @type {Em.Object}
+   */
+  upgradeTypeConfig: Em.computed.findByKey('upgradeMethods', 'type', 'upgradeType'),
+
+  /**
+   * @type {boolean}
+   */
+  cantBeStarted: Em.computed.alias('upgradeTypeConfig.cantBeStarted'),
+
+  /**
    * @type {boolean}
    * @default true
    */
@@ -171,7 +181,8 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
       precheckResultsMessage: '',
       precheckResultsTitle: '',
       action: '',
-      isWizardRestricted: !App.supports.enabledWizardForHostOrderedUpgrade
+      isWizardRestricted: !App.supports.enabledWizardForHostOrderedUpgrade,
+      cantBeStarted: true
     })
   ],
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a2f7a030/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_options.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_options.hbs b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_options.hbs
index 18fcfcf..fe3833c 100644
--- a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_options.hbs
+++ b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_options.hbs
@@ -26,35 +26,37 @@
         <div class="text method-text">{{t admin.stackVersions.version.upgrade.upgradeOptions.bodyMsg.method}}</div>
         <div {{bindAttr class=":row :method-options view.isInUpgradeWizard:disabled"}}>
             {{#each method in view.upgradeMethods}}
-              <div class="method-option col-md-6">
-                <div {{bindAttr class="method.allowed::not-allowed method.allowed::not-allowed-by-version
-          method.isPrecheckFailed:not-allowed method.isPrecheckFailed:check-failed
-          method.selected:selected method.type :img-thumbnail"}}
-                    {{action selectMethod method target="view"}}>
-                  <div {{bindAttr class="method.icon :method-icon"}}></div>
-                  <div class="method-name">{{method.displayName}}</div>
-                  <div class="method-description">{{{method.description}}}</div>
-                    {{#if view.showPreUpgradeChecks}}
-                        {{#if method.isCheckRequestInProgress}}
-                          <div class="method-precheck-message checking">
-                              {{view App.SpinnerView message="admin.stackVersions.version.upgrade.upgradeOptions.preCheck.msg.checking"}}
-                          </div>
-                        {{else}}
-                          <div {{bindAttr class=":method-precheck-message method.precheckResultsMessageClass"}}>
-                            <i {{bindAttr class="method.precheckResultsMessageIconClass"}}></i>
-                            <b>{{method.precheckResultsTitle}}</b>&nbsp;
-                            <a {{action runAction method target="view"}}>
-                                {{method.precheckResultsMessage}}
-                            </a>
-                              {{#if method.bypassedFailures}}
-                                <div
-                                  class="alert-danger">{{t admin.stackVersions.version.upgrade.upgradeOptions.errors_bypassed}}</div>
-                              {{/if}}
-                          </div>
+                {{#unless method.cantBeStarted}}
+                  <div class="method-option col-md-6">
+                    <div {{bindAttr class="method.allowed::not-allowed method.allowed::not-allowed-by-version
+                            method.isPrecheckFailed:not-allowed method.isPrecheckFailed:check-failed
+                            method.selected:selected method.type :img-thumbnail"}}
+                        {{action selectMethod method target="view"}}>
+                      <div {{bindAttr class="method.icon :method-icon"}}></div>
+                      <div class="method-name">{{method.displayName}}</div>
+                      <div class="method-description">{{{method.description}}}</div>
+                        {{#if view.showPreUpgradeChecks}}
+                            {{#if method.isCheckRequestInProgress}}
+                              <div class="method-precheck-message checking">
+                                  {{view App.SpinnerView message="admin.stackVersions.version.upgrade.upgradeOptions.preCheck.msg.checking"}}
+                              </div>
+                            {{else}}
+                              <div {{bindAttr class=":method-precheck-message method.precheckResultsMessageClass"}}>
+                                <i {{bindAttr class="method.precheckResultsMessageIconClass"}}></i>
+                                <b>{{method.precheckResultsTitle}}</b>&nbsp;
+                                <a {{action runAction method target="view"}}>
+                                    {{method.precheckResultsMessage}}
+                                </a>
+                                  {{#if method.bypassedFailures}}
+                                    <div
+                                      class="alert-danger">{{t admin.stackVersions.version.upgrade.upgradeOptions.errors_bypassed}}</div>
+                                  {{/if}}
+                              </div>
+                            {{/if}}
                         {{/if}}
-                    {{/if}}
-                </div>
-              </div>
+                    </div>
+                  </div>
+                {{/unless}}
             {{/each}}
         </div>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a2f7a030/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js
index e54a0fa..bcb1ad7 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js
@@ -68,7 +68,11 @@ App.upgradeWizardView = Em.View.extend({
    * when downgrade already started
    * @type {boolean}
    */
-  isDowngradeAvailable: Em.computed.and('!controller.isDowngrade', 'controller.downgradeAllowed'),
+  isDowngradeAvailable: Em.computed.and(
+    '!controller.isDowngrade',
+    'controller.downgradeAllowed',
+    '!controller.cantBeStarted'
+  ),
 
   /**
    * progress value is rounded to floor

http://git-wip-us.apache.org/repos/asf/ambari/blob/a2f7a030/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js
index 5630a8c..075bcc8 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js
@@ -416,7 +416,7 @@ describe('App.upgradeWizardView', function () {
     });
   });
 
-  App.TestAliases.testAsComputedAnd(getView(), 'isDowngradeAvailable', ['!controller.isDowngrade',
'controller.downgradeAllowed']);
+  App.TestAliases.testAsComputedAnd(getView(), 'isDowngradeAvailable', ['!controller.isDowngrade',
'controller.downgradeAllowed', '!controller.cantBeStarted']);
 
   describe("#taskDetails", function () {
     it("runningItem present", function () {


Mime
View raw message