Updated Branches: refs/heads/trunk 33092de45 -> 5ff51712a
http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/utils/number_utils.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/number_utils.js b/ambari-web/app/utils/number_utils.js index c201e52..a83aa8e 100644 --- a/ambari-web/app/utils/number_utils.js +++ b/ambari-web/app/utils/number_utils.js @@ -19,17 +19,16 @@ module.exports = { /** * 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> * @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) { return 'n/a'; } else { http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/utils/object_utils.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/object_utils.js b/ambari-web/app/utils/object_utils.js index badfa75..f215471 100644 --- a/ambari-web/app/utils/object_utils.js +++ b/ambari-web/app/utils/object_utils.js @@ -72,8 +72,9 @@ module.exports = { /** * Gets value of property path. - * - * @param propertyPath + * + * @param {Object} object + * @param {String} propertyPath * Format is 'a.b.c' * @return Returns <code>undefined</code> when path does not exist. */ http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/utils/polling.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/polling.js b/ambari-web/app/utils/polling.js index 2b05131..a239391 100644 --- a/ambari-web/app/utils/polling.js +++ b/ambari-web/app/utils/polling.js @@ -38,8 +38,7 @@ App.Poll = Em.Object.extend({ mockDataPrefix: '/data/wizard/deploy/5_hosts', barWidth: function () { - var barWidth = 'width: ' + this.get('progress') + '%;'; - return barWidth; + return 'width: ' + this.get('progress') + '%;'; }.property('progress'), isCompleted: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/utils/string_utils.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/string_utils.js b/ambari-web/app/utils/string_utils.js index 92cb75f..c1b6061 100644 --- a/ambari-web/app/utils/string_utils.js +++ b/ambari-web/app/utils/string_utils.js @@ -37,7 +37,8 @@ module.exports = { break; 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; str = Array(left+1).join(pad) + str + Array(right+1).join(pad); break; @@ -53,12 +54,10 @@ module.exports = { }, 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 new_name; + return name.replace(/_\w/g,replacer); }, /** * Compare two versions by following rules: @@ -147,4 +146,4 @@ module.exports = { var last_slash = path.lastIndexOf('/'); return (last_slash!=0)?path.substr(0,last_slash):'/'; } -} +}; http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/utils/updater.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/updater.js b/ambari-web/app/utils/updater.js index 5bd426c..36d8c51 100644 --- a/ambari-web/app/utils/updater.js +++ b/ambari-web/app/utils/updater.js @@ -47,7 +47,7 @@ function update(obj, name, isWorking, interval){ state.timeout = setTimeout(state.func, interval); return true; -}; +} function rerun(name){ var state = states[name]; @@ -55,7 +55,7 @@ function rerun(name){ clearTimeout(state.timeout); state.func(); } -}; +} App.updater = { @@ -126,4 +126,4 @@ App.updater = { return rerun(name); } -} +}; http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/common/chart.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/chart.js b/ambari-web/app/views/common/chart.js index a565617..e2cdbdb 100644 --- a/ambari-web/app/views/common/chart.js +++ b/ambari-web/app/views/common/chart.js @@ -174,8 +174,6 @@ App.ChartView = Em.View.extend({ if (renderer.getDate(point).getTime() <= selectedDate.getTime()) { prevVal = nextVal; nextVal = point; - } else { - return; } }); @@ -200,7 +198,7 @@ App.ChartView = Em.View.extend({ vis.append("svg:g") .attr("class", "axis") .attr("transform", "translate(0," + this.get('p') + ")") - .call(renderer.axis) + .call(renderer.axis); $.each(this.get('nodeAttributes'), function (i, v) { var element = $('<div></div>').addClass(v).addClass("stateValue").html(""); http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/common/chart/linear.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/chart/linear.js b/ambari-web/app/views/common/chart/linear.js index 6729263..d85cce3 100644 --- a/ambari-web/app/views/common/chart/linear.js +++ b/ambari-web/app/views/common/chart/linear.js @@ -59,7 +59,7 @@ App.ChartLinearView = Em.View.extend({ .attr("x1", thisChart.x(0)) .attr("y1", -1 * thisChart.y(0)) .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") .attr("x1", thisChart.x(0)) http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/common/chart/linear_time.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/chart/linear_time.js b/ambari-web/app/views/common/chart/linear_time.js index c7756c1..bf8dcab 100644 --- a/ambari-web/app/views/common/chart/linear_time.js +++ b/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 * format '23 GB' etc. * - * @type Function + * @type {Function} */ App.ChartLinearTimeView.BytesFormatter = function (y) { 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%' * - * @type Function + * @type {Function} */ App.ChartLinearTimeView.PercentageFormatter = function (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', * '5s', '10 m', '3 hr' etc. Time is expected to be provided in milliseconds. * - * @type Function + * @type {Function} */ App.ChartLinearTimeView.TimeElapsedFormatter = function (millis) { var value = millis; @@ -873,7 +873,7 @@ App.ChartLinearTimeView.TimeElapsedFormatter = function (millis) { * The default formatter which uses Rickshaw.Fixtures.Number.formatKMBT * which shows 10K, 300M etc. * - * @type Function + * @type {Function} */ App.ChartLinearTimeView.DefaultFormatter = function(y) { if(isNaN(y)){ @@ -903,7 +903,7 @@ App.ChartLinearTimeView.DefaultFormatter = function(y) { * @param valueFormatter Value itself will need further processing * via provided formatter. Ex: '10M requests/s'. Generally * should be App.ChartLinearTimeView.DefaultFormatter. - * @return Function + * @return {Function} */ App.ChartLinearTimeView.CreateRateFormatter = function (unitsPrefix, valueFormatter) { var suffix = " "+unitsPrefix+"/s"; http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/common/configs/services_config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/services_config.js b/ambari-web/app/views/common/configs/services_config.js index 41be669..7698307 100644 --- a/ambari-web/app/views/common/configs/services_config.js +++ b/ambari-web/app/views/common/configs/services_config.js @@ -380,7 +380,7 @@ App.ServiceConfigsByCategoryView = Ember.View.extend({ }); // remove undefined elements from array sortedConfigs = sortedConfigs.filter(function (config) { - if (config !== undefined) return true; + return config !== undefined; }); return sortedConfigs.concat(unSorted); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/common/grid.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/grid.js b/ambari-web/app/views/common/grid.js index eb27c8f..fe1b051 100644 --- a/ambari-web/app/views/common/grid.js +++ b/ambari-web/app/views/common/grid.js @@ -143,7 +143,7 @@ App.GridPager = Em.View.extend({ init:function () { this._super(); - this.clearPages() + this.clearPages(); this.pushPages(); }, @@ -203,7 +203,7 @@ App.Grid = Em.View.extend({ var collection = this.get('_collection.className'); collection = collection.find(); - arrayCollection = collection.filter(function(data) { + var arrayCollection = collection.filter(function(data) { var oneFilterFail = false; $.each(filters, function(fieldname, values){ if(values.length && values.indexOf(data.get(fieldname)) == -1) { @@ -270,7 +270,7 @@ App.Grid = Em.View.extend({ options[field].push(filter); } }); - }) + }); thisGrid.set('_filters', options); } http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/common/metric.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/metric.js b/ambari-web/app/views/common/metric.js index bae2ce4..affe619 100644 --- a/ambari-web/app/views/common/metric.js +++ b/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', items:[ 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') -}) \ No newline at end of file +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/common/modal_popup.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/modal_popup.js b/ambari-web/app/views/common/modal_popup.js index 72db6f3..fe87d66 100644 --- a/ambari-web/app/views/common/modal_popup.js +++ b/ambari-web/app/views/common/modal_popup.js @@ -113,6 +113,7 @@ App.showReloadPopup = function () { * * @param {Function} primary - "OK" button click handler * @param {String} body - additional text constant. Will be placed in the popup-body + * @param {Function} secondary * @return {*} */ App.showConfirmationPopup = function (primary, body, secondary) { http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/common/rolling_restart_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/rolling_restart_view.js b/ambari-web/app/views/common/rolling_restart_view.js index 1ca6066..e27dede 100644 --- a/ambari-web/app/views/common/rolling_restart_view.js +++ b/ambari-web/app/views/common/rolling_restart_view.js @@ -81,9 +81,7 @@ App.RollingRestartView = Em.View.extend({ nonMaintainanceHostComponents : function() { var hostComponents = this.get('allHostComponents'); hostComponents = hostComponents.filter(function(item) { - if (item.get('workStatus') !== App.HostComponentStatus.maintenance) { - return true; - } + return item.get('workStatus') !== App.HostComponentStatus.maintenance; }); return hostComponents; }.property('allHostComponents', '[email protected]'), http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/common/sort_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/sort_view.js b/ambari-web/app/views/common/sort_view.js index 25cdc5a..4b6efea 100644 --- a/ambari-web/app/views/common/sort_view.js +++ b/ambari-web/app/views/common/sort_view.js @@ -76,7 +76,7 @@ var wrapperView = Em.View.extend({ /** * sort content by property * @param property - * @param order: true - DESC, false - ASC + * @param order true - DESC, false - ASC */ sort: function(property, order){ var content = this.get('content').toArray(); @@ -120,7 +120,7 @@ var wrapperView = Em.View.extend({ } else { return a - b; } - } + }; break; default: func = function(a,b){ http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/common/time_range.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/time_range.js b/ambari-web/app/views/common/time_range.js index 3983d11..977b376 100644 --- a/ambari-web/app/views/common/time_range.js +++ b/ambari-web/app/views/common/time_range.js @@ -218,4 +218,4 @@ App.TimeRangeWidget = Em.View.extend({ $("#slider").slider("destroy"); } }.observes('chosenPreset') -}) \ No newline at end of file +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/experimental.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/experimental.js b/ambari-web/app/views/experimental.js index a201d81..5d84c2c 100644 --- a/ambari-web/app/views/experimental.js +++ b/ambari-web/app/views/experimental.js @@ -35,7 +35,7 @@ App.ExperimentalView = Em.View.extend({ supports.forEach(function(s){ var propName = 'App.supports.' + s.get('name'); var propValue = s.get('selected'); - console.log(">>>>>>>> " + propName + " = "+ propValue) + console.log(">>>>>>>> " + propName + " = "+ propValue); Ember.set(propName, propValue); }); App.router.transitionTo('root.index'); http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/main/admin.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin.js b/ambari-web/app/views/main/admin.js index 4df5ca7..faea2bd 100644 --- a/ambari-web/app/views/main/admin.js +++ b/ambari-web/app/views/main/admin.js @@ -40,7 +40,7 @@ App.MainAdminView = Em.View.extend({ url: 'adminSecurity.index', label: Em.I18n.t('common.security') }); - }; + } items.push({ name: 'cluster', url: 'adminCluster', http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/main/charts/heatmap/heatmap_host.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/charts/heatmap/heatmap_host.js b/ambari-web/app/views/main/charts/heatmap/heatmap_host.js index b926fad..99932e5 100644 --- a/ambari-web/app/views/main/charts/heatmap/heatmap_host.js +++ b/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 * - * @param {Object} - * e + * @param {Object} e * @this App.MainChartsHeatmapHostView */ mouseEnter: function (e) { @@ -95,8 +94,7 @@ App.MainChartsHeatmapHostView = Em.View.extend({ /** * hide Host details block * - * @param {Object} - * e + * @param {Object} e * @this App.MainChartsHeatmapHostView */ mouseLeave: function (e) { http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/main/dashboard.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard.js b/ambari-web/app/views/main/dashboard.js index c5a78b8..33cd2bd 100644 --- a/ambari-web/app/views/main/dashboard.js +++ b/ambari-web/app/views/main/dashboard.js @@ -61,8 +61,7 @@ App.MainDashboardView = Em.View.extend({ //self.translateToReal(newValue); } } - }); - $( "#sortable" ).disableSelection(); + }).disableSelection(); }, setWidgetsDataModel: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/main/dashboard/service/hdfs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/service/hdfs.js b/ambari-web/app/views/main/dashboard/service/hdfs.js index da5241e..8927a5c 100644 --- a/ambari-web/app/views/main/dashboard/service/hdfs.js +++ b/ambari-web/app/views/main/dashboard/service/hdfs.js @@ -40,10 +40,9 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({ dashboardMasterComponentView: Em.View.extend({ templateName: require('templates/main/service/info/summary/master_components'), 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 masters; }.property('parentView.service.hostComponents') }), http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/main/dashboard/widget.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widget.js b/ambari-web/app/views/main/dashboard/widget.js index 8c55598..c68bff7 100644 --- a/ambari-web/app/views/main/dashboard/widget.js +++ b/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[colors.length - 1]; + var sliderElement = $('#slider-range'); 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+ - $('#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- 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 { configObj.set('isIE9', true); http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js b/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js index 172520b..295610e 100644 --- a/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js +++ b/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js @@ -177,4 +177,4 @@ App.NodeManagersLiveView = App.TextDashboardWidgetView.extend({ }); } -}) +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/main/host/details.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/details.js b/ambari-web/app/views/main/host/details.js index 1a4be4d..074c7a9 100644 --- a/ambari-web/app/views/main/host/details.js +++ b/ambari-web/app/views/main/host/details.js @@ -27,12 +27,11 @@ App.MainHostDetailsView = Em.View.extend({ }.property('App.router.mainHostDetailsController.content'), maintenance: function(){ - var options = [ + return [ {action: 'startAllComponents', 'label': this.t('hosts.host.details.startAllComponents')}, {action: 'stopAllComponents', 'label': this.t('hosts.host.details.stopAllComponents')}, {action: 'restartAllComponents', 'label': this.t('hosts.host.details.restartAllComponents')}, {action: 'deleteHost', 'label': this.t('hosts.host.details.deleteHost')}]; - return options; }.property('controller.content'), didInsertElement: function() { App.tooltip($("[rel='HealthTooltip']")); http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/main/mirroring/jobs_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/mirroring/jobs_view.js b/ambari-web/app/views/main/mirroring/jobs_view.js index 7a97cf4..831d6f0 100644 --- a/ambari-web/app/views/main/mirroring/jobs_view.js +++ b/ambari-web/app/views/main/mirroring/jobs_view.js @@ -90,12 +90,7 @@ App.MainJobsView = App.TableView.extend({ canActionBeTaken: function () { 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'), isKilled: function () { @@ -121,7 +116,6 @@ App.MainJobsView = App.TableView.extend({ case 'WAITING' : return "label"; break; - case 'KILLED' : case 'FAILED' : case 'ERROR' : return "label label-important"; http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/main/service/info/metrics/yarn/qmr.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/metrics/yarn/qmr.js b/ambari-web/app/views/main/service/info/metrics/yarn/qmr.js index d90def7..b923d19 100644 --- a/ambari-web/app/views/main/service/info/metrics/yarn/qmr.js +++ b/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) { queueNames.forEach(function (qName) { - var qPath = qName.replace(/\//g, '.') + var qPath = qName.replace(/\//g, '.'); var displayName; var allocatedData = objUtils.getProperty(jsonData.metrics.yarn.Queue, qPath + '.AllocatedMB'); var availableData = objUtils.getProperty(jsonData.metrics.yarn.Queue, qPath + '.AvailableMB'); http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/main/service/info/summary.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js index 9c42029..4bb15f2 100644 --- a/ambari-web/app/views/main/service/info/summary.js +++ b/ambari-web/app/views/main/service/info/summary.js @@ -29,7 +29,7 @@ App.AlertItemView = Em.View.extend({ App.tooltip($("div[rel=tooltip]")); $(".tooltip").remove(); } -}) +}); App.MainServiceInfoSummaryView = Em.View.extend({ templateName: require('templates/main/service/info/summary'), @@ -66,11 +66,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({ noTemplateService: function () { var serviceName = this.get("service.serviceName"); //services with only master components - if(serviceName == "WEBHCAT" || serviceName == "NAGIOS"){ - return true; - }else{ - return false; - } + return serviceName == "WEBHCAT" || serviceName == "NAGIOS"; }.property('controller.content'), clients: function () { @@ -82,10 +78,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({ }.property('controller.content'), hasManyServers: function () { - if (this.get('servers').length > 1) { - return true; - } - return false; + return this.get('servers').length > 1; }.property('servers'), clientsHostText: function () { @@ -99,10 +92,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({ }.property("hasManyClients"), hasManyClients: function () { - if (this.get('clients').length > 1) { - return true; - } - return false; + return this.get('clients').length > 1; }.property('clients'), servers: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/main/service/menu.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/menu.js b/ambari-web/app/views/main/service/menu.js index 79dbc71..b9ae802 100644 --- a/ambari-web/app/views/main/service/menu.js +++ b/ambari-web/app/views/main/service/menu.js @@ -22,10 +22,7 @@ var misc = require('utils/misc'); App.MainServiceMenuView = Em.CollectionView.extend({ content:function () { 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); }.property('App.router.mainServiceController.content', 'App.router.mainServiceController.content.length'), http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/main/service/reassign/step1_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/reassign/step1_view.js b/ambari-web/app/views/main/service/reassign/step1_view.js index 2478c37..ddabf14 100644 --- a/ambari-web/app/views/main/service/reassign/step1_view.js +++ b/ambari-web/app/views/main/service/reassign/step1_view.js @@ -22,7 +22,7 @@ var App = require('app'); App.ReassignMasterWizardStep1View = Em.View.extend({ 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.message3').format(this.get('controller.content.reassign.display_name')) ]; http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/wizard/step1_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/wizard/step1_view.js b/ambari-web/app/views/wizard/step1_view.js index d98b5f0..c2900ee 100644 --- a/ambari-web/app/views/wizard/step1_view.js +++ b/ambari-web/app/views/wizard/step1_view.js @@ -261,6 +261,7 @@ App.WizardStep1View = Em.View.extend({ case 2: return ['sles11', 'suse11']; } + return []; }, osTypeToGroup: function (osType) { switch(osType) { @@ -276,5 +277,6 @@ App.WizardStep1View = Em.View.extend({ case 'suse11': return 2; } + return -1; } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/app/views/wizard/step9_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/wizard/step9_view.js b/ambari-web/app/views/wizard/step9_view.js index 6b7dc86..1a4723b 100644 --- a/ambari-web/app/views/wizard/step9_view.js +++ b/ambari-web/app/views/wizard/step9_view.js @@ -34,8 +34,7 @@ App.WizardStep9View = Em.View.extend({ barWidth:function () { var controller = this.get('controller'); - var barWidth = 'width: ' + controller.get('progress') + '%;'; - return barWidth; + return 'width: ' + controller.get('progress') + '%;'; }.property('controller.progress'), progressMessage: function() { @@ -81,8 +80,7 @@ App.HostStatusView = Em.View.extend({ }, barWidth:function () { - var barWidth = 'width: ' + this.get('obj.progress') + '%;'; - return barWidth; + return 'width: ' + this.get('obj.progress') + '%;'; }.property('obj.progress'), onStatus:function () { @@ -246,15 +244,14 @@ App.HostStatusView = Em.View.extend({ }, getStartedTasks:function (host) { - var startedTasks = host.logTasks.filter(function (task) { + return host.logTasks.filter(function (task) { return task.Tasks.status; }); - return startedTasks; }, openTaskLogInDialog: function(){ - newwindow=window.open(); - newdocument=newwindow.document; + var newwindow=window.open(); + var newdocument=newwindow.document; newdocument.write($(".task-detail-log-info").html()); newdocument.close(); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/test/controllers/installer_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/installer_test.js b/ambari-web/test/controllers/installer_test.js index b48cf16..a92007f 100644 --- a/ambari-web/test/controllers/installer_test.js +++ b/ambari-web/test/controllers/installer_test.js @@ -62,7 +62,7 @@ describe('App.InstallerController', function () { } } ] - } + }; it ('Correct data', function() { installerController.loadStacksVersionsSuccessCallback(test_data); expect(installerController.get('stacks.length')).to.equal(2); http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/test/controllers/main/admin/cluster_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/admin/cluster_test.js b/ambari-web/test/controllers/main/admin/cluster_test.js index cd85214..ce35948 100644 --- a/ambari-web/test/controllers/main/admin/cluster_test.js +++ b/ambari-web/test/controllers/main/admin/cluster_test.js @@ -61,7 +61,7 @@ describe('App.MainAdminClusterController', function () { }); controller.updateUpgradeVersionSuccessCallback.call(controller, data); expect(controller.get('upgradeVersion')).to.equal('HDP-1.3.1'); - }) + }); it('if min upgrade version less then current then upgrade version equal current', function(){ data.items[0].Versions.min_upgrade_version = "1.2.3"; var controller = App.MainAdminClusterController.create({ @@ -71,4 +71,4 @@ describe('App.MainAdminClusterController', function () { expect(controller.get('upgradeVersion')).to.equal('HDP-1.2.2'); }) }) -}) +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/test/installer/step0_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/installer/step0_test.js b/ambari-web/test/installer/step0_test.js index 9f1c02f..eb9b3d8 100644 --- a/ambari-web/test/installer/step0_test.js +++ b/ambari-web/test/installer/step0_test.js @@ -62,16 +62,16 @@ describe('App.WizardStep0Controller', function () { wizardStep0Controller.set('hasSubmitted', true); wizardStep0Controller.set('content', {'cluster':{'name':''}}); expect(wizardStep0Controller.get('invalidClusterName')).to.equal(true); - }) + }); it('should return true if cluster name contains white spaces', function () { wizardStep0Controller.set('hasSubmitted', true); wizardStep0Controller.set('content', {'cluster':{'name':'the cluster'}}); expect(wizardStep0Controller.get('invalidClusterName')).to.equal(true); - }) + }); it('should return true if cluster name contains special chars', function () { wizardStep0Controller.set('hasSubmitted', true); wizardStep0Controller.set('content', {'cluster':{'name':'$cluster'}}); expect(wizardStep0Controller.get('invalidClusterName')).to.equal(true); }) }) -}) \ No newline at end of file +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/test/installer/step2_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/installer/step2_test.js b/ambari-web/test/installer/step2_test.js index 5971c8f..20c1fc6 100644 --- a/ambari-web/test/installer/step2_test.js +++ b/ambari-web/test/installer/step2_test.js @@ -35,12 +35,12 @@ describe('App.WizardStep2Controller', function () { it('should push to hostNameArr only new host names', function(){ expect(controller.get('hostNameArr').length).to.equal(0); - }) + }); it('should push to inputtedAgainHostNames already installed host names', function(){ expect(controller.get('inputtedAgainHostNames').length).to.equal(1); }) - }) + }); describe('#isAllHostNamesValid()', function () { @@ -51,7 +51,7 @@ describe('App.WizardStep2Controller', function () { it('should return true if all host names are valid', function(){ controller.set('hostNames', 'amache.org ambari.com'); expect(controller.isAllHostNamesValid()).to.equal(true); - }) + }); var tests = [ 'hostname', @@ -68,7 +68,7 @@ describe('App.WizardStep2Controller', function () { expect(controller.isAllHostNamesValid()).to.equal(false); }); }); - }) + }); describe('#checkHostError()', function () { @@ -78,7 +78,7 @@ describe('App.WizardStep2Controller', function () { controller.set('content', {'installOptions': {'hostNames': ''}}); controller.checkHostError(); expect(controller.get('hostsError').length).to.be.above(2); - }) + }); /*it('should set hostsError if hostNames is invalid', function () { controller.set('content', {'installOptions': {'hostNames': '@#$%'}}); @@ -91,7 +91,7 @@ describe('App.WizardStep2Controller', function () { controller.checkHostError(); expect(controller.get('hostsError')).to.equal(null); }) - }) + }); describe('#checkHostAfterSubmitHandler()', function () { @@ -102,7 +102,7 @@ describe('App.WizardStep2Controller', function () { } }); controller.set('hasSubmitted', true); - }) + }); it('should be called after changing hostNames', function (done) { var controller = App.WizardStep2Controller.create({ @@ -113,7 +113,7 @@ describe('App.WizardStep2Controller', function () { }); controller.set('content', {'installOptions': {'hostNames': 'ambari'}}); }) - }) + }); describe('#sshKeyError', function () { @@ -125,13 +125,13 @@ describe('App.WizardStep2Controller', function () { it('should return error message if hasSubmitted is true, manualInstall is false and sshKey is ""', function () { expect(controller.get('sshKeyError').length).to.be.above(2); - }) + }); it('should return null if hasSubmitted is false', function () { controller.set('hasSubmitted', false); expect(controller.get('sshKeyError')).to.equal(null); }) - }) + }); describe('#getHostInfo()', function () { @@ -147,7 +147,7 @@ describe('App.WizardStep2Controller', function () { 'ambari':{'name':'ambari', 'installType': 'manualDriven', 'bootStatus': 'PENDING'} }); }) - }) + }); describe('#setSshKey()', function () { @@ -158,7 +158,7 @@ describe('App.WizardStep2Controller', function () { controller.setSshKey('222'); expect(controller.get('content.installOptions.sshKey')).to.equal('222'); }) - }) + }); describe('#evaluateStep()', function () { @@ -168,7 +168,7 @@ describe('App.WizardStep2Controller', function () { }); controller.set('isSubmitDisabled', true); expect(controller.evaluateStep()).to.equal(false); - }) + }); it('should return false if hostsError is not empty', function () { var controller = App.WizardStep2Controller.create({ @@ -176,7 +176,7 @@ describe('App.WizardStep2Controller', function () { }); controller.set('hostsError', 'error'); expect(controller.evaluateStep()).to.equal(false); - }) + }); it('should return false if sshKeyError is not empty', function () { var controller = App.WizardStep2Controller.create({ @@ -184,14 +184,14 @@ describe('App.WizardStep2Controller', function () { }); controller.set('sshKeyError', 'error'); expect(controller.evaluateStep()).to.equal(false); - }) + }); it('should return false if hostNameArr is empty', function () { var controller = App.WizardStep2Controller.create({ hostNames: '' }); expect(controller.evaluateStep()).to.equal(false); - }) + }); it('should return false if isPattern is false', function () { var controller = App.WizardStep2Controller.create({ @@ -200,7 +200,7 @@ describe('App.WizardStep2Controller', function () { }); expect(controller.evaluateStep()).to.equal(false); }) - }) + }); describe('#patternExpression()', function () { @@ -219,7 +219,7 @@ describe('App.WizardStep2Controller', function () { } expect(result).to.equal(true); }) - }) + }); describe('#proceedNext()', function () { @@ -233,7 +233,7 @@ describe('App.WizardStep2Controller', function () { }); controller.proceedNext(true); }) - }) + }); describe('#isSubmitDisabled', function () { @@ -245,14 +245,14 @@ describe('App.WizardStep2Controller', function () { it('should return value if hostsError is not empty', function () { controller.set('hostsError', 'error'); expect(controller.get('isSubmitDisabled').length).to.above(0); - }) + }); it('should return value if sshKeyError is not empty', function () { controller.set('sshKeyError', 'error'); controller.set('hostsError', ''); expect(controller.get('isSubmitDisabled').length).to.above(0); }) - }) + }); /*describe('#saveHosts()', function () { var controller = App.WizardStep2Controller.create({ @@ -269,4 +269,4 @@ describe('App.WizardStep2Controller', function () { expect(controller.get('content.hosts')).to.not.be.empty; }) })*/ -}) +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/test/login_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/login_test.js b/ambari-web/test/login_test.js index 23c0711..1975b2d 100644 --- a/ambari-web/test/login_test.js +++ b/ambari-web/test/login_test.js @@ -41,4 +41,4 @@ describe('App.LoginController', function () { }) */ }) -}) +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/test/utils/config_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js index 1ac31b8..834cfc9 100644 --- a/ambari-web/test/utils/config_test.js +++ b/ambari-web/test/utils/config_test.js @@ -33,14 +33,14 @@ describe('App.config', function () { data = { serviceName: 'HDFS', filename: 'core-site.xml' - } + }; expect(App.config.identifyCategory(data).name).to.equal('AdvancedCoreSite'); }); it('should return "CapacityScheduler" if filename "capacity-scheduler.xml" and serviceName "YARN"', function () { data = { serviceName: 'YARN', filename: 'capacity-scheduler.xml' - } + }; expect(App.config.identifyCategory(data).name).to.equal('CapacityScheduler'); }); }); http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/test/utils/validator_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/utils/validator_test.js b/ambari-web/test/utils/validator_test.js index 2882a10..1561dc3 100644 --- a/ambari-web/test/utils/validator_test.js +++ b/ambari-web/test/utils/validator_test.js @@ -23,120 +23,120 @@ describe('validator', function () { describe('#isValidEmail(value)', function () { it('should return false if value is null', function () { expect(validator.isValidEmail(null)).to.equal(false); - }) + }); it('should return false if value is ""', function () { expect(validator.isValidEmail('')).to.equal(false); - }) + }); it('should return false if value is "a.com"', function () { expect(validator.isValidEmail('a.com')).to.equal(false); - }) + }); it('should return false if value is "@a.com"', function () { expect(validator.isValidEmail('@a.com')).to.equal(false); - }) + }); it('should return false if value is "[email protected]"', function () { expect(validator.isValidEmail('[email protected]')).to.equal(false); - }) + }); it('should return true if value is "[email protected]"', function () { expect(validator.isValidEmail('[email protected]')).to.equal(true); - }) + }); it('should return true if value is "[email protected]"', function () { expect(validator.isValidEmail('[email protected]')).to.equal(true); }) - }) + }); describe('#isValidInt(value)', function () { it('should return false if value is null', function () { expect(validator.isValidInt(null)).to.equal(false); - }) + }); it('should return false if value is ""', function () { expect(validator.isValidInt('')).to.equal(false); - }) + }); it('should return false if value is "abc"', function () { expect(validator.isValidInt('abc')).to.equal(false); - }) + }); it('should return false if value is "0xff"', function () { expect(validator.isValidInt('0xff')).to.equal(false); - }) + }); it('should return false if value is " 1""', function () { expect(validator.isValidInt(' 1')).to.equal(false); - }) + }); it('should return false if value is "1 "', function () { expect(validator.isValidInt('1 ')).to.equal(false); - }) + }); it('should return true if value is "10"', function () { expect(validator.isValidInt('10')).to.equal(true); - }) + }); it('should return true if value is "-123"', function () { expect(validator.isValidInt('-123')).to.equal(true); - }) + }); it('should return true if value is "0"', function () { expect(validator.isValidInt('0')).to.equal(true); - }) + }); it('should return true if value is 10', function () { expect(validator.isValidInt(10)).to.equal(true); - }) + }); it('should return true if value is -123', function () { expect(validator.isValidInt(10)).to.equal(true); - }) + }); it('should return true if value is 0', function () { expect(validator.isValidInt(10)).to.equal(true); }) - }) + }); describe('#isValidFloat(value)', function () { it('should return false if value is null', function () { expect(validator.isValidFloat(null)).to.equal(false); - }) + }); it('should return false if value is ""', function () { expect(validator.isValidFloat('')).to.equal(false); - }) + }); it('should return false if value is "abc"', function () { expect(validator.isValidFloat('abc')).to.equal(false); - }) + }); it('should return false if value is "0xff"', function () { expect(validator.isValidFloat('0xff')).to.equal(false); - }) + }); it('should return false if value is " 1""', function () { expect(validator.isValidFloat(' 1')).to.equal(false); - }) + }); it('should return false if value is "1 "', function () { expect(validator.isValidFloat('1 ')).to.equal(false); - }) + }); it('should return true if value is "10"', function () { expect(validator.isValidFloat('10')).to.equal(true); - }) + }); it('should return true if value is "-123"', function () { expect(validator.isValidFloat('-123')).to.equal(true); - }) + }); it('should return true if value is "0"', function () { expect(validator.isValidFloat('0')).to.equal(true); - }) + }); it('should return true if value is 10', function () { expect(validator.isValidFloat(10)).to.equal(true); - }) + }); it('should return true if value is -123', function () { expect(validator.isValidFloat(10)).to.equal(true); - }) + }); it('should return true if value is 0', function () { expect(validator.isValidFloat(10)).to.equal(true); - }) + }); it('should return true if value is "0.0"', function () { expect(validator.isValidFloat("0.0")).to.equal(true); - }) + }); it('should return true if value is "10.123"', function () { expect(validator.isValidFloat("10.123")).to.equal(true); - }) + }); it('should return true if value is "-10.123"', function () { expect(validator.isValidFloat("-10.123")).to.equal(true); - }) + }); it('should return true if value is 10.123', function () { expect(validator.isValidFloat(10.123)).to.equal(true); - }) + }); it('should return true if value is -10.123', function () { expect(validator.isValidFloat(-10.123)).to.equal(true); }) - }) + }); /*describe('#isIpAddress(value)', function () { it('"127.0.0.1" - valid IP', function () { expect(validator.isIpAddress('127.0.0.1')).to.equal(true); @@ -184,20 +184,20 @@ describe('validator', function () { describe('#isDomainName(value)', function () { it('"google.com" - valid Domain Name', function () { expect(validator.isDomainName('google.com')).to.equal(true); - }) + }); it('"google" - invalid Domain Name', function () { expect(validator.isDomainName('google')).to.equal(false); - }) + }); it('"123.123" - invalid Domain Name', function () { expect(validator.isDomainName('123.123')).to.equal(false); - }) + }); it('"4goog.le" - valid Domain Name', function () { expect(validator.isDomainName('4goog.le')).to.equal(true); - }) + }); it('"55454" - invalid Domain Name', function () { expect(validator.isDomainName('55454')).to.equal(false); }) - }) + }); describe('#isValidUserName(value)', function() { var tests = [ {m:'"" - invalid',i:'',e:false}, @@ -218,7 +218,7 @@ describe('validator', function () { expect(validator.isValidUserName(test.i)).to.equal(test.e); }) }); - }) + }); describe('#isValidUNIXUser(value)', function() { var tests = [ {m:'"" - invalid',i:'',e:false}, @@ -239,7 +239,7 @@ describe('validator', function () { expect(validator.isValidUNIXUser(test.i)).to.equal(test.e); }) }); - }) + }); describe('#isValidDir(value)', function() { var tests = [ {m:'"dir" - invalid',i:'dir',e:false}, @@ -255,7 +255,7 @@ describe('validator', function () { expect(validator.isValidDir(test.i)).to.equal(test.e); }) }); - }) + }); describe('#isAllowedDir(value)', function() { var tests = [ {m:'"/home" - not allowed',i:'/home',e:false}, @@ -273,7 +273,7 @@ describe('validator', function () { expect(validator.isAllowedDir(test.i)).to.equal(test.e); }) }); - }) + }); describe('#isValidConfigKey(value)', function() { var tests = [ {m:'"123" - valid',i:'123',e:true}, @@ -292,4 +292,4 @@ describe('validator', function () { }) }); }) -}) \ No newline at end of file +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/5ff51712/ambari-web/test/views/common/chart/linear_time_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/common/chart/linear_time_test.js b/ambari-web/test/views/common/chart/linear_time_test.js index 39728d8..989118e 100644 --- a/ambari-web/test/views/common/chart/linear_time_test.js +++ b/ambari-web/test/views/common/chart/linear_time_test.js @@ -30,13 +30,13 @@ describe('App.ChartLinearTimeView', function () { var result = chartLinearTimeView.transformData(data, name); it('"name" should be "abc" ', function () { expect(result.name).to.equal('abc'); - }) + }); it('data size should be 3 ', function () { expect(result.data.length).to.equal(3); - }) + }); it('data[0].x should be 2 ', function () { expect(result.data[0].x).to.equal(2); - }) + }); it('data[0].y should be 1 ', function () { expect(result.data[0].y).to.equal(1); }) @@ -109,7 +109,7 @@ describe('App.ChartLinearTimeView', function () { expect(App.ChartLinearTimeView.PercentageFormatter(test.i)).to.equal(test.e); }); }); - }), + }); describe('#TimeElapsedFormatter', function() { var tests = [ {m:'undefined to "0 ms"',i:undefined,e:'0 ms'}, @@ -128,4 +128,4 @@ describe('App.ChartLinearTimeView', function () { }); }); }) -}) +});
