ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-18875. Cannot delete config groups with no hosts and some config changes (akovalenko)
Date Mon, 14 Nov 2016 15:24:53 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 2fdd066cf -> 0e9ddb6b2


AMBARI-18875. Cannot delete config groups with no hosts and some config changes (akovalenko)


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

Branch: refs/heads/branch-2.5
Commit: 0e9ddb6b243d6022ecb426bf76ab2302dd9077d0
Parents: 2fdd066
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Mon Nov 14 16:51:31 2016 +0200
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Mon Nov 14 16:52:54 2016 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/info/configs.js | 2 +-
 ambari-web/app/mappers/configs/config_groups_mapper.js  | 2 +-
 ambari-web/app/models/configs/config_group.js           | 2 ++
 ambari-web/app/models/configs/service_config_version.js | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0e9ddb6b/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 946a1b9..130b1b5 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -461,7 +461,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.AddSecurityConfi
   addOverrides: function(data, allConfigs) {
     var self = this;
     data.items.forEach(function(group) {
-      if (group.group_name !== App.ServiceConfigGroup.defaultGroupName) {
+      if (![App.ServiceConfigGroup.defaultGroupName, App.ServiceConfigGroup.deletedGroupName].contains(group.group_name))
{
         var configGroup = App.ServiceConfigGroup.find().filterProperty('serviceName', group.service_name).findProperty('name',
group.group_name);
         group.configurations.forEach(function(config) {
           for (var prop in config.properties) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e9ddb6b/ambari-web/app/mappers/configs/config_groups_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/configs/config_groups_mapper.js b/ambari-web/app/mappers/configs/config_groups_mapper.js
index 44bd7a8..8700135 100644
--- a/ambari-web/app/mappers/configs/config_groups_mapper.js
+++ b/ambari-web/app/mappers/configs/config_groups_mapper.js
@@ -63,7 +63,7 @@ App.configGroupsMapper = App.QuickDataMapper.create({
 
       if (json && json.items) {
         json.items.forEach(function (configGroup) {
-          if (configGroup.group_name !== App.ServiceConfigGroup.defaultGroupName) {
+          if (![App.ServiceConfigGroup.defaultGroupName, App.ServiceConfigGroup.deletedGroupName].contains(configGroup.group_name))
{
             if (mapFromVersions) {
               configGroup.id = App.ServiceConfigGroup.groupId(configGroup.service_name, configGroup.group_name);
             } else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e9ddb6b/ambari-web/app/models/configs/config_group.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/config_group.js b/ambari-web/app/models/configs/config_group.js
index 55ddaad..e2993d8 100644
--- a/ambari-web/app/models/configs/config_group.js
+++ b/ambari-web/app/models/configs/config_group.js
@@ -161,6 +161,8 @@ App.ServiceConfigGroup.groupId = function(serviceName, groupName) {
 
 App.ServiceConfigGroup.defaultGroupName = 'Default';
 
+App.ServiceConfigGroup.deletedGroupName = 'Deleted';
+
 /**
  * Delete all records with isTemporary:true
  * @method

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e9ddb6b/ambari-web/app/models/configs/service_config_version.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/service_config_version.js b/ambari-web/app/models/configs/service_config_version.js
index 2859030..4120681 100644
--- a/ambari-web/app/models/configs/service_config_version.js
+++ b/ambari-web/app/models/configs/service_config_version.js
@@ -54,7 +54,7 @@ App.ServiceConfigVersion = DS.Model.extend({
    * @type {Boolean}
    */
   isConfigGroupDeleted: function () {
-    return this.get('groupName') === 'Deleted';
+    return this.get('groupName') === App.ServiceConfigGroup.deletedGroupName;
   }.property('groupName'),
 
   /**


Mime
View raw message