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-15287. Ambari Admin: externalize string constants used in Versions section (alexantonenko)
Date Mon, 07 Mar 2016 10:21:08 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b88ede8df -> c2aec6fb1


AMBARI-15287. Ambari Admin: externalize string constants used in Versions section (alexantonenko)


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

Branch: refs/heads/trunk
Commit: c2aec6fb14ae49dd5fb6f217093e4606ab36588f
Parents: b88ede8
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Fri Mar 4 17:52:14 2016 +0200
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Mon Mar 7 12:21:03 2016 +0200

----------------------------------------------------------------------
 .../stackVersions/StackVersionsCreateCtrl.js       | 17 ++++++++++-------
 .../stackVersions/StackVersionsEditCtrl.js         | 11 +++++++----
 .../ui/admin-web/app/scripts/i18n.config.js        |  6 +++++-
 .../app/views/stackVersions/stackVersionPage.html  |  6 +++---
 4 files changed, 25 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c2aec6fb/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
index 99464cf..038b197 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
@@ -20,6 +20,9 @@
 angular.module('ambariAdminConsole')
 .controller('StackVersionsCreateCtrl', ['$scope', 'Stack', '$routeParams', '$location', 'Alert',
'$translate', 'Cluster', function($scope, Stack, $routeParams, $location, Alert, $translate,
Cluster) {
   var $t = $translate.instant;
+  $scope.constants = {
+    os: $t('versions.os')
+  };
   $scope.createController = true;
   $scope.osList = [];
   $scope.skipValidation = false;
@@ -35,14 +38,14 @@ angular.module('ambariAdminConsole')
 
   $scope.option1 = {
     index: 1,
-    displayName: 'Upload Version Definition File',
+    displayName: $t('versions.uploadFile'),
     file: null,
     hasError: false
   };
   $scope.option2 = {
     index: 2,
-    displayName: 'Version Definition File URL',
-    url: 'https://',
+    displayName: $t('versions.enterURL'),
+    url: $t('versions.defaultURL'),
     hasError: false
   };
   $scope.selectedOption = {
@@ -102,10 +105,10 @@ angular.module('ambariAdminConsole')
           .then(function (response) {
             $scope.id = response.id;
             $scope.isPatch = response.type == 'PATCH';
-            $scope.stackNameVersion = response.stackNameVersion || 'n/a';
-            $scope.displayName = response.displayName || 'n/a';
-            $scope.version = response.version || 'n/a';
-            $scope.actualVersion = response.actualVersion || 'n/a';
+            $scope.stackNameVersion = response.stackNameVersion || $t('common.NA');
+            $scope.displayName = response.displayName || $t('common.NA');
+            $scope.version = response.version || $t('common.NA');
+            $scope.actualVersion = response.actualVersion || $t('common.NA');
             $scope.updateObj = response.updateObj;
             $scope.upgradeStack = {
               stack_name: response.stackName,

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2aec6fb/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 b86515f..d1da4c4 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
@@ -20,6 +20,9 @@
 angular.module('ambariAdminConsole')
 .controller('StackVersionsEditCtrl', ['$scope', '$location', 'Cluster', 'Stack', '$routeParams',
'ConfirmationModal', 'Alert', '$translate', function($scope, $location, Cluster, Stack, $routeParams,
ConfirmationModal, Alert, $translate) {
   var $t = $translate.instant;
+  $scope.constants = {
+    os: $t('versions.os')
+  };
   $scope.editController = true;
   $scope.osList = [];
   $scope.skipValidation = false;
@@ -35,10 +38,10 @@ angular.module('ambariAdminConsole')
     return Stack.getRepo($routeParams.versionId, $routeParams.stackName).then(function (response)
{
       $scope.id = response.id;
       $scope.isPatch = response.type == 'PATCH';
-      $scope.stackNameVersion = response.stackNameVersion || 'n/a';
-      $scope.displayName = response.displayName || 'n/a';
-      $scope.version = response.version || 'n/a';
-      $scope.actualVersion = response.actualVersion || 'n/a';
+      $scope.stackNameVersion = response.stackNameVersion || $t('common.NA');
+      $scope.displayName = response.displayName || $t('common.NA');
+      $scope.version = response.version || $t('common.NA');
+      $scope.actualVersion = response.actualVersion || $t('common.NA');
       $scope.updateObj = response.updateObj;
       $scope.upgradeStack = {
         stack_name: response.stackName,

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2aec6fb/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
index e12e897..2579a38 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
@@ -77,6 +77,7 @@ angular.module('ambariAdminConsole')
       'usersGroups': 'Users/Groups',
       'enabled': 'Enabled',
       'disabled': 'Disabled',
+      'NA': 'n/a',
 
       'clusterNameChangeConfirmation': {
         'title': 'Confirm Cluster Name Change',
@@ -110,7 +111,8 @@ angular.module('ambariAdminConsole')
         'save': 'Save',
         'clearFilters': 'clear filters',
         'confirmChange': 'Confirm Change',
-        'discard': 'Discard'
+        'discard': 'Discard',
+        'remove': 'Remove'
       },
 
       'alerts': {
@@ -305,6 +307,7 @@ angular.module('ambariAdminConsole')
       'installed': 'Installed',
       'uploadFile': 'Upload Version Definition File',
       'enterURL': 'Version Definition File URL',
+      'defaultURL': 'https://',
       'readInfo': 'Read Version Info',
       'browse': 'Browse',
       'installOn': 'Install on...',
@@ -317,6 +320,7 @@ angular.module('ambariAdminConsole')
       'baseURL': 'Base URL',
       'skipValidation': 'Skip Repository Base URL validation (Advanced)',
       'noVersions': 'Select version to display details.',
+      'patch': 'Patch',
       'contents': {
         'title': 'Contents',
         'empty': 'No contents to display'

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2aec6fb/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 b8d51b5..c37006b 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
@@ -97,7 +97,7 @@
       <div class="clearfix">
         <label class="control-label col-sm-3">{{'versions.details.stackName' | translate}}</label>
         <div class="version-info col-sm-7">{{stackNameVersion}}</div>
-        <div class="col-sm-2 patch-icon" ng-if="isPatch"><span class="glyphicon
glyphicon-tree-deciduous"></span>Patch</div>
+        <div class="col-sm-2 patch-icon" ng-if="isPatch"><span class="glyphicon
glyphicon-tree-deciduous"></span>{{'versions.patch' | translate}}</div>
       </div>
       <div class="clearfix">
         <label class="control-label col-sm-3">{{'versions.details.displayName' | translate}}</label>
@@ -152,13 +152,13 @@
                                          ng-change="clearError()" ng-disabled="!os.selected"></div>
               </div>
             </div>
-            <div class="col-sm-1 remove-icon" ng-click="removeOS()"><span class="glyphicon
glyphicon-minus"></span>Remove</div>
+            <div class="col-sm-1 remove-icon" ng-click="removeOS()"><span class="glyphicon
glyphicon-minus"></span>{{'common.controls.remove' | translate}}</div>
           </div>
         </div>
       </div>
         <div class="btn-group pull-right" dropdown>
           <button class="btn dropdown-toggle">
-            <span class="glyphicon glyphicon-plus"></span> Add OS &nbsp;<span
class="caret"></span></button>
+            <span class="glyphicon glyphicon-plus"></span> {{'common.add' | translate:
'{term: constants.os}'}} &nbsp;<span class="caret"></span></button>
           <ul class="dropdown-menu">
             <li ng-repeat="os in osList"><a ng-if="os.selected==false" ng-click="addOS()">{{os.OperatingSystems.os_type}}</a></li>
           </ul>


Mime
View raw message