Updated Branches:
  refs/heads/trunk 305c934f5 -> 0120a4d47

AMBARI-3951 No link for Manage Config groups at Service Page. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0120a4d4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0120a4d4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0120a4d4

Branch: refs/heads/trunk
Commit: 0120a4d47075130a9721766018311c2609ab94be
Parents: 305c934
Author: aBabiichuk <[email protected]>
Authored: Tue Dec 3 14:37:12 2013 +0200
Committer: aBabiichuk <[email protected]>
Committed: Tue Dec 3 14:37:12 2013 +0200

----------------------------------------------------------------------
 .../controllers/main/service/info/configs.js    | 97 ++++++++++++++++++++
 ambari-web/app/controllers/main/service/item.js | 93 -------------------
 .../app/controllers/wizard/step7_controller.js  |  2 +-
 .../templates/common/configs/service_config.hbs |  4 +-
 ambari-web/app/views/main/service/item.js       |  3 -
 5 files changed, 99 insertions(+), 100 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0120a4d4/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index 1284106..beee93d 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -1873,6 +1873,103 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend({
     overrides.pushObject(newSCP);
   },
 
+  manageConfigurationGroup: function () {
+    this.manageConfigurationGroups();
+  },
+
+  manageConfigurationGroups: function (controller) {
+    var serviceData = (controller && controller.get('selectedService')) || 
this.get('content');
+    var serviceName = serviceData.get('serviceName');
+    var displayName = serviceData.get('displayName');
+    App.ModalPopup.show({
+      header: 
Em.I18n.t('services.service.config_groups_popup.header').format(displayName),
+      bodyClass: App.MainServiceManageConfigGroupView.extend({
+        serviceName: serviceName,
+        displayName: displayName,
+        usedConfigGroupNames: (controller && 
controller.get('usedConfigGroupNames')),
+        controllerBinding: (!!controller) ? 
'App.router.installerManageConfigGroupsController' : 
'App.router.manageConfigGroupsController'
+      }),
+      classNames: ['sixty-percent-width-modal', 
'manage-configuration-group-popup'],
+      primary: Em.I18n.t('common.save'),
+      onPrimary: function() {
+        // Save modified config-groups
+        if (!!controller) {
+          controller.set('selectedService.configGroups', 
App.router.get('installerManageConfigGroupsController.configGroups'));
+          controller.selectedServiceObserver();
+          this.hide();
+          return;
+        }
+        var modifiedConfigGroups = 
this.get('subViewController.hostsModifiedConfigGroups');
+        console.log("manageConfigurationGroups(): Saving modified 
config-groups: ", modifiedConfigGroups);
+        var self = this;
+        var errors = [];
+        var clearHostsPutCount = modifiedConfigGroups.toClearHosts.length;
+        var setHostsPutCount = modifiedConfigGroups.toSetHosts.length;
+        var finishFunction = function(error) {
+          if (error != null) {
+            errors.push(error);
+          }
+          if (--clearHostsPutCount <= 0) {
+            // Done with all the clear hosts PUTs
+            if (--setHostsPutCount < 0) {
+              // Done with all the PUTs
+              if (errors.length > 0) {
+                console.log(errors);
+                self.get('subViewController').set('errorMessage',
+                    errors.join(". "));
+              } else {
+                self.hide();
+              }
+            } else {
+              
App.config.updateConfigurationGroup(modifiedConfigGroups.toSetHosts[setHostsPutCount],
 finishFunction, finishFunction);
+            }
+          }
+        };
+        this.updateConfigGroupOnServicePage();
+        modifiedConfigGroups.toClearHosts.forEach(function (cg) {
+          App.config.clearConfigurationGroupHosts(cg, finishFunction, 
finishFunction);
+        });
+      },
+      onSecondary: function () {
+        this.updateConfigGroupOnServicePage();
+        this.hide();
+      },
+      onClose: function () {
+        this.updateConfigGroupOnServicePage();
+        this.hide();
+      },
+      subViewController: function(){
+        return App.router.get('manageConfigGroupsController');
+      }.property('App.router.manageConfigGroupsController'),
+      updateConfigGroupOnServicePage: function () {
+        var mainServiceInfoConfigsController = 
App.get('router.mainServiceInfoConfigsController');
+        var selectedConfigGroup = 
mainServiceInfoConfigsController.get('selectedConfigGroup');
+        var managedConfigGroups = this.get('subViewController.configGroups');
+        //check whether selectedConfigGroup was selected
+        if(!selectedConfigGroup){
+          return;
+        }
+        
mainServiceInfoConfigsController.set('configGroups',this.get('subViewController.configGroups'));
+        if(selectedConfigGroup.isDefault) {
+          mainServiceInfoConfigsController.set('selectedConfigGroup',  
managedConfigGroups.findProperty('isDefault', true));
+        }else{
+          selectedConfigGroup = managedConfigGroups.findProperty('id', 
selectedConfigGroup.id);
+          if(selectedConfigGroup){
+            mainServiceInfoConfigsController.set('selectedConfigGroup', 
selectedConfigGroup);
+          }else{
+            mainServiceInfoConfigsController.set('selectedConfigGroup',  
managedConfigGroups.findProperty('isDefault', true));
+          }
+        }
+      },
+      updateButtons: function(){
+        var modified = this.get('subViewController.isHostsModified');
+        this.set('enablePrimary', modified);
+      }.observes('subViewController.isHostsModified'),
+      secondary : Em.I18n.t('common.cancel'),
+      didInsertElement: function () {}
+    });
+  },
+
   selectConfigGroup: function (event) {
     this.set('selectedConfigGroup', event.context);
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/0120a4d4/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 beb2858..f03e931 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -227,99 +227,6 @@ App.MainServiceItemController = Em.Controller.extend({
     App.router.transitionTo('reassign');
   },
 
-  manageConfigurationGroups: function (controller) {
-    var serviceData = (controller && controller.get('selectedService')) || 
this.get('content');
-    var serviceName = serviceData.get('serviceName');
-    var displayName = serviceData.get('displayName');
-    App.ModalPopup.show({
-      header: 
Em.I18n.t('services.service.config_groups_popup.header').format(displayName),
-      bodyClass: App.MainServiceManageConfigGroupView.extend({
-        serviceName: serviceName,
-        displayName: displayName,
-        usedConfigGroupNames: (controller && 
controller.get('usedConfigGroupNames')),
-        controllerBinding: (!!controller) ? 
'App.router.installerManageConfigGroupsController' : 
'App.router.manageConfigGroupsController'
-      }),
-      classNames: ['sixty-percent-width-modal', 
'manage-configuration-group-popup'],
-      primary: Em.I18n.t('common.save'),
-      onPrimary: function() {
-        // Save modified config-groups
-        if (!!controller) {
-          controller.set('selectedService.configGroups', 
App.router.get('installerManageConfigGroupsController.configGroups'));
-          controller.selectedServiceObserver();
-          this.hide();
-          return;
-        }
-        var modifiedConfigGroups = 
this.get('subViewController.hostsModifiedConfigGroups');
-        console.log("manageConfigurationGroups(): Saving modified 
config-groups: ", modifiedConfigGroups);
-        var self = this;
-        var errors = [];
-        var clearHostsPutCount = modifiedConfigGroups.toClearHosts.length;
-        var setHostsPutCount = modifiedConfigGroups.toSetHosts.length;
-        var finishFunction = function(error) {
-          if (error != null) {
-            errors.push(error);
-          }
-          if (--clearHostsPutCount <= 0) {
-            // Done with all the clear hosts PUTs
-            if (--setHostsPutCount < 0) {
-              // Done with all the PUTs
-              if (errors.length > 0) {
-                console.log(errors);
-                self.get('subViewController').set('errorMessage',
-                    errors.join(". "));
-              } else {
-                self.hide();
-              }
-            } else {
-              
App.config.updateConfigurationGroup(modifiedConfigGroups.toSetHosts[setHostsPutCount],
 finishFunction, finishFunction);
-            }
-          }
-        };
-        this.updateConfigGroupOnServicePage();
-        modifiedConfigGroups.toClearHosts.forEach(function (cg) {
-          App.config.clearConfigurationGroupHosts(cg, finishFunction, 
finishFunction);
-        });
-      },
-      onSecondary: function () {
-        this.updateConfigGroupOnServicePage();
-        this.hide();
-      },
-      onClose: function () {
-        this.updateConfigGroupOnServicePage();
-        this.hide();
-      },
-      subViewController: function(){
-        return App.router.get('manageConfigGroupsController');
-      }.property('App.router.manageConfigGroupsController'),
-      updateConfigGroupOnServicePage: function () {
-        var mainServiceInfoConfigsController = 
App.get('router.mainServiceInfoConfigsController');
-        var selectedConfigGroup = 
mainServiceInfoConfigsController.get('selectedConfigGroup');
-        var managedConfigGroups = this.get('subViewController.configGroups');
-        //check whether selectedConfigGroup was selected
-        if(!selectedConfigGroup){
-          return;
-        }
-        
mainServiceInfoConfigsController.set('configGroups',this.get('subViewController.configGroups'));
-        if(selectedConfigGroup.isDefault) {
-          mainServiceInfoConfigsController.set('selectedConfigGroup',  
managedConfigGroups.findProperty('isDefault', true));
-        }else{
-          selectedConfigGroup = managedConfigGroups.findProperty('id', 
selectedConfigGroup.id);
-          if(selectedConfigGroup){
-            mainServiceInfoConfigsController.set('selectedConfigGroup', 
selectedConfigGroup);
-          }else{
-            mainServiceInfoConfigsController.set('selectedConfigGroup',  
managedConfigGroups.findProperty('isDefault', true));
-          }
-        }
-      },
-      updateButtons: function(){
-        var modified = this.get('subViewController.isHostsModified');
-        this.set('enablePrimary', modified);
-      }.observes('subViewController.isHostsModified'),
-      secondary : Em.I18n.t('common.cancel'),
-      didInsertElement: function () {}
-    });
-  },
-
   /**
    * On click callback for <code>action</code> dropdown menu
    * Calls runSmokeTest, runRebalancer, runCompaction or reassignMaster 
depending on context

http://git-wip-us.apache.org/repos/asf/ambari/blob/0120a4d4/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js 
b/ambari-web/app/controllers/wizard/step7_controller.js
index 36f3053..85a2f25 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -239,7 +239,7 @@ App.WizardStep7Controller = Em.Controller.extend({
   },
 
   manageConfigurationGroup: function () {
-    
App.router.get('mainServiceItemController').manageConfigurationGroups(this);
+    
App.router.get('mainServiceInfoConfigsController').manageConfigurationGroups(this);
   },
   /**
    * Filter text will be located here

http://git-wip-us.apache.org/repos/asf/ambari/blob/0120a4d4/ambari-web/app/templates/common/configs/service_config.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_config.hbs 
b/ambari-web/app/templates/common/configs/service_config.hbs
index 5776918..5c4f174 100644
--- a/ambari-web/app/templates/common/configs/service_config.hbs
+++ b/ambari-web/app/templates/common/configs/service_config.hbs
@@ -67,9 +67,7 @@
     {{#if controller.isHostsConfigsPage}}
       &nbsp;<a href="#" {{action "switchHostGroup" target="controller"}}>{{t 
common.change}}</a>
     {{/if}}
-    {{#if controller.isInstaller}}
-        <a href="#" class="link" {{action "manageConfigurationGroup" 
target="controller"}}>{{t 
services.service.actions.manage_configuration_groups.short}}</a>
-    {{/if}}
+     <a href="#" class="link" {{action "manageConfigurationGroup" 
target="controller"}}>{{t 
services.service.actions.manage_configuration_groups.short}}</a>
      <div class="pull-right">
        {{view App.FilterComboboxView filterBinding="view.filter" 
columnsBinding="view.columns" }}
      </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0120a4d4/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 faa7e07..76d0712 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -44,9 +44,6 @@ App.MainServiceItemView = Em.View.extend({
       default:
         options.push({action: 'runSmokeTest', 'label': 
Em.I18n.t('services.service.actions.run.smoke'), disabled:disabled});
     }
-    if (App.supports.hostOverrides) {
-      options.push({action: 'manageConfigurationGroups', 'label': 
Em.I18n.t('services.service.actions.manage_configuration_groups'), disabled: 
false});
-    }
     return options;
   }.property('controller.content', 'controller.isStopDisabled'),
   isMaintenanceActive: function() {

Reply via email to