Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 18B5B11492 for ; Mon, 21 Jul 2014 15:54:39 +0000 (UTC) Received: (qmail 21477 invoked by uid 500); 21 Jul 2014 15:54:39 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 21455 invoked by uid 500); 21 Jul 2014 15:54:38 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 21307 invoked by uid 99); 21 Jul 2014 15:54:38 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2014 15:54:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8ED3C9AD4AA; Mon, 21 Jul 2014 15:54:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: onechiporenko@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: AMBARI-6549. Fix App.testMode using. (onechiporenko) Date: Mon, 21 Jul 2014 15:54:38 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk 88f5e9fa1 -> cb335d5d7 AMBARI-6549. Fix App.testMode using. (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cb335d5d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cb335d5d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cb335d5d Branch: refs/heads/trunk Commit: cb335d5d7d3dd4d421259364324ccabc8f3b4485 Parents: 88f5e9f Author: Oleg Nechiporenko Authored: Mon Jul 21 18:46:45 2014 +0300 Committer: Oleg Nechiporenko Committed: Mon Jul 21 18:46:45 2014 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/application.js | 2 +- .../global/background_operations_controller.js | 2 +- .../app/controllers/global/cluster_controller.js | 10 +++++----- ambari-web/app/controllers/main/admin/cluster.js | 4 ++-- .../main/admin/highAvailability_controller.js | 6 +++--- ambari-web/app/controllers/main/admin/security.js | 6 +++--- .../app/controllers/main/admin/security/add/step2.js | 4 ++-- .../app/controllers/main/admin/security/add/step3.js | 2 +- .../app/controllers/main/admin/security/add/step4.js | 2 +- .../admin/security/security_progress_controller.js | 8 ++++---- .../app/controllers/main/apps/item_controller.js | 2 +- ambari-web/app/controllers/main/apps_controller.js | 2 +- ambari-web/app/controllers/main/host/details.js | 6 +++--- .../main/mirroring/edit_dataset_controller.js | 4 ++-- ambari-web/app/controllers/main/service/item.js | 6 +++--- .../controllers/main/service/reassign_controller.js | 4 ++-- .../wizard/stack_upgrade/step3_controller.js | 14 +++++++------- ambari-web/app/controllers/wizard/step2_controller.js | 2 +- ambari-web/app/controllers/wizard/step3_controller.js | 14 +++++++------- ambari-web/app/controllers/wizard/step8_controller.js | 2 +- ambari-web/app/controllers/wizard/step9_controller.js | 14 +++++++------- ambari-web/app/models/host.js | 2 +- ambari-web/app/router.js | 6 +++--- ambari-web/app/routes/add_host_routes.js | 4 ++-- ambari-web/app/routes/add_security.js | 6 +++--- ambari-web/app/routes/add_service_routes.js | 2 +- ambari-web/app/routes/installer.js | 6 +++--- ambari-web/app/utils/host_progress_popup.js | 2 +- ambari-web/app/utils/jobs.js | 2 +- ambari-web/app/utils/polling.js | 2 +- ambari-web/app/views/common/table_view.js | 2 +- ambari-web/app/views/main/apps/item/bar_view.js | 2 +- ambari-web/app/views/main/apps/item/dag_view.js | 4 ++-- ambari-web/app/views/main/dashboard/widget.js | 2 +- ambari-web/app/views/main/dashboard/widgets.js | 8 ++++---- .../app/views/main/dashboard/widgets/datanode_live.js | 2 +- .../views/main/dashboard/widgets/flume_agent_live.js | 2 +- .../main/dashboard/widgets/hbase_average_load.js | 2 +- .../dashboard/widgets/hbase_regions_in_transition.js | 2 +- .../views/main/dashboard/widgets/jobtracker_rpc.js | 2 +- .../app/views/main/dashboard/widgets/namenode_rpc.js | 2 +- .../main/dashboard/widgets/node_managers_live.js | 2 +- .../views/main/dashboard/widgets/supervisor_live.js | 2 +- .../views/main/dashboard/widgets/tasktracker_live.js | 2 +- .../views/wizard/step3/hostWarningPopupBody_view.js | 3 ++- ambari-web/app/views/wizard/step8_view.js | 2 +- 46 files changed, 95 insertions(+), 94 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/application.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/application.js b/ambari-web/app/controllers/application.js index f82d9bd..72f1af2 100644 --- a/ambari-web/app/controllers/application.js +++ b/ambari-web/app/controllers/application.js @@ -106,7 +106,7 @@ App.ApplicationController = Em.Controller.extend(App.UserPref, { curValue = initValue; } var key = self.persistKey(); - if (!App.testMode) { + if (!App.get('testMode')) { self.postUserPref(key, curValue); } this.hide(); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/global/background_operations_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/global/background_operations_controller.js b/ambari-web/app/controllers/global/background_operations_controller.js index a3452ef..553654b 100644 --- a/ambari-web/app/controllers/global/background_operations_controller.js +++ b/ambari-web/app/controllers/global/background_operations_controller.js @@ -98,7 +98,7 @@ App.BackgroundOperationsController = Em.Controller.extend({ 'operationsCount': count } }; - if (levelInfo.get('name') === 'TASK_DETAILS' && !App.testMode) { + if (levelInfo.get('name') === 'TASK_DETAILS' && !App.get('testMode')) { result.name = 'background_operations.get_by_task'; result.successCallback = 'callBackFilteredByTask'; result.data = { http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/global/cluster_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js index 5bae104..738ee1f 100644 --- a/ambari-web/app/controllers/global/cluster_controller.js +++ b/ambari-web/app/controllers/global/cluster_controller.js @@ -150,11 +150,11 @@ App.ClusterController = Em.Controller.extend({ }, getUrl: function (testUrl, url) { - return (App.testMode) ? testUrl : App.apiPrefix + '/clusters/' + App.get('clusterName') + url; + return (App.get('testMode')) ? testUrl : App.get('apiPrefix') + '/clusters/' + App.get('clusterName') + url; }, setGangliaUrl: function () { - if (App.testMode) { + if (App.get('testMode')) { this.set('gangliaUrl', 'http://gangliaserver/ganglia/?t=yes'); this.set('isGangliaUrlLoaded', true); } else { @@ -186,7 +186,7 @@ App.ClusterController = Em.Controller.extend({ }, setNagiosUrl: function () { - if (App.testMode) { + if (App.get('testMode')) { this.set('nagiosUrl', 'http://nagiosserver/nagios'); this.set('isNagiosUrlLoaded', true); } else { @@ -259,7 +259,7 @@ App.ClusterController = Em.Controller.extend({ return; } var clusterUrl = this.getUrl('/data/clusters/cluster.json', '?fields=Clusters'); - var usersUrl = App.testMode ? '/data/users/users.json' : App.apiPrefix + '/users/?fields=*'; + var usersUrl = App.get('testMode') ? '/data/users/users.json' : App.get('apiPrefix') + '/users/?fields=*'; var racksUrl = "/data/racks/racks.json"; @@ -284,7 +284,7 @@ App.ClusterController = Em.Controller.extend({ self.updateLoadStatus('cluster'); }); - if (App.testMode) { + if (App.get('testMode')) { self.updateLoadStatus('clusterStatus'); } else { App.clusterStatus.updateFromServer().complete(function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/main/admin/cluster.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/cluster.js b/ambari-web/app/controllers/main/admin/cluster.js index 264b4e9..30095d3 100644 --- a/ambari-web/app/controllers/main/admin/cluster.js +++ b/ambari-web/app/controllers/main/admin/cluster.js @@ -39,7 +39,7 @@ App.MainAdminClusterController = Em.Controller.extend({ }.observes('App.router.clusterController.isLoaded', 'App.currentStackVersion', 'App.router.mainServiceController.content.length'), updateUpgradeVersionSuccessCallback: function (data) { - var upgradeVersion = this.get('upgradeVersion') || App.defaultStackVersion; + var upgradeVersion = this.get('upgradeVersion') || App.get('defaultStackVersion'); var currentVersion = App.get('currentStackVersionNumber'); upgradeVersion = upgradeVersion.replace(/HDP-/, ''); data.items.mapProperty('Versions.stack_version').forEach(function (version) { @@ -91,7 +91,7 @@ App.MainAdminClusterController = Em.Controller.extend({ loadRepositoriesSuccessCallback: function (data) { var allRepos = []; data.items.forEach(function (os) { - if (!App.supports.ubuntu && os.OperatingSystems.os_type == 'debian12') return; // @todo: remove after Ubuntu support confirmation + if (!App.get('supports.ubuntu') && os.OperatingSystems.os_type == 'debian12') return; // @todo: remove after Ubuntu support confirmation os.repositories.forEach(function (repository) { var osType = repository.Repositories.os_type; var repo = Em.Object.create({ http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/main/admin/highAvailability_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability_controller.js b/ambari-web/app/controllers/main/admin/highAvailability_controller.js index 9f60d28..e090662 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability_controller.js @@ -85,12 +85,12 @@ App.MainAdminHighAvailabilityController = Em.Controller.extend({ }, setSecurityStatus: function () { - if (App.testMode) { - this.set('securityEnabled', !App.testEnableSecurity); + if (App.get('testMode')) { + this.set('securityEnabled', !App.get('testEnableSecurity')); this.set('dataIsLoaded', true); } else { //get Security Status From Server - App.ajax.send({ + return App.ajax.send({ name: 'admin.security_status', sender: this, success: 'getSecurityStatusFromServerSuccessCallback', http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/main/admin/security.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security.js b/ambari-web/app/controllers/main/admin/security.js index d5638d4..e777541 100644 --- a/ambari-web/app/controllers/main/admin/security.js +++ b/ambari-web/app/controllers/main/admin/security.js @@ -163,7 +163,7 @@ App.MainAdminSecurityController = Em.Controller.extend({ loadSecurityUsers: function () { var securityUsers = this.get('serviceUsers'); if (!securityUsers || securityUsers.length < 1) { // Page could be refreshed in middle - if (App.testMode) { + if (App.get('testMode')) { securityUsers.pushObject({id: 'puppet var', name: 'hdfs_user', value: 'hdfs'}); securityUsers.pushObject({id: 'puppet var', name: 'mapred_user', value: 'mapred'}); securityUsers.pushObject({id: 'puppet var', name: 'hbase_user', value: 'hbase'}); @@ -241,8 +241,8 @@ App.MainAdminSecurityController = Em.Controller.extend({ }, setSecurityStatus: function () { - if (App.testMode) { - this.set('securityEnabled', !App.testEnableSecurity); + if (App.get('testMode')) { + this.set('securityEnabled', !App.get('testEnableSecurity')); this.set('dataIsLoaded', true); } else { //get Security Status From Server http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/main/admin/security/add/step2.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security/add/step2.js b/ambari-web/app/controllers/main/admin/security/add/step2.js index ceedc50..44fb6c2 100644 --- a/ambari-web/app/controllers/main/admin/security/add/step2.js +++ b/ambari-web/app/controllers/main/admin/security/add/step2.js @@ -320,7 +320,7 @@ App.MainAdminSecurityAddStep2Controller = Em.Controller.extend({ loadUsers: function () { var securityUsers = App.router.get('mainAdminSecurityController').get('serviceUsers'); if (Em.isNone(securityUsers) || securityUsers.length === 0) { - if (App.testMode) { + if (App.get('testMode')) { securityUsers = securityUsers || []; securityUsers.pushObject({id: 'puppet var', name: 'hdfs_user', value: 'hdfs'}); securityUsers.pushObject({id: 'puppet var', name: 'mapred_user', value: 'mapred'}); @@ -404,7 +404,7 @@ App.MainAdminSecurityAddStep2Controller = Em.Controller.extend({ if (hdfsService) { var properties = stepConfigs.findProperty('serviceName', 'HDFS').get('configs'); var configCategories = hdfsService.configCategories; - if ((App.testMode && App.testNameNodeHA) || (this.get('content.isNnHa') === 'true')) { + if ((App.get('testMode') && App.get('testNameNodeHA')) || (this.get('content.isNnHa') === 'true')) { this.removeConfigCategory(properties, configCategories, 'SNameNode'); } else { this.removeConfigCategory(properties, configCategories, 'JournalNode'); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/main/admin/security/add/step3.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security/add/step3.js b/ambari-web/app/controllers/main/admin/security/add/step3.js index 659afde..a58f028 100644 --- a/ambari-web/app/controllers/main/admin/security/add/step3.js +++ b/ambari-web/app/controllers/main/admin/security/add/step3.js @@ -385,7 +385,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({ */ getSecurityUsers: function () { var securityUsers = []; - if (App.testMode) { + if (App.get('testMode')) { this.get('testModeUsers').forEach(function (user) { securityUsers.push({ id: 'puppet var', http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/main/admin/security/add/step4.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security/add/step4.js b/ambari-web/app/controllers/main/admin/security/add/step4.js index 2500f4d..08c23d0 100644 --- a/ambari-web/app/controllers/main/admin/security/add/step4.js +++ b/ambari-web/app/controllers/main/admin/security/add/step4.js @@ -425,7 +425,7 @@ App.MainAdminSecurityAddStep4Controller = App.MainAdminSecurityProgressControlle * load users from server */ loadUsersFromServer: function () { - if (App.testMode) { + if (App.get('testMode')) { var serviceUsers = this.get('serviceUsers'); this.get('testModeUsers').forEach(function (user) { user.id = 'puppet var'; http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/main/admin/security/security_progress_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security/security_progress_controller.js b/ambari-web/app/controllers/main/admin/security/security_progress_controller.js index 460856a..1d020fb 100644 --- a/ambari-web/app/controllers/main/admin/security/security_progress_controller.js +++ b/ambari-web/app/controllers/main/admin/security/security_progress_controller.js @@ -158,7 +158,7 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({ command.start(); } else if (command.get('name') === 'APPLY_CONFIGURATIONS') { command.set('isStarted', true); - if (App.testMode) { + if (App.get('testMode')) { command.set('isError', false); command.set('isSuccess', true); } else { @@ -166,7 +166,7 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({ } } else if (command.get('name') === 'DELETE_ATS') { command.set('isStarted', true); - if (App.testMode) { + if (App.get('testMode')) { command.set('isError', false); command.set('isSuccess', true); } else { @@ -218,7 +218,7 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({ var urlPrefix = App.apiPrefix + '/clusters/' + App.get('clusterName'); operationsInfo.forEach(function (operation) { var command = this.get('commands').findProperty('name', operation.name); - var url = (App.testMode) ? operation.testUrl : urlPrefix + operation.realUrl; + var url = (App.get('testMode')) ? operation.testUrl : urlPrefix + operation.realUrl; command.set('url', url); command.set('data', operation.data); }, this); @@ -408,7 +408,7 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({ commands.pushObject(command); }, this); App.db.setSecurityDeployCommands(commands); - if (!App.testMode) { + if (!App.get('testMode')) { App.clusterStatus.setClusterStatus({ clusterName: this.get('clusterName'), clusterState: 'ADD_SECURITY_STEP_4', http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/main/apps/item_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/apps/item_controller.js b/ambari-web/app/controllers/main/apps/item_controller.js index e046576..02ad20a 100644 --- a/ambari-web/app/controllers/main/apps/item_controller.js +++ b/ambari-web/app/controllers/main/apps/item_controller.js @@ -34,7 +34,7 @@ App.MainAppsItemController = Em.Controller.extend({ } var self = this; - var url = App.testMode ? '/data/apps/jobs/'+ currentId +'.json' : + var url = App.get('testMode') ? '/data/apps/jobs/'+ currentId +'.json' : App.apiPrefix + "/jobhistory/job?workflowId=" + currentId; var mapper = App.jobsMapper; http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/main/apps_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/apps_controller.js b/ambari-web/app/controllers/main/apps_controller.js index 737a9d9..9cd0f59 100644 --- a/ambari-web/app/controllers/main/apps_controller.js +++ b/ambari-web/app/controllers/main/apps_controller.js @@ -48,7 +48,7 @@ App.MainAppsController = Em.ArrayController.extend({ var self = this; //var runsUrl = App.testMode ? "/data/apps/runs.json" : App.apiPrefix + "/jobhistory/workflow?orderBy=startTime&sortDir=DESC&limit=" + App.maxRunsForAppBrowser; - var runsUrl = App.testMode ? "/data/apps/runs.json" : App.apiPrefix + this.get("runUrl"); + var runsUrl = App.get('testMode') ? "/data/apps/runs.json" : App.get('apiPrefix') + this.get("runUrl"); App.HttpClient.get(runsUrl, App.runsMapper, { complete:function (jqXHR, textStatus) { http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/main/host/details.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js index 0795db4..cc13471 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/ambari-web/app/controllers/main/host/details.js @@ -356,7 +356,7 @@ App.MainHostDetailsController = Em.Controller.extend({ upgradeComponentSuccessCallback: function (data, opt, params) { console.log('Send request for UPGRADE successfully'); - if (App.testMode) { + if (App.get('testMode')) { this.mimicWorkStatusChange(params.component, App.HostComponentStatus.starting, App.HostComponentStatus.started); } this.showBackgroundOperationsPopup(); @@ -548,7 +548,7 @@ App.MainHostDetailsController = Em.Controller.extend({ var self = this; console.log('Send request for INSTALLING NEW COMPONENT successfully'); - if (App.testMode) { + if (App.get('testMode')) { this.mimicWorkStatusChange(params.component, App.HostComponentStatus.installing, App.HostComponentStatus.stopped); } @@ -823,7 +823,7 @@ App.MainHostDetailsController = Em.Controller.extend({ */ installComponentSuccessCallback: function (data, opt, params) { console.log('Send request for REINSTALL COMPONENT successfully'); - if (App.testMode) { + if (App.get('testMode')) { this.mimicWorkStatusChange(params.component, App.HostComponentStatus.installing, App.HostComponentStatus.stopped); } this.showBackgroundOperationsPopup(); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js b/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js index 844a47d..ea11921 100644 --- a/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js +++ b/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js @@ -289,7 +289,7 @@ App.MainMirroringEditDataSetController = Ember.Controller.extend({ * @return {String} */ createDatasetXML: function () { - var datasetNamePrefix = App.mirroringDatasetNamePrefix; + var datasetNamePrefix = App.get('mirroringDatasetNamePrefix'); var datasetName = this.get('formFields.datasetName'); var prefixedDatasetName = datasetNamePrefix + datasetName; var sourceCluster = App.get('clusterName'); @@ -315,7 +315,7 @@ App.MainMirroringEditDataSetController = Ember.Controller.extend({ * @param {String} datasetXML */ sendDatasetToServer: function (datasetXML) { - var datasetNamePrefix = App.mirroringDatasetNamePrefix; + var datasetNamePrefix = App.get('mirroringDatasetNamePrefix'); var datasetName = this.get('formFields.datasetName'); var prefixedDatasetName = datasetNamePrefix + datasetName; return App.ajax.send({ http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/main/service/item.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js index c740d3f..2cfaa7f 100644 --- a/ambari-web/app/controllers/main/service/item.js +++ b/ambari-web/app/controllers/main/service/item.js @@ -64,13 +64,13 @@ App.MainServiceItemController = Em.Controller.extend({ var config = this.get('callBackConfig')[(JSON.parse(ajaxOptions.data)).Body.ServiceInfo.state]; var self = this; console.log('Send request for ' + config.c + ' successfully'); - if (App.testMode) { + if (App.get('testMode')) { self.set('content.workStatus', App.Service.Health[config.f]); self.get('content.hostComponents').setEach('workStatus', App.HostComponentStatus[config.f]); setTimeout(function () { self.set('content.workStatus', App.Service.Health[config.c2]); self.get('content.hostComponents').setEach('workStatus', App.HostComponentStatus[config.hs]); - }, App.testModeDelayForActions); + }, App.get('testModeDelayForActions')); } // load data (if we need to show this background operations popup) from persist App.router.get('applicationController').dataLoading().done(function (initValue) { @@ -338,7 +338,7 @@ App.MainServiceItemController = Em.Controller.extend({ setStartStopState: function () { var serviceName = this.get('content.serviceName'); var backgroundOperations = App.router.get('backgroundOperationsController.services'); - if (backgroundOperations.length > 0) { + if (backgroundOperations && backgroundOperations.length > 0) { for (var i = 0; i < backgroundOperations.length; i++) { if (backgroundOperations[i].isRunning && (backgroundOperations[i].dependentService === "ALL_SERVICES" || http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/main/service/reassign_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/reassign_controller.js b/ambari-web/app/controllers/main/service/reassign_controller.js index 5a6ba25..6f0ff4e 100644 --- a/ambari-web/app/controllers/main/service/reassign_controller.js +++ b/ambari-web/app/controllers/main/service/reassign_controller.js @@ -83,8 +83,8 @@ App.ReassignMasterController = App.WizardController.extend({ }.observes('content.reassign.component_name', 'content.securityEnabled'), getSecurityStatus: function () { - if (App.testMode) { - this.set('securityEnabled', !App.testEnableSecurity); + if (App.get('testMode')) { + this.set('securityEnabled', !App.get('testEnableSecurity')); } else { //get Security Status From Server App.ajax.send({ http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/wizard/stack_upgrade/step3_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/stack_upgrade/step3_controller.js b/ambari-web/app/controllers/wizard/stack_upgrade/step3_controller.js index d67850a..faacac5 100644 --- a/ambari-web/app/controllers/wizard/stack_upgrade/step3_controller.js +++ b/ambari-web/app/controllers/wizard/stack_upgrade/step3_controller.js @@ -81,7 +81,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({ clusterStatus = jQuery.extend(oldStatus, clusterStatus); this.set('content.cluster', clusterStatus); App.router.get(this.get('content.controllerName')).save('cluster'); - if(!App.testMode){ + if(!App.get('testMode')){ App.clusterStatus.setClusterStatus({ clusterName: this.get('content.cluster.name'), clusterState: clusterStatus.status, @@ -144,7 +144,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({ stopServices: function () { var process = this.get('processes').findProperty('name', 'STOP_SERVICES'); process.set('isRunning', true); - if (App.testMode) { + if (App.get('testMode')) { this.startPolling(); this.saveClusterStatus({ requestId: 1, @@ -193,7 +193,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({ runUpgrade: function () { var process = this.get('processes').findProperty('name', 'UPGRADE_SERVICES'); process.set('isRunning', true); - if (App.testMode) { + if (App.get('testMode')) { this.startPolling(); this.saveClusterStatus({ requestId: 1, @@ -239,7 +239,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({ startPolling: function(){ if(!this.get('isPolling')){ this.set('isPolling', true); - if (App.testMode) { + if (App.get('testMode')) { this.simulatePolling(); } else { //pass an interval "1" to start poll immediately first time @@ -285,7 +285,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({ getUrl:function(){ var requestId = this.get('content.cluster.requestId'); var clusterName = this.get('content.cluster.name'); - if(App.testMode){ + if(App.get('testMode')){ return this.get('mockUrl'); } return App.apiPrefix + '/clusters/' + clusterName + '/requests/' + requestId + '?fields=tasks/*'; @@ -326,7 +326,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({ doPollSuccessCallback: function (data) { var result = this.parseTasks(data); if(result){ - if (App.testMode) { + if (App.get('testMode')) { this.simulatePolling(); } else { @@ -508,7 +508,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({ var clusterStatus = this.get('content.cluster.status'); var upgrade = this.get('processes').findProperty('name', 'UPGRADE_SERVICES'); var stop = this.get('processes').findProperty('name', 'STOP_SERVICES'); - if(App.testMode){ + if(App.get('testMode')){ if(this.get('processes').everyProperty('isRunning', false)){ stop.set('isRunning', true); } http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/wizard/step2_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step2_controller.js b/ambari-web/app/controllers/wizard/step2_controller.js index b5e1d6d..08dcd12 100644 --- a/ambari-web/app/controllers/wizard/step2_controller.js +++ b/ambari-web/app/controllers/wizard/step2_controller.js @@ -62,7 +62,7 @@ App.WizardStep2Controller = Em.Controller.extend({ /** * "Shortcut" to content.installOptions.hostNames - * @type {string[]} + * @type {string} */ hostNames: function () { return this.get('content.installOptions.hostNames').toLowerCase(); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/wizard/step3_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js index e88ef41..88a328e 100644 --- a/ambari-web/app/controllers/wizard/step3_controller.js +++ b/ambari-web/app/controllers/wizard/step3_controller.js @@ -148,7 +148,7 @@ App.WizardStep3Controller = Em.Controller.extend({ * @type {bool} */ isWarningsBoxVisible: function () { - return (App.testMode) ? true : !this.get('isRegistrationInProgress'); + return (App.get('testMode')) ? true : !this.get('isRegistrationInProgress'); }.property('isRegistrationInProgress'), /** @@ -225,7 +225,7 @@ App.WizardStep3Controller = Em.Controller.extend({ var hostsInfo = this.get('content.hosts'); var hosts = []; var bootStatus = (this.get('content.installOptions.manualInstall')) ? 'DONE' : 'PENDING'; - if (App.testMode) { + if (App.get('testMode')) { bootStatus = 'REGISTERED'; } @@ -574,7 +574,7 @@ App.WizardStep3Controller = Em.Controller.extend({ var stopPolling = true; hosts.forEach(function (_host, index) { // Change name of first host for test mode. - if (App.testMode) { + if (App.get('testMode')) { if (index == 0) { _host.set('name', 'localhost.localdomain'); } @@ -840,7 +840,7 @@ App.WizardStep3Controller = Em.Controller.extend({ var resource_filters = { "hosts": hosts }; - if (App.testMode) { + if (App.get('testMode')) { this.getHostNameResolutionSuccess(); } else { return App.ajax.send({ @@ -857,7 +857,7 @@ App.WizardStep3Controller = Em.Controller.extend({ }, getHostNameResolutionSuccess: function(response) { - if (!App.testMode) { + if (!App.get('testMode')) { this.set("requestId", response.Requests.id); } this.getHostCheckTasks(); @@ -982,7 +982,7 @@ App.WizardStep3Controller = Em.Controller.extend({ hostsDiskNames.push(host_name); } // "Transparent Huge Pages" check - context = self.checkTHP(host_name, host.Hosts.last_agent_env.transparentHugePage); + context = self.checkTHP(host_name, Em.get(host, 'Hosts.last_agent_env.transparentHugePage')); if (context) { thpContext.push(context); thpHostsNames.push(host_name); @@ -1305,7 +1305,7 @@ App.WizardStep3Controller = Em.Controller.extend({ * @method parseWarnings */ parseWarnings: function (data) { - data = App.testMode ? data : this.filterBootHosts(data); + data = App.get('testMode') ? data : this.filterBootHosts(data); var warnings = []; var warning; var hosts = []; http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/wizard/step8_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js index 5dccf72..9abc072 100644 --- a/ambari-web/app/controllers/wizard/step8_controller.js +++ b/ambari-web/app/controllers/wizard/step8_controller.js @@ -594,7 +594,7 @@ App.WizardStep8Controller = Em.Controller.extend({ loadRepoInfoSuccessCallback: function (data) { var allRepos = []; data.items.forEach(function (os) { - if (!App.supports.ubuntu && os.OperatingSystems.os_type == 'debian12') return; // @todo: remove after Ubuntu support confirmation + if (!App.get('supports.ubuntu') && os.OperatingSystems.os_type == 'debian12') return; // @todo: remove after Ubuntu support confirmation os.repositories.forEach(function (repository) { allRepos.push(Em.Object.create({ base_url: repository.Repositories.base_url, http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/controllers/wizard/step9_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js index 2575085..95ea56e 100644 --- a/ambari-web/app/controllers/wizard/step9_controller.js +++ b/ambari-web/app/controllers/wizard/step9_controller.js @@ -117,7 +117,7 @@ App.WizardStep9Controller = Em.Controller.extend({ * @method togglePreviousSteps */ togglePreviousSteps: function () { - if (App.testMode) { + if (App.get('testMode')) { return; } var installerController = App.router.get('installerController'); @@ -258,7 +258,7 @@ App.WizardStep9Controller = Em.Controller.extend({ * @method navigateStep */ navigateStep: function () { - if (App.testMode) { + if (App.get('testMode')) { // this is for repeatedly testing out installs in test mode this.set('content.cluster.status', 'PENDING'); this.set('content.cluster.isCompleted', false); @@ -949,7 +949,7 @@ App.WizardStep9Controller = Em.Controller.extend({ */ loadLogData: function (startPolling) { var requestsId = this.get('wizardController').getDBProperty('cluster').oldRequestsId; - if (App.testMode) { + if (App.get('testMode')) { this.set('POLL_INTERVAL', 1); } this.getLogsByRequest(!!startPolling, requestsId[requestsId.length-1]); @@ -1064,7 +1064,7 @@ App.WizardStep9Controller = Em.Controller.extend({ */ doPolling: function () { var requestId = this.get('content.cluster.requestId'); - if (App.testMode) { + if (App.get('testMode')) { this.incrementProperty('numPolls'); } this.getLogsByRequest(true, requestId); @@ -1161,7 +1161,7 @@ App.WizardStep9Controller = Em.Controller.extend({ * @method saveClusterStatus */ saveClusterStatus: function (clusterStatus) { - if (!App.testMode) { + if (!App.get('testMode')) { App.router.get(this.get('content.controllerName')).saveClusterStatus(clusterStatus); } else { @@ -1175,9 +1175,9 @@ App.WizardStep9Controller = Em.Controller.extend({ * @method saveInstalledHosts */ saveInstalledHosts: function (context) { - if (!App.testMode) { + if (!App.get('testMode')) { App.router.get(this.get('content.controllerName')).saveInstalledHosts(context); } } -}); +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/models/host.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/host.js b/ambari-web/app/models/host.js index 757f893..f59c97b 100644 --- a/ambari-web/app/models/host.js +++ b/ambari-web/app/models/host.js @@ -186,7 +186,7 @@ App.Host = DS.Model.extend({ * @returns {bool} */ isNotHeartBeating : function() { - return (App.testMode) ? false : (this.get('healthStatus') === "UNKNOWN"); + return (App.get('testMode')) ? false : (this.get('healthStatus') === "UNKNOWN"); }.property('lastHeartBeatTime'), /** http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/router.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js index 1a01787..8e849b4 100644 --- a/ambari-web/app/router.js +++ b/ambari-web/app/router.js @@ -161,7 +161,7 @@ App.Router = Em.Router.extend({ var hash = window.btoa(loginName + ":" + controller.get('password')); var usr = ''; - if (App.testMode) { + if (App.get('testMode')) { if (loginName === "admin" && controller.get('password') === 'admin') { usr = 'admin'; } else if (loginName === 'user' && controller.get('password') === 'user') { @@ -254,7 +254,7 @@ App.Router = Em.Router.extend({ }, getSection: function (callback) { - if (App.testMode) { + if (App.get('testMode')) { if (App.alwaysGoToInstaller) { callback('installer'); } else { @@ -309,7 +309,7 @@ App.Router = Em.Router.extend({ this.set('loginController.loginName', ''); this.set('loginController.password', ''); // When logOff is called by Sign Out button, context contains event object. As it is only case we should send logoff request, we are checking context below. - if (!App.testMode && context) { + if (!App.get('testMode') && context) { App.ajax.send({ name: 'router.logoff', sender: this, http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/routes/add_host_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/add_host_routes.js b/ambari-web/app/routes/add_host_routes.js index 2dad8dc..fb3d951 100644 --- a/ambari-web/app/routes/add_host_routes.js +++ b/ambari-web/app/routes/add_host_routes.js @@ -277,7 +277,7 @@ module.exports = App.WizardRoute.extend({ var wizardStep9Controller = router.get('wizardStep9Controller'); wizardStep9Controller.set('wizardController', controller); controller.loadAllPriorSteps(); - if (!App.testMode) { //if test mode is ON don't disable prior steps link. + if (!App.get('testMode')) { //if test mode is ON don't disable prior steps link. controller.setLowerStepsDisable(6); } controller.connectOutlet('wizardStep9', controller.get('content')); @@ -328,7 +328,7 @@ module.exports = App.WizardRoute.extend({ controller.loadAllPriorSteps(); var wizardStep10Controller = router.get('wizardStep10Controller'); wizardStep10Controller.set('wizardController', controller); - if (!App.testMode) { //if test mode is ON don't disable prior steps link. + if (!App.get('testMode')) { //if test mode is ON don't disable prior steps link. controller.setLowerStepsDisable(7); } controller.connectOutlet('wizardStep10', controller.get('content')); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/routes/add_security.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/add_security.js b/ambari-web/app/routes/add_security.js index 02648a9..1b1599d 100644 --- a/ambari-web/app/routes/add_security.js +++ b/ambari-web/app/routes/add_security.js @@ -103,7 +103,7 @@ module.exports = App.WizardRoute.extend({ route: '/start', enter: function (router) { router.get('addSecurityController').setCurrentStep('1'); - if(!App.testMode){ + if(!App.get('testMode')){ App.clusterStatus.setClusterStatus({ clusterName: this.get('clusterName'), clusterState: 'ADD_SECURITY_STEP_1', @@ -139,7 +139,7 @@ module.exports = App.WizardRoute.extend({ enter: function (router) { router.get('addSecurityController').setCurrentStep('2'); - if(!App.testMode){ + if(!App.get('testMode')){ App.clusterStatus.setClusterStatus({ clusterName: this.get('clusterName'), clusterState: 'ADD_SECURITY_STEP_2', @@ -173,7 +173,7 @@ module.exports = App.WizardRoute.extend({ enter: function (router) { router.get('addSecurityController').setCurrentStep('3'); - if(!App.testMode){ + if(!App.get('testMode')){ App.clusterStatus.setClusterStatus({ clusterName: this.get('clusterName'), clusterState: 'ADD_SECURITY_STEP_3', http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/routes/add_service_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/add_service_routes.js b/ambari-web/app/routes/add_service_routes.js index 2b3812a..00de282 100644 --- a/ambari-web/app/routes/add_service_routes.js +++ b/ambari-web/app/routes/add_service_routes.js @@ -266,7 +266,7 @@ module.exports = App.WizardRoute.extend({ controller.loadAllPriorSteps(); var wizardStep9Controller = router.get('wizardStep9Controller'); wizardStep9Controller.set('wizardController', controller); - if (!App.testMode) { //if test mode is ON don't disable prior steps link. + if (!App.get('testMode')) { //if test mode is ON don't disable prior steps link. controller.setLowerStepsDisable(6); } controller.connectOutlet('wizardStep9', controller.get('content')); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/routes/installer.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js index ff02fe3..f16e81d 100644 --- a/ambari-web/app/routes/installer.js +++ b/ambari-web/app/routes/installer.js @@ -145,7 +145,7 @@ module.exports = Em.Route.extend({ next: function (router) { var wizardStep1Controller = router.get('wizardStep1Controller'); var installerController = router.get('installerController'); - if (App.testMode) { + if (App.get('testMode')) { installerController.set('validationCnt', 0); installerController.set('invalidCnt', 0); } else { @@ -369,7 +369,7 @@ module.exports = Em.Route.extend({ var controller = router.get('installerController'); controller.setCurrentStep('9'); controller.loadAllPriorSteps().done(function () { - if (!App.testMode) { + if (!App.get('testMode')) { controller.setLowerStepsDisable(9); } var wizardStep9Controller = router.get('wizardStep9Controller'); @@ -416,7 +416,7 @@ module.exports = Em.Route.extend({ var controller = router.get('installerController'); controller.setCurrentStep('10'); controller.loadAllPriorSteps().done(function () { - if (!App.testMode) { + if (!App.get('testMode')) { controller.setLowerStepsDisable(10); } controller.connectOutlet('wizardStep10', controller.get('content')); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/utils/host_progress_popup.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/host_progress_popup.js b/ambari-web/app/utils/host_progress_popup.js index 56ca788..fb9a5e6 100644 --- a/ambari-web/app/utils/host_progress_popup.js +++ b/ambari-web/app/utils/host_progress_popup.js @@ -496,7 +496,7 @@ App.HostPopup = Em.Object.create({ updateNotShowBgChecked: function () { var curVal = !this.get('isNotShowBgChecked'); var key = App.router.get('applicationController').persistKey(); - if (!App.testMode) { + if (!App.get('testMode')) { App.router.get('applicationController').postUserPref(key, curVal); } }.observes('isNotShowBgChecked'), http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/utils/jobs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/jobs.js b/ambari-web/app/utils/jobs.js index aa21d43..8d8ee3f 100644 --- a/ambari-web/app/utils/jobs.js +++ b/ambari-web/app/utils/jobs.js @@ -58,7 +58,7 @@ module.exports = { var ahsWebPort = yarnService.get('ahsWebPort'); var hiveJobId = hiveJob.get('id'); // First refresh query - var hiveQueriesUrl = App.testMode ? "/data/jobs/hive-query-2.json" : "/proxy?url=http://" + historyServerHostName + var hiveQueriesUrl = App.get('testMode') ? "/data/jobs/hive-query-2.json" : "/proxy?url=http://" + historyServerHostName + ":" + ahsWebPort + "/ws/v1/timeline/HIVE_QUERY_ID/" + hiveJob.get('id') + "?fields=events,otherinfo"; App.HttpClient.get(hiveQueriesUrl, App.hiveJobMapper, { complete : function(jqXHR, textStatus) { http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/utils/polling.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/polling.js b/ambari-web/app/utils/polling.js index 13b3a63..0b79b34 100644 --- a/ambari-web/app/utils/polling.js +++ b/ambari-web/app/utils/polling.js @@ -60,7 +60,7 @@ App.Poll = Em.Object.extend({ }, setRequestId: function () { - if (App.testMode) { + if (App.get('testMode')) { this.set('requestId', '1'); this.doPolling(); return; http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/common/table_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/table_view.js b/ambari-web/app/views/common/table_view.js index 4c91052..8e5d27d 100644 --- a/ambari-web/app/views/common/table_view.js +++ b/ambari-web/app/views/common/table_view.js @@ -346,7 +346,7 @@ App.TableView = Em.View.extend(App.UserPref, { var self = this; Em.run.next(function() { App.db.setDisplayLength(self.get('controller.name'), self.get('displayLength')); - if (!App.testMode) { + if (!App.get('testMode')) { if (App.get('isAdmin')) { self.postUserPref(self.displayLengthKey(), self.get('displayLength')); } http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/main/apps/item/bar_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/apps/item/bar_view.js b/ambari-web/app/views/main/apps/item/bar_view.js index a5e3633..939d8c8 100644 --- a/ambari-web/app/views/main/apps/item/bar_view.js +++ b/ambari-web/app/views/main/apps/item/bar_view.js @@ -49,7 +49,7 @@ App.MainAppsItemBarView = Em.View.extend({ finish:false, updateTasksView:function () { - var url = App.testMode ? '/data/apps/jobs/taskview.json' : App.apiPrefix + "/jobhistory/tasklocality?workflowId=" + this.get('controller.content.id'); + var url = App.get('testMode') ? '/data/apps/jobs/taskview.json' : App.get('apiPrefix') + "/jobhistory/tasklocality?workflowId=" + this.get('controller.content.id'); var mapper = App.jobTasksMapper; mapper.set('model', this); var self = this; http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/main/apps/item/dag_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/apps/item/dag_view.js b/ambari-web/app/views/main/apps/item/dag_view.js index de7ee25..6000b12 100644 --- a/ambari-web/app/views/main/apps/item/dag_view.js +++ b/ambari-web/app/views/main/apps/item/dag_view.js @@ -106,7 +106,7 @@ App.MainAppsItemDagView = Em.View.extend({ allreduce:false, updateTimeline:function () { - var url = App.testMode ? '/data/apps/jobs/timeline.json' : App.apiPrefix + "/jobhistory/task?workflowId=" + this.get('controller.content.id') + "&width=" + this.$().width() + "&startTime=" + this.get('controller.content.startTime') + "&endTime=" + (this.get('controller.content.startTime')+this.get('controller.content.elapsedTime')); + var url = App.get('testMode') ? '/data/apps/jobs/timeline.json' : App.get('apiPrefix') + "/jobhistory/task?workflowId=" + this.get('controller.content.id') + "&width=" + this.$().width() + "&startTime=" + this.get('controller.content.startTime') + "&endTime=" + (this.get('controller.content.startTime')+this.get('controller.content.elapsedTime')); var mapper = App.jobTimeLineMapper; mapper.set('model', this); var self = this; @@ -115,7 +115,7 @@ App.MainAppsItemDagView = Em.View.extend({ self.set('loadJobTimeline', true); } }); - url = App.testMode ? '/data/apps/jobs/timeline.json' : App.apiPrefix + "/jobhistory/task?width=" + this.$().width() + "&startTime=" + this.get('controller.content.startTime') + "&endTime=" + (this.get('controller.content.startTime')+this.get('controller.content.elapsedTime')); + url = App.get('testMode') ? '/data/apps/jobs/timeline.json' : App.get('apiPrefix') + "/jobhistory/task?width=" + this.$().width() + "&startTime=" + this.get('controller.content.startTime') + "&endTime=" + (this.get('controller.content.startTime')+this.get('controller.content.elapsedTime')); var mapper = App.taskTimeLineMapper; mapper.set('model', this); var self = this; http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/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 b73790c..7561a99 100644 --- a/ambari-web/app/views/main/dashboard/widget.js +++ b/ambari-web/app/views/main/dashboard/widget.js @@ -154,7 +154,7 @@ App.DashboardWidgetView = Em.View.extend({ self.set('thresh1', parseFloat(configObj.get('thresh1')) ); self.set('thresh2', parseFloat(configObj.get('thresh2')) ); - if (!App.testMode) { + if (!App.get('testMode')) { // save to persist var parent = self.get('parentView'); parent.getUserPref(parent.get('persistKey')).complete(function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/main/dashboard/widgets.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets.js b/ambari-web/app/views/main/dashboard/widgets.js index 0aa27a2..a604800 100644 --- a/ambari-web/app/views/main/dashboard/widgets.js +++ b/ambari-web/app/views/main/dashboard/widgets.js @@ -54,7 +54,7 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, { //placeholder: "sortable-placeholder", cursor: "move", update: function (event, ui) { - if (!App.testMode) { + if (!App.get('testMode')) { // update persist then translate to real var widgetsArray = $('div[viewid]'); // get all in DOM self.getUserPref(self.get('persistKey')).complete(function () { @@ -216,7 +216,7 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, { var hiddenWidgets = this.get('hiddenWidgets'); var checkedWidgets = hiddenWidgets.filterProperty('checked', true); - if (App.testMode) { + if (App.get('testMode')) { var visibleWidgets = this.get('visibleWidgets'); checkedWidgets.forEach(function(item){ var newObj = parent.widgetsMapper(item.id); @@ -291,7 +291,7 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, { */ setOnLoadVisibleWidgets: function () { var self = this; - if (App.testMode) { + if (App.get('testMode')) { this.translateToReal(this.get('initPrefObject')); } else { // called when first load/refresh/jump back page @@ -526,7 +526,7 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, { resetAllWidgets: function() { var self = this; App.showConfirmationPopup(function() { - if(!App.testMode) { + if(!App.get('testMode')) { self.postUserPref(self.get('persistKey'), self.get('initPrefObject')); self.setDBProperty(self.get('persistKey'), self.get('initPrefObject')); } http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/main/dashboard/widgets/datanode_live.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/datanode_live.js b/ambari-web/app/views/main/dashboard/widgets/datanode_live.js index 6bbdf5a..7b9110f 100644 --- a/ambari-web/app/views/main/dashboard/widgets/datanode_live.js +++ b/ambari-web/app/views/main/dashboard/widgets/datanode_live.js @@ -127,7 +127,7 @@ App.DataNodeUpView = App.TextDashboardWidgetView.extend({ if (!configObj.isThresh1Error && !configObj.isThresh2Error) { parent.set('thresh1', parseFloat(configObj.get('thresh1')) ); parent.set('thresh2', parseFloat(configObj.get('thresh2')) ); - if (!App.testMode) { + if (!App.get('testMode')) { var big_parent = parent.get('parentView'); big_parent.getUserPref(big_parent.get('persistKey')); var oldValue = big_parent.get('currentPrefObject'); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/main/dashboard/widgets/flume_agent_live.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/flume_agent_live.js b/ambari-web/app/views/main/dashboard/widgets/flume_agent_live.js index 8d086e4..3e9b57d 100644 --- a/ambari-web/app/views/main/dashboard/widgets/flume_agent_live.js +++ b/ambari-web/app/views/main/dashboard/widgets/flume_agent_live.js @@ -132,7 +132,7 @@ App.FlumeAgentUpView = App.TextDashboardWidgetView.extend({ if (!configObj.isThresh1Error && !configObj.isThresh2Error) { parent.set('thresh1', parseFloat(configObj.get('thresh1')) ); parent.set('thresh2', parseFloat(configObj.get('thresh2')) ); - if (!App.testMode) { + if (!App.get('testMode')) { var big_parent = parent.get('parentView'); big_parent.getUserPref(big_parent.get('persistKey')); var oldValue = big_parent.get('currentPrefObject'); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/main/dashboard/widgets/hbase_average_load.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/hbase_average_load.js b/ambari-web/app/views/main/dashboard/widgets/hbase_average_load.js index c00994e..21f3fcd 100644 --- a/ambari-web/app/views/main/dashboard/widgets/hbase_average_load.js +++ b/ambari-web/app/views/main/dashboard/widgets/hbase_average_load.js @@ -121,7 +121,7 @@ App.HBaseAverageLoadView = App.TextDashboardWidgetView.extend({ if (!configObj.isThresh1Error && !configObj.isThresh2Error) { parent.set('thresh1', parseFloat(configObj.get('thresh1')) ); parent.set('thresh2', parseFloat(configObj.get('thresh2')) ); - if (!App.testMode) { + if (!App.get('testMode')) { //save to persist var big_parent = parent.get('parentView'); big_parent.getUserPref(big_parent.get('persistKey')); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/main/dashboard/widgets/hbase_regions_in_transition.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/hbase_regions_in_transition.js b/ambari-web/app/views/main/dashboard/widgets/hbase_regions_in_transition.js index d93f9e7..6f4f4cd 100644 --- a/ambari-web/app/views/main/dashboard/widgets/hbase_regions_in_transition.js +++ b/ambari-web/app/views/main/dashboard/widgets/hbase_regions_in_transition.js @@ -117,7 +117,7 @@ App.HBaseRegionsInTransitionView = App.TextDashboardWidgetView.extend({ if (!configObj.isThresh1Error && !configObj.isThresh2Error) { parent.set('thresh1', parseFloat(configObj.get('thresh1')) ); parent.set('thresh2', parseFloat(configObj.get('thresh2')) ); - if (!App.testMode) { + if (!App.get('testMode')) { //save to persist var big_parent = parent.get('parentView'); big_parent.getUserPref(big_parent.get('persistKey')); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/main/dashboard/widgets/jobtracker_rpc.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/jobtracker_rpc.js b/ambari-web/app/views/main/dashboard/widgets/jobtracker_rpc.js index 8424f1b..ba67938 100644 --- a/ambari-web/app/views/main/dashboard/widgets/jobtracker_rpc.js +++ b/ambari-web/app/views/main/dashboard/widgets/jobtracker_rpc.js @@ -122,7 +122,7 @@ App.JobTrackerRpcView = App.TextDashboardWidgetView.extend({ if (!configObj.isThresh1Error && !configObj.isThresh2Error) { parent.set('thresh1', parseFloat(configObj.get('thresh1')) ); parent.set('thresh2', parseFloat(configObj.get('thresh2')) ); - if (!App.testMode) { + if (!App.get('testMode')) { // save to persist var big_parent = parent.get('parentView'); big_parent.getUserPref(big_parent.get('persistKey')); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/main/dashboard/widgets/namenode_rpc.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/namenode_rpc.js b/ambari-web/app/views/main/dashboard/widgets/namenode_rpc.js index 7f6c2fb..59c9c6a 100644 --- a/ambari-web/app/views/main/dashboard/widgets/namenode_rpc.js +++ b/ambari-web/app/views/main/dashboard/widgets/namenode_rpc.js @@ -124,7 +124,7 @@ App.NameNodeRpcView = App.TextDashboardWidgetView.extend({ if (!configObj.isThresh1Error && !configObj.isThresh2Error) { parent.set('thresh1', parseFloat(configObj.get('thresh1')) ); parent.set('thresh2', parseFloat(configObj.get('thresh2')) ); - if (!App.testMode) { + if (!App.get('testMode')) { //save to persist var big_parent = parent.get('parentView'); big_parent.getUserPref(big_parent.get('persistKey')); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/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 ae7b41f..66bedfe 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 @@ -130,7 +130,7 @@ App.NodeManagersLiveView = App.TextDashboardWidgetView.extend({ if (!configObj.isThresh1Error && !configObj.isThresh2Error) { parent.set('thresh1', parseFloat(configObj.get('thresh1')) ); parent.set('thresh2', parseFloat(configObj.get('thresh2')) ); - if (!App.testMode) { + if (!App.get('testMode')) { //save to persit var big_parent = parent.get('parentView'); big_parent.getUserPref(big_parent.get('persistKey')); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js b/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js index 663827a..91bf496 100644 --- a/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js +++ b/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js @@ -131,7 +131,7 @@ App.SuperVisorUpView = App.TextDashboardWidgetView.extend({ if (!configObj.isThresh1Error && !configObj.isThresh2Error) { parent.set('thresh1', parseFloat(configObj.get('thresh1')) ); parent.set('thresh2', parseFloat(configObj.get('thresh2')) ); - if (!App.testMode) { + if (!App.get('testMode')) { var big_parent = parent.get('parentView'); big_parent.getUserPref(big_parent.get('persistKey')); var oldValue = big_parent.get('currentPrefObject'); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/main/dashboard/widgets/tasktracker_live.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/tasktracker_live.js b/ambari-web/app/views/main/dashboard/widgets/tasktracker_live.js index 243d57c..28a4596 100644 --- a/ambari-web/app/views/main/dashboard/widgets/tasktracker_live.js +++ b/ambari-web/app/views/main/dashboard/widgets/tasktracker_live.js @@ -117,7 +117,7 @@ App.TaskTrackerUpView = App.TextDashboardWidgetView.extend({ if (!configObj.isThresh1Error && !configObj.isThresh2Error) { parent.set('thresh1', parseFloat(configObj.get('thresh1')) ); parent.set('thresh2', parseFloat(configObj.get('thresh2')) ); - if (!App.testMode) { + if (!App.get('testMode')) { //save to persit var big_parent = parent.get('parentView'); big_parent.getUserPref(big_parent.get('persistKey')); http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js b/ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js index fe03189..0d13246 100644 --- a/ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js +++ b/ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js @@ -134,7 +134,8 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({ categoryWarnings: function () { var warningsByHost = this.get('warningsByHost'); if (Em.isNone(warningsByHost)) return []; - return warningsByHost.findProperty('name', this.get('category')).warnings; + var category = warningsByHost.findProperty('name', this.get('category')); + return Em.isNone(category) ? []: category.warnings; }.property('warningsByHost', 'category'), /** http://git-wip-us.apache.org/repos/asf/ambari/blob/cb335d5d/ambari-web/app/views/wizard/step8_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/wizard/step8_view.js b/ambari-web/app/views/wizard/step8_view.js index 8189154..8657f9d 100644 --- a/ambari-web/app/views/wizard/step8_view.js +++ b/ambari-web/app/views/wizard/step8_view.js @@ -47,7 +47,7 @@ App.WizardStep8View = Em.View.extend({ * @method showLoadingIndicator */ showLoadingIndicator: function () { - if (!this.get('controller.isSubmitDisabled') || App.testMode) { + if (!this.get('controller.isSubmitDisabled') || App.get('testMode')) { if (this.get('modalPopup')) { this.get('modalPopup').hide(); this.set('modalPopup', null);