Repository: ambari Updated Branches: refs/heads/trunk c8e7c98fb -> 597951c1f
AMBARI-11108. Incorrect warning message in popup window during host deleting (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/597951c1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/597951c1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/597951c1 Branch: refs/heads/trunk Commit: 597951c1f1301d465db8c4c2fbc74cd2a283457a Parents: c8e7c98 Author: Aleksandr Kovalenko <[email protected]> Authored: Wed May 13 19:28:51 2015 +0300 Committer: Aleksandr Kovalenko <[email protected]> Committed: Wed May 13 19:34:19 2015 +0300 ---------------------------------------------------------------------- ambari-web/app/app.js | 2 +- ambari-web/app/models/stack_service_component.js | 15 ++++++++------- .../test/models/stack_service_component_test.js | 12 ++++++------ 3 files changed, 15 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/597951c1/ambari-web/app/app.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js index 3a2ec51..23db3a5 100644 --- a/ambari-web/app/app.js +++ b/ambari-web/app/app.js @@ -320,7 +320,7 @@ module.exports = Em.Application.create({ }.property('App.router.clusterController.isLoaded'), addableMasterInstallerWizard: function () { - return App.StackServiceComponent.find().filterProperty('isMasterAddableInstallerWizard').filterProperty('showAddBtnInInstall').mapProperty('componentName') + return App.StackServiceComponent.find().filterProperty('isMasterAddableInstallerWizard').mapProperty('componentName') }.property('App.router.clusterController.isLoaded'), multipleMasters: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/597951c1/ambari-web/app/models/stack_service_component.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/stack_service_component.js b/ambari-web/app/models/stack_service_component.js index af88bd7..bd8dcbc 100644 --- a/ambari-web/app/models/stack_service_component.js +++ b/ambari-web/app/models/stack_service_component.js @@ -97,7 +97,7 @@ App.StackServiceComponent = DS.Model.extend({ /** @property {Boolean} isAddableToHost - component can be added on host details page **/ isAddableToHost: function() { - return ((this.get('isMasterAddableInstallerWizard') || (this.get('isSlave') && this.get('maxToInstall') > 2) || this.get('isClient')) && !this.get('isHAComponentOnly')); + return this.get('isMasterAddableInstallerWizard') || ((this.get('isNotAddableOnlyInInstall') || this.get('isSlave') || this.get('isClient')) && !this.get('isHAComponentOnly')); }.property('componentName'), /** @property {Boolean} isDeletable - component supports delete action **/ @@ -142,7 +142,7 @@ App.StackServiceComponent = DS.Model.extend({ * @property {Boolean} isMasterAddableInstallerWizard **/ isMasterAddableInstallerWizard: function() { - return this.get('isMaster') && this.get('isMultipleAllowed') && this.get('maxToInstall') > 1 && !this.get('isMasterAddableOnlyOnHA').contains(this.get('componentName')); + return this.get('isMaster') && this.get('isMultipleAllowed') && !this.get('isMasterAddableOnlyOnHA') && !this.get('isNotAddableOnlyInInstall'); }.property('componentName'), /** @@ -150,7 +150,9 @@ App.StackServiceComponent = DS.Model.extend({ * New instances of these components are added in appropriate HA wizards * @property {Boolean} isMasterAddableOnlyOnHA */ - isMasterAddableOnlyOnHA: ['NAMENODE', 'RESOURCEMANAGER', 'HIVE_METASTORE', 'HIVE_SERVER', 'RANGER_ADMIN'], + isMasterAddableOnlyOnHA: function () { + return ['NAMENODE', 'RESOURCEMANAGER', 'RANGER_ADMIN'].contains(this.get('componentName')); + }.property('componentName'), /** @property {Boolean} isHAComponentOnly - Components that can be installed only if HA enabled **/ isHAComponentOnly: function() { @@ -193,10 +195,9 @@ App.StackServiceComponent = DS.Model.extend({ return !!App.StackServiceComponent.coHost[componentName]; }.property('componentName'), - /** @property {Boolean} showAddBtnInInstall - show add button for this component on Assign Masters **/ - showAddBtnInInstall: function() { - var doNotShowList = ['HIVE_METASTORE', 'HIVE_SERVER']; - return !doNotShowList.contains(this.get('componentName')); + /** @property {Boolean} isNotAddableOnlyInInstall - is this component addable, except Install and Add Service Wizards **/ + isNotAddableOnlyInInstall: function() { + return ['HIVE_METASTORE', 'HIVE_SERVER', 'RANGER_KMS_SERVER'].contains(this.get('componentName')); }.property('componentName') }); http://git-wip-us.apache.org/repos/asf/ambari/blob/597951c1/ambari-web/test/models/stack_service_component_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/models/stack_service_component_test.js b/ambari-web/test/models/stack_service_component_test.js index 15e9a68..8774a1f 100644 --- a/ambari-web/test/models/stack_service_component_test.js +++ b/ambari-web/test/models/stack_service_component_test.js @@ -208,11 +208,11 @@ var componentPropertiesValidationTests = [ isMaster: true, isRestartable: true, isReassignable: true, - isDeletable: false, + isDeletable: true, isRollinRestartAllowed: false, isDecommissionAllowed: false, isRefreshConfigsAllowed: false, - isAddableToHost: false, + isAddableToHost: true, isShownOnInstallerAssignMasterPage: true, isShownOnInstallerSlaveClientPage: false, isShownOnAddServiceAssignMasterPage: true, @@ -237,11 +237,11 @@ var componentPropertiesValidationTests = [ isMaster: true, isRestartable: true, isReassignable: true, - isDeletable: false, + isDeletable: true, isRollinRestartAllowed: false, isDecommissionAllowed: false, isRefreshConfigsAllowed: false, - isAddableToHost: false, + isAddableToHost: true, isShownOnInstallerAssignMasterPage: true, isShownOnInstallerSlaveClientPage: false, isShownOnAddServiceAssignMasterPage: true, @@ -286,13 +286,13 @@ var componentPropertiesValidationTests = [ { componentName: 'POSTGRESQL_SERVER', expected: { - isShownOnInstallerAssignMasterPage: false, + isShownOnInstallerAssignMasterPage: false } }, { componentName: 'MYSQL_SERVER', expected: { - isShownOnInstallerAssignMasterPage: false, + isShownOnInstallerAssignMasterPage: false } }, ];
