You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2014/01/02 16:47:20 UTC

git commit: AMBARI-4208 Add Service Wizard: Removing group from installed service not applied to configs. (Denys Buzhor via atkach)

Updated Branches:
  refs/heads/trunk 87686b64a -> 67bc85546


AMBARI-4208 Add Service Wizard: Removing group from installed service not applied to configs. (Denys Buzhor via atkach)


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

Branch: refs/heads/trunk
Commit: 67bc855462edf48bc9ae3b4d9bd52ccc80482a9e
Parents: 87686b6
Author: atkach <at...@hortonworks.com>
Authored: Thu Jan 2 17:47:15 2014 +0200
Committer: atkach <at...@hortonworks.com>
Committed: Thu Jan 2 17:47:15 2014 +0200

----------------------------------------------------------------------
 .../app/controllers/main/service/info/configs.js       |  5 ++++-
 ambari-web/app/controllers/wizard/step7_controller.js  | 13 +++++++++++++
 ambari-web/app/controllers/wizard/step8_controller.js  | 10 ++++++++++
 ambari-web/app/routes/add_service_routes.js            |  1 +
 4 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/67bc8554/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 9a52bf7..0bce90a 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -1907,18 +1907,21 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         if (!this.get('enablePrimary')) {
           return false;
         }
+        var modifiedConfigGroups = this.get('subViewController.hostsModifiedConfigGroups');
         // Save modified config-groups
         if (!!controller) {
           controller.set('selectedService.configGroups', App.router.get('manageConfigGroupsController.configGroups'));
           controller.selectedServiceObserver();
           if (controller.get('name') == "wizardStep7Controller") {
+            if (controller.get('selectedService.selected') === false && modifiedConfigGroups.toDelete.length > 0) {
+              controller.setGroupsToDelete(modifiedConfigGroups.toDelete);
+            }
             App.config.persistWizardStep7ConfigGroups();
             this.updateConfigGroupOnServicePage();
           }
           this.hide();
           return;
         }
-        var modifiedConfigGroups = this.get('subViewController.hostsModifiedConfigGroups');
         console.log("manageConfigurationGroups(): Saving modified config-groups: ", modifiedConfigGroups);
         var self = this;
         var errors = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/67bc8554/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 ae8636d..86f3615 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -52,6 +52,8 @@ App.WizardStep7Controller = Em.Controller.extend({
 
   configGroups: [],
 
+  groupsToDelete: [],
+
   selectedConfigGroup: null,
 
   serviceConfigsData: require('data/service_configs'),
@@ -320,6 +322,7 @@ App.WizardStep7Controller = Em.Controller.extend({
     if(this.get('allInstalledServiceNames').contains('YARN') && !App.supports.capacitySchedulerUi){
       configs = App.config.fileConfigsIntoTextarea(configs, 'capacity-scheduler.xml');
     }
+    this.set('groupsToDelete', this.get('wizardController').getDBProperty('groupsToDelete') || []);
     var localDB = {
       hosts: this.get('wizardController').getDBProperty('hosts'),
       masterComponentHosts: this.get('wizardController').getDBProperty('masterComponentHosts'),
@@ -361,6 +364,16 @@ App.WizardStep7Controller = Em.Controller.extend({
     }
   },
 
+  setGroupsToDelete: function(groups) {
+    var groupsToDelete = this.get('groupsToDelete');
+    groups.forEach(function(group) {
+      if (group.get('id'))
+        groupsToDelete.push({
+          id: group.get('id')
+        });
+    });
+    this.get('wizardController').setDBProperty('groupsToDelete', groupsToDelete);
+  },
   selectedServiceObserver: function () {
     if (App.supports.hostOverridesInstaller && this.get('selectedService') && (this.get('selectedService.serviceName') !== 'MISC')) {
       var serviceGroups = this.get('selectedService.configGroups');

http://git-wip-us.apache.org/repos/asf/ambari/blob/67bc8554/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 634ffc4..ea1b605 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1487,6 +1487,10 @@ App.WizardStep8Controller = Em.Controller.extend({
     var sendData = [];
     var updateData = [];
     var serviceConfigController = App.router.get('mainServiceInfoConfigsController');
+    var groupsToDelete = App.router.get(this.get('content.controllerName')).getDBProperty('groupsToDelete');
+    if (groupsToDelete && groupsToDelete.length > 0) {
+      this.removeInstalledServicesConfigurationGroups(groupsToDelete);
+    }
     configGroups.forEach(function (configGroup) {
       var groupConfigs = [];
       var groupData = {
@@ -1542,6 +1546,12 @@ App.WizardStep8Controller = Em.Controller.extend({
     });
   },
 
+  removeInstalledServicesConfigurationGroups: function(groupsToDelete) {
+    groupsToDelete.forEach(function(item) {
+      App.config.deleteConfigGroup(Em.Object.create(item));
+    });
+  },
+
   createGlobalSiteObj: function () {
     var globalSiteProperties = {};
     var globalSiteObj = this.get('globals');

http://git-wip-us.apache.org/repos/asf/ambari/blob/67bc8554/ambari-web/app/routes/add_service_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_service_routes.js b/ambari-web/app/routes/add_service_routes.js
index 1c845e1..521b2a9 100644
--- a/ambari-web/app/routes/add_service_routes.js
+++ b/ambari-web/app/routes/add_service_routes.js
@@ -172,6 +172,7 @@ module.exports = Em.Route.extend({
         addServiceController.saveSlaveComponentHosts(wizardStep6Controller);
         addServiceController.get('content').set('serviceConfigProperties', null);
         addServiceController.setDBProperty('serviceConfigProperties', null);
+        addServiceController.setDBProperty('groupsToDelete', []);
         router.transitionTo('step4');
       }
     }