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-9563 Versions: use version name (display_name), not technical version, in the UI. (atkach)
Date Wed, 11 Feb 2015 13:32:51 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk e52dbb5f4 -> 0f22258c8


AMBARI-9563 Versions: use version name (display_name), not technical version, in the UI. (atkach)


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

Branch: refs/heads/trunk
Commit: 0f22258c801d409527cc3b5a894c377525a8bbbd
Parents: e52dbb5
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Wed Feb 11 14:04:17 2015 +0200
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Wed Feb 11 15:32:41 2015 +0200

----------------------------------------------------------------------
 .../stackVersions/StackVersionsEditCtrl.js            |  5 +++--
 .../ui/admin-web/app/scripts/services/Stack.js        |  2 ++
 .../main/resources/ui/admin-web/app/styles/main.css   |  4 ++++
 .../app/views/modals/BodyForDeregisterVersion.html    |  2 +-
 .../ui/admin-web/app/views/stackVersions/list.html    |  2 +-
 .../app/views/stackVersions/stackVersionPage.html     |  4 ++--
 ambari-web/app/controllers/main/host.js               | 10 +++++-----
 ambari-web/app/messages.js                            |  1 +
 .../main/admin/stack_upgrade/upgrade_version_box.hbs  |  6 +++---
 ambari-web/app/templates/main/host/stack_versions.hbs |  2 +-
 .../admin/stack_upgrade/upgrade_version_box_view.js   | 14 +++++++-------
 ambari-web/app/views/main/host.js                     | 12 ++++++------
 ambari-web/app/views/main/host/stack_versions_view.js | 10 +++++-----
 13 files changed, 41 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/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 0d0a363..dcd79df 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
@@ -30,6 +30,7 @@ angular.module('ambariAdminConsole')
       $scope.stack = response.stack;
       $scope.stackName = response.stackName;
       $scope.versionName = response.versionName;
+      $scope.displayName = response.displayName;
       $scope.stackVersion = response.stackVersion;
       $scope.updateObj = response.updateObj;
       $scope.subversion = response.versionName.substring(4); // cut off stack version
@@ -144,7 +145,7 @@ angular.module('ambariAdminConsole')
     return Stack.validateBaseUrls($scope.skipValidation, $scope.osList, upgradeStack).then(function
(invalidUrls) {
       if (invalidUrls.length === 0) {
         Stack.updateRepo($scope.stackName, $scope.stackVersion, $scope.id, $scope.updateObj).then(function
() {
-          Alert.success('Edited version <a href="#/stackVersions/' + $scope.stackName
+ '/' + $scope.versionName + '/edit">' + $scope.repoVersionFullName + '</a>');
+          Alert.success('Edited version <a href="#/stackVersions/' + $scope.stackName
+ '/' + $scope.versionName + '/edit">' + $scope.displayName + '</a>');
           $location.path('/stackVersions');
         }).catch(function (data) {
           Alert.error('Version update error', data.message);
@@ -174,7 +175,7 @@ angular.module('ambariAdminConsole')
 
   $scope.delete = function () {
     ConfirmationModal.show('Deregister Version', { "url": 'views/modals/BodyForDeregisterVersion.html',
-      "scope": {"repoVersionFullName": $scope.repoVersionFullName }}).then(function() {
+      "scope": {"displayName": $scope.displayName }}).then(function() {
       Stack.deleteRepo($scope.stackName, $scope.stackVersion, $scope.id).then( function ()
{
         $location.path('/stackVersions');
       }).catch(function (data) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/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 681b844..d37c714 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
@@ -147,6 +147,7 @@ angular.module('ambariAdminConsole')
     getRepo: function (repoVersion, stack_name) {
       var url = Settings.baseUrl + '/stacks/' + stack_name + '/versions?' +
       'fields=repository_versions/operating_systems/repositories/*' +
+      ',repository_versions/RepositoryVersions/display_name' +
       '&repository_versions/RepositoryVersions/repository_version=' + repoVersion;
       var deferred = $q.defer();
       $http.get(url, {mock: 'version/version.json'})
@@ -158,6 +159,7 @@ angular.module('ambariAdminConsole')
           stack: data.Versions.stack_name + '-' + data.Versions.stack_version,
           stackName: data.Versions.stack_name,
           versionName: data.repository_versions[0].RepositoryVersions.repository_version,
+          displayName : data.repository_versions[0].RepositoryVersions.display_name,
           repoVersionFullName : data.Versions.stack_name + '-' + data.repository_versions[0].RepositoryVersions.repository_version,
           osList: data.repository_versions[0].operating_systems,
           updateObj: data.repository_versions[0]

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
index ca8faed..5b82129 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
@@ -391,6 +391,10 @@ a.gotoinstance{
   padding: 0;
 }
 
+.breadcrumb .sub-text{
+  font-size: 16px;
+}
+
 .user-edit-panel .ats-switch span.switch-right , .create-user-form .ats-switch span.switch-right{
   background-color: #da4f49;
   color: white;

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/BodyForDeregisterVersion.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/BodyForDeregisterVersion.html
b/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/BodyForDeregisterVersion.html
index 16ce616..a48633a 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/BodyForDeregisterVersion.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/BodyForDeregisterVersion.html
@@ -15,4 +15,4 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 -->
-Are you sure you want to deregister version <strong>{{innerScope.repoVersionFullName}}</strong>
?
+Are you sure you want to deregister version <strong>{{innerScope.displayName}}</strong>
?

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/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 9f6a1a2..e4db634 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
@@ -33,7 +33,7 @@
     <thead>
     <tr>
       <th class="col-medium">
-        <label>Version</label>
+        <label>Name</label>
         <input type="text" class="form-control" ng-change="resetPagination()" ng-model="filter.version"
placeholder="Any">
       </th>
       <th class="col-small">

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/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 378a85c..77b80d0 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
@@ -19,7 +19,7 @@
 <div class="clearfix">
   <ol class="breadcrumb pull-left">
     <li><a href="#/stackVersions">Versions</a></li>
-    <li class="active" ng-if="editController">{{repoVersionFullName}}</li>
+    <li class="active" ng-if="editController">{{displayName}}&nbsp;<span class="sub-text">({{repoVersionFullName}})</span></li>
     <li class="active" ng-if="createController">Register Version</li>
   </ol>
 
@@ -39,7 +39,7 @@
     </div>
     <div class="panel-body">
       <div class="form-inline repo-version-inline">
-        <label class="control-label col-sm-2 repo-version-label">Version</label>
+        <label class="control-label col-sm-2 repo-version-label">Name</label>
         <div class="col-sm-10">
           <select class="form-control repo-version-select"
                   ng-model="$parent.upgradeStack.selected"

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/ambari-web/app/controllers/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host.js b/ambari-web/app/controllers/main/host.js
index 6074d66..9511be8 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -470,11 +470,11 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin,
{
 
   /**
    * Filter hosts by stack version and state
-   * @param {String} version
+   * @param {String} displayName
    * @param {String} state
    */
-  filterByStack: function (version, state) {
-    if (!version || !state)
+  filterByStack: function (displayName, state) {
+    if (!displayName || !state)
       return;
     var column = 11;
 
@@ -482,8 +482,8 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin,
{
       iColumn: column,
       value: [
         {
-          property: 'repository_versions/RepositoryVersions/repository_version',
-          value: version
+          property: 'repository_versions/RepositoryVersions/display_name',
+          value: displayName
         },
         {
           property: 'HostStackVersions/state',

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 4da3334..9e1a61d 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1954,6 +1954,7 @@ Em.I18n.translations = {
 
   'hosts.host.menu.stackVersions': 'Versions',
   'hosts.host.stackVersions.table.allVersions': 'All Versions',
+  'hosts.host.stackVersions.table.allNames': 'All Names',
   'hosts.host.stackVersions.table.noVersions': 'No versions',
   'hosts.host.stackVersions.table.filteredInfo': '{0} of {1} versions showing',
   'hosts.host.stackVersions.status.init': 'Uninstalled',

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/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 1aa7a4e..23dc285 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
@@ -56,19 +56,19 @@
   <div class="row-fluid host-link">
     <div class="span4 align-center">
       <div><a href="#" {{bindAttr class="view.content.noInitHosts:empty-hosts-tooltip:hosts-tooltip
:not-active"}}
-        {{action showHosts view.versionStateMap.not_installed view.content.repositoryVersion
view.content.notInstalledHosts target="view"}}>
+        {{action showHosts view.versionStateMap.not_installed view.content.displayName view.content.notInstalledHosts
target="view"}}>
         {{view.content.notInstalledHosts.length}}</a></div>
       <div>{{t admin.stackVersions.version.notInstalled}}</div>
     </div>
     <div class="span4 align-center">
       <div><a href="#" {{bindAttr class="view.content.noInstalledHosts:empty-hosts-tooltip:hosts-tooltip
:not-active"}}
-        {{action showHosts view.versionStateMap.installed view.content.repositoryVersion
view.content.installedHosts target="view"}}>
+        {{action showHosts view.versionStateMap.installed view.content.displayName view.content.installedHosts
target="view"}}>
         {{view.content.installedHosts.length}}</a></div>
       <div>{{t common.installed}}</div>
     </div>
     <div class="span4 align-center">
       <div><a href="#" {{bindAttr class="view.content.noCurrentHosts:empty-hosts-tooltip:hosts-tooltip
:not-active"}}
-        {{action showHosts view.versionStateMap.current view.content.repositoryVersion view.content.currentHosts
target="view"}}>
+        {{action showHosts view.versionStateMap.current view.content.displayName view.content.currentHosts
target="view"}}>
         {{view.content.currentHosts.length}}</a></div>
       <div>{{t common.current}}</div>
     </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/ambari-web/app/templates/main/host/stack_versions.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host/stack_versions.hbs b/ambari-web/app/templates/main/host/stack_versions.hbs
index 7585a7b..0627ae1 100644
--- a/ambari-web/app/templates/main/host/stack_versions.hbs
+++ b/ambari-web/app/templates/main/host/stack_versions.hbs
@@ -35,7 +35,7 @@
     {{#each view.pageContent}}
       <tr>
         <td class="first stack-name">{{this.stack}}</td>
-        <td class="repo-version">{{this.repoVersion}}</td>
+        <td class="repo-version">{{this.displayName}}</td>
         <td class="host-stack-version-status">
           {{#if this.isCurrent}}
             <span class="label label-success">{{t common.current}}</span>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/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 0aca242..9958563 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
@@ -247,13 +247,13 @@ App.UpgradeVersionBoxView = Em.View.extend({
    */
   showHosts: function (event) {
     var status = event.contexts[0];
-    var version = event.contexts[1];
+    var displayName = event.contexts[1];
     var hosts = event.contexts[2];
     var self = this;
     if (hosts.length) {
       return App.ModalPopup.show({
         bodyClass: Ember.View.extend({
-          title: Em.I18n.t('admin.stackVersions.hosts.popup.title').format(version, status.label,
hosts.length),
+          title: Em.I18n.t('admin.stackVersions.hosts.popup.title').format(displayName, status.label,
hosts.length),
           hosts: hosts,
           template: Em.Handlebars.compile('<h4>{{view.title}}</h4><div class="limited-height-2">{{#each
view.hosts}}<div>{{this}}</div>{{/each}}</div>')
         }),
@@ -262,7 +262,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
         secondary: Em.I18n.t('common.close'),
         onPrimary: function () {
           this.hide();
-          self.filterHostsByStack(version, status.id);
+          self.filterHostsByStack(displayName, status.id);
         }
       });
     }
@@ -270,13 +270,13 @@ App.UpgradeVersionBoxView = Em.View.extend({
 
   /**
    * goes to the hosts page with content filtered by repo_version_name and repo_version_state
-   * @param version
+   * @param displayName
    * @param state
    * @method filterHostsByStack
    */
-  filterHostsByStack: function (version, state) {
-    if (!version || !state) return;
-    App.router.get('mainHostController').filterByStack(version, state);
+  filterHostsByStack: function (displayName, state) {
+    if (!displayName || !state) return;
+    App.router.get('mainHostController').filterByStack(displayName, state);
     App.router.get('mainHostController').set('showFilterConditionsFirstLoad', true);
     App.router.transitionTo('hosts.index');
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/ambari-web/app/views/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js
index 88b41f5..f116e6c 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -594,7 +594,7 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
      */
     currentVersion: function() {
       var currentRepoVersion = this.get('content.stackVersions').findProperty('isCurrent')
|| this.get('content.stackVersions').objectAt(0);
-      return currentRepoVersion ? currentRepoVersion.get('repoVersion') + " (" + currentRepoVersion.get('displayStatus')
+ ")" : "";
+      return currentRepoVersion ? currentRepoVersion.get('displayName') + " (" + currentRepoVersion.get('displayStatus')
+ ")" : "";
     }.property('content.stackVersions'),
 
     /**
@@ -603,7 +603,7 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
      */
     versionlabels: function () {
       return this.get('content.stackVersions').filterProperty('isCurrent', false).map(function
(version) {
-        return version.get('repoVersion');
+        return version.get('displayName');
       }).join("<br />");
     }.property('content.stackVersions.length'),
 
@@ -1016,14 +1016,14 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin,
{
       versionSelectView: filters.createSelectView({
         classNames: ['notActive'],
         fieldType: 'filter-input-width',
-        filterPropertyName: 'repository_versions/RepositoryVersions/repository_version',
+        filterPropertyName: 'repository_versions/RepositoryVersions/display_name',
         content: function () {
           return  [
             {
               value: '',
-              label: Em.I18n.t('hosts.host.stackVersions.table.allVersions')
+              label: Em.I18n.t('common.all')
             }
-          ].concat(this.get('controller.allHostStackVersions').mapProperty('repoVersion').uniq().map(function
(version) {
+          ].concat(this.get('controller.allHostStackVersions').mapProperty('displayName').uniq().map(function
(version) {
             return {
               value: version,
               label: version
@@ -1064,7 +1064,7 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
         var filterProperties = [];
         if (this.get('selectedVersion')) {
           filterProperties.push({
-            property: 'repository_versions/RepositoryVersions/repository_version',
+            property: 'repository_versions/RepositoryVersions/display_name',
             value: this.get('selectedVersion')
           });
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/ambari-web/app/views/main/host/stack_versions_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/stack_versions_view.js b/ambari-web/app/views/main/host/stack_versions_view.js
index 380850a..5e57a21 100644
--- a/ambari-web/app/views/main/host/stack_versions_view.js
+++ b/ambari-web/app/views/main/host/stack_versions_view.js
@@ -66,8 +66,8 @@ App.MainHostStackVersionsView = App.TableView.extend({
    */
   repoVersionSort: sort.fieldView.extend({
     column: 2,
-    name: 'repoVersion',
-    displayName: Em.I18n.t('common.version'),
+    name: 'displayName',
+    displayName: Em.I18n.t('common.name'),
     type: 'version'
   }),
 
@@ -118,9 +118,9 @@ App.MainHostStackVersionsView = App.TableView.extend({
       return [
         {
           value: '',
-          label: Em.I18n.t('hosts.host.stackVersions.table.allVersions')
+          label: Em.I18n.t('common.all')
         }
-      ].concat(this.get('parentView.content').mapProperty('repoVersion').uniq().map(function
(version) {
+      ].concat(this.get('parentView.content').mapProperty('displayName').uniq().map(function
(version) {
         return {
           value: version,
           label: version
@@ -182,7 +182,7 @@ App.MainHostStackVersionsView = App.TableView.extend({
   colPropAssoc: function () {
     var associations = [];
     associations[1] = 'stack';
-    associations[2] = 'repoVersion';
+    associations[2] = 'displayName';
     associations[3] = 'status';
     return associations;
   }.property()


Mime
View raw message