소스 검색

AMBARI-4023. In installer, default config-group ends up ordered last in the list of config-groups. (Denys Buzhor via akovalenko)

Aleksandr Kovalenko 11 년 전
부모
커밋
06c22ff5a9
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      ambari-web/app/controllers/wizard/step7_controller.js

+ 6 - 2
ambari-web/app/controllers/wizard/step7_controller.js

@@ -141,8 +141,12 @@ App.WizardStep7Controller = Em.Controller.extend({
 
   selectedServiceObserver: function () {
     if (App.supports.hostOverridesInstaller && this.get('selectedService') && (this.get('selectedService.serviceName') !== 'MISC')) {
-      var serviceGroups = this.get('selectedService.configGroups').sort(function (a, b) {
-        return a.isDefault || b.isDefault ? 1 : 0;
+      var serviceGroups = this.get('selectedService.configGroups');
+      serviceGroups.forEach(function (item, index, array) {
+        if (item.isDefault) {
+          array.unshift(item);
+          array.splice(index + 1, 1);
+        }
       });
       this.set('configGroups', serviceGroups);
       this.set('selectedConfigGroup', serviceGroups.findProperty('isDefault'));