Browse Source

AMBARI-4396. Misc code cleanup. (onechiporenko)

Oleg Nechiporenko 11 years ago
parent
commit
5ff51712a8
100 changed files with 228 additions and 305 deletions
  1. 1 2
      ambari-web/app/controllers/application.js
  2. 0 1
      ambari-web/app/controllers/global/background_operations_controller.js
  3. 1 1
      ambari-web/app/controllers/main.js
  4. 1 1
      ambari-web/app/controllers/main/admin/advanced.js
  5. 1 1
      ambari-web/app/controllers/main/admin/authentication.js
  6. 3 6
      ambari-web/app/controllers/main/admin/cluster.js
  7. 4 6
      ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
  8. 2 2
      ambari-web/app/controllers/main/admin/highAvailability/step2_controller.js
  9. 2 4
      ambari-web/app/controllers/main/admin/highAvailability/step4_controller.js
  10. 1 1
      ambari-web/app/controllers/main/admin/highAvailability/step6_controller.js
  11. 1 1
      ambari-web/app/controllers/main/admin/highAvailability/step8_controller.js
  12. 0 2
      ambari-web/app/controllers/main/admin/security/security_progress_controller.js
  13. 2 2
      ambari-web/app/controllers/main/admin/user.js
  14. 1 1
      ambari-web/app/controllers/main/admin/user/create.js
  15. 1 1
      ambari-web/app/controllers/main/admin/user/edit.js
  16. 1 1
      ambari-web/app/controllers/main/apps/item_controller.js
  17. 2 3
      ambari-web/app/controllers/main/apps_controller.js
  18. 1 1
      ambari-web/app/controllers/main/charts.js
  19. 1 9
      ambari-web/app/controllers/main/host/addHost/step4_controller.js
  20. 0 1
      ambari-web/app/controllers/main/host/add_controller.js
  21. 3 2
      ambari-web/app/controllers/main/host/details.js
  22. 6 18
      ambari-web/app/controllers/main/mirroring/targetClusterController.js
  23. 13 9
      ambari-web/app/controllers/main/service/info/configs.js
  24. 3 7
      ambari-web/app/controllers/main/service/manage_config_groups_controller.js
  25. 1 1
      ambari-web/app/controllers/main/service/reassign/step2_controller.js
  26. 1 1
      ambari-web/app/controllers/main/service/reassign/step3_controller.js
  27. 1 1
      ambari-web/app/controllers/main/service/reassign/step5_controller.js
  28. 1 1
      ambari-web/app/controllers/main/service/reassign/step6_controller.js
  29. 2 0
      ambari-web/app/controllers/wizard/slave_component_groups_controller.js
  30. 2 4
      ambari-web/app/controllers/wizard/stack_upgrade/step3_controller.js
  31. 1 1
      ambari-web/app/controllers/wizard/step10_controller.js
  32. 9 9
      ambari-web/app/controllers/wizard/step3_controller.js
  33. 2 2
      ambari-web/app/controllers/wizard/step5_controller.js
  34. 1 4
      ambari-web/app/controllers/wizard/step6_controller.js
  35. 9 9
      ambari-web/app/controllers/wizard/step7_controller.js
  36. 9 5
      ambari-web/app/controllers/wizard/step8_controller.js
  37. 1 2
      ambari-web/app/controllers/wizard/step9_controller.js
  38. 1 1
      ambari-web/app/data/HDP2/custom_configs.js
  39. 1 1
      ambari-web/app/data/custom_configs.js
  40. 2 0
      ambari-web/app/data/service_components.js
  41. 1 1
      ambari-web/app/data/services.js
  42. 1 1
      ambari-web/app/data/statusCodes.js
  43. 1 2
      ambari-web/app/mappers/cluster_mapper.js
  44. 1 1
      ambari-web/app/mappers/runs_mapper.js
  45. 1 2
      ambari-web/app/mappers/service_metrics_mapper.js
  46. 1 3
      ambari-web/app/models/alert.js
  47. 1 1
      ambari-web/app/models/app.js
  48. 1 1
      ambari-web/app/models/authentication.js
  49. 2 1
      ambari-web/app/models/cluster_states.js
  50. 2 0
      ambari-web/app/models/dataset_job.js
  51. 1 1
      ambari-web/app/models/form.js
  52. 1 3
      ambari-web/app/models/host.js
  53. 1 0
      ambari-web/app/models/run.js
  54. 2 2
      ambari-web/app/models/service.js
  55. 1 1
      ambari-web/app/models/service/yarn.js
  56. 2 1
      ambari-web/app/models/service_config.js
  57. 1 1
      ambari-web/app/router.js
  58. 1 1
      ambari-web/app/routes/high_availability_routes.js
  59. 5 9
      ambari-web/app/routes/installer.js
  60. 3 3
      ambari-web/app/templates/main/mirroring/testConnectionResults.hbs
  61. 1 5
      ambari-web/app/utils/ajax.js
  62. 1 1
      ambari-web/app/utils/base64.js
  63. 12 16
      ambari-web/app/utils/config.js
  64. 1 2
      ambari-web/app/utils/configs/defaults_providers/yarn_defaults_provider.js
  65. 2 7
      ambari-web/app/utils/configs/validators/service_configs_validator.js
  66. 2 2
      ambari-web/app/utils/date.js
  67. 1 1
      ambari-web/app/utils/db.js
  68. 5 5
      ambari-web/app/utils/graph.js
  69. 13 13
      ambari-web/app/utils/helper.js
  70. 4 3
      ambari-web/app/utils/host_progress_popup.js
  71. 0 1
      ambari-web/app/utils/hosts.js
  72. 3 3
      ambari-web/app/utils/http_client.js
  73. 7 8
      ambari-web/app/utils/number_utils.js
  74. 3 2
      ambari-web/app/utils/object_utils.js
  75. 1 2
      ambari-web/app/utils/polling.js
  76. 5 6
      ambari-web/app/utils/string_utils.js
  77. 3 3
      ambari-web/app/utils/updater.js
  78. 1 3
      ambari-web/app/views/common/chart.js
  79. 1 1
      ambari-web/app/views/common/chart/linear.js
  80. 5 5
      ambari-web/app/views/common/chart/linear_time.js
  81. 1 1
      ambari-web/app/views/common/configs/services_config.js
  82. 3 3
      ambari-web/app/views/common/grid.js
  83. 2 2
      ambari-web/app/views/common/metric.js
  84. 1 0
      ambari-web/app/views/common/modal_popup.js
  85. 1 3
      ambari-web/app/views/common/rolling_restart_view.js
  86. 2 2
      ambari-web/app/views/common/sort_view.js
  87. 1 1
      ambari-web/app/views/common/time_range.js
  88. 1 1
      ambari-web/app/views/experimental.js
  89. 1 1
      ambari-web/app/views/main/admin.js
  90. 2 4
      ambari-web/app/views/main/charts/heatmap/heatmap_host.js
  91. 1 2
      ambari-web/app/views/main/dashboard.js
  92. 1 2
      ambari-web/app/views/main/dashboard/service/hdfs.js
  93. 5 4
      ambari-web/app/views/main/dashboard/widget.js
  94. 1 1
      ambari-web/app/views/main/dashboard/widgets/node_managers_live.js
  95. 1 2
      ambari-web/app/views/main/host/details.js
  96. 1 7
      ambari-web/app/views/main/mirroring/jobs_view.js
  97. 1 1
      ambari-web/app/views/main/service/info/metrics/yarn/qmr.js
  98. 4 14
      ambari-web/app/views/main/service/info/summary.js
  99. 1 4
      ambari-web/app/views/main/service/menu.js
  100. 1 1
      ambari-web/app/views/main/service/reassign/step1_view.js

+ 1 - 2
ambari-web/app/controllers/application.js

@@ -29,8 +29,7 @@ App.ApplicationController = Em.Controller.extend({
 
 
   clusterDisplayName: function () {
   clusterDisplayName: function () {
     var name = this.get('clusterName');
     var name = this.get('clusterName');
-    var displayName = name.length > 13 ? name.substr(0, 10) + "..." : name;
-    return displayName;
+    return name.length > 13 ? name.substr(0, 10) + "..." : name;
   }.property('clusterName'),
   }.property('clusterName'),
 
 
   isClusterDataLoaded: function() {
   isClusterDataLoaded: function() {

+ 0 - 1
ambari-web/app/controllers/global/background_operations_controller.js

@@ -228,7 +228,6 @@ App.BackgroundOperationsController = Em.Controller.extend({
 
 
   /**
   /**
    * Onclick handler for background operations number located right to logo
    * Onclick handler for background operations number located right to logo
-   * @return PopupObject For testing purposes
    */
    */
   showPopup: function(){
   showPopup: function(){
     // load the checkbox on footer first, then show popup.
     // load the checkbox on footer first, then show popup.

+ 1 - 1
ambari-web/app/controllers/main.js

@@ -90,4 +90,4 @@ App.MainController = Em.Controller.extend({
     );
     );
   }.observes("App.router.location.lastSetURL", "App.clusterStatus.isInstalled")
   }.observes("App.router.location.lastSetURL", "App.clusterStatus.isInstalled")
 
 
-})
+});

+ 1 - 1
ambari-web/app/controllers/main/admin/advanced.js

@@ -51,4 +51,4 @@ App.MainAdminAdvancedController = Em.Controller.extend({
       }
       }
     })
     })
   }
   }
-})
+});

+ 1 - 1
ambari-web/app/controllers/main/admin/authentication.js

@@ -39,4 +39,4 @@ App.MainAdminAuthenticationController = Em.Controller.extend({
     }
     }
   },
   },
   content:App.Authentication.find(1)
   content:App.Authentication.find(1)
-})
+});

+ 3 - 6
ambari-web/app/controllers/main/admin/cluster.js

@@ -40,17 +40,14 @@ App.MainAdminClusterController = Em.Controller.extend({
 
 
   updateUpgradeVersionSuccessCallback: function(data) {
   updateUpgradeVersionSuccessCallback: function(data) {
     var upgradeVersion = this.get('upgradeVersion') || App.defaultStackVersion;
     var upgradeVersion = this.get('upgradeVersion') || App.defaultStackVersion;
-    var currentStack = {};
-    var upgradeStack = {};
     var currentVersion = App.get('currentStackVersionNumber');
     var currentVersion = App.get('currentStackVersionNumber');
-    var minUpgradeVersion = currentVersion;
     upgradeVersion = upgradeVersion.replace(/HDP-/, '');
     upgradeVersion = upgradeVersion.replace(/HDP-/, '');
     data.items.mapProperty('Versions.stack_version').forEach(function(version){
     data.items.mapProperty('Versions.stack_version').forEach(function(version){
       upgradeVersion = (stringUtils.compareVersions(upgradeVersion, version) === -1) ? version : upgradeVersion;
       upgradeVersion = (stringUtils.compareVersions(upgradeVersion, version) === -1) ? version : upgradeVersion;
     });
     });
-    currentStack = data.items.findProperty('Versions.stack_version', currentVersion);
-    upgradeStack = data.items.findProperty('Versions.stack_version', upgradeVersion);
-    minUpgradeVersion = upgradeStack.Versions.min_upgrade_version;
+    var currentStack = data.items.findProperty('Versions.stack_version', currentVersion);
+    var upgradeStack = data.items.findProperty('Versions.stack_version', upgradeVersion);
+    var minUpgradeVersion = upgradeStack.Versions.min_upgrade_version;
     if(minUpgradeVersion && (stringUtils.compareVersions(minUpgradeVersion, currentVersion) === 1)){
     if(minUpgradeVersion && (stringUtils.compareVersions(minUpgradeVersion, currentVersion) === 1)){
       upgradeVersion = currentVersion;
       upgradeVersion = currentVersion;
       upgradeStack = currentStack;
       upgradeStack = currentStack;

+ 4 - 6
ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js

@@ -64,8 +64,6 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   setCommandsAndTasks: function(tmpTasks) {
   setCommandsAndTasks: function(tmpTasks) {
     console.warn('func: setCommandsAndTasks');
     console.warn('func: setCommandsAndTasks');
     var fTask = this.get('failedTask');
     var fTask = this.get('failedTask');
-    var newCommands = [];
-    var newTasks = [];
     var index = [
     var index = [
       'deleteSNameNode',
       'deleteSNameNode',
       'startAllServices',
       'startAllServices',
@@ -86,12 +84,12 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
     if(index > 6){
     if(index > 6){
       --index;
       --index;
     }
     }
-    newCommands = this.get('commands').splice(index);
+    var newCommands = this.get('commands').splice(index);
     this.set('commands', newCommands);
     this.set('commands', newCommands);
-    newTasks = tmpTasks.splice(index);
+    var newTasks = tmpTasks.splice(index);
     for (var i = 0; i < newTasks.length; i++) {
     for (var i = 0; i < newTasks.length; i++) {
       newTasks[i].id = i;
       newTasks[i].id = i;
-    };
+    }
     this.set('tasks', newTasks);
     this.set('tasks', newTasks);
     var hbaseTask = this.get('tasks').findProperty('command', 'restoreHBaseConfigs');
     var hbaseTask = this.get('tasks').findProperty('command', 'restoreHBaseConfigs');
     if (!App.Service.find().someProperty('serviceName', 'HBASE') && hbaseTask) {
     if (!App.Service.find().someProperty('serviceName', 'HBASE') && hbaseTask) {
@@ -243,7 +241,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
   },
   stopStandbyNameNode: function(){
   stopStandbyNameNode: function(){
     console.warn('func: stopStandbyNameNode');
     console.warn('func: stopStandbyNameNode');
-    var hostName = this.get('content.masterComponentHosts').findProperty('isAddNameNode', true).hostName;;
+    var hostName = this.get('content.masterComponentHosts').findProperty('isAddNameNode', true).hostName;
     this.stopComponent('NAMENODE', hostName);
     this.stopComponent('NAMENODE', hostName);
   },
   },
   stopNameNode: function(){
   stopNameNode: function(){

+ 2 - 2
ambari-web/app/controllers/main/admin/highAvailability/step2_controller.js

@@ -47,7 +47,7 @@ App.HighAvailabilityWizardStep2Controller = App.WizardStep5Controller.extend({
         }else{
         }else{
           item.set('color','grey');
           item.set('color','grey');
         }
         }
-      })
+      });
 
 
       mappingObject = Ember.Object.create({
       mappingObject = Ember.Object.create({
         host_name:item,
         host_name:item,
@@ -106,7 +106,7 @@ App.HighAvailabilityWizardStep2Controller = App.WizardStep5Controller.extend({
         isAddNameNode: true,
         isAddNameNode: true,
         zId: 1
         zId: 1
       }
       }
-    )
+    );
 
 
     masterComponents.forEach(function (item) {
     masterComponents.forEach(function (item) {
       var componentObj = Ember.Object.create(item);
       var componentObj = Ember.Object.create(item);

+ 2 - 4
ambari-web/app/controllers/main/admin/highAvailability/step4_controller.js

@@ -43,7 +43,7 @@ App.HighAvailabilityWizardStep4Controller = Em.Controller.extend({
   checkNnCheckPointStatus: function (data) {
   checkNnCheckPointStatus: function (data) {
     var self = this;
     var self = this;
     var journalTransactionInfo =  $.parseJSON(data.metrics.dfs.namenode.JournalTransactionInfo);
     var journalTransactionInfo =  $.parseJSON(data.metrics.dfs.namenode.JournalTransactionInfo);
-    var isInSafeMode = data.metrics.dfs.namenode.Safemode != "" ? true : false;
+    var isInSafeMode = (data.metrics.dfs.namenode.Safemode != "");
     journalTransactionInfo = parseInt(journalTransactionInfo.LastAppliedOrWrittenTxId) - parseInt(journalTransactionInfo.MostRecentCheckpointTxId);
     journalTransactionInfo = parseInt(journalTransactionInfo.LastAppliedOrWrittenTxId) - parseInt(journalTransactionInfo.MostRecentCheckpointTxId);
     if(journalTransactionInfo <= 1 && isInSafeMode){
     if(journalTransactionInfo <= 1 && isInSafeMode){
       this.set("isNextEnabled", true);
       this.set("isNextEnabled", true);
@@ -61,7 +61,5 @@ App.HighAvailabilityWizardStep4Controller = Em.Controller.extend({
     }
     }
   }
   }
 
 
-
-
-})
+});
 
 

+ 1 - 1
ambari-web/app/controllers/main/admin/highAvailability/step6_controller.js

@@ -72,5 +72,5 @@ App.HighAvailabilityWizardStep6Controller = Em.Controller.extend({
     }
     }
   }
   }
 
 
-})
+});
 
 

+ 1 - 1
ambari-web/app/controllers/main/admin/highAvailability/step8_controller.js

@@ -22,5 +22,5 @@ App.HighAvailabilityWizardStep8Controller = Em.Controller.extend({
 
 
   name:"highAvailabilityWizardStep8Controller"
   name:"highAvailabilityWizardStep8Controller"
 
 
-})
+});
 
 

+ 0 - 2
ambari-web/app/controllers/main/admin/security/security_progress_controller.js

@@ -243,9 +243,7 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
 
 
   /**
   /**
    * gets site config properties from server and sets it for every configuration
    * gets site config properties from server and sets it for every configuration
-   * @param serviceConfigTags
    */
    */
-
   getAllConfigurations: function () {
   getAllConfigurations: function () {
     var urlParams = [];
     var urlParams = [];
     this.get('serviceConfigTags').forEach(function (_tag) {
     this.get('serviceConfigTags').forEach(function (_tag) {

+ 2 - 2
ambari-web/app/controllers/main/admin/user.js

@@ -61,7 +61,7 @@ App.MainAdminUserController = Em.Controller.extend({
             } catch (err) {
             } catch (err) {
 
 
             }
             }
-          })
+          });
         this.hide();
         this.hide();
       },
       },
       onSecondary:function () {
       onSecondary:function () {
@@ -106,4 +106,4 @@ App.MainAdminUserController = Em.Controller.extend({
       statusCode: require('data/statusCodes')
       statusCode: require('data/statusCodes')
     });
     });
   }
   }
-})
+});

+ 1 - 1
ambari-web/app/controllers/main/admin/user/create.js

@@ -21,4 +21,4 @@ var App = require('app');
 App.MainAdminUserCreateController = Em.Controller.extend({
 App.MainAdminUserCreateController = Em.Controller.extend({
   name:'mainAdminUserCreateController',
   name:'mainAdminUserCreateController',
   content:false
   content:false
-})
+});

+ 1 - 1
ambari-web/app/controllers/main/admin/user/edit.js

@@ -21,4 +21,4 @@ var App = require('app');
 App.MainAdminUserEditController = App.MainAdminUserController.extend({
 App.MainAdminUserEditController = App.MainAdminUserController.extend({
   name:'mainAdminUserEditController',
   name:'mainAdminUserEditController',
   content:false
   content:false
-})
+});

+ 1 - 1
ambari-web/app/controllers/main/apps/item_controller.js

@@ -46,4 +46,4 @@ App.MainAppsItemController = Em.Controller.extend({
     });
     });
   }.observes('content')
   }.observes('content')
 
 
-})
+});

+ 2 - 3
ambari-web/app/controllers/main/apps_controller.js

@@ -337,7 +337,7 @@ App.MainAppsController = Em.ArrayController.extend({
             filtersUsed = true;
             filtersUsed = true;
           }
           }
         }
         }
-      };
+      }
 
 
       link = link.slice(0,link.length-1);
       link = link.slice(0,link.length-1);
 
 
@@ -501,5 +501,4 @@ App.MainAppsController = Em.ArrayController.extend({
     ]
     ]
   })
   })
 
 
-
-})
+});

+ 1 - 1
ambari-web/app/controllers/main/charts.js

@@ -20,4 +20,4 @@ var App = require('app');
 
 
 App.MainChartsController = Em.ArrayController.extend({
 App.MainChartsController = Em.ArrayController.extend({
   name:'mainChartsController'
   name:'mainChartsController'
-})
+});

+ 1 - 9
ambari-web/app/controllers/main/host/addHost/step4_controller.js

@@ -53,13 +53,5 @@ App.AddHostStep4Controller= Em.Controller.extend({
     return df.promise();
     return df.promise();
   }
   }
 
 
-
-
-
-
-
-
-
-
-})
+});
 
 

+ 0 - 1
ambari-web/app/controllers/main/host/add_controller.js

@@ -287,7 +287,6 @@ App.AddHostController = App.WizardController.extend({
 
 
   /**
   /**
    * Generate clients list for selected services and save it to model
    * Generate clients list for selected services and save it to model
-   * @param stepController step4WizardController
    */
    */
   saveClients: function () {
   saveClients: function () {
     var clients = [];
     var clients = [];

+ 3 - 2
ambari-web/app/controllers/main/host/details.js

@@ -370,7 +370,7 @@ App.MainHostDetailsController = Em.Controller.extend({
    * send command to server to install selected host component
    * send command to server to install selected host component
    * @param event
    * @param event
    */
    */
-  addComponent: function (event, context) {
+  addComponent: function (event) {
     var self = this;
     var self = this;
     var component = event.context;
     var component = event.context;
     var componentName = component.get('componentName').toUpperCase().toString();
     var componentName = component.get('componentName').toUpperCase().toString();
@@ -683,7 +683,8 @@ App.MainHostDetailsController = Em.Controller.extend({
   /**
   /**
    * Performs either Decommission or Recommission by updating the hosts list on
    * Performs either Decommission or Recommission by updating the hosts list on
    * server.
    * server.
-   * @param decommission defines context for request (true for decommission and false for recommission)
+   * @param {Array} decommissionHostNames
+   * @param {Boolean} decommission defines context for request (true for decommission and false for recommission)
    */
    */
   doDatanodeDecommission: function(decommissionHostNames, decommission){
   doDatanodeDecommission: function(decommissionHostNames, decommission){
     var self = this;
     var self = this;

+ 6 - 18
ambari-web/app/controllers/main/mirroring/targetClusterController.js

@@ -27,16 +27,14 @@ App.MainMirroringTargetClusterController = Ember.Controller.extend({
         return value;
         return value;
       }
       }
       var controller = App.router.get('mainMirroringTargetClusterController');
       var controller = App.router.get('mainMirroringTargetClusterController');
-      var isNameNodeWebUrlError = controller.checkNameNodeWebUrlErrors();
-      return isNameNodeWebUrlError;
+      return controller.checkNameNodeWebUrlErrors();
     }.property('targetCluster.nameNodeWebUrl', 'model.targetCluster.nameNodeWebUrl'),
     }.property('targetCluster.nameNodeWebUrl', 'model.targetCluster.nameNodeWebUrl'),
     isNameNodeRpcUrlError: function (key, value) {
     isNameNodeRpcUrlError: function (key, value) {
       if (value) {
       if (value) {
         return value;
         return value;
       }
       }
       var controller = App.router.get('mainMirroringTargetClusterController');
       var controller = App.router.get('mainMirroringTargetClusterController');
-      var isNameNodeRpcUrlError = controller.checkNameNodeRpcUrlErrors();
-      return isNameNodeRpcUrlError;
+      return controller.checkNameNodeRpcUrlErrors();
     }.property('targetCluster.nameNodeRpcUrl', 'model.targetCluster.nameNodeRpcUrl'),
     }.property('targetCluster.nameNodeRpcUrl', 'model.targetCluster.nameNodeRpcUrl'),
 
 
     isOozieServerUrlError: function (key, value) {
     isOozieServerUrlError: function (key, value) {
@@ -44,8 +42,7 @@ App.MainMirroringTargetClusterController = Ember.Controller.extend({
         return value;
         return value;
       }
       }
       var controller = App.router.get('mainMirroringTargetClusterController');
       var controller = App.router.get('mainMirroringTargetClusterController');
-      var isOozieServerUrlError = controller.checkOozieServerUrlErrors();
-      return isOozieServerUrlError;
+      return controller.checkOozieServerUrlErrors();
     }.property('targetCluster.oozieServerUrl', 'model.targetCluster.oozieServerUrl'),
     }.property('targetCluster.oozieServerUrl', 'model.targetCluster.oozieServerUrl'),
 
 
     isClusterNameError: function (key, value) {
     isClusterNameError: function (key, value) {
@@ -53,8 +50,7 @@ App.MainMirroringTargetClusterController = Ember.Controller.extend({
         return value;
         return value;
       }
       }
       var controller = App.router.get('mainMirroringTargetClusterController');
       var controller = App.router.get('mainMirroringTargetClusterController');
-      var isClusterNameError = controller.checkClusterNameErrors();
-      return isClusterNameError;
+      return controller.checkClusterNameErrors();
     }.property('targetCluster.clusterName', 'model.targetCluster.clusterName'),
     }.property('targetCluster.clusterName', 'model.targetCluster.clusterName'),
 
 
     nameNodeWebUrlErrorMessage: null,
     nameNodeWebUrlErrorMessage: null,
@@ -71,19 +67,11 @@ App.MainMirroringTargetClusterController = Ember.Controller.extend({
     var isNameNodeRpcUrlError = this.checkNameNodeRpcUrlErrors();
     var isNameNodeRpcUrlError = this.checkNameNodeRpcUrlErrors();
     var isOozieServerUrlError = this.checkOozieServerUrlErrors();
     var isOozieServerUrlError = this.checkOozieServerUrlErrors();
 
 
-    if (isNameNodeWebUrlError || isNameNodeRpcUrlError || isOozieServerUrlError) {
-      return false;
-    }
-    return true;
+    return !(isNameNodeWebUrlError || isNameNodeRpcUrlError || isOozieServerUrlError);
   },
   },
 
 
   validate2: function () {
   validate2: function () {
-    var isClusterNameError = this.checkClusterNameErrors();
-
-    if (isClusterNameError) {
-      return false;
-    }
-    return true;
+    return !this.checkClusterNameErrors();
   },
   },
 
 
   checkNameNodeWebUrlErrors: function () {
   checkNameNodeWebUrlErrors: function () {

+ 13 - 9
ambari-web/app/controllers/main/service/info/configs.js

@@ -370,8 +370,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         this.loadedGroupToOverrideSiteToTagMap[groupName] = {};
         this.loadedGroupToOverrideSiteToTagMap[groupName] = {};
         item.get('configSiteTags').forEach(function (siteTag) {
         item.get('configSiteTags').forEach(function (siteTag) {
           var site = siteTag.get('site');
           var site = siteTag.get('site');
-          var tag = siteTag.get('tag');
-          this.loadedGroupToOverrideSiteToTagMap[groupName][site] = tag;
+          this.loadedGroupToOverrideSiteToTagMap[groupName][site] = siteTag.get('tag');
         }, this);
         }, this);
       }, this);
       }, this);
     }
     }
@@ -692,7 +691,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
 
 
   /**
   /**
    * Determines which host components are running on each host.
    * Determines which host components are running on each host.
-   * @param status 'running' or 'unknown'
+   * @param {Array} services
+   * @param {String} status 'running' or 'unknown'
    * @return Returned in the following format:
    * @return Returned in the following format:
    * {
    * {
    *  runningHosts: {
    *  runningHosts: {
@@ -1206,13 +1206,14 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
    * @param templateName
    * @param templateName
    * @param expression
    * @param expression
    * @param name
    * @param name
-   * @return {
+   * @return {Object}
+   * example: <code>{
    *   value: '...',
    *   value: '...',
    *   overrides: {
    *   overrides: {
    *    'value1': [h1, h2],
    *    'value1': [h1, h2],
    *    'value2': [h3]
    *    'value2': [h3]
    *   }
    *   }
-   * }
+   * }</code>
    */
    */
   getGlobConfigValueWithOverrides: function (templateName, expression, name) {
   getGlobConfigValueWithOverrides: function (templateName, expression, name) {
     var express = expression.match(/<(.*?)>/g);
     var express = expression.match(/<(.*?)>/g);
@@ -1493,7 +1494,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
 
 
   /**
   /**
    * create global site object
    * create global site object
-   * @param tagName
+   * @param {String} tagName
+   * @param {Array} globalConfigs
    * @return {Object}
    * @return {Object}
    */
    */
   createGlobalSiteObj: function (tagName, globalConfigs) {
   createGlobalSiteObj: function (tagName, globalConfigs) {
@@ -1580,6 +1582,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
    * create site object
    * create site object
    * @param siteName
    * @param siteName
    * @param tagName
    * @param tagName
+   * @param siteObj
    * @return {Object}
    * @return {Object}
    */
    */
   createSiteObj: function (siteName, tagName, siteObj) {
   createSiteObj: function (siteName, tagName, siteObj) {
@@ -1593,8 +1596,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
 
 
   /**
   /**
    * Set display names of the property from the puppet/global names
    * Set display names of the property from the puppet/global names
-   * @param: displayNames: a field to be set with displayNames
-   * @param names: array of property puppet/global names
+   * @param {Array} displayNames a field to be set with displayNames
+   * @param {Array} names array of property puppet/global names
    */
    */
   setPropertyDisplayNames: function (displayNames, names) {
   setPropertyDisplayNames: function (displayNames, names) {
     var stepConfigs = this.get('stepConfigs').findProperty('serviceName', this.get('content.serviceName')).configs;
     var stepConfigs = this.get('stepConfigs').findProperty('serviceName', this.get('content.serviceName')).configs;
@@ -2025,7 +2028,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
 
 
   /**
   /**
    * If some configs are changed and user navigates away or select another config-group, show this popup with propose to save changes
    * If some configs are changed and user navigates away or select another config-group, show this popup with propose to save changes
-   * @param {object} event - triggered event for seleting another config-group
+   * @param {String} path
+   * @param {object} event - triggered event for selecting another config-group
    */
    */
   showSavePopup: function (path, event) {
   showSavePopup: function (path, event) {
     var _this = this;
     var _this = this;

+ 3 - 7
ambari-web/app/controllers/main/service/manage_config_groups_controller.js

@@ -235,7 +235,7 @@ App.ManageConfigGroupsController = Em.Controller.extend({
    */
    */
   deleteHosts: function () {
   deleteHosts: function () {
     if (this.get('isDeleteHostsDisabled')) {
     if (this.get('isDeleteHostsDisabled')) {
-      return false;
+      return;
     }
     }
     var groupHosts = this.get('selectedConfigGroup.hosts');
     var groupHosts = this.get('selectedConfigGroup.hosts');
     var defaultGroupHosts = this.get('selectedConfigGroup.parentConfigGroup.hosts');
     var defaultGroupHosts = this.get('selectedConfigGroup.parentConfigGroup.hosts');
@@ -249,11 +249,7 @@ App.ManageConfigGroupsController = Em.Controller.extend({
   isDeleteHostsDisabled: function () {
   isDeleteHostsDisabled: function () {
     var selectedConfigGroup = this.get('selectedConfigGroup');
     var selectedConfigGroup = this.get('selectedConfigGroup');
     if (selectedConfigGroup) {
     if (selectedConfigGroup) {
-      if (selectedConfigGroup.isDefault || this.get('selectedHosts').length === 0) {
-        return true;
-      } else {
-        return false;
-      }
+      return selectedConfigGroup.isDefault || this.get('selectedHosts').length === 0;
     }
     }
     return true;
     return true;
   }.property('selectedConfigGroup', 'selectedConfigGroup.hosts.length', 'selectedHosts.length'),
   }.property('selectedConfigGroup', 'selectedConfigGroup.hosts.length', 'selectedHosts.length'),
@@ -335,7 +331,7 @@ App.ManageConfigGroupsController = Em.Controller.extend({
       }.property('warningMessage', 'configGroupName', 'configGroupDesc'),
       }.property('warningMessage', 'configGroupName', 'configGroupDesc'),
       onPrimary: function () {
       onPrimary: function () {
         if (!this.get('enablePrimary')) {
         if (!this.get('enablePrimary')) {
-          return false;
+          return;
         }
         }
         self.set('selectedConfigGroup.name', this.get('configGroupName'));
         self.set('selectedConfigGroup.name', this.get('configGroupName'));
         self.set('selectedConfigGroup.description', this.get('configGroupDesc'));
         self.set('selectedConfigGroup.description', this.get('configGroupDesc'));

+ 1 - 1
ambari-web/app/controllers/main/service/reassign/step2_controller.js

@@ -70,7 +70,7 @@ App.ReassignMasterWizardStep2Controller = App.WizardStep5Controller.extend({
       }
       }
     }, this);
     }, this);
     if (availableComponentHosts.length == 0) {
     if (availableComponentHosts.length == 0) {
-      return false;
+      return;
     }
     }
     currentComponents.forEach(function (item) {
     currentComponents.forEach(function (item) {
       preparedAvailableHosts = availableComponentHosts.slice(0);
       preparedAvailableHosts = availableComponentHosts.slice(0);

+ 1 - 1
ambari-web/app/controllers/main/service/reassign/step3_controller.js

@@ -18,4 +18,4 @@
 
 
 var App = require('app');
 var App = require('app');
 
 
-App.ReassignMasterWizardStep3Controller = Em.Controller.extend()
+App.ReassignMasterWizardStep3Controller = Em.Controller.extend();

+ 1 - 1
ambari-web/app/controllers/main/service/reassign/step5_controller.js

@@ -20,4 +20,4 @@ var App = require('app');
 
 
 App.ReassignMasterWizardStep5Controller = Em.Controller.extend({
 App.ReassignMasterWizardStep5Controller = Em.Controller.extend({
 
 
-})
+});

+ 1 - 1
ambari-web/app/controllers/main/service/reassign/step6_controller.js

@@ -113,4 +113,4 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro
       this.onTaskError();
       this.onTaskError();
     }
     }
   }
   }
-})
+});

+ 2 - 0
ambari-web/app/controllers/wizard/slave_component_groups_controller.js

@@ -163,6 +163,7 @@ App.SlaveComponentGroupsController = Em.ArrayController.extend({
     if(hosts){
     if(hosts){
       return hosts.mapProperty('group').uniq();
       return hosts.mapProperty('group').uniq();
     }
     }
+    return [];
   }.property('hosts'),
   }.property('hosts'),
 
 
   componentGroups: function () {
   componentGroups: function () {
@@ -287,6 +288,7 @@ App.SlaveComponentGroupsController = Em.ArrayController.extend({
     if(hosts){
     if(hosts){
       return hosts.filterProperty('group', group.name);
       return hosts.filterProperty('group', group.name);
     }
     }
+    return [];
   },
   },
 
 
   /**
   /**

+ 2 - 4
ambari-web/app/controllers/wizard/stack_upgrade/step3_controller.js

@@ -346,10 +346,9 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
     var tasks = data.tasks || [];
     var tasks = data.tasks || [];
     var process = this.get('processes').findProperty('isRunning', true);
     var process = this.get('processes').findProperty('isRunning', true);
     // if process was finished then it terminates next poll
     // if process was finished then it terminates next poll
-    var continuePolling = true;
 
 
     this.progressOnProcess(tasks, process);
     this.progressOnProcess(tasks, process);
-    continuePolling = this.statusOnProcess(tasks, process);
+    var continuePolling = this.statusOnProcess(tasks, process);
     if(process.get('hosts').length && tasks.length){
     if(process.get('hosts').length && tasks.length){
       process.get('hosts').forEach(function (host) {
       process.get('hosts').forEach(function (host) {
         var tasksPerHost = tasks.filterProperty('Tasks.host_name', host.name);
         var tasksPerHost = tasks.filterProperty('Tasks.host_name', host.name);
@@ -367,7 +366,6 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
    * @param process
    * @param process
    */
    */
   progressOnProcess: function(actions, process){
   progressOnProcess: function(actions, process){
-    var progress = 0;
     var actionsNumber = actions.length;
     var actionsNumber = actions.length;
     var completedActions = actions.filterProperty('Tasks.status', 'COMPLETED').length
     var completedActions = actions.filterProperty('Tasks.status', 'COMPLETED').length
       + actions.filterProperty('Tasks.status', 'FAILED').length
       + actions.filterProperty('Tasks.status', 'FAILED').length
@@ -375,7 +373,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
       + actions.filterProperty('Tasks.status', 'TIMEDOUT').length;
       + actions.filterProperty('Tasks.status', 'TIMEDOUT').length;
     var queuedActions = actions.filterProperty('Tasks.status', 'QUEUED').length;
     var queuedActions = actions.filterProperty('Tasks.status', 'QUEUED').length;
     var inProgressActions = actions.filterProperty('Tasks.status', 'IN_PROGRESS').length;
     var inProgressActions = actions.filterProperty('Tasks.status', 'IN_PROGRESS').length;
-    progress = Math.ceil(((queuedActions * 0.09) + (inProgressActions * 0.35) + completedActions ) / actionsNumber * 100);
+    var progress = Math.ceil(((queuedActions * 0.09) + (inProgressActions * 0.35) + completedActions ) / actionsNumber * 100);
     console.log('INFO: progress is: ' + progress);
     console.log('INFO: progress is: ' + progress);
     process.set('progress', progress);
     process.set('progress', progress);
   },
   },

+ 1 - 1
ambari-web/app/controllers/wizard/step10_controller.js

@@ -185,7 +185,7 @@ App.WizardStep10Controller = Em.Controller.extend({
           this.loadOozieServer(component);
           this.loadOozieServer(component);
           break;
           break;
         case 'GANGLIA_SERVER':
         case 'GANGLIA_SERVER':
-          this.loadGanglia(component)
+          this.loadGanglia(component);
           break;
           break;
         case 'NAGIOS_SERVER':
         case 'NAGIOS_SERVER':
           this.loadNagios(component);
           this.loadNagios(component);

+ 9 - 9
ambari-web/app/controllers/wizard/step3_controller.js

@@ -296,7 +296,7 @@ App.WizardStep3Controller = Em.Controller.extend({
 
 
   disablePreviousSteps: function () {
   disablePreviousSteps: function () {
     App.router.get('installerController.isStepDisabled').filter(function (step) {
     App.router.get('installerController.isStepDisabled').filter(function (step) {
-      if (step.step >= 0 && step.step <= 2) return true;
+      return step.step >= 0 && step.step <= 2;
     }).setEach('value', this.get('isRegistrationInProgress'));
     }).setEach('value', this.get('isRegistrationInProgress'));
     if (this.get('isRegistrationInProgress')) {
     if (this.get('isRegistrationInProgress')) {
       this.set('isSubmitDisabled', true);
       this.set('isSubmitDisabled', true);
@@ -780,7 +780,7 @@ App.WizardStep3Controller = Em.Controller.extend({
       var host = {
       var host = {
         name: _host.Hosts.host_name,
         name: _host.Hosts.host_name,
         warnings: []
         warnings: []
-      }
+      };
       if (!_host.Hosts.last_agent_env) {
       if (!_host.Hosts.last_agent_env) {
         // in some unusual circumstances when last_agent_env is not available from the _host,
         // in some unusual circumstances when last_agent_env is not available from the _host,
         // skip the _host and proceed to process the rest of the hosts.
         // skip the _host and proceed to process the rest of the hosts.
@@ -804,7 +804,7 @@ App.WizardStep3Controller = Em.Controller.extend({
             hosts: [_host.Hosts.host_name],
             hosts: [_host.Hosts.host_name],
             category: 'fileFolders',
             category: 'fileFolders',
             onSingleHost: true
             onSingleHost: true
-          }
+          };
           warnings.push(warning);
           warnings.push(warning);
         }
         }
         host.warnings.push(warning);
         host.warnings.push(warning);
@@ -824,7 +824,7 @@ App.WizardStep3Controller = Em.Controller.extend({
               hosts: [_host.Hosts.host_name],
               hosts: [_host.Hosts.host_name],
               category: 'packages',
               category: 'packages',
               onSingleHost: true
               onSingleHost: true
-            }
+            };
             warnings.push(warning);
             warnings.push(warning);
           }
           }
           host.warnings.push(warning);
           host.warnings.push(warning);
@@ -852,7 +852,7 @@ App.WizardStep3Controller = Em.Controller.extend({
                     '<p style="text-align: center">................</p>' +
                     '<p style="text-align: center">................</p>' +
                     '...' + process.command.substr(-230)) + '</td></tr></table>',
                     '...' + process.command.substr(-230)) + '</td></tr></table>',
             onSingleHost: true
             onSingleHost: true
-          }
+          };
           warnings.push(warning);
           warnings.push(warning);
         }
         }
         host.warnings.push(warning);
         host.warnings.push(warning);
@@ -875,7 +875,7 @@ App.WizardStep3Controller = Em.Controller.extend({
                 hosts: [_host.Hosts.host_name],
                 hosts: [_host.Hosts.host_name],
                 category: 'services',
                 category: 'services',
                 onSingleHost: true
                 onSingleHost: true
-              }
+              };
               warnings.push(warning);
               warnings.push(warning);
             }
             }
             host.warnings.push(warning);
             host.warnings.push(warning);
@@ -898,7 +898,7 @@ App.WizardStep3Controller = Em.Controller.extend({
               hosts: [_host.Hosts.host_name],
               hosts: [_host.Hosts.host_name],
               category: 'users',
               category: 'users',
               onSingleHost: true
               onSingleHost: true
-            }
+            };
             warnings.push(warning);
             warnings.push(warning);
           }
           }
           host.warnings.push(warning);
           host.warnings.push(warning);
@@ -919,7 +919,7 @@ App.WizardStep3Controller = Em.Controller.extend({
             hosts: [_host.Hosts.host_name],
             hosts: [_host.Hosts.host_name],
             category: 'misc',
             category: 'misc',
             onSingleHost: true
             onSingleHost: true
-          }
+          };
           warnings.push(warning);
           warnings.push(warning);
         }
         }
         host.warnings.push(warning);
         host.warnings.push(warning);
@@ -938,7 +938,7 @@ App.WizardStep3Controller = Em.Controller.extend({
             hosts: [_host.Hosts.host_name],
             hosts: [_host.Hosts.host_name],
             category: 'firewall',
             category: 'firewall',
             onSingleHost: true
             onSingleHost: true
-          }
+          };
           warnings.push(warning);
           warnings.push(warning);
         }
         }
         host.warnings.push(warning);
         host.warnings.push(warning);

+ 2 - 2
ambari-web/app/controllers/wizard/step5_controller.js

@@ -605,7 +605,7 @@ App.WizardStep5Controller = Em.Controller.extend({
    * @return {Boolean}
    * @return {Boolean}
    */
    */
   removeComponent:function (componentName, zId) {
   removeComponent:function (componentName, zId) {
-    var currentZooKeepers = this.get("selectedServicesMasters").filterProperty("component_name", componentName)
+    var currentZooKeepers = this.get("selectedServicesMasters").filterProperty("component_name", componentName);
 
 
     //work only if the Zookeeper service is selected in previous step
     //work only if the Zookeeper service is selected in previous step
     if (!currentZooKeepers.length) {
     if (!currentZooKeepers.length) {
@@ -650,7 +650,7 @@ App.WizardStep5Controller = Em.Controller.extend({
 
 
     currentComponents.forEach(function (item) {
     currentComponents.forEach(function (item) {
       preparedAvailableHosts = availableComponentHosts.slice(0);
       preparedAvailableHosts = availableComponentHosts.slice(0);
-      preparedAvailableHosts.pushObject(this.get("hosts").findProperty("host_name", item.get("selectedHost")))
+      preparedAvailableHosts.pushObject(this.get("hosts").findProperty("host_name", item.get("selectedHost")));
       preparedAvailableHosts.sort(this.sortHostsByConfig, this);
       preparedAvailableHosts.sort(this.sortHostsByConfig, this);
       item.set("availableHosts", preparedAvailableHosts);
       item.set("availableHosts", preparedAvailableHosts);
     }, this);
     }, this);

+ 1 - 4
ambari-web/app/controllers/wizard/step6_controller.js

@@ -89,10 +89,7 @@ App.WizardStep6Controller = Em.Controller.extend({
             isError |= host.get('checkboxes').findProperty('title', header.get('label')).checked;
             isError |= host.get('checkboxes').findProperty('title', header.get('label')).checked;
           });
           });
           isError = !isError;
           isError = !isError;
-          if (isError) {
-            return;
-          }
-          else {
+          if (!isError) {
             self.set('errorMessage', '');
             self.set('errorMessage', '');
           }
           }
         });
         });

+ 9 - 9
ambari-web/app/controllers/wizard/step7_controller.js

@@ -191,8 +191,7 @@ App.WizardStep7Controller = Em.Controller.extend({
           loadedGroupToOverrideSiteToTagMap[groupName] = {};
           loadedGroupToOverrideSiteToTagMap[groupName] = {};
           item.get('configSiteTags').forEach(function (siteTag) {
           item.get('configSiteTags').forEach(function (siteTag) {
             var site = siteTag.get('site');
             var site = siteTag.get('site');
-            var tag = siteTag.get('tag');
-            loadedGroupToOverrideSiteToTagMap[groupName][site] = tag;
+            loadedGroupToOverrideSiteToTagMap[groupName][site] = siteTag.get('tag');
           }, this);
           }, this);
         }, this);
         }, this);
       }
       }
@@ -579,7 +578,8 @@ App.WizardStep7Controller = Em.Controller.extend({
   },
   },
 
 
   /**
   /**
-   * @param: An array of display names
+   * @param {String} siteProperty
+   * @param {Array} displayNames An array of display names
    */
    */
   setDisplayMessage: function (siteProperty, displayNames) {
   setDisplayMessage: function (siteProperty, displayNames) {
     var displayMsg = null;
     var displayMsg = null;
@@ -607,9 +607,9 @@ App.WizardStep7Controller = Em.Controller.extend({
 
 
   /**
   /**
    * Set display names of the property tfrom he puppet/global names
    * Set display names of the property tfrom he puppet/global names
-   * @param displayNames: a field to be set with displayNames
-   * @param names: array of property puppet/global names
-   * @param configProperties: array of config properties of the respective service to the name param
+   * @param {Array} displayNames a field to be set with displayNames
+   * @param {Array} names array of property puppet/global names
+   * @param {Array} configProperties array of config properties of the respective service to the name param
    */
    */
   setPropertyDisplayNames: function (displayNames, names, configProperties) {
   setPropertyDisplayNames: function (displayNames, names, configProperties) {
     names.forEach(function (_name, index) {
     names.forEach(function (_name, index) {
@@ -621,7 +621,7 @@ App.WizardStep7Controller = Em.Controller.extend({
 
 
   /**
   /**
    * Display Error Message with service name, its custom configuration name and displaynames on the page
    * Display Error Message with service name, its custom configuration name and displaynames on the page
-   * @param customConfig: array with custom configuration, serviceName and displayNames relative to custom configuration
+   * @param {Array} customConfig array with custom configuration, serviceName and displayNames relative to custom configuration
    */
    */
   showCustomConfigErrMsg: function (customConfig) {
   showCustomConfigErrMsg: function (customConfig) {
 
 
@@ -660,7 +660,7 @@ App.WizardStep7Controller = Em.Controller.extend({
     var validComponents = Ember.A([]);
     var validComponents = Ember.A([]);
     var seenComponents = {};
     var seenComponents = {};
     masterComponents.forEach(function(component){
     masterComponents.forEach(function(component){
-      var cn = component.component
+      var cn = component.component;
       var cdn = component.display_name;
       var cdn = component.display_name;
       if(component.serviceId===selectedServiceName && !seenComponents[cn]){
       if(component.serviceId===selectedServiceName && !seenComponents[cn]){
         validComponents.pushObject(Ember.Object.create({
         validComponents.pushObject(Ember.Object.create({
@@ -672,7 +672,7 @@ App.WizardStep7Controller = Em.Controller.extend({
       }
       }
     });
     });
     slaveComponents.forEach(function(component){
     slaveComponents.forEach(function(component){
-      var cn = component.componentName
+      var cn = component.componentName;
       var cdn = component.displayName;
       var cdn = component.displayName;
       var componentDef = scMaps.findProperty('component_name', cn);
       var componentDef = scMaps.findProperty('component_name', cn);
       if(componentDef!=null && selectedServiceName===componentDef.service_name && !seenComponents[cn]){
       if(componentDef!=null && selectedServiceName===componentDef.service_name && !seenComponents[cn]){

+ 9 - 5
ambari-web/app/controllers/wizard/step8_controller.js

@@ -247,13 +247,17 @@ App.WizardStep8Controller = Em.Controller.extend({
 
 
   /**
   /**
    * Set all site property that are derived from other puppet-variable
    * Set all site property that are derived from other puppet-variable
-   * @return {
+   * @param {String} templateName
+   * @param {String} expression
+   * @param {String} name
+   * @return {Object}
+   * example: <code>{
    *   value: '...',
    *   value: '...',
    *   overrides: {
    *   overrides: {
    *    'value1': [h1, h2],
    *    'value1': [h1, h2],
    *    'value2': [h3]
    *    'value2': [h3]
    *   }
    *   }
-   * }
+   * }</code>
    */
    */
 
 
   getGlobConfigValueWithOverrides: function (templateName, expression, name) {
   getGlobConfigValueWithOverrides: function (templateName, expression, name) {
@@ -787,7 +791,7 @@ App.WizardStep8Controller = Em.Controller.extend({
       var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/services?ServiceInfo/service_name=' + _service;
       var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/services?ServiceInfo/service_name=' + _service;
       var data = {
       var data = {
         "components": componentsData
         "components": componentsData
-      }
+      };
 
 
       this.ajax({
       this.ajax({
         type: 'POST',
         type: 'POST',
@@ -1550,7 +1554,7 @@ App.WizardStep8Controller = Em.Controller.extend({
 
 
       self.set('ajaxBusy', false);
       self.set('ajaxBusy', false);
       self.doNextAjaxCall();
       self.doNextAjaxCall();
-    }
+    };
 
 
     params.error = function (xhr, status, error) {
     params.error = function (xhr, status, error) {
       var responseText = JSON.parse(xhr.responseText);
       var responseText = JSON.parse(xhr.responseText);
@@ -1563,7 +1567,7 @@ App.WizardStep8Controller = Em.Controller.extend({
       App.router.get(self.get('content.controllerName')).setStepsEnable();
       App.router.get(self.get('content.controllerName')).setStepsEnable();
       self.get('ajaxQueue').clear();
       self.get('ajaxQueue').clear();
       self.set('ajaxBusy', false);
       self.set('ajaxBusy', false);
-    }
+    };
     this.get('ajaxQueue').pushObject(params);
     this.get('ajaxQueue').pushObject(params);
   }
   }
 
 

+ 1 - 2
ambari-web/app/controllers/wizard/step9_controller.js

@@ -603,8 +603,7 @@ App.WizardStep9Controller = Em.Controller.extend({
       if (this.isSuccess(polledData)) {
       if (this.isSuccess(polledData)) {
         clusterStatus.status = 'STARTED';
         clusterStatus.status = 'STARTED';
         var serviceStartTime = new Date().getTime();
         var serviceStartTime = new Date().getTime();
-        var timeToStart = ((parseInt(serviceStartTime) - parseInt(this.get('content.cluster.installStartTime'))) / 60000).toFixed(2);
-        clusterStatus.installTime = timeToStart;
+        clusterStatus.installTime = ((parseInt(serviceStartTime) - parseInt(this.get('content.cluster.installStartTime'))) / 60000).toFixed(2);
       } else {
       } else {
         clusterStatus.status = 'START FAILED'; // 'START FAILED' implies to step10 that installation was successful but start failed
         clusterStatus.status = 'START FAILED'; // 'START FAILED' implies to step10 that installation was successful but start failed
       }
       }

+ 1 - 1
ambari-web/app/data/HDP2/custom_configs.js

@@ -124,4 +124,4 @@ module.exports =
       "isQueue": true,
       "isQueue": true,
       "filename": 'capacity-scheduler.xml'
       "filename": 'capacity-scheduler.xml'
     }
     }
-  ]
+  ];

+ 1 - 1
ambari-web/app/data/custom_configs.js

@@ -202,4 +202,4 @@ module.exports =
       "filename": 'capacity-scheduler.xml',
       "filename": 'capacity-scheduler.xml',
       "index": 12
       "index": 12
     }
     }
-  ]
+  ];

+ 2 - 0
ambari-web/app/data/service_components.js

@@ -16,6 +16,8 @@
  * limitations under the License.
  * limitations under the License.
  */
  */
 
 
+var App = require('app');
+
 module.exports = new Ember.Set([
 module.exports = new Ember.Set([
 
 
   {
   {

+ 1 - 1
ambari-web/app/data/services.js

@@ -174,4 +174,4 @@ module.exports = [
     isHidden: !App.supports.storm,
     isHidden: !App.supports.storm,
     description: Em.I18n.t('services.storm.description')
     description: Em.I18n.t('services.storm.description')
   }
   }
-]
+];

+ 1 - 1
ambari-web/app/data/statusCodes.js

@@ -52,4 +52,4 @@ module.exports = {
 	503: function () {
 	503: function () {
 		console.log("Error code 503: Gateway timeout.");
 		console.log("Error code 503: Gateway timeout.");
 	}
 	}
-}
+};

+ 1 - 2
ambari-web/app/mappers/cluster_mapper.js

@@ -41,8 +41,7 @@ App.clusterMapper = App.QuickDataMapper.create({
               var hostOverridesArray = {};
               var hostOverridesArray = {};
               json.Clusters.desired_configs[site].host_overrides.forEach(function(override){
               json.Clusters.desired_configs[site].host_overrides.forEach(function(override){
                 var hostname = override.host_name;
                 var hostname = override.host_name;
-                var tag = override.tag;
-                hostOverridesArray[hostname] = tag;
+                hostOverridesArray[hostname] = override.tag;
               });
               });
               configObj.set('hostOverrides', hostOverridesArray);
               configObj.set('hostOverrides', hostOverridesArray);
             }
             }

+ 1 - 1
ambari-web/app/mappers/runs_mapper.js

@@ -32,7 +32,7 @@ App.runsMapper = App.QuickDataMapper.create({
         iTotalRecords:json.iTotalRecords,
         iTotalRecords:json.iTotalRecords,
         startIndex:parseInt(json.startIndex)+1,
         startIndex:parseInt(json.startIndex)+1,
         endIndex:parseInt(json.endIndex)+1
         endIndex:parseInt(json.endIndex)+1
-      }
+      };
 
 
       json.aaData.forEach(function(item, index) {
       json.aaData.forEach(function(item, index) {
         result.push(this.generateWorkflow(item, index));
         result.push(this.generateWorkflow(item, index));

+ 1 - 2
ambari-web/app/mappers/service_metrics_mapper.js

@@ -443,10 +443,9 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
 
 
         if (component.host_components[0].metrics && component.host_components[0].metrics.yarn) {
         if (component.host_components[0].metrics && component.host_components[0].metrics.yarn) {
           var root = component.host_components[0].metrics.yarn.Queue.root;
           var root = component.host_components[0].metrics.yarn.Queue.root;
-          var queue = JSON.stringify({
+          component.queue = JSON.stringify({
             'root': self.parseObject(root)
             'root': self.parseObject(root)
           });
           });
-          component.queue = queue;
         }
         }
         // extend config
         // extend config
         finalConfig = jQuery.extend(finalConfig, yarnConfig);
         finalConfig = jQuery.extend(finalConfig, yarnConfig);

+ 1 - 3
ambari-web/app/models/alert.js

@@ -103,9 +103,7 @@ App.Alert = Em.Object.extend({
     var diff = new Date().getTime() - d.getTime();
     var diff = new Date().getTime() - d.getTime();
     if (diff < 60000) {
     if (diff < 60000) {
       diff = 60000 - diff;
       diff = 60000 - diff;
-      var newD = new Date(d.getTime() - diff );
-      //console.log("Making time more than 1 minute. New time=",newD,", Old time=",d);
-      return newD;
+      return new Date(d.getTime() - diff );
     }
     }
     return d;
     return d;
   },
   },

+ 1 - 1
ambari-web/app/models/app.js

@@ -65,4 +65,4 @@ App.App.FIXTURES = [
     execution_time: '134762957834',
     execution_time: '134762957834',
     runs: []
     runs: []
   }
   }
-]
+];

+ 1 - 1
ambari-web/app/models/authentication.js

@@ -43,7 +43,7 @@ App.Authentication.FIXTURES = [
     search_base_dn:"",
     search_base_dn:"",
     username_attribute:""
     username_attribute:""
   }
   }
-]
+];
 
 
 App.AuthenticationForm = App.Form.extend({
 App.AuthenticationForm = App.Form.extend({
   testResult:false,
   testResult:false,

+ 2 - 1
ambari-web/app/models/cluster_states.js

@@ -53,7 +53,8 @@ App.clusterStatus = Ember.Object.create({
   }.property('clusterState'),
   }.property('clusterState'),
   /**
   /**
    * get cluster data from server and update cluster status
    * get cluster data from server and update cluster status
-   * @param isAsync: set this to true if the call is to be made asynchronously.  if unspecified, false is assumed
+   * @param {Boolean} isAsync set this to true if the call is to be made asynchronously.  if unspecified, false is assumed
+   * @param {Boolean} overrideLocaldb
    * @return promise object for the get call
    * @return promise object for the get call
    */
    */
   updateFromServer: function(isAsync, overrideLocaldb) {
   updateFromServer: function(isAsync, overrideLocaldb) {

+ 2 - 0
ambari-web/app/models/dataset_job.js

@@ -31,12 +31,14 @@ App.DataSetJob = DS.Model.extend({
     if (this.get('startDate')) {
     if (this.get('startDate')) {
       return $.timeago(this.get('startDate'));
       return $.timeago(this.get('startDate'));
     }
     }
+    return '';
   }.property('startDate'),
   }.property('startDate'),
 
 
   endFormatted: function () {
   endFormatted: function () {
     if (this.get('endDate')) {
     if (this.get('endDate')) {
       return $.timeago(this.get('endDate'));
       return $.timeago(this.get('endDate'));
     }
     }
+    return '';
   }.property('endDate'),
   }.property('endDate'),
 
 
   healthClass: function () {
   healthClass: function () {

+ 1 - 1
ambari-web/app/models/form.js

@@ -67,7 +67,7 @@ App.Form = Em.View.extend({
         isValid = false;
         isValid = false;
         console.warn(this.get('name') + " IS INVALID : " + this.get('errorMessage'));
         console.warn(this.get('name') + " IS INVALID : " + this.get('errorMessage'));
       }
       }
-    })
+    });
 
 
     return isValid;
     return isValid;
   },
   },

+ 1 - 3
ambari-web/app/models/host.js

@@ -222,9 +222,7 @@ App.Host = DS.Model.extend({
    */
    */
   healthToolTip: function(){
   healthToolTip: function(){
     var hostComponents = this.get('hostComponents').filter(function(item){
     var hostComponents = this.get('hostComponents').filter(function(item){
-      if(item.get('workStatus') !== App.HostComponentStatus.started){
-        return true;
-      }
+      return item.get('workStatus') !== App.HostComponentStatus.started;
     });
     });
     var output = '';
     var output = '';
     switch (this.get('healthClass')){
     switch (this.get('healthClass')){

+ 1 - 0
ambari-web/app/models/run.js

@@ -109,6 +109,7 @@ App.Run = DS.Model.extend({
     if (this.get('id').indexOf('mr_') === 0) {
     if (this.get('id').indexOf('mr_') === 0) {
       return 'MapReduce';
       return 'MapReduce';
     }
     }
+    return '';
   }.property('id')
   }.property('id')
 });
 });
 
 

+ 2 - 2
ambari-web/app/models/service.js

@@ -131,10 +131,10 @@ App.Service = DS.Model.extend({
       restartHC[host].forEach(function(c){
       restartHC[host].forEach(function(c){
         hcCount++;
         hcCount++;
         hostsMsg += "<li>"+c+"</li>";       
         hostsMsg += "<li>"+c+"</li>";       
-      })
+      });
       hostsMsg += "</ul>";
       hostsMsg += "</ul>";
     }
     }
-    hostsMsg += "</ul>"
+    hostsMsg += "</ul>";
     return this.t('services.service.config.restartService.TooltipMessage').format(hcCount, hostCount, hostsMsg);
     return this.t('services.service.config.restartService.TooltipMessage').format(hcCount, hostCount, hostsMsg);
   }.property('restartRequiredHostsAndComponents')
   }.property('restartRequiredHostsAndComponents')
 });
 });

+ 1 - 1
ambari-web/app/models/service/yarn.js

@@ -86,7 +86,7 @@ App.YARNService = App.Service.extend({
           }
           }
         }
         }
         return names;
         return names;
-      }
+      };
       allQueueNames = addQueues(queues, '');
       allQueueNames = addQueues(queues, '');
     }
     }
     this.set('allQueueNames', allQueueNames);
     this.set('allQueueNames', allQueueNames);

+ 2 - 1
ambari-web/app/models/service_config.js

@@ -78,6 +78,7 @@ App.ServiceConfigCategory = Ember.Object.extend({
       case 'RegionServer':
       case 'RegionServer':
         return 'HBASE_REGIONSERVER';
         return 'HBASE_REGIONSERVER';
     }
     }
+    return null;
   }.property('name'),
   }.property('name'),
 
 
 
 
@@ -89,7 +90,7 @@ App.ServiceConfigCategory = Ember.Object.extend({
   }.property('name'),
   }.property('name'),
 
 
   isForSlaveComponent: function () {
   isForSlaveComponent: function () {
-    var slaveComponents = ['DataNode', 'TaskTracker', 'RegionServer']
+    var slaveComponents = ['DataNode', 'TaskTracker', 'RegionServer'];
     return (slaveComponents.contains(this.get('name')));
     return (slaveComponents.contains(this.get('name')));
   }.property('name'),
   }.property('name'),
 
 

+ 1 - 1
ambari-web/app/router.js

@@ -39,7 +39,7 @@ App.Router = Em.Router.extend({
     this.get('addHostController').clear();
     this.get('addHostController').clear();
     this.get('addServiceController').clear();
     this.get('addServiceController').clear();
     this.get('stackUpgradeController').clear();
     this.get('stackUpgradeController').clear();
-    for (i = 1; i < 11; i++) {
+    for (var i = 1; i < 11; i++) {
       this.set('wizardStep' + i + 'Controller.hasSubmitted', false);
       this.set('wizardStep' + i + 'Controller.hasSubmitted', false);
       this.set('wizardStep' + i + 'Controller.isDisabled', true);
       this.set('wizardStep' + i + 'Controller.isDisabled', true);
     }
     }

+ 1 - 1
ambari-web/app/routes/high_availability_routes.js

@@ -140,7 +140,7 @@ module.exports = Em.Route.extend({
       var controller = router.get('highAvailabilityWizardController');
       var controller = router.get('highAvailabilityWizardController');
       var highAvailabilityWizardStep2Controller = router.get('highAvailabilityWizardStep2Controller');
       var highAvailabilityWizardStep2Controller = router.get('highAvailabilityWizardStep2Controller');
       var addNN = highAvailabilityWizardStep2Controller.get('selectedServicesMasters').findProperty('isAddNameNode', true).get('selectedHost');
       var addNN = highAvailabilityWizardStep2Controller.get('selectedServicesMasters').findProperty('isAddNameNode', true).get('selectedHost');
-      var sNN = highAvailabilityWizardStep2Controller.get('selectedServicesMasters').findProperty('component_name','SECONDARY_NAMENODE').get('selectedHost')
+      var sNN = highAvailabilityWizardStep2Controller.get('selectedServicesMasters').findProperty('component_name','SECONDARY_NAMENODE').get('selectedHost');
       if(addNN){
       if(addNN){
         App.db.setRollBackHighAvailabilityWizardAddNNHost(addNN);
         App.db.setRollBackHighAvailabilityWizardAddNNHost(addNN);
       }
       }

+ 5 - 9
ambari-web/app/routes/installer.js

@@ -405,17 +405,13 @@ module.exports = Em.Route.extend({
     },
     },
     back: Em.Router.transitionTo('step9'),
     back: Em.Router.transitionTo('step9'),
     complete: function (router, context) {
     complete: function (router, context) {
-      if (true) {   // this function will be moved to installerController where it will validate
-        var controller = router.get('installerController');
-        controller.finish();
+      var controller = router.get('installerController');
+      controller.finish();
 
 
-        // We need to do recovery based on whether we are in Add Host or Installer wizard
-        controller.saveClusterState('DEFAULT');
+      // We need to do recovery based on whether we are in Add Host or Installer wizard
+      controller.saveClusterState('DEFAULT');
 
 
-        router.transitionTo('main.index');
-      } else {
-        console.log('cluster installation failure');
-      }
+      router.transitionTo('main.index');
     }
     }
   }),
   }),
 
 

+ 3 - 3
ambari-web/app/templates/main/mirroring/testConnectionResults.hbs

@@ -31,7 +31,7 @@
                 </td>
                 </td>
             </tr>
             </tr>
             <tr class="spacer">
             <tr class="spacer">
-                <td colspan="2"/>
+                <td colspan="2"></td>
             </tr>
             </tr>
             <tr>
             <tr>
                 <td>NameNode RPC..8020</td>
                 <td>NameNode RPC..8020</td>
@@ -44,7 +44,7 @@
                 </td>
                 </td>
             </tr>
             </tr>
             <tr class="spacer">
             <tr class="spacer">
-                <td colspan="2"/>
+                <td colspan="2"></td>
             </tr>
             </tr>
             <tr>
             <tr>
                 <td>Oozie server..11000</td>
                 <td>Oozie server..11000</td>
@@ -57,7 +57,7 @@
                 </td>
                 </td>
             </tr>
             </tr>
             <tr class="spacer">
             <tr class="spacer">
-                <td colspan="2"/>
+                <td colspan="2"></td>
             </tr>
             </tr>
             <tr {{bindAttr class="content.isClusterNameError:error"}}>
             <tr {{bindAttr class="content.isClusterNameError:error"}}>
                 <td>{{t mirroring.targetcluster.enterClusterName}}</td>
                 <td>{{t mirroring.targetcluster.enterClusterName}}</td>

+ 1 - 5
ambari-web/app/utils/ajax.js

@@ -1187,7 +1187,7 @@ var urls = {
       var statusCode = jQuery.extend({}, require('data/statusCodes'));
       var statusCode = jQuery.extend({}, require('data/statusCodes'));
       statusCode['403'] = function () {
       statusCode['403'] = function () {
         console.log("Error code 403: Forbidden.");
         console.log("Error code 403: Forbidden.");
-      }
+      };
       return {
       return {
         statusCode: statusCode
         statusCode: statusCode
       };
       };
@@ -1594,7 +1594,6 @@ if ($.mocho) {
   ajax.reopen({
   ajax.reopen({
     /**
     /**
      * Don't use it anywhere except tests!
      * Don't use it anywhere except tests!
-     * @deprecated
      * @returns {Array}
      * @returns {Array}
      */
      */
     fakeGetUrlNames: function() {
     fakeGetUrlNames: function() {
@@ -1607,7 +1606,6 @@ if ($.mocho) {
 
 
     /**
     /**
      * Don't use it anywhere except tests!
      * Don't use it anywhere except tests!
-     * @deprecated
      * @param name
      * @param name
      * @returns {*}
      * @returns {*}
      */
      */
@@ -1617,7 +1615,6 @@ if ($.mocho) {
 
 
     /**
     /**
      * Don't use it anywhere except tests!
      * Don't use it anywhere except tests!
-     * @deprecated
      * @param url
      * @param url
      * @param data
      * @param data
      * @returns {String}
      * @returns {String}
@@ -1628,7 +1625,6 @@ if ($.mocho) {
 
 
     /**
     /**
      * Don't use it anywhere except tests!
      * Don't use it anywhere except tests!
-     * @deprecated
      * @param urlObj
      * @param urlObj
      * @param data
      * @param data
      * @returns {Object}
      * @returns {Object}

+ 1 - 1
ambari-web/app/utils/base64.js

@@ -56,7 +56,7 @@
   // [https://gist.github.com/1020396] by [https://github.com/atk]
   // [https://gist.github.com/1020396] by [https://github.com/atk]
   object.atob || (
   object.atob || (
     object.atob = function (input) {
     object.atob = function (input) {
-      input = input.replace(/=+$/, '')
+      input = input.replace(/=+$/, '');
       if (input.length % 4 == 1) throw INVALID_CHARACTER_ERR;
       if (input.length % 4 == 1) throw INVALID_CHARACTER_ERR;
       for (
       for (
         // initialize result and counters
         // initialize result and counters

+ 12 - 16
ambari-web/app/utils/config.js

@@ -363,7 +363,7 @@ App.config = Em.Object.create({
       if (a.name < b.name) return -1;
       if (a.name < b.name) return -1;
       if (a.name > b.name) return 1;
       if (a.name > b.name) return 1;
       return 0;
       return 0;
-    }
+    };
 
 
 
 
     return {
     return {
@@ -382,15 +382,12 @@ App.config = Em.Object.create({
   mergePreDefinedWithStored: function (storedConfigs, advancedConfigs) {
   mergePreDefinedWithStored: function (storedConfigs, advancedConfigs) {
     var mergedConfigs = [];
     var mergedConfigs = [];
     var preDefinedConfigs = $.extend(true, [], this.get('preDefinedGlobalProperties').concat(this.get('preDefinedSiteProperties')));
     var preDefinedConfigs = $.extend(true, [], this.get('preDefinedGlobalProperties').concat(this.get('preDefinedSiteProperties')));
-    var preDefinedNames = [];
-    var storedNames = [];
-    var names = [];
     var categoryMetaData = null;
     var categoryMetaData = null;
     storedConfigs = (storedConfigs) ? storedConfigs : [];
     storedConfigs = (storedConfigs) ? storedConfigs : [];
 
 
-    preDefinedNames = preDefinedConfigs.mapProperty('name');
-    storedNames = storedConfigs.mapProperty('name');
-    names = preDefinedNames.concat(storedNames).uniq();
+    var preDefinedNames = preDefinedConfigs.mapProperty('name');
+    var storedNames = storedConfigs.mapProperty('name');
+    var names = preDefinedNames.concat(storedNames).uniq();
     names.forEach(function (name) {
     names.forEach(function (name) {
       var stored = storedConfigs.findProperty('name', name);
       var stored = storedConfigs.findProperty('name', name);
       var preDefined = preDefinedConfigs.findProperty('name', name);
       var preDefined = preDefinedConfigs.findProperty('name', name);
@@ -528,13 +525,11 @@ App.config = Em.Object.create({
       }
       }
     });
     });
     services.forEach(function (service) {
     services.forEach(function (service) {
-      var serviceConfig = {};
       var configsByService = [];
       var configsByService = [];
       var serviceConfigs = configs.filterProperty('serviceName', service.serviceName);
       var serviceConfigs = configs.filterProperty('serviceName', service.serviceName);
       serviceConfigs.forEach(function (_config) {
       serviceConfigs.forEach(function (_config) {
-        var serviceConfigProperty = {};
         _config.isOverridable = (_config.isOverridable === undefined) ? true : _config.isOverridable;
         _config.isOverridable = (_config.isOverridable === undefined) ? true : _config.isOverridable;
-        serviceConfigProperty = App.ServiceConfigProperty.create(_config);
+        var serviceConfigProperty = App.ServiceConfigProperty.create(_config);
         this.updateHostOverrides(serviceConfigProperty, _config);
         this.updateHostOverrides(serviceConfigProperty, _config);
         if (!storedConfigs) {
         if (!storedConfigs) {
           serviceConfigProperty.initialValue(localDB);
           serviceConfigProperty.initialValue(localDB);
@@ -543,7 +538,7 @@ App.config = Em.Object.create({
         serviceConfigProperty.validate();
         serviceConfigProperty.validate();
         configsByService.pushObject(serviceConfigProperty);
         configsByService.pushObject(serviceConfigProperty);
       }, this);
       }, this);
-      serviceConfig = this.createServiceConfig(service.serviceName);
+      var serviceConfig = this.createServiceConfig(service.serviceName);
       serviceConfig.set('showConfig', service.showConfig);
       serviceConfig.set('showConfig', service.showConfig);
 
 
       // Use calculated default values for some configs
       // Use calculated default values for some configs
@@ -994,7 +989,8 @@ App.config = Em.Object.create({
    * trim both trailing and leading spaces for host displayType and hive/oozie datebases url.
    * trim both trailing and leading spaces for host displayType and hive/oozie datebases url.
    * for directory or directories displayType format string for further using.
    * for directory or directories displayType format string for further using.
    * for password and values with spaces only do nothing.
    * for password and values with spaces only do nothing.
-   * @param property
+   * @param {Object} property
+   * @param {Boolean} isEmberObject
    * @returns {*}
    * @returns {*}
    */
    */
   trimProperty: function (property, isEmberObject) {
   trimProperty: function (property, isEmberObject) {
@@ -1040,7 +1036,7 @@ App.config = Em.Object.create({
    * of {id:2, name:'New hardware group'}. In the case of dialog being cancelled,
    * of {id:2, name:'New hardware group'}. In the case of dialog being cancelled,
    * the callback is provided <code>null</code>
    * the callback is provided <code>null</code>
    *
    *
-   * @param callback  Callback function which is invoked when dialog
+   * @param {String} groupName
    *  is closed, cancelled or OK is pressed.
    *  is closed, cancelled or OK is pressed.
    */
    */
 
 
@@ -1299,7 +1295,9 @@ App.config = Em.Object.create({
    * Changes possible here are the name, description and
    * Changes possible here are the name, description and
    * host memberships of the configuration-group.
    * host memberships of the configuration-group.
    * 
    * 
-   * @param configGroup  (App.ConfigGroup) Configuration group to update
+   * @param {App.ConfigGroup} configGroup Configuration group to update
+   * @param {Function} successCallback
+   * @param {Function} errorCallback
    */
    */
   updateConfigurationGroup: function (configGroup, successCallback, errorCallback) {
   updateConfigurationGroup: function (configGroup, successCallback, errorCallback) {
     var putConfigGroup = {
     var putConfigGroup = {
@@ -1381,7 +1379,6 @@ App.config = Em.Object.create({
    * 
    * 
    * @param serviceId
    * @param serviceId
    *          (string) ID of the service. Ex: HDFS
    *          (string) ID of the service. Ex: HDFS
-   * @return Array of App.ConfigGroups
    */
    */
   getConfigGroupsForService: function (serviceId) {
   getConfigGroupsForService: function (serviceId) {
 
 
@@ -1392,7 +1389,6 @@ App.config = Em.Object.create({
    *
    *
    * @param hostName
    * @param hostName
    *          (string) host name used to register
    *          (string) host name used to register
-   * @return Array of App.ConfigGroups
    */
    */
   getConfigGroupsForHost: function (hostName) {
   getConfigGroupsForHost: function (hostName) {
 
 

+ 1 - 2
ambari-web/app/utils/configs/defaults_providers/yarn_defaults_provider.js

@@ -293,8 +293,7 @@ App.YARNDefaultsProvider = App.DefaultsProvider.create({
    */
    */
   clusterDataIsValid: function () {
   clusterDataIsValid: function () {
     if (!this.get('clusterData')) return false;
     if (!this.get('clusterData')) return false;
-    if (this.get('clusterData.ram') == null || this.get('clusterData.cpu') == null || this.get('clusterData.disk') == null || this.get('clusterData.hBaseInstalled') == null) return false;
-    return true;
+    return !(this.get('clusterData.ram') == null || this.get('clusterData.cpu') == null || this.get('clusterData.disk') == null || this.get('clusterData.hBaseInstalled') == null);
   }
   }
 
 
 });
 });

+ 2 - 7
ambari-web/app/utils/configs/validators/service_configs_validator.js

@@ -37,9 +37,7 @@ App.ServiceConfigsValidator = Em.Object.extend({
   
   
   /**
   /**
    * Validate the given config property with the available  
    * Validate the given config property with the available  
-   * {@param recommendedDefaults}. This can do cross-property
-   * validations also. 
-   * 
+   *
    * @param config  {App.ServiceConfigProperty}
    * @param config  {App.ServiceConfigProperty}
    * @return {string}  No validation issues when <code>null</code> returned.
    * @return {string}  No validation issues when <code>null</code> returned.
    */
    */
@@ -100,10 +98,7 @@ App.ServiceConfigsValidator = Em.Object.extend({
       return false;
       return false;
     }
     }
     // "-Xmx" can be only one
     // "-Xmx" can be only one
-    if (value.match(/\-Xmx/ig).length != 1) {
-      return false;
-    }
-    return true;
+    return value.match(/\-Xmx/ig).length == 1;
   },
   },
   /**
   /**
    * Parse Xmx size from raw value
    * Parse Xmx size from raw value

+ 2 - 2
ambari-web/app/utils/date.js

@@ -65,7 +65,7 @@ module.exports = {
    * 1000000 ms = 16.66 mins
    * 1000000 ms = 16.66 mins
    * 3500000 secs = 58.33 mins
    * 3500000 secs = 58.33 mins
    * @param time
    * @param time
-   * @param zeroValid, for the case to show 0 when time is 0, not null
+   * @param zeroValid for the case to show 0 when time is 0, not null
    * @return string formatted date
    * @return string formatted date
    */
    */
   timingFormat:function (time, /* optional */ zeroValid) {
   timingFormat:function (time, /* optional */ zeroValid) {
@@ -94,4 +94,4 @@ module.exports = {
       return time + ' days';
       return time + ' days';
     }
     }
   }
   }
-}
+};

+ 1 - 1
ambari-web/app/utils/db.js

@@ -339,7 +339,7 @@ App.db.setWizardCurrentStep = function (wizardType, currentStep) {
  */
  */
 App.db.setLocalStorage = function () {
 App.db.setLocalStorage = function () {
   localStorage.setObject('ambari', App.db.data);
   localStorage.setObject('ambari', App.db.data);
-}
+};
 
 
 App.db.setSecurityWizardStatus = function (status) {
 App.db.setSecurityWizardStatus = function (status) {
   App.db.data = localStorage.getObject('ambari');
   App.db.data = localStorage.getObject('ambari');

+ 5 - 5
ambari-web/app/utils/graph.js

@@ -84,8 +84,8 @@ module.exports = {
    * @param reduceOffSwitch
    * @param reduceOffSwitch
    * @param startTime
    * @param startTime
    * @param endTime
    * @param endTime
-   * @param w
-   * @param h
+   * @param svgw
+   * @param svgh
    * @param element
    * @param element
    */
    */
   drawJobTasks:function (mapNodeLocal, mapRackLocal, mapOffSwitch, reduceOffSwitch, startTime, endTime, svgw, svgh, element) {
   drawJobTasks:function (mapNodeLocal, mapRackLocal, mapOffSwitch, reduceOffSwitch, startTime, endTime, svgw, svgh, element) {
@@ -155,12 +155,12 @@ module.exports = {
       .text("Task Attempt Duration");
       .text("Task Attempt Duration");
 
 
 
 
-    var dotInfo = new Array();
+    var dotInfo = [];
     var mapDotInfo = function(d) {
     var mapDotInfo = function(d) {
       var thisx = Math.round(x(d.x));
       var thisx = Math.round(x(d.x));
       var thisy = Math.round(y(d.y));
       var thisy = Math.round(y(d.y));
       if (!(thisx in dotInfo))
       if (!(thisx in dotInfo))
-        dotInfo[thisx] = new Array();
+        dotInfo[thisx] = [];
       var existing = dotInfo[thisx][thisy];
       var existing = dotInfo[thisx][thisy];
       var newInfo = d.label + "  \n" +
       var newInfo = d.label + "  \n" +
           'Run-time: ' + self.durationFormatter(d.y) + '  \nWait-time: ' + self.durationFormatter(d.x-startTime) +
           'Run-time: ' + self.durationFormatter(d.y) + '  \nWait-time: ' + self.durationFormatter(d.x-startTime) +
@@ -181,4 +181,4 @@ module.exports = {
     this.addSeries(svgg, mapOffSwitch, 'brown', x, y, axisHeight+rmax, startTime, dotInfo);
     this.addSeries(svgg, mapOffSwitch, 'brown', x, y, axisHeight+rmax, startTime, dotInfo);
     this.addSeries(svgg, reduceOffSwitch, 'steelblue', x, y, axisHeight+rmax, startTime, dotInfo);
     this.addSeries(svgg, reduceOffSwitch, 'steelblue', x, y, axisHeight+rmax, startTime, dotInfo);
   }
   }
-}
+};

+ 13 - 13
ambari-web/app/utils/helper.js

@@ -41,7 +41,6 @@ String.prototype.ip2long = function () {
   // *     returns 2: 11259375
   // *     returns 2: 11259375
   // *     example 3: ip2long('255.255.255.256');
   // *     example 3: ip2long('255.255.255.256');
   // *     returns 3: false
   // *     returns 3: false
-  var i = 0;
   // PHP allows decimal, octal, and hexadecimal IP components.
   // PHP allows decimal, octal, and hexadecimal IP components.
   // PHP allows between 1 (e.g. 127) to 4 (e.g 127.0.0.1) components.
   // PHP allows between 1 (e.g. 127) to 4 (e.g 127.0.0.1) components.
   var IP = this.match(/^([1-9]\d*|0[0-7]*|0x[\da-f]+)(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?$/i); // Verify IP format.
   var IP = this.match(/^([1-9]\d*|0[0-7]*|0x[\da-f]+)(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?$/i); // Verify IP format.
@@ -50,7 +49,7 @@ String.prototype.ip2long = function () {
   }
   }
   // Reuse IP variable for component counter.
   // Reuse IP variable for component counter.
   IP[0] = 0;
   IP[0] = 0;
-  for (i = 1; i < 5; i += 1) {
+  for (var i = 1; i < 5; i += 1) {
     IP[0] += !!((IP[i] || '').length);
     IP[0] += !!((IP[i] || '').length);
     IP[i] = parseInt(IP[i]) || 0;
     IP[i] = parseInt(IP[i]) || 0;
   }
   }
@@ -67,7 +66,7 @@ String.prototype.ip2long = function () {
 
 
 String.prototype.capitalize = function () {
 String.prototype.capitalize = function () {
   return this.charAt(0).toUpperCase() + this.slice(1);
   return this.charAt(0).toUpperCase() + this.slice(1);
-}
+};
 
 
 Em.CoreObject.reopen({
 Em.CoreObject.reopen({
   t:function (key, attrs) {
   t:function (key, attrs) {
@@ -101,7 +100,7 @@ Em.Handlebars.registerHelper('highlight', function (property, words, fn) {
   });
   });
 
 
   return new Em.Handlebars.SafeString(property);
   return new Em.Handlebars.SafeString(property);
-})
+});
 
 
 /**
 /**
  * Replace {i} with argument. where i is number of argument to replace with
  * Replace {i} with argument. where i is number of argument to replace with
@@ -150,12 +149,12 @@ Number.prototype.toDaysHoursMinutes = function () {
   formatted.m = (dateDiff / minK).toFixed(2);
   formatted.m = (dateDiff / minK).toFixed(2);
 
 
   return formatted;
   return formatted;
-}
+};
 
 
 Number.prototype.countPercentageRatio = function (maxValue) {
 Number.prototype.countPercentageRatio = function (maxValue) {
   var usedValue = this;
   var usedValue = this;
   return Math.round((usedValue / maxValue) * 100) + "%";
   return Math.round((usedValue / maxValue) * 100) + "%";
-}
+};
 
 
 Number.prototype.long2ip = function () {
 Number.prototype.long2ip = function () {
   // http://kevin.vanzonneveld.net
   // http://kevin.vanzonneveld.net
@@ -166,7 +165,7 @@ Number.prototype.long2ip = function () {
     return false;
     return false;
 
 
   return [this >>> 24, this >>> 16 & 0xFF, this >>> 8 & 0xFF, this & 0xFF].join('.');
   return [this >>> 24, this >>> 16 & 0xFF, this >>> 8 & 0xFF, this & 0xFF].join('.');
-}
+};
 
 
 /**
 /**
  * Formats the given URL template by replacing keys in 'substitutes'
  * Formats the given URL template by replacing keys in 'substitutes'
@@ -203,7 +202,7 @@ App.formatUrl = function (urlTemplate, substitutes, testUrl) {
         hostName:App.test_hostname
         hostName:App.test_hostname
       };
       };
       jQuery.extend(allSubstitutes, substitutes);
       jQuery.extend(allSubstitutes, substitutes);
-      for (key in allSubstitutes) {
+      for (var key in allSubstitutes) {
         var useKey = '{' + key + '}';
         var useKey = '{' + key + '}';
         formatted = formatted.replace(new RegExp(useKey, 'g'), allSubstitutes[key]);
         formatted = formatted.replace(new RegExp(useKey, 'g'), allSubstitutes[key]);
       }
       }
@@ -212,7 +211,7 @@ App.formatUrl = function (urlTemplate, substitutes, testUrl) {
     }
     }
   }
   }
   return formatted;
   return formatted;
-}
+};
 
 
 /**
 /**
  * Certain variables can have JSON in string
  * Certain variables can have JSON in string
@@ -369,6 +368,7 @@ App.format = {
       case 'LOGVIEWER_SERVER':
       case 'LOGVIEWER_SERVER':
         return 'Logviewer Server';
         return 'Logviewer Server';
     }
     }
+    return '';
   },
   },
 
 
   /**
   /**
@@ -396,7 +396,7 @@ App.popover = function(self, options) {
   self.on("remove", function () {
   self.on("remove", function () {
     $(this).trigger('mouseleave');
     $(this).trigger('mouseleave');
   });
   });
-}
+};
 
 
 /**
 /**
  * wrapper to bootstrap tooltip
  * wrapper to bootstrap tooltip
@@ -409,7 +409,7 @@ App.tooltip = function(self, options) {
   self.on("remove", function () {
   self.on("remove", function () {
     $(this).trigger('mouseleave');
     $(this).trigger('mouseleave');
   });
   });
-}
+};
 
 
 /*
 /*
  * Helper function for bound property helper registration
  * Helper function for bound property helper registration
@@ -421,7 +421,7 @@ App.registerBoundHelper = function(name, view) {
     options.hash.contentBinding = property;
     options.hash.contentBinding = property;
     return Em.Handlebars.helpers.view.call(this, view, options);
     return Em.Handlebars.helpers.view.call(this, view, options);
   });
   });
-}
+};
 
 
 /*
 /*
  * Return singular or plural word based on Em.I18n property key.
  * Return singular or plural word based on Em.I18n property key.
@@ -466,4 +466,4 @@ App.registerBoundHelper('pluralize', Em.View.extend({
     }
     }
   }
   }
   })
   })
-)
+);

+ 4 - 3
ambari-web/app/utils/host_progress_popup.js

@@ -806,14 +806,15 @@ App.HostPopup = Em.Object.create({
          * Create Clip Board
          * Create Clip Board
          */
          */
         createClipBoard: function () {
         createClipBoard: function () {
+          var logElement = $(".task-detail-log-maintext");
           $(".task-detail-log-clipboard-wrap").html('<textarea class="task-detail-log-clipboard"></textarea>');
           $(".task-detail-log-clipboard-wrap").html('<textarea class="task-detail-log-clipboard"></textarea>');
           $(".task-detail-log-clipboard")
           $(".task-detail-log-clipboard")
             .html("stderr: \n" + $(".stderr").html() + "\n stdout:\n" + $(".stdout").html())
             .html("stderr: \n" + $(".stderr").html() + "\n stdout:\n" + $(".stdout").html())
             .css("display", "block")
             .css("display", "block")
-            .width($(".task-detail-log-maintext").width())
-            .height($(".task-detail-log-maintext").height())
+            .width(logElement.width())
+            .height(logElement.height())
             .select();
             .select();
-          $(".task-detail-log-maintext").css("display", "none")
+          logElement.css("display", "none")
         },
         },
 
 
         /**
         /**

+ 0 - 1
ambari-web/app/utils/hosts.js

@@ -49,7 +49,6 @@ module.exports = {
       dialogMessage: popupDescription.dialogMessage,
       dialogMessage: popupDescription.dialogMessage,
       warningMessage: null,
       warningMessage: null,
       onPrimary: function () {
       onPrimary: function () {
-        console.debug('(old-selectedHosts)=', selectedHosts);
         this.set('warningMessage', null);
         this.set('warningMessage', null);
         var arrayOfSelectedHosts = [];
         var arrayOfSelectedHosts = [];
         var selectedHosts = availableHosts.filterProperty('selected', true);
         var selectedHosts = availableHosts.filterProperty('selected', true);

+ 3 - 3
ambari-web/app/utils/http_client.js

@@ -28,7 +28,7 @@ App.HttpClient = Em.Object.create({
    * @param jqXHR
    * @param jqXHR
    * @param textStatus
    * @param textStatus
    * @param errorThrown
    * @param errorThrown
-   * @url api that invoked this callback function
+   * @param url api that invoked this callback function
    */
    */
   defaultErrorHandler: function (jqXHR, textStatus, errorThrown, url) {
   defaultErrorHandler: function (jqXHR, textStatus, errorThrown, url) {
     try {
     try {
@@ -107,7 +107,7 @@ App.HttpClient = Em.Object.create({
    * @param {number} interval - frequency request
    * @param {number} interval - frequency request
    */
    */
   get: function (url, mapper, data, errorHandler, interval) {
   get: function (url, mapper, data, errorHandler, interval) {
-    var eHandler = data.complete
+    var eHandler = data.complete;
     if (!errorHandler && data.error) {
     if (!errorHandler && data.error) {
       errorHandler = data.error;
       errorHandler = data.error;
     }
     }
@@ -118,7 +118,7 @@ App.HttpClient = Em.Object.create({
       data = null;
       data = null;
       mapper = null;
       mapper = null;
       errorHandler = null;
       errorHandler = null;
-    }
+    };
 
 
     interval = "" + interval;
     interval = "" + interval;
     if (interval.match(/\d+/)) {
     if (interval.match(/\d+/)) {

+ 7 - 8
ambari-web/app/utils/number_utils.js

@@ -19,17 +19,16 @@ module.exports = {
   /**
   /**
    * Convert byte size to other metrics.
    * Convert byte size to other metrics.
    * 
    * 
-   * @param {Number} Bytes to convert to string
-   * @param {Number} Precision Number to adjust precision of return value. Default is 0.
-   * @param {String}
-   *          parseType JS method name for parse string to number. Default is
-   *          "parseInt".
-   * @param {Number} Multiplies bytes by this number if given. This is needed
+   * @param {Number} bytes to convert to string
+   * @param {Number} precision Number to adjust precision of return value. Default is 0.
+   * @param {String} parseType
+   *           JS method name for parse string to number. Default is "parseInt".
+   * @param {Number} multiplyBy bytes by this number if given. This is needed
    *          as <code>null * 1024 = 0</null>
    *          as <code>null * 1024 = 0</null>
    * @remarks The parseType argument can be "parseInt" or "parseFloat".
    * @remarks The parseType argument can be "parseInt" or "parseFloat".
-   * @return {String) Returns converted value with abbreviation.
+   * @return {String} Returns converted value with abbreviation.
    */
    */
-  bytesToSize: function (bytes, precision, parseType/* = 'parseInt' */, multiplyBy) {
+  bytesToSize: function (bytes, precision, parseType, multiplyBy) {
     if (bytes === null || bytes === undefined) {
     if (bytes === null || bytes === undefined) {
       return 'n/a';
       return 'n/a';
     } else {
     } else {

+ 3 - 2
ambari-web/app/utils/object_utils.js

@@ -72,8 +72,9 @@ module.exports = {
   
   
   /**
   /**
    * Gets value of property path.
    * Gets value of property path.
-   * 
-   * @param propertyPath
+   *
+   * @param {Object} object
+   * @param {String} propertyPath
    *          Format is 'a.b.c'
    *          Format is 'a.b.c'
    * @return Returns <code>undefined</code> when path does not exist.
    * @return Returns <code>undefined</code> when path does not exist.
    */
    */

+ 1 - 2
ambari-web/app/utils/polling.js

@@ -38,8 +38,7 @@ App.Poll = Em.Object.extend({
   mockDataPrefix: '/data/wizard/deploy/5_hosts',
   mockDataPrefix: '/data/wizard/deploy/5_hosts',
 
 
   barWidth: function () {
   barWidth: function () {
-    var barWidth = 'width: ' + this.get('progress') + '%;';
-    return barWidth;
+    return 'width: ' + this.get('progress') + '%;';
   }.property('progress'),
   }.property('progress'),
 
 
   isCompleted: function () {
   isCompleted: function () {

+ 5 - 6
ambari-web/app/utils/string_utils.js

@@ -37,7 +37,8 @@ module.exports = {
           break;
           break;
 
 
         case STR_PAD_BOTH:
         case STR_PAD_BOTH:
-          var right = Math.ceil((padlen = len - str.length) / 2);
+          var padlen = len - str.length;
+          var right = Math.ceil((padlen) / 2);
           var left = padlen - right;
           var left = padlen - right;
           str = Array(left+1).join(pad) + str + Array(right+1).join(pad);
           str = Array(left+1).join(pad) + str + Array(right+1).join(pad);
           break;
           break;
@@ -53,12 +54,10 @@ module.exports = {
 
 
   },
   },
   underScoreToCamelCase: function(name){
   underScoreToCamelCase: function(name){
-    var new_name = name.replace(/_\w/g,replacer);
-    function replacer(str, p1, p2, offset, s)
-    {
+    function replacer(str, p1, p2, offset, s) {
       return str[1].toUpperCase();
       return str[1].toUpperCase();
     }
     }
-    return new_name;
+    return name.replace(/_\w/g,replacer);
   },
   },
   /**
   /**
    * Compare two versions by following rules:
    * Compare two versions by following rules:
@@ -147,4 +146,4 @@ module.exports = {
     var last_slash = path.lastIndexOf('/');
     var last_slash = path.lastIndexOf('/');
     return (last_slash!=0)?path.substr(0,last_slash):'/';
     return (last_slash!=0)?path.substr(0,last_slash):'/';
   }
   }
-}
+};

+ 3 - 3
ambari-web/app/utils/updater.js

@@ -47,7 +47,7 @@ function update(obj, name, isWorking, interval){
 
 
   state.timeout = setTimeout(state.func, interval);
   state.timeout = setTimeout(state.func, interval);
   return true;
   return true;
-};
+}
 
 
 function rerun(name){
 function rerun(name){
   var state = states[name];
   var state = states[name];
@@ -55,7 +55,7 @@ function rerun(name){
     clearTimeout(state.timeout);
     clearTimeout(state.timeout);
     state.func();
     state.func();
   }
   }
-};
+}
 
 
 App.updater = {
 App.updater = {
 
 
@@ -126,4 +126,4 @@ App.updater = {
     return rerun(name);
     return rerun(name);
   }
   }
 
 
-}
+};

+ 1 - 3
ambari-web/app/views/common/chart.js

@@ -174,8 +174,6 @@ App.ChartView = Em.View.extend({
           if (renderer.getDate(point).getTime() <= selectedDate.getTime()) {
           if (renderer.getDate(point).getTime() <= selectedDate.getTime()) {
             prevVal = nextVal;
             prevVal = nextVal;
             nextVal = point;
             nextVal = point;
-          } else {
-            return;
           }
           }
         });
         });
 
 
@@ -200,7 +198,7 @@ App.ChartView = Em.View.extend({
     vis.append("svg:g")
     vis.append("svg:g")
       .attr("class", "axis")
       .attr("class", "axis")
       .attr("transform", "translate(0," + this.get('p') + ")")
       .attr("transform", "translate(0," + this.get('p') + ")")
-      .call(renderer.axis)
+      .call(renderer.axis);
 
 
     $.each(this.get('nodeAttributes'), function (i, v) {
     $.each(this.get('nodeAttributes'), function (i, v) {
       var element = $('<div></div>').addClass(v).addClass("stateValue").html("");
       var element = $('<div></div>').addClass(v).addClass("stateValue").html("");

+ 1 - 1
ambari-web/app/views/common/chart/linear.js

@@ -59,7 +59,7 @@ App.ChartLinearView = Em.View.extend({
       .attr("x1", thisChart.x(0))
       .attr("x1", thisChart.x(0))
       .attr("y1", -1 * thisChart.y(0))
       .attr("y1", -1 * thisChart.y(0))
       .attr("x2", thisChart.x(this.get('data').length))
       .attr("x2", thisChart.x(this.get('data').length))
-      .attr("y2", -1 * thisChart.y(0))
+      .attr("y2", -1 * thisChart.y(0));
 
 
     this.get('g').append("svg:line")
     this.get('g').append("svg:line")
       .attr("x1", thisChart.x(0))
       .attr("x1", thisChart.x(0))

+ 5 - 5
ambari-web/app/views/common/chart/linear_time.js

@@ -796,7 +796,7 @@ App.ChartLinearTimeView = Ember.View.extend({
  * A formatter which will turn a number into computer storage sizes of the
  * A formatter which will turn a number into computer storage sizes of the
  * format '23 GB' etc.
  * format '23 GB' etc.
  * 
  * 
- * @type Function
+ * @type {Function}
  */
  */
 App.ChartLinearTimeView.BytesFormatter = function (y) {
 App.ChartLinearTimeView.BytesFormatter = function (y) {
   if (y == 0) return '0 B';
   if (y == 0) return '0 B';
@@ -825,7 +825,7 @@ App.ChartLinearTimeView.BytesFormatter = function (y) {
 /**
 /**
  * A formatter which will turn a number into percentage display like '42%'
  * A formatter which will turn a number into percentage display like '42%'
  * 
  * 
- * @type Function
+ * @type {Function}
  */
  */
 App.ChartLinearTimeView.PercentageFormatter = function (percentage) {
 App.ChartLinearTimeView.PercentageFormatter = function (percentage) {
   var value = percentage;
   var value = percentage;
@@ -841,7 +841,7 @@ App.ChartLinearTimeView.PercentageFormatter = function (percentage) {
  * A formatter which will turn elapsed time into display time like '50 ms',
  * A formatter which will turn elapsed time into display time like '50 ms',
  * '5s', '10 m', '3 hr' etc. Time is expected to be provided in milliseconds.
  * '5s', '10 m', '3 hr' etc. Time is expected to be provided in milliseconds.
  * 
  * 
- * @type Function
+ * @type {Function}
  */
  */
 App.ChartLinearTimeView.TimeElapsedFormatter = function (millis) {
 App.ChartLinearTimeView.TimeElapsedFormatter = function (millis) {
   var value = millis;
   var value = millis;
@@ -873,7 +873,7 @@ App.ChartLinearTimeView.TimeElapsedFormatter = function (millis) {
  * The default formatter which uses Rickshaw.Fixtures.Number.formatKMBT 
  * The default formatter which uses Rickshaw.Fixtures.Number.formatKMBT 
  * which shows 10K, 300M etc.
  * which shows 10K, 300M etc.
  *
  *
- * @type Function
+ * @type {Function}
  */
  */
 App.ChartLinearTimeView.DefaultFormatter = function(y) {
 App.ChartLinearTimeView.DefaultFormatter = function(y) {
   if(isNaN(y)){
   if(isNaN(y)){
@@ -903,7 +903,7 @@ App.ChartLinearTimeView.DefaultFormatter = function(y) {
  * @param valueFormatter  Value itself will need further processing 
  * @param valueFormatter  Value itself will need further processing 
  *        via provided formatter. Ex: '10M requests/s'. Generally
  *        via provided formatter. Ex: '10M requests/s'. Generally
  *        should be App.ChartLinearTimeView.DefaultFormatter. 
  *        should be App.ChartLinearTimeView.DefaultFormatter. 
- * @return Function
+ * @return {Function}
  */
  */
 App.ChartLinearTimeView.CreateRateFormatter = function (unitsPrefix, valueFormatter) {
 App.ChartLinearTimeView.CreateRateFormatter = function (unitsPrefix, valueFormatter) {
   var suffix = " "+unitsPrefix+"/s";
   var suffix = " "+unitsPrefix+"/s";

+ 1 - 1
ambari-web/app/views/common/configs/services_config.js

@@ -380,7 +380,7 @@ App.ServiceConfigsByCategoryView = Ember.View.extend({
     });
     });
     // remove undefined elements from array
     // remove undefined elements from array
     sortedConfigs = sortedConfigs.filter(function (config) {
     sortedConfigs = sortedConfigs.filter(function (config) {
-      if (config !== undefined) return true;
+      return config !== undefined;
     });
     });
     return sortedConfigs.concat(unSorted);
     return sortedConfigs.concat(unSorted);
   },
   },

+ 3 - 3
ambari-web/app/views/common/grid.js

@@ -143,7 +143,7 @@ App.GridPager = Em.View.extend({
 
 
   init:function () {
   init:function () {
     this._super();
     this._super();
-    this.clearPages()
+    this.clearPages();
     this.pushPages();
     this.pushPages();
   },
   },
 
 
@@ -203,7 +203,7 @@ App.Grid = Em.View.extend({
 
 
     var collection = this.get('_collection.className');
     var collection = this.get('_collection.className');
     collection = collection.find();
     collection = collection.find();
-    arrayCollection = collection.filter(function(data) {
+    var arrayCollection = collection.filter(function(data) {
       var oneFilterFail = false;
       var oneFilterFail = false;
       $.each(filters, function(fieldname, values){
       $.each(filters, function(fieldname, values){
         if(values.length && values.indexOf(data.get(fieldname)) == -1) {
         if(values.length && values.indexOf(data.get(fieldname)) == -1) {
@@ -270,7 +270,7 @@ App.Grid = Em.View.extend({
             options[field].push(filter);
             options[field].push(filter);
           }
           }
         });
         });
-      })
+      });
 
 
       thisGrid.set('_filters', options);
       thisGrid.set('_filters', options);
     }
     }

+ 2 - 2
ambari-web/app/views/common/metric.js

@@ -89,7 +89,7 @@ App.MetricFilteringWidget = Em.View.extend({
     Em.Object.create({ label:Em.I18n.t('metric.more.process'), code:'process',
     Em.Object.create({ label:Em.I18n.t('metric.more.process'), code:'process',
       items:[
       items:[
         Em.Object.create({value:'proc_run'}),
         Em.Object.create({value:'proc_run'}),
-        Em.Object.create({value:'proc_total'}),
+        Em.Object.create({value:'proc_total'})
       ]
       ]
     })
     })
 
 
@@ -168,4 +168,4 @@ App.MetricFilteringWidget = Em.View.extend({
   },
   },
 
 
   templateName:require('templates/common/metric')
   templateName:require('templates/common/metric')
-})
+});

+ 1 - 0
ambari-web/app/views/common/modal_popup.js

@@ -113,6 +113,7 @@ App.showReloadPopup = function () {
  *
  *
  * @param {Function} primary - "OK" button click handler
  * @param {Function} primary - "OK" button click handler
  * @param {String} body - additional text constant. Will be placed in the popup-body
  * @param {String} body - additional text constant. Will be placed in the popup-body
+ * @param {Function} secondary
  * @return {*}
  * @return {*}
  */
  */
 App.showConfirmationPopup = function (primary, body, secondary) {
 App.showConfirmationPopup = function (primary, body, secondary) {

+ 1 - 3
ambari-web/app/views/common/rolling_restart_view.js

@@ -81,9 +81,7 @@ App.RollingRestartView = Em.View.extend({
   nonMaintainanceHostComponents : function() {
   nonMaintainanceHostComponents : function() {
     var hostComponents = this.get('allHostComponents');
     var hostComponents = this.get('allHostComponents');
     hostComponents = hostComponents.filter(function(item) {
     hostComponents = hostComponents.filter(function(item) {
-      if (item.get('workStatus') !== App.HostComponentStatus.maintenance) {
-        return true;
-      }
+      return item.get('workStatus') !== App.HostComponentStatus.maintenance;
     });
     });
     return hostComponents;
     return hostComponents;
   }.property('allHostComponents', 'allHostComponents.@each.workStatus'),
   }.property('allHostComponents', 'allHostComponents.@each.workStatus'),

+ 2 - 2
ambari-web/app/views/common/sort_view.js

@@ -76,7 +76,7 @@ var wrapperView = Em.View.extend({
   /**
   /**
    * sort content by property
    * sort content by property
    * @param property
    * @param property
-   * @param order: true - DESC, false - ASC
+   * @param order true - DESC, false - ASC
    */
    */
   sort: function(property, order){
   sort: function(property, order){
     var content = this.get('content').toArray();
     var content = this.get('content').toArray();
@@ -120,7 +120,7 @@ var wrapperView = Em.View.extend({
           } else {
           } else {
             return a - b;
             return a - b;
           }
           }
-        }
+        };
         break;
         break;
       default:
       default:
         func = function(a,b){
         func = function(a,b){

+ 1 - 1
ambari-web/app/views/common/time_range.js

@@ -218,4 +218,4 @@ App.TimeRangeWidget = Em.View.extend({
       $("#slider").slider("destroy");
       $("#slider").slider("destroy");
     }
     }
   }.observes('chosenPreset')
   }.observes('chosenPreset')
-})
+});

+ 1 - 1
ambari-web/app/views/experimental.js

@@ -35,7 +35,7 @@ App.ExperimentalView = Em.View.extend({
     supports.forEach(function(s){
     supports.forEach(function(s){
       var propName = 'App.supports.' + s.get('name');
       var propName = 'App.supports.' + s.get('name');
       var propValue = s.get('selected');
       var propValue = s.get('selected');
-      console.log(">>>>>>>> " + propName + " = "+ propValue)
+      console.log(">>>>>>>> " + propName + " = "+ propValue);
       Ember.set(propName, propValue);
       Ember.set(propName, propValue);
     });
     });
     App.router.transitionTo('root.index');
     App.router.transitionTo('root.index');

+ 1 - 1
ambari-web/app/views/main/admin.js

@@ -40,7 +40,7 @@ App.MainAdminView = Em.View.extend({
         url: 'adminSecurity.index',
         url: 'adminSecurity.index',
         label: Em.I18n.t('common.security')
         label: Em.I18n.t('common.security')
       });
       });
-    };
+    }
     items.push({
     items.push({
       name: 'cluster',
       name: 'cluster',
       url: 'adminCluster',
       url: 'adminCluster',

+ 2 - 4
ambari-web/app/views/main/charts/heatmap/heatmap_host.js

@@ -27,8 +27,7 @@ App.MainChartsHeatmapHostView = Em.View.extend({
   /**
   /**
    * show Host details block and move it near the cursor
    * show Host details block and move it near the cursor
    * 
    * 
-   * @param {Object}
-   *          e
+   * @param {Object} e
    * @this App.MainChartsHeatmapHostView
    * @this App.MainChartsHeatmapHostView
    */
    */
   mouseEnter: function (e) {
   mouseEnter: function (e) {
@@ -95,8 +94,7 @@ App.MainChartsHeatmapHostView = Em.View.extend({
   /**
   /**
    * hide Host details block
    * hide Host details block
    * 
    * 
-   * @param {Object}
-   *          e
+   * @param {Object} e
    * @this App.MainChartsHeatmapHostView
    * @this App.MainChartsHeatmapHostView
    */
    */
   mouseLeave: function (e) {
   mouseLeave: function (e) {

+ 1 - 2
ambari-web/app/views/main/dashboard.js

@@ -61,8 +61,7 @@ App.MainDashboardView = Em.View.extend({
           //self.translateToReal(newValue);
           //self.translateToReal(newValue);
         }
         }
       }
       }
-    });
-    $( "#sortable" ).disableSelection();
+    }).disableSelection();
   },
   },
 
 
   setWidgetsDataModel: function () {
   setWidgetsDataModel: function () {

+ 1 - 2
ambari-web/app/views/main/dashboard/service/hdfs.js

@@ -40,10 +40,9 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
   dashboardMasterComponentView: Em.View.extend({
   dashboardMasterComponentView: Em.View.extend({
     templateName: require('templates/main/service/info/summary/master_components'),
     templateName: require('templates/main/service/info/summary/master_components'),
     mastersComp : function() {
     mastersComp : function() {
-      var masters = this.get('parentView.service.hostComponents').filter(function(comp){
+      return this.get('parentView.service.hostComponents').filter(function(comp){
         return comp.get('isMaster') && comp.get('componentName') !== 'JOURNALNODE';
         return comp.get('isMaster') && comp.get('componentName') !== 'JOURNALNODE';
       });
       });
-      return masters;
     }.property('parentView.service.hostComponents')
     }.property('parentView.service.hostComponents')
   }),
   }),
 
 

+ 5 - 4
ambari-web/app/views/main/dashboard/widget.js

@@ -197,15 +197,16 @@ App.DashboardWidgetView = Em.View.extend({
               colorstops += colors[i+1] + " " + handlers[i]*100/max_tmp + "%,";
               colorstops += colors[i+1] + " " + handlers[i]*100/max_tmp + "%,";
             }
             }
             colorstops += colors[colors.length - 1];
             colorstops += colors[colors.length - 1];
+            var sliderElement = $('#slider-range');
             var css1 = '-webkit-linear-gradient(left,' + colorstops + ')'; // chrome & safari
             var css1 = '-webkit-linear-gradient(left,' + colorstops + ')'; // chrome & safari
-            $('#slider-range').css('background-image', css1);
+            sliderElement.css('background-image', css1);
             var css2 = '-ms-linear-gradient(left,' + colorstops + ')'; // IE 10+
             var css2 = '-ms-linear-gradient(left,' + colorstops + ')'; // IE 10+
-            $('#slider-range').css('background-image', css2);
+            sliderElement.css('background-image', css2);
             //$('#slider-range').css('filter', 'progid:DXImageTransform.Microsoft.gradient( startColorStr= ' + colors[0] + ', endColorStr= ' + colors[2] +',  GradientType=1 )' ); // IE 10-
             //$('#slider-range').css('filter', 'progid:DXImageTransform.Microsoft.gradient( startColorStr= ' + colors[0] + ', endColorStr= ' + colors[2] +',  GradientType=1 )' ); // IE 10-
             var css3 = '-moz-linear-gradient(left,' + colorstops + ')'; // Firefox
             var css3 = '-moz-linear-gradient(left,' + colorstops + ')'; // Firefox
-            $('#slider-range').css('background-image', css3);
+            sliderElement.css('background-image', css3);
 
 
-            $('#slider-range .ui-widget-header').css({'background-color': '#FF8E00', 'background-image': 'none'}); // change the  original ranger color
+            sliderElement.find('.ui-widget-header').css({'background-color': '#FF8E00', 'background-image': 'none'}); // change the  original ranger color
           }
           }
         } else {
         } else {
           configObj.set('isIE9', true);
           configObj.set('isIE9', true);

+ 1 - 1
ambari-web/app/views/main/dashboard/widgets/node_managers_live.js

@@ -177,4 +177,4 @@ App.NodeManagersLiveView = App.TextDashboardWidgetView.extend({
     });
     });
   }
   }
 
 
-})
+});

+ 1 - 2
ambari-web/app/views/main/host/details.js

@@ -27,12 +27,11 @@ App.MainHostDetailsView = Em.View.extend({
   }.property('App.router.mainHostDetailsController.content'),
   }.property('App.router.mainHostDetailsController.content'),
 
 
   maintenance: function(){
   maintenance: function(){
-    var options = [
+    return [
          {action: 'startAllComponents', 'label': this.t('hosts.host.details.startAllComponents')},
          {action: 'startAllComponents', 'label': this.t('hosts.host.details.startAllComponents')},
          {action: 'stopAllComponents', 'label': this.t('hosts.host.details.stopAllComponents')},
          {action: 'stopAllComponents', 'label': this.t('hosts.host.details.stopAllComponents')},
          {action: 'restartAllComponents', 'label': this.t('hosts.host.details.restartAllComponents')},
          {action: 'restartAllComponents', 'label': this.t('hosts.host.details.restartAllComponents')},
          {action: 'deleteHost', 'label': this.t('hosts.host.details.deleteHost')}];
          {action: 'deleteHost', 'label': this.t('hosts.host.details.deleteHost')}];
-    return options;
   }.property('controller.content'),
   }.property('controller.content'),
   didInsertElement: function() {
   didInsertElement: function() {
     App.tooltip($("[rel='HealthTooltip']"));
     App.tooltip($("[rel='HealthTooltip']"));

+ 1 - 7
ambari-web/app/views/main/mirroring/jobs_view.js

@@ -90,12 +90,7 @@ App.MainJobsView = App.TableView.extend({
     canActionBeTaken: function () {
     canActionBeTaken: function () {
       var job_status = this.get('content.status');
       var job_status = this.get('content.status');
 
 
-      if (job_status == "RUNNING" || job_status == "SUSPENDED") {
-        return true;
-      }
-
-      return false;
-
+      return job_status == "RUNNING" || job_status == "SUSPENDED";
     }.property('content.status'),
     }.property('content.status'),
 
 
     isKilled: function () {
     isKilled: function () {
@@ -121,7 +116,6 @@ App.MainJobsView = App.TableView.extend({
         case 'WAITING' :
         case 'WAITING' :
           return "label";
           return "label";
           break;
           break;
-        case 'KILLED' :
         case 'FAILED' :
         case 'FAILED' :
         case 'ERROR' :
         case 'ERROR' :
           return "label label-important";
           return "label label-important";

+ 1 - 1
ambari-web/app/views/main/service/info/metrics/yarn/qmr.js

@@ -56,7 +56,7 @@ App.ChartServiceMetricsYARN_QMR = App.ChartLinearTimeView.extend({
     }
     }
     if (jsonData && jsonData.metrics && jsonData.metrics.yarn.Queue) {
     if (jsonData && jsonData.metrics && jsonData.metrics.yarn.Queue) {
       queueNames.forEach(function (qName) {
       queueNames.forEach(function (qName) {
-        var qPath = qName.replace(/\//g, '.')
+        var qPath = qName.replace(/\//g, '.');
         var displayName;
         var displayName;
         var allocatedData = objUtils.getProperty(jsonData.metrics.yarn.Queue, qPath + '.AllocatedMB');
         var allocatedData = objUtils.getProperty(jsonData.metrics.yarn.Queue, qPath + '.AllocatedMB');
         var availableData = objUtils.getProperty(jsonData.metrics.yarn.Queue, qPath + '.AvailableMB');
         var availableData = objUtils.getProperty(jsonData.metrics.yarn.Queue, qPath + '.AvailableMB');

+ 4 - 14
ambari-web/app/views/main/service/info/summary.js

@@ -29,7 +29,7 @@ App.AlertItemView = Em.View.extend({
     App.tooltip($("div[rel=tooltip]"));
     App.tooltip($("div[rel=tooltip]"));
     $(".tooltip").remove();
     $(".tooltip").remove();
   }
   }
-})
+});
 
 
 App.MainServiceInfoSummaryView = Em.View.extend({
 App.MainServiceInfoSummaryView = Em.View.extend({
   templateName: require('templates/main/service/info/summary'),
   templateName: require('templates/main/service/info/summary'),
@@ -66,11 +66,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   noTemplateService: function () {
   noTemplateService: function () {
     var serviceName = this.get("service.serviceName");
     var serviceName = this.get("service.serviceName");
     //services with only master components
     //services with only master components
-    if(serviceName == "WEBHCAT" || serviceName == "NAGIOS"){
-      return true;
-    }else{
-      return false;
-    }
+    return serviceName == "WEBHCAT" || serviceName == "NAGIOS";
   }.property('controller.content'),
   }.property('controller.content'),
 
 
   clients: function () {
   clients: function () {
@@ -82,10 +78,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   }.property('controller.content'),
   }.property('controller.content'),
 
 
   hasManyServers: function () {
   hasManyServers: function () {
-    if (this.get('servers').length > 1) {
-      return true;
-    }
-    return false;
+    return this.get('servers').length > 1;
   }.property('servers'),
   }.property('servers'),
 
 
   clientsHostText: function () {
   clientsHostText: function () {
@@ -99,10 +92,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   }.property("hasManyClients"),
   }.property("hasManyClients"),
 
 
   hasManyClients: function () {
   hasManyClients: function () {
-    if (this.get('clients').length > 1) {
-      return true;
-    }
-    return false;
+    return this.get('clients').length > 1;
   }.property('clients'),
   }.property('clients'),
 
 
   servers: function () {
   servers: function () {

+ 1 - 4
ambari-web/app/views/main/service/menu.js

@@ -22,10 +22,7 @@ var misc = require('utils/misc');
 App.MainServiceMenuView = Em.CollectionView.extend({
 App.MainServiceMenuView = Em.CollectionView.extend({
   content:function () {
   content:function () {
     var items = App.router.get('mainServiceController.content').filter(function(item){
     var items = App.router.get('mainServiceController.content').filter(function(item){
-      if(['PIG', 'SQOOP', 'HCATALOG', 'TEZ'].contains(item.get('id'))){
-        return false;
-      }
-      return true;
+      return !['PIG', 'SQOOP', 'HCATALOG', 'TEZ'].contains(item.get('id'));
     });
     });
     return misc.sortByOrder(App.Service.servicesSortOrder, items);
     return misc.sortByOrder(App.Service.servicesSortOrder, items);
   }.property('App.router.mainServiceController.content', 'App.router.mainServiceController.content.length'),
   }.property('App.router.mainServiceController.content', 'App.router.mainServiceController.content.length'),

+ 1 - 1
ambari-web/app/views/main/service/reassign/step1_view.js

@@ -22,7 +22,7 @@ var App = require('app');
 App.ReassignMasterWizardStep1View = Em.View.extend({
 App.ReassignMasterWizardStep1View = Em.View.extend({
 
 
   message: function () {
   message: function () {
-    messages = [
+    var messages = [
       Em.I18n.t('services.reassign.step1.message1').format(this.get('controller.content.reassign.display_name')),
       Em.I18n.t('services.reassign.step1.message1').format(this.get('controller.content.reassign.display_name')),
       Em.I18n.t('services.reassign.step1.message3').format(this.get('controller.content.reassign.display_name'))
       Em.I18n.t('services.reassign.step1.message3').format(this.get('controller.content.reassign.display_name'))
     ];
     ];

Some files were not shown because too many files changed in this diff