Repository: ambari Updated Branches: refs/heads/trunk 8056e25dc -> fcfc8c17c
Revert "AMBARI-9127. no "Download client configuration" in "Service Actions" menu (alexantonenko)." This reverts commit bf9f73e214576c25fdbafac002f02b597b76dbf1. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fcfc8c17 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fcfc8c17 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fcfc8c17 Branch: refs/heads/trunk Commit: fcfc8c17c295bf178e210434b4a5cd8f6c13b5fa Parents: 8056e25 Author: Jaimin Jetly <[email protected]> Authored: Wed Jan 14 11:57:14 2015 -0800 Committer: Jaimin Jetly <[email protected]> Committed: Wed Jan 14 11:58:21 2015 -0800 ---------------------------------------------------------------------- ambari-web/app/controllers/main/service/item.js | 2 +- ambari-web/app/views/main/service/item.js | 2 +- .../test/controllers/main/service/item_test.js | 4 +- .../alerts/manage_alert_groups_view_test.js | 2 +- ambari-web/test/views/main/service/item_test.js | 79 +++++++++----------- 5 files changed, 40 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/fcfc8c17/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 119e834..be65323 100644 --- a/ambari-web/app/controllers/main/service/item.js +++ b/ambari-web/app/controllers/main/service/item.js @@ -700,7 +700,7 @@ App.MainServiceItemController = Em.Controller.extend({ }, downloadClientConfigs: function (event) { - var component = this.get('content.clientComponents').rejectProperty('totalCount', 0)[0]; + var component = this.get('content.hostComponents').findProperty('isClient'); componentsUtils.downloadClientConfigs.call(this, { serviceName: this.get('content.serviceName'), componentName: (event && event.name) || component.get('componentName'), http://git-wip-us.apache.org/repos/asf/ambari/blob/fcfc8c17/ambari-web/app/views/main/service/item.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js index 2edd40d..21ee93b 100644 --- a/ambari-web/app/views/main/service/item.js +++ b/ambari-web/app/views/main/service/item.js @@ -132,7 +132,7 @@ App.MainServiceItemView = Em.View.extend({ action: this.get('controller.isSeveralClients') ? '' : 'downloadClientConfigs', label: Em.I18n.t('services.service.actions.downloadClientConfigs'), cssClass: 'icon-download-alt', - isHidden: this.get('controller.content.clientComponents').rejectProperty('totalCount', 0).length == 0, + isHidden: !this.get('controller.content.hostComponents').findProperty('isClient'), disabled: false, hasSubmenu: this.get('controller.isSeveralClients'), submenuOptions: this.get('controller.clientComponents') http://git-wip-us.apache.org/repos/asf/ambari/blob/fcfc8c17/ambari-web/test/controllers/main/service/item_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/service/item_test.js b/ambari-web/test/controllers/main/service/item_test.js index 548028e..5caf5d3 100644 --- a/ambari-web/test/controllers/main/service/item_test.js +++ b/ambari-web/test/controllers/main/service/item_test.js @@ -617,9 +617,9 @@ describe('App.MainServiceItemController', function () { var mainServiceItemController = App.MainServiceItemController.create({ content: { - clientComponents: [ + hostComponents: [ Em.Object.create({ - totalCount: 1, + isClient: true, componentName: 'C1', displayName: 'd1' }) http://git-wip-us.apache.org/repos/asf/ambari/blob/fcfc8c17/ambari-web/test/views/main/alerts/manage_alert_groups_view_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/main/alerts/manage_alert_groups_view_test.js b/ambari-web/test/views/main/alerts/manage_alert_groups_view_test.js index 97004d2..645856a 100644 --- a/ambari-web/test/views/main/alerts/manage_alert_groups_view_test.js +++ b/ambari-web/test/views/main/alerts/manage_alert_groups_view_test.js @@ -20,7 +20,7 @@ var App = require('app'); var view; -describe.skip('App.MainAlertsManageAlertGroupView', function () { +describe('App.MainAlertsManageAlertGroupView', function () { beforeEach(function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/fcfc8c17/ambari-web/test/views/main/service/item_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/main/service/item_test.js b/ambari-web/test/views/main/service/item_test.js index 4838358..6ca3e37 100644 --- a/ambari-web/test/views/main/service/item_test.js +++ b/ambari-web/test/views/main/service/item_test.js @@ -85,13 +85,12 @@ describe('App.MainServiceItemView', function () { totalCount: 1 }) ], - clientComponents: [ + hostComponents: [ Em.Object.create({ componentName: 'HDFS_CLIENT', - totalCount: 1 - }) - ], - hostComponents: [ + isMaster: false, + isSlave: false + }), Em.Object.create({ componentName: 'NAMENODE', isMaster: true, @@ -112,21 +111,20 @@ describe('App.MainServiceItemView', function () { {"action": "runSmokeTest", "label": "Run Service Check", "cssClass": "icon-thumbs-up-alt"}, {"action": "turnOnOffPassive", "context": "Turn On Maintenance Mode for HDFS", "label": "Turn On Maintenance Mode", "cssClass": "icon-medkit", "disabled": false}, {"action": "rebalanceHdfsNodes", "customCommand": "REBALANCEHDFS", "context": "Rebalance HDFS", "label": "Rebalance HDFS", "cssClass": "icon-refresh", "disabled": false}, - {"action": "downloadClientConfigs", "label": "Download Client Configs", "cssClass": "icon-download-alt", "isHidden": false, "disabled": false, hasSubmenu: false, submenuOptions: []} + {"action": "downloadClientConfigs", "label": "Download Client Configs", "cssClass": "icon-download-alt", "isHidden": true, "disabled": false, hasSubmenu: false, submenuOptions: []} ] }, - { + { serviceName: "ZOOKEEPER", displayName: "ZooKeeper", serviceTypes: [], slaveComponents: [], - clientComponents: [ + hostComponents: [ Em.Object.create({ componentName: 'ZOOKEEPER_CLIENT', - totalCount: 1 - }) - ], - hostComponents: [ + isMaster: false, + isSlave: false + }), Em.Object.create({ componentName: 'ZOOKEEPER_SERVER', isMaster: true, @@ -142,7 +140,7 @@ describe('App.MainServiceItemView', function () { {"action": "runSmokeTest", "label": "Run Service Check", "cssClass": "icon-thumbs-up-alt"}, {"action": "turnOnOffPassive", "context": "Turn On Maintenance Mode for ZooKeeper", "label": "Turn On Maintenance Mode", "cssClass": "icon-medkit", "disabled": false}, {"cssClass": "icon-plus", "label": "Add ZooKeeper Server", "service": "ZOOKEEPER", "component": "ZOOKEEPER_SERVER", "action": "addZOOKEEPER_SERVER", "disabled": "disabled", tooltip: ''}, - {"action": "downloadClientConfigs", "label": "Download Client Configs", "cssClass": "icon-download-alt", "isHidden": false, "disabled": false, "hasSubmenu": false, "submenuOptions": []} + {"action": "downloadClientConfigs", "label": "Download Client Configs", "cssClass": "icon-download-alt", "isHidden": true, "disabled": false, "hasSubmenu": false, "submenuOptions": []} ] }, { @@ -155,12 +153,6 @@ describe('App.MainServiceItemView', function () { totalCount: 1 }) ], - clientComponents: [ - Em.Object.create({ - componentName: 'YARN_CLIENT', - totalCount: 1 - }) - ], hostComponents: [ Em.Object.create({ componentName: 'APP_TIMELINE_SERVER', @@ -171,6 +163,11 @@ describe('App.MainServiceItemView', function () { componentName: 'RESOURCEMANAGER', isMaster: true, isSlave: false + }), + Em.Object.create({ + componentName: 'YARN_CLIENT', + isMaster: false, + isSlave: false }) ], result: [ @@ -182,7 +179,7 @@ describe('App.MainServiceItemView', function () { {"action": "enableRMHighAvailability", "label": "Enable ResourceManager HA", "cssClass": "icon-arrow-up", "isHidden": false, disabled: false}, {"action": "runSmokeTest", "label": "Run Service Check", "cssClass": "icon-thumbs-up-alt"}, {"action": "turnOnOffPassive", "context": "Turn On Maintenance Mode for YARN", "label": "Turn On Maintenance Mode", "cssClass": "icon-medkit", "disabled": false}, - {"action": "downloadClientConfigs", "label": "Download Client Configs", "cssClass": "icon-download-alt", "isHidden": false, "disabled": false, "hasSubmenu": false, "submenuOptions": []} + {"action": "downloadClientConfigs", "label": "Download Client Configs", "cssClass": "icon-download-alt", "isHidden": true, "disabled": false, "hasSubmenu": false, "submenuOptions": []} ] }, { @@ -190,24 +187,23 @@ describe('App.MainServiceItemView', function () { displayName: "MapReduce2", serviceTypes: [], slaveComponents: [], - clientComponents: [ - Em.Object.create({ - componentName: 'MAPREDUCE2_CLIENT', - totalCount: 1 - }) - ], hostComponents: [ Em.Object.create({ componentName: 'HISTORYSERVER', isMaster: true, isSlave: false + }), + Em.Object.create({ + componentName: 'MAPREDUCE2_CLIENT', + isMaster: false, + isSlave: false }) ], result: [ {"action": "restartAllHostComponents", "context": "MAPREDUCE2", "label": "Restart All", "cssClass": "icon-repeat", "disabled": false}, {"action": "runSmokeTest", "label": "Run Service Check", "cssClass": "icon-thumbs-up-alt"}, {"action": "turnOnOffPassive", "context": "Turn On Maintenance Mode for MapReduce2", "label": "Turn On Maintenance Mode", "cssClass": "icon-medkit", "disabled": false}, - {"action": "downloadClientConfigs", "label": "Download Client Configs", "cssClass": "icon-download-alt", "isHidden": false, "disabled": false, "hasSubmenu": false, "submenuOptions": []} + {"action": "downloadClientConfigs", "label": "Download Client Configs", "cssClass": "icon-download-alt", "isHidden": true, "disabled": false, "hasSubmenu": false, "submenuOptions": []} ] }, { @@ -215,7 +211,6 @@ describe('App.MainServiceItemView', function () { displayName: "Kafka", serviceTypes: [], slaveComponents: [], - clientComponents: [], hostComponents: [ Em.Object.create({ componentName: 'KAFKA_BROKER', @@ -234,7 +229,6 @@ describe('App.MainServiceItemView', function () { serviceName: "FLUME", displayName: "Flume", serviceTypes: [], - clientComponents: [], slaveComponents: [ Em.Object.create({ componentName: 'FLUME_HANDLER', @@ -267,13 +261,12 @@ describe('App.MainServiceItemView', function () { totalCount: 1 }) ], - clientComponents: [ + hostComponents: [ Em.Object.create({ componentName: 'HBASE_CLIENT', - totalCount: 1 - }) - ], - hostComponents: [ + isMaster: false, + isSlave: false + }), Em.Object.create({ componentName: 'HBASE_MASTER', isMaster: true, @@ -290,7 +283,7 @@ describe('App.MainServiceItemView', function () { {"action": "runSmokeTest", "label": "Run Service Check", "cssClass": "icon-thumbs-up-alt"}, {"action": "turnOnOffPassive", "context": "Turn On Maintenance Mode for HBase", "label": "Turn On Maintenance Mode", "cssClass": "icon-medkit", "disabled": false}, {"cssClass": "icon-plus", "label": "Add HBase Master", "service": "HBASE", "component": "HBASE_MASTER", "action": "addHBASE_MASTER", "disabled": '', tooltip: ''}, - {"action": "downloadClientConfigs", "label": "Download Client Configs", "cssClass": "icon-download-alt", "isHidden": false, "disabled": false, "hasSubmenu": false, "submenuOptions": []} + {"action": "downloadClientConfigs", "label": "Download Client Configs", "cssClass": "icon-download-alt", "isHidden": true, "disabled": false, "hasSubmenu": false, "submenuOptions": []} ] }, { @@ -298,13 +291,12 @@ describe('App.MainServiceItemView', function () { displayName: "Oozie", serviceTypes: [], slaveComponents: [], - clientComponents: [ + hostComponents: [ Em.Object.create({ componentName: 'OOZIE_CLIENT', - totalCount: 1 - }) - ], - hostComponents: [ + isMaster: false, + isSlave: false + }), Em.Object.create({ componentName: 'OOZIE_SERVER', isMaster: true, @@ -316,7 +308,7 @@ describe('App.MainServiceItemView', function () { {"action": "reassignMaster", "context": "OOZIE_SERVER", "label": "Move Oozie Server", "cssClass": "icon-share-alt", "disabled": false}, {"action": "runSmokeTest", "label": "Run Service Check", "cssClass": "icon-thumbs-up-alt"}, {"action": "turnOnOffPassive", "context": "Turn On Maintenance Mode for Oozie", "label": "Turn On Maintenance Mode", "cssClass": "icon-medkit", "disabled": false}, - {"action": "downloadClientConfigs", "label": "Download Client Configs", "cssClass": "icon-download-alt", "isHidden": false, "disabled": false, "hasSubmenu": false, "submenuOptions": []} + {"action": "downloadClientConfigs", "label": "Download Client Configs", "cssClass": "icon-download-alt", "isHidden": true, "disabled": false, "hasSubmenu": false, "submenuOptions": []} ] }, { @@ -324,7 +316,6 @@ describe('App.MainServiceItemView', function () { displayName: "Knox", serviceTypes: [], slaveComponents: [], - clientComponents: [], hostComponents: [ Em.Object.create({ componentName: 'KNOX_GATEWAY', @@ -411,13 +402,13 @@ describe('App.MainServiceItemView', function () { content: Em.Object.create({ hostComponents: testCase.hostComponents, slaveComponents: testCase.slaveComponents, - clientComponents: testCase.clientComponents, serviceName: testCase.serviceName, displayName: testCase.displayName, serviceTypes: testCase.serviceTypes, passiveState: 'OFF' }), - isSeveralClients: false + isSeveralClients: false, + clientComponents: [] }), mastersExcludedCommands: mastersExcludedCommands, hasConfigTab: hasConfigTab
