ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [30/50] [abbrv] ambari git commit: AMBARI-21652. Upgrade History Page Doesn't Display After Performing a PATCH Upgrade (alexantonenko)
Date Thu, 10 Aug 2017 17:49:15 GMT
AMBARI-21652. Upgrade History Page Doesn't Display After Performing a PATCH Upgrade (alexantonenko)


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

Branch: refs/heads/branch-2.6
Commit: 5c912a0b869a649260de7518b42867dbd655a663
Parents: 3b1f93b
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Thu Aug 3 16:58:43 2017 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Thu Aug 3 16:58:43 2017 +0300

----------------------------------------------------------------------
 ambari-web/app/messages.js                      |  4 +-
 .../stack_version/stack_upgrade_history.js      |  1 +
 .../admin/stack_upgrade/upgrade_history.hbs     | 64 ++++++++++----------
 ambari-web/app/utils/string_utils.js            | 14 +++++
 ambari-web/test/utils/string_utils_test.js      | 30 +++++++++
 5 files changed, 79 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5c912a0b/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 210bc8a..10d2990 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1755,8 +1755,8 @@ Em.I18n.translations = {
   'admin.stackVersions.version.upgrade.upgradeOptions.preCheck.allPassed.msg':'All checks
passed',
   'admin.stackVersions.version.upgrade.upgradeOptions.preCheck.failed.tooltip':'Option not
available',
   'admin.stackVersions.version.upgrade.upgradeOptions.notAllowed':'Not allowed by the current
version',
-  'admin.stackVersions.version.upgrade.upgradeOptions.EU.confirm.msg': 'You are about to
perform an <b>Express Upgrade</b> to <b>{1}</b>. This will incur cluster
downtime. Are you sure you want to proceed?',
-  'admin.stackVersions.version.upgrade.upgradeOptions.RU.confirm.msg': 'You are about to
perform a <b>Rolling Upgrade</b> to <b>{1}</b>. Are you sure you want
to proceed?',
+  'admin.stackVersions.version.upgrade.upgradeOptions.EU.confirm.msg': 'You are about to
perform an <b>Express Upgrade</b> to <b>{0}</b>. This will incur cluster
downtime. Are you sure you want to proceed?',
+  'admin.stackVersions.version.upgrade.upgradeOptions.RU.confirm.msg': 'You are about to
perform a <b>Rolling Upgrade</b> to <b>{0}</b>. Are you sure you want
to proceed?',
   'admin.stackVersions.version.upgrade.upgradeOptions.error': 'Could not proceed with upgrade:',
   'admin.stackVersions.version.upgrade.upgradeOptions.loading': 'Checking for supported upgrade
types...',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/5c912a0b/ambari-web/app/models/stack_version/stack_upgrade_history.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_version/stack_upgrade_history.js b/ambari-web/app/models/stack_version/stack_upgrade_history.js
index 1973381..69454c0 100644
--- a/ambari-web/app/models/stack_version/stack_upgrade_history.js
+++ b/ambari-web/app/models/stack_version/stack_upgrade_history.js
@@ -17,6 +17,7 @@
  */
 
 var App = require('app');
+var stringUtils = require('utils/string_utils');
 
 App.StackUpgradeHistory = DS.Model.extend({
   requestId: DS.attr('number'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/5c912a0b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_history.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_history.hbs b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_history.hbs
index c4832c0..d70a991 100644
--- a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_history.hbs
+++ b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_history.hbs
@@ -21,32 +21,27 @@
     {{view App.SpinnerView}}
   </div>
   <div {{bindAttr class="view.isReady::hidden"}}>
-    <div class="row">
-      <h2 class="table-title col-sm-3">{{t common.upgrade.history}}</h2>
-      <div class="table-controls row span9 pull-right">
-        <div class="span12">
-          <div class="btn-group pull-right">
-            <a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#">
-              <span class="filters-label">{{t common.filter}}: </span>
-              <span>
-                {{view.selectedCategory.label}}
-                <span class="caret"></span>
-              </span>
-            </a>
-            <ul class="dropdown-menu">
-              {{#each category in view.categories}}
-                <li>
-                  <a {{action selectCategory category target="view"}} href="#">
-                    {{category.label}}
-                  </a>
-                </li>
-              {{/each}}
-            </ul>
-          </div>
-        </div>
-      </div>
+    <div class="btn-group display-inline-block">
+      <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+        <span class="filters-label">{{t common.filter}}: </span>
+	        <span>
+	          {{view.selectedCategory.label}}
+              <span class="caret"></span>
+	        </span>
+      </a>
+      <ul class="dropdown-menu">
+          {{#each category in view.categories}}
+            <li>
+              <a {{action selectCategory category target="view"}} href="#">
+                  {{category.label}}
+              </a>
+            </li>
+          {{/each}}
+      </ul>
     </div>
-    <table class="table advanced-header-table table-hover" id="upgrade-summary-table">
+    <br/>
+    <br/>
+    <table class="table advanced-header-table table-striped" id="upgrade-summary-table">
       <thead>
       <tr>
         <th>{{t common.direction}}</th>
@@ -95,13 +90,18 @@
           {{/each}}
         {{/if}}
       </tbody>
-      <tfoot>
-        <tr>
-          <td colspan="8">
-            {{view App.PaginationView}}
-          </td>
-        </tr>
-        </tfoot>
     </table>
+    <div class="page-bar">
+      <div class="items-on-page">
+        <label>{{t common.show}}: {{view view.rowsPerPageSelectView selectionBinding="view.displayLength"}}</label>
+      </div>
+      <div class="info">{{view.paginationInfo}}</div>
+      <div class="paging_two_button">
+        <a {{bindAttr class="view.paginationLeftClass"}}{{action previousPage target="view"}}><i
+          class="icon-arrow-left"></i></a>
+        <a {{bindAttr class="view.paginationRightClass"}}{{action nextPage target="view"}}><i
+          class="icon-arrow-right"></i></a>
+      </div>
+    </div>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/5c912a0b/ambari-web/app/utils/string_utils.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/string_utils.js b/ambari-web/app/utils/string_utils.js
index 77e709d..aed61b7 100644
--- a/ambari-web/app/utils/string_utils.js
+++ b/ambari-web/app/utils/string_utils.js
@@ -244,5 +244,19 @@ module.exports = {
       text += allowed.charAt(Math.floor(Math.random() * allowed.length));
     }
     return text;
+  },
+
+  /**
+   * @param {string} string
+   * @returns {string}
+   * @method upperUnderscoreToText
+   */
+  upperUnderscoreToText: function(string) {
+    if (typeof(string) !== 'string') {
+      return '';
+    }
+    return string.split('_').map(function(word) {
+      return word.toLowerCase().capitalize();
+    }).join(' ');
   }
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/5c912a0b/ambari-web/test/utils/string_utils_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/string_utils_test.js b/ambari-web/test/utils/string_utils_test.js
index 3c7b077..6750906 100644
--- a/ambari-web/test/utils/string_utils_test.js
+++ b/ambari-web/test/utils/string_utils_test.js
@@ -255,4 +255,34 @@ describe('stringUtils', function () {
       });
     });
   });
+
+  describe('#upperUnderscoreToText', function() {
+    var testCases = [
+      {
+        input: null,
+        expected: ''
+      },
+      {
+        input: '',
+        expected: ''
+      },
+      {
+        input: 'foo',
+        expected: 'Foo'
+      },
+      {
+        input: 'FOO',
+        expected: 'Foo'
+      },
+      {
+        input: 'FOO_BAR',
+        expected: 'Foo Bar'
+      }
+    ];
+    testCases.forEach(function(test) {
+      it('should return ' + test.expected + ' when string is ' + test.input, function() {
+        expect(stringUtils.upperUnderscoreToText(test.input)).to.be.equal(test.expected);
+      });
+    });
+  });
 });


Mime
View raw message