You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2014/08/04 19:57:53 UTC
git commit: AMBARI-6737. Layout assign master components by Service.
(Denys Buzhor via akovalenko)
Repository: ambari
Updated Branches:
refs/heads/trunk bb91e787a -> a431c7588
AMBARI-6737. Layout assign master components by Service. (Denys Buzhor via akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a431c758
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a431c758
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a431c758
Branch: refs/heads/trunk
Commit: a431c7588bea10f94184dc1ea24c8435c40e1617
Parents: bb91e78
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Mon Aug 4 20:56:26 2014 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Mon Aug 4 20:56:26 2014 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/wizard/step5_controller.js | 10 ++++++++++
1 file changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/a431c758/ambari-web/app/controllers/wizard/step5_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step5_controller.js b/ambari-web/app/controllers/wizard/step5_controller.js
index e01c3e3..c137d38 100644
--- a/ambari-web/app/controllers/wizard/step5_controller.js
+++ b/ambari-web/app/controllers/wizard/step5_controller.js
@@ -555,6 +555,7 @@ App.WizardStep5Controller = Em.Controller.extend({
componentObj.set('isHostNameValid', true);
result.push(componentObj);
}, this);
+ result = this.sortComponentsByServiceName(result);
this.set("selectedServicesMasters", result);
if (this.get('isReassignWizard')) {
var components = result.filterProperty('component_name', this.get('content.reassign.component_name'));
@@ -565,6 +566,15 @@ App.WizardStep5Controller = Em.Controller.extend({
}
},
+ sortComponentsByServiceName: function(components) {
+ var _components = components.sortPropertyLight('selectedHost');
+ var displayOrder = App.StackService.displayOrder;
+ return _components.sort(function (a, b) {
+ var aValue = displayOrder.indexOf(a.serviceId) != -1 ? displayOrder.indexOf(a.serviceId) : _components.length;
+ var bValue = displayOrder.indexOf(b.serviceId) != -1 ? displayOrder.indexOf(b.serviceId) : _components.length;
+ return aValue - bValue;
+ });
+ },
/**
* Update dependent co-hosted components according to the change in the component host
* @method updateCoHosts