Browse Source

AMBARI-13996 Some config refactor on wizards. (ababiichuk)

aBabiichuk 9 years ago
parent
commit
ef208aaac1
33 changed files with 255 additions and 1125 deletions
  1. 1 3
      ambari-web/app/assets/test/tests.js
  2. 1 1
      ambari-web/app/controllers/main/admin/kerberos.js
  3. 1 3
      ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
  4. 4 1
      ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
  5. 2 26
      ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
  6. 1 3
      ambari-web/app/controllers/main/service/add_controller.js
  7. 1 9
      ambari-web/app/controllers/main/service/info/configs.js
  8. 175 176
      ambari-web/app/controllers/wizard/step7_controller.js
  9. 1 1
      ambari-web/app/data/HDP2/site_properties.js
  10. 1 2
      ambari-web/app/mappers.js
  11. 0 143
      ambari-web/app/mappers/configs/config_versions_mapper.js
  12. 0 0
      ambari-web/app/mappers/configs/service_config_version_mapper.js
  13. 1 1
      ambari-web/app/mappers/configs/stack_config_properties_mapper.js
  14. 0 1
      ambari-web/app/mixins/common/serverValidator.js
  15. 0 1
      ambari-web/app/models.js
  16. 0 236
      ambari-web/app/models/configs/config_property.js
  17. 0 34
      ambari-web/app/models/configs/config_version.js
  18. 1 1
      ambari-web/app/models/configs/stack_config_property.js
  19. 4 2
      ambari-web/app/models/stack_service.js
  20. 3 67
      ambari-web/app/utils/config.js
  21. 20 1
      ambari-web/app/utils/configs/config_initializer.js
  22. 2 2
      ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
  23. 2 2
      ambari-web/test/controllers/main/admin/kerberos_test.js
  24. 0 82
      ambari-web/test/controllers/main/admin/serviceAccounts_controller_test.js
  25. 4 229
      ambari-web/test/controllers/wizard/step7_test.js
  26. 1 1
      ambari-web/test/data/HDP2.2/site_properties_test.js
  27. 1 2
      ambari-web/test/data/HDP2.3/site_properties_test.js
  28. 1 1
      ambari-web/test/data/HDP2/site_properties_test.js
  29. 24 24
      ambari-web/test/mappers/configs/service_config_version_mapper_test.js
  30. 0 1
      ambari-web/test/mappers/configs/themes_mapper_test.js
  31. 0 66
      ambari-web/test/models/configs/config_property_test.js
  32. 1 1
      ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
  33. 2 2
      ambari-web/test/views/common/configs/widgets/time_interval_spinner_view_test.js

+ 1 - 3
ambari-web/app/assets/test/tests.js

@@ -131,9 +131,8 @@ var files = [
   'test/mappers/users_mapper_test',
   'test/mappers/stack_mapper_test',
   'test/mappers/stack_service_mapper_test',
-  'test/mappers/configs/stack_config_properties_mapper_test',
   'test/mappers/configs/config_groups_mapper_test',
-  'test/mappers/configs/config_versions_mapper_test',
+  'test/mappers/configs/service_config_version_mapper_test',
   'test/mappers/configs/themes_mapper_test',
   'test/mixins/common/configs/enhanced_configs_test',
   'test/mixins/common/configs/configs_saver_test',
@@ -321,7 +320,6 @@ var files = [
   'test/models/configs/sub_section_test',
   'test/models/configs/section_test',
   'test/models/configs/service_config_version_test',
-  'test/models/configs/config_property_test',
   'test/models/configs/objects/service_config_test',
   'test/models/configs/objects/service_config_category_test',
   'test/models/configs/objects/service_config_property_test',

+ 1 - 1
ambari-web/app/controllers/main/admin/kerberos.js

@@ -351,7 +351,7 @@ App.MainAdminKerberosController = App.KerberosWizardStep4Controller.extend({
   prepareConfigProperties: function (configs) {
     var self = this;
     var configProperties = configs.slice(0);
-    var siteProperties = App.config.get('preDefinedSiteProperties');
+    var siteProperties = App.configsCollection.getAll();
     var installedServiceNames = ['Cluster'].concat(App.Service.find().mapProperty('serviceName'));
     configProperties = configProperties.filter(function (item) {
       return installedServiceNames.contains(item.get('serviceName'));

+ 1 - 3
ambari-web/app/controllers/main/admin/kerberos/step2_controller.js

@@ -85,8 +85,6 @@ App.KerberosWizardStep2Controller = App.WizardStep7Controller.extend(App.KDCCred
       return;
     }
     this.clearStep();
-    //STEP 2: Load on-site configs by service from local DB
-    var storedConfigs = this.get('content.serviceConfigProperties');
     //STEP 3: Merge pre-defined configs with loaded on-site configs
     this.set('configs', App.configsCollection.getAll());
     App.config.setPreDefinedServiceConfigs(this.get('addMiscTabToPage'));
@@ -95,7 +93,7 @@ App.KerberosWizardStep2Controller = App.WizardStep7Controller.extend(App.KDCCred
     if (App.get('supports.storeKDCCredentials') && !this.get('wizardController.skipClientInstall')) {
       this.initilizeKDCStoreProperties(this.get('configs'));
     }
-    this.applyServicesConfigs(this.get('configs'), storedConfigs);
+    this.applyServicesConfigs(this.get('configs'));
   },
 
   /**

+ 4 - 1
ambari-web/app/controllers/main/admin/kerberos/step4_controller.js

@@ -173,7 +173,7 @@ App.KerberosWizardStep4Controller = App.WizardStep7Controller.extend(App.AddSecu
     var installedServiceNames = ['Cluster'].concat(App.Service.find().mapProperty('serviceName'));
     var adminProps = [];
     var configProperties = configs.slice(0);
-    var siteProperties = App.config.get('preDefinedSiteProperties');
+    var siteProperties = App.configsCollection.getAll();
     // override stored values
     App.config.mergeStoredValue(configProperties, this.get('wizardController').loadCachedStepConfigValues(this));
 
@@ -182,6 +182,9 @@ App.KerberosWizardStep4Controller = App.WizardStep7Controller.extend(App.AddSecu
       installedServiceNames = installedServiceNames.concat(this.get('selectedServiceNames'));
       this.get('adminPropertyNames').forEach(function(item) {
         var property = storedServiceConfigs.filterProperty('filename', 'krb5-conf.xml').findProperty('name', item.name);
+        if (!property) {
+          property = siteProperties.filterProperty('filename', 'krb5-conf.xml').findProperty('name', item.name);
+        }
         if (!!property) {
           var _prop = App.ServiceConfigProperty.create($.extend({}, property, { name: item.name, value: '', recommendedValue: '', serviceName: 'Cluster', displayName: item.displayName}));
           if (App.router.get('mainAdminKerberosController.isManualKerberos')) {

+ 2 - 26
ambari-web/app/controllers/main/admin/serviceAccounts_controller.js

@@ -106,34 +106,10 @@ App.MainAdminServiceAccountsController = App.MainServiceInfoConfigsController.ex
     var configs = App.config.mergePredefinedWithSaved(serverConfigs, this.get('selectedService'));
     var miscConfigs = configs.filterProperty('displayType', 'user').filterProperty('category', 'Users and Groups');
     miscConfigs.setEach('isVisible', true);
-
-    // load specific users along the wizards which called <code>loadUsers</code> method
-    var wizardContentProperties = [
-      {key: 'group', configName: 'user_group'},
-      {key: 'smokeuser', configName: 'smokeuser'},
-      {key: 'hdfsUser', configName: 'hdfs_user'}
-    ];
-    wizardContentProperties.forEach(function(item) {
-      this.setContentProperty(item.key, item.configName, miscConfigs);
-    }, this);
-    this.set('users', miscConfigs.filterProperty('isVisible'));
+    this.set('users', miscConfigs);
     this.set('dataIsLoaded', true);
   },
-  /**
-   * set config value to property of "content"
-   * @param key
-   * @param configName
-   * @param misc_configs
-   * @return {Boolean}
-   */
-  setContentProperty: function (key, configName, misc_configs) {
-    var content = this.get('content');
-    if (key && configName && misc_configs.someProperty('name', configName) && content.get(key)) {
-      content.set(key, misc_configs.findProperty('name', configName).get("value"));
-      return true;
-    }
-    return false;
-  },
+
   /**
    * sort miscellaneous configs by specific order
    * @param sortOrder

+ 1 - 3
ambari-web/app/controllers/main/service/add_controller.js

@@ -70,9 +70,7 @@ App.AddServiceController = App.WizardController.extend(App.AddSecurityConfigs, {
     controllerName: 'addServiceController',
     configGroups: [],
     clients: [],
-    additionalClients: [],
-    smokeuser: "ambari-qa",
-    group: "hadoop"
+    additionalClients: []
   }),
 
   loadMap: {

+ 1 - 9
ambari-web/app/controllers/main/service/info/configs.js

@@ -191,7 +191,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader, A
 
   /**
    * get array of config properties that are shown in settings tab
-   * @type {App.StackConfigProperty[]}
+   * @type {String[]}
    */
   settingsTabProperties: function() {
     var properties = [];
@@ -491,14 +491,6 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader, A
         return serviceNames.contains(c.get('serviceName'));
       });
       var serviceConfig = App.config.createServiceConfig(serviceName, configGroups, configsByService, configsByService.length);
-      if (serviceConfig.get('serviceName') === 'HDFS') {
-        if (App.get('isHaEnabled')) {
-          var c = serviceConfig.configs,
-            removedConfigs = c.filterProperty('category', 'SECONDARY_NAMENODE');
-          removedConfigs.setEach('isVisible', false);
-          serviceConfig.configs = c;
-        }
-      }
       this.addHostNamesToConfigs(serviceConfig);
       this.get('stepConfigs').pushObject(serviceConfig);
     }, this);

+ 175 - 176
ambari-web/app/controllers/wizard/step7_controller.js

@@ -204,6 +204,23 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
    */
   filter: '',
 
+  /**
+   * list of dependencies that are user to set init value of config
+   *
+   * @type {Object}
+   */
+  configDependencies: function() {
+    var dependencies = {
+      'sliderSelected': this.get('allSelectedServiceNames').contains('SLIDER')
+    };
+    var hiveMetastore = App.configsCollection.getConfigByName('hive.metastore.uris', 'hive-site.xml');
+    var clientPort = App.configsCollection.getConfigByName('clientPort', 'zoo.cfg.xml');
+
+    if (hiveMetastore) dependencies['hive.metastore.uris'] = hiveMetastore.recommendedValue;
+    if (clientPort) dependencies['clientPort']  = clientPort.recommendedValue;
+    return dependencies
+  }.property('allSelectedServiceNames'),
+
   /**
    * List of filters for config properties to populate filter combobox
    */
@@ -415,9 +432,71 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
       }, this);
     }, this);
     this.set('preSelectedConfigGroup', App.ServiceConfigGroup.find(App.ServiceConfigGroup.getParentConfigGroupId(serviceName)));
-    App.config.loadServiceConfigGroupOverrides(service.get('configs'), loadedGroupToOverrideSiteToTagMap, service.get('configGroups'), this.onLoadOverrides, this);
+    this.loadServiceConfigGroupOverrides(service.get('configs'), loadedGroupToOverrideSiteToTagMap, service.get('configGroups'));
+  },
+
+  /**
+   * Get properties from server by type and tag with properties, that belong to group
+   * push them to common {serviceConfigs} and call callback function
+   */
+  loadServiceConfigGroupOverrides: function (serviceConfigs, loadedGroupToOverrideSiteToTagMap, configGroups) {
+    var configKeyToConfigMap = {};
+    serviceConfigs.forEach(function (item) {
+      if (!configKeyToConfigMap[item.filename]) {
+        configKeyToConfigMap[item.filename] = {};
+      }
+      configKeyToConfigMap[item.filename][item.name] = item;
+    });
+    var typeTagToGroupMap = {};
+    var urlParams = [];
+    for (var group in loadedGroupToOverrideSiteToTagMap) {
+      var overrideTypeTags = loadedGroupToOverrideSiteToTagMap[group];
+      for (var type in overrideTypeTags) {
+        var tag = overrideTypeTags[type];
+        typeTagToGroupMap[type + "///" + tag] = configGroups.findProperty('name', group);
+        urlParams.push('(type=' + type + '&tag=' + tag + ')');
+      }
+    }
+    var params = urlParams.join('|');
+    if (urlParams.length) {
+      App.ajax.send({
+        name: 'config.host_overrides',
+        sender: this,
+        data: {
+          params: params,
+          configKeyToConfigMap: configKeyToConfigMap,
+          typeTagToGroupMap: typeTagToGroupMap,
+          serviceConfigs: serviceConfigs
+        },
+        success: 'loadServiceConfigGroupOverridesSuccess'
+      });
+    } else {
+      this.onLoadOverrides(serviceConfigs);
+    }
+  },
+
+  loadServiceConfigGroupOverridesSuccess: function (data, opt, params) {
+    data.items.forEach(function (config) {
+      var group = params.typeTagToGroupMap[config.type + "///" + config.tag];
+      var properties = config.properties;
+      for (var prop in properties) {
+        var fileName = App.config.getOriginalFileName(config.type);
+        var serviceConfig = !!params.configKeyToConfigMap[fileName] ? params.configKeyToConfigMap[fileName][prop] : false;
+        var hostOverrideValue = App.config.formatPropertyValue(serviceConfig, properties[prop]);
+        var hostOverrideIsFinal = !!(config.properties_attributes && config.properties_attributes.final && config.properties_attributes.final[prop]);
+        if (serviceConfig) {
+          // Value of this property is different for this host.
+          if (!Em.get(serviceConfig, 'overrides')) Em.set(serviceConfig, 'overrides', []);
+          serviceConfig.overrides.pushObject({value: hostOverrideValue, group: group, isFinal: hostOverrideIsFinal});
+        } else {
+          params.serviceConfigs.push(App.config.createCustomGroupConfig(prop, config, group));
+        }
+      }
+    });
+    this.onLoadOverrides(params.serviceConfigs);
   },
 
+
   onLoadOverrides: function (configs) {
     var serviceName = configs[0].serviceName,
       service = this.get('stepConfigs').findProperty('serviceName', serviceName);
@@ -536,37 +615,6 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
     }
   },
 
-  /**
-   *  Resolve dependency between configs.
-   *  @param serviceName {String}
-   *  @param configs {Ember.Enumerable}
-   */
-  resolveServiceDependencyConfigs: function (serviceName, configs) {
-    switch (serviceName) {
-      case 'YARN':
-        this.resolveYarnConfigs(configs);
-        break;
-    }
-  },
-
-  /**
-   * Update some Storm configs
-   * If SLIDER is selected to install or already installed,
-   * some Yarn properties must be changed
-   * @param {Ember.Enumerable} configs
-   * @method resolveYarnConfigs
-   */
-  resolveYarnConfigs: function (configs) {
-    var cfgToChange = configs.findProperty('name', 'hadoop.registry.rm.enabled');
-    if (cfgToChange) {
-      var res = this.get('allSelectedServiceNames').contains('SLIDER').toString();
-      if (Em.get(cfgToChange, 'value') !== res) {
-        Em.set(cfgToChange, 'recommendedValue', res);
-        Em.set(cfgToChange, 'value', res);
-      }
-    }
-  },
-
   /**
    * On load function
    * @method loadStep
@@ -589,13 +637,13 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
     this.resolveConfigThemeConditions(configs);
 
     this.set('groupsToDelete', this.get('wizardController').getDBProperty('groupsToDelete') || []);
-    if (this.get('wizardController.name') === 'addServiceController') {
+    if (this.get('wizardController.name') === 'addServiceController' && !this.get('content.serviceConfigProperties.length')) {
       App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags')).done(function (loadedConfigs) {
         configs = self.setInstalledServiceConfigs(configs, loadedConfigs, self.get('installedServiceNames'));
-        self.applyServicesConfigs(configs, storedConfigs);
+        self.applyServicesConfigs(configs);
       });
     } else {
-      this.applyServicesConfigs(configs, storedConfigs);
+      this.applyServicesConfigs(configs);
     }
   },
 
@@ -636,47 +684,50 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
     });
   },
 
-  applyServicesConfigs: function (configs, storedConfigs) {
+  applyServicesConfigs: function (configs) {
     if (this.get('allSelectedServiceNames').contains('YARN')) {
       configs = App.config.fileConfigsIntoTextarea(configs, 'capacity-scheduler.xml', []);
     }
-
-    ["YARN"].forEach(function (serviceName) {
-      if (this.get('allSelectedServiceNames').contains(serviceName)) {
-        this.resolveServiceDependencyConfigs(serviceName, configs);
-      }
-    }, this);
-    //STEP 6: Distribute configs by service and wrap each one in App.ServiceConfigProperty (configs -> serviceConfigs)
     if (App.get('isKerberosEnabled') && this.get('wizardController.name') == 'addServiceController') {
       this.addKerberosDescriptorConfigs(configs, this.get('wizardController.kerberosDescriptorConfigs') || []);
     }
-    var serviceConfigs = this.renderConfigs(configs, storedConfigs, this.get('allSelectedServiceNames'), this.get('installedServiceNames'));
-    this.setStepConfigs(serviceConfigs);
+    var stepConfigs = this.createStepConfigs();
+    var serviceConfigs = this.renderConfigs(stepConfigs, configs);
+    // if HA is enabled -> Make some reconfigurations
+    if (this.get('wizardController.name') === 'addServiceController' && App.get('isHaEnabled')) {
+      serviceConfigs = this._reconfigureServicesOnNnHa(serviceConfigs);
+    }
+    this.set('stepConfigs', serviceConfigs);
     this.checkHostOverrideInstaller();
-    this.activateSpecialConfigs();
     this.selectProperService();
     var self = this;
     var rangerService = App.StackService.find().findProperty('serviceName', 'RANGER');
     if (rangerService && !rangerService.get('isInstalled') && !rangerService.get('isSelected')) {
       App.config.removeRangerConfigs(self.get('stepConfigs'));
     }
-    if (this.get('content.serviceConfigProperties.length') > 0) {
-      this.completeConfigLoading();
-    } else {
-      this.loadServerSideConfigsRecommendations().always(function () {
-        if (self.get('wizardController.name') == 'addServiceController') {
-          // for Add Service just remove or add dependent properties and ignore config values changes
-          // for installed services only
-          self.addRemoveDependentConfigs(self.get('installedServiceNames'));
-          self.clearDependenciesForInstalledServices(self.get('installedServiceNames'), self.get('stepConfigs'));
-        }
-        // * add dependencies based on recommendations
-        // * update config values with recommended
-        // * remove properties received from recommendations
-        self.updateDependentConfigs();
-        self.completeConfigLoading();
-      });
+    this.loadServerSideConfigsRecommendations().always(function() {
+      self.updateConfigsRecommendations();
+      self.completeConfigLoading();
+    });
+  },
+
+  /**
+   * update dependent configs based on recommendations from
+   * stack adviser
+   *
+   * @method updateConfigsRecommendations
+   */
+  updateConfigsRecommendations: function() {
+    if (this.get('wizardController.name') == 'addServiceController') {
+      // for Add Service just remove or add dependent properties and ignore config values changes
+      // for installed services only
+      this.addRemoveDependentConfigs(this.get('installedServiceNames'));
+      this.clearDependenciesForInstalledServices(this.get('installedServiceNames'), this.get('stepConfigs'));
     }
+    // * add dependencies based on recommendations
+    // * update config values with recommended
+    // * remove properties received from recommendations
+    this.updateDependentConfigs();
   },
 
   completeConfigLoading: function() {
@@ -726,130 +777,88 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
   },
 
   /**
-   * Set init <code>stepConfigs</code> value
-   * Set <code>selected</code> for addable services if addServiceController is used
-   * Remove SNameNode if HA is enabled (and if addServiceController is used)
-   * @param {Ember.Object[]} serviceConfigs
-   * @method setStepConfigs
+   * Create stepConfigs array with all info except configs list
+   *
+   * @return {Object[]}
+   * @method createStepConfigs
    */
-  setStepConfigs: function (serviceConfigs) {
-    if (this.get('wizardController.name') === 'addServiceController') {
-      serviceConfigs.setEach('showConfig', true);
-      serviceConfigs.setEach('selected', false);
-      this.get('selectedServiceNames').forEach(function (serviceName) {
-        if (!serviceConfigs.findProperty('serviceName', serviceName)) return;
-        serviceConfigs.findProperty('serviceName', serviceName).set('selected', true);
-      }, this);
-      this.get('installedServiceNames').forEach(function (serviceName) {
-        var serviceConfigObj = serviceConfigs.findProperty('serviceName', serviceName);
-        var isInstallableService = App.StackService.find(serviceName).get('isInstallable');
-        if (!isInstallableService) serviceConfigObj.set('showConfig', false);
-      }, this);
-      // if HA is enabled -> Remove SNameNode
-      if (App.get('isHaEnabled')) {
-        var c = serviceConfigs.findProperty('serviceName', 'HDFS').configs,
-          removedConfigs = c.filterProperty('category', 'SECONDARY_NAMENODE');
-        removedConfigs.setEach('isVisible', false);
-        serviceConfigs.findProperty('serviceName', 'HDFS').configs = c;
-
-        serviceConfigs = this._reconfigureServicesOnNnHa(serviceConfigs);
-      }
-    }
-
-    // Remove Notifications from MISC if it isn't Installer Controller
-    if (this.get('wizardController.name') !== 'installerController') {
-      var miscService = serviceConfigs.findProperty('serviceName', 'MISC');
-      if (miscService) {
-        c = miscService.configs;
-        removedConfigs = c.filterProperty('category', 'Notifications');
-        removedConfigs.map(function (config) {
-          c = c.without(config);
-        });
-        miscService.configs = c;
+  createStepConfigs: function() {
+    var stepConfigs = [];
+    App.config.get('preDefinedServiceConfigs').forEach(function (service) {
+      var serviceName = service.get('serviceName');
+      if (['MISC'].concat(this.get('allSelectedServiceNames')).contains(serviceName)) {
+        var serviceConfig = App.config.createServiceConfig(serviceName);
+        if (this.get('wizardController.name') == 'addServiceController') {
+          serviceConfig.set('selected', !this.get('installedServiceNames').concat('MISC').contains(serviceName));
+          if (serviceName === 'MISC') {
+            serviceConfig.set('configCategories', serviceConfig.get('configCategories').rejectProperty('name', 'Notifications'));
+          }
+        }
+        serviceConfig.set('showConfig', App.StackService.find(serviceName).get('isInstallable'));
+        stepConfigs.pushObject(serviceConfig);
       }
-    }
-    this.set('stepConfigs', serviceConfigs);
+    }, this);
+    return stepConfigs;
   },
 
   /**
    * render configs, distribute them by service
    * and wrap each in ServiceConfigProperty object
+   * @param stepConfigs
    * @param configs
-   * @param storedConfigs
-   * @param allSelectedServiceNames
-   * @param installedServiceNames
    * @return {App.ServiceConfig[]}
    */
-  renderConfigs: function (configs, storedConfigs, allSelectedServiceNames, installedServiceNames) {
+  renderConfigs: function (stepConfigs, configs) {
     var localDB = {
       hosts: this.get('wizardController.content.hosts'),
       masterComponentHosts: this.get('wizardController.content.masterComponentHosts'),
       slaveComponentHosts: this.get('wizardController.content.slaveComponentHosts')
     };
-    var renderedServiceConfigs = [];
-    var services = [];
-
-    App.config.get('preDefinedServiceConfigs').forEach(function (serviceConfig) {
-      var serviceName = serviceConfig.get('serviceName');
-      if (allSelectedServiceNames.contains(serviceName) || serviceName === 'MISC') {
-        if (!installedServiceNames.contains(serviceName) || serviceName === 'MISC') {
-          serviceConfig.set('showConfig', true);
-        }
-        services.push(serviceConfig);
+    var configsByService = {}, dependencies = this.get('configDependencies');
+
+    stepConfigs.forEach(function (service) {
+      if (!configsByService[service.get('serviceName')])  {
+        configsByService[service.get('serviceName')] = service.get('configs');
       }
-    });
-    services.forEach(function (service) {
-      var configsByService = [];
-      var dependencies = {};
-      var serviceConfigs = [];
+      if (['addServiceController', 'installerController'].contains(this.get('wizardController.name'))) {
+        this.addHostNamesToConfigs(service, localDB.masterComponentHosts, localDB.slaveComponentHosts);
+      }
+    }, this);
 
-      configs.forEach(function (config) {
-        if (config.serviceName === service.get('serviceName')) {
-          serviceConfigs.push(config);
-        }
-        if (config.filename === 'hive-site.xml' && config.name === 'hive.metastore.uris') {
-          dependencies['hive.metastore.uris'] = config.recommendedValue;
-        }
-        if (config.filename === 'zoo.cfg.xml' && config.name === 'clientPort') {
-          dependencies['clientPort'] = config.recommendedValue;
-        }
-      }, this);
-      serviceConfigs.forEach(function (_config) {
+    configs.forEach(function (_config) {
+      if (configsByService[_config.serviceName]) {
         var serviceConfigProperty = App.ServiceConfigProperty.create(_config);
         this.updateHostOverrides(serviceConfigProperty, _config);
-        if (!storedConfigs && !serviceConfigProperty.get('hasInitialValue')) {
+        if (this.get('wizardController.name') === 'addServiceController') {
+          this._updateIsEditableFlagForConfig(serviceConfigProperty, true);
+        }
+        if (!this.get('content.serviceConfigProperties.length') && !serviceConfigProperty.get('hasInitialValue')) {
           App.ConfigInitializer.initialValue(serviceConfigProperty, localDB, dependencies);
         }
         serviceConfigProperty.validate();
-        configsByService.pushObject(serviceConfigProperty);
-      }, this);
-      var serviceConfig = App.config.createServiceConfig(service.get('serviceName'));
-      serviceConfig.set('showConfig', service.get('showConfig'));
-      serviceConfig.set('configs', configsByService);
-      if (['addServiceController', 'installerController'].contains(this.get('wizardController.name'))) {
-        this.addHostNamesToConfigs(serviceConfig, localDB.masterComponentHosts, localDB.slaveComponentHosts);
+        configsByService[_config.serviceName].pushObject(serviceConfigProperty);
       }
-      renderedServiceConfigs.push(serviceConfig);
     }, this);
-    return renderedServiceConfigs;
+    return stepConfigs;
   },
 
   /**
    * Add host name properties to appropriate categories (for installer and add service)
-   * @param serviceConfig
-   * @param masterComponents
-   * @param slaveComponents
+   *
+   * @param {Object} serviceConfig
+   * @param {Object[]} masterComponents - info from localStorage
+   * @param {Object[]} slaveComponents - info from localStorage
    */
   addHostNamesToConfigs: function(serviceConfig, masterComponents, slaveComponents) {
     serviceConfig.get('configCategories').forEach(function(c) {
       if (c.showHost) {
         var value = [];
         var componentName = c.name;
-        var masters = masterComponents.filterProperty('component', componentName);
+        var masters = masterComponents && masterComponents.filterProperty('component', componentName);
         if (masters.length) {
           value = masters.mapProperty('hostName');
         } else {
-          var slaves = slaveComponents.findProperty('componentName', componentName);
+          var slaves = slaveComponents && slaveComponents.findProperty('componentName', componentName);
           if (slaves) {
             value = slaves.hosts.mapProperty('hostName');
           }
@@ -991,6 +1000,8 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
       configsMap[configSite.type] = configSite.properties || {};
     });
     var allConfigs = configs.filter(function (_config) {
+      // filter out alert_notification configs on add service //TODO find better place for this!
+      if (_config.filename === 'alert_notification') return false;
       if ((['MISC'].concat(installedServiceNames).contains(_config.serviceName))) {
         var type = _config.filename ? App.config.getConfigTagFromFileName(_config.filename) : null;
         var mappedConfigValue = type && configsMap[type] ? configsMap[type][_config.name] : null;
@@ -1003,13 +1014,14 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
           }
           _config.value = App.config.formatPropertyValue(_config, mappedConfigValue);
           _config.hasInitialValue = true;
+          this.updateDependencies(_config);
           delete configsMap[type][_config.name];
           return true;
         }
       } else {
         return true;
       }
-    });
+    }, this);
     //add user properties
     Em.keys(configsMap).forEach(function (filename) {
       Em.keys(configsMap[filename]).forEach(function (propertyName) {
@@ -1026,6 +1038,19 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
     return allConfigs;
   },
 
+  /**
+   * update dependencies according to current config value
+   *
+   * @param config
+   */
+  updateDependencies: function(config) {
+    if (config.name === 'hive.metastore.uris' && config.filename === 'hive-site.xml') {
+      this.get('configDependencies')['hive.metastore.uris'] = config.savedValue;
+    } else if (config.name === 'clientPort' && config.filename === 'hive-site.xml') {
+      this.get('configDependencies')['clientPort'] = config.savedValue;
+    }
+  },
+
   /**
    * Add group ids to <code>groupsToDelete</code>
    * Also save <code>groupsToDelete</code> to local storage
@@ -1207,32 +1232,6 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
     App.router.get('manageConfigGroupsController').manageConfigurationGroups(this);
   },
 
-  /**
-   * Make some configs visible depending on active services
-   * @method activateSpecialConfigs
-   */
-  activateSpecialConfigs: function () {
-    if (this.get('addMiscTabToPage')) {
-      var serviceToShow = this.get('selectedServiceNames').concat('MISC');
-      var miscConfigs = this.get('stepConfigs').findProperty('serviceName', 'MISC').configs;
-      if (this.get('wizardController.name') == "addServiceController") {
-        miscConfigs.findProperty('name', 'smokeuser').set('isEditable', false);
-        miscConfigs.findProperty('name', 'user_group').set('isEditable', false);
-        if (this.get('content.smokeuser')) {
-          miscConfigs.findProperty('name', 'smokeuser').set('value', this.get('content.smokeuser'));
-        }
-        if (this.get('content.group')) {
-          miscConfigs.findProperty('name', 'user_group').set('value', this.get('content.group'));
-        }
-      }
-    }
-    var wizardController = this.get('wizardController');
-    if (wizardController.get('name') === "kerberosWizardController")  {
-      var kerberosConfigs =  this.get('stepConfigs').findProperty('serviceName', 'KERBEROS').configs;
-      kerberosConfigs.findProperty('name', 'kdc_type').set('value', wizardController.get('content.kerberosOption'));
-    }
-  },
-
   /**
    * Check whether hive New MySQL database is on the same host as Ambari server MySQL server
    * @return {$.ajax|null}

+ 1 - 1
ambari-web/app/data/HDP2/site_properties.js

@@ -1846,7 +1846,7 @@ var hdp2properties = [
     "filename": "storm-env.xml",
     "index": 12
   }
-].concat(require('data/HDP2/alert_notification')).concat(require('data/HDP2/gluster_fs_properties'));
+].concat(require('data/HDP2/gluster_fs_properties'));
 
 if (App.get('isHadoopWindowsStack')) {
   var excludedWindowsConfigs = [

+ 1 - 2
ambari-web/app/mappers.js

@@ -24,7 +24,7 @@ require('mappers/stack_version_mapper');
 require('mappers/configs/themes_mapper');
 require('mappers/configs/stack_config_properties_mapper');
 require('mappers/configs/config_groups_mapper');
-require('mappers/configs/config_versions_mapper');
+require('mappers/configs/service_config_version_mapper');
 require('mappers/repository_version_mapper');
 require('mappers/hosts_mapper');
 require('mappers/cluster_mapper');
@@ -35,7 +35,6 @@ require('mappers/service_metrics_mapper');
 require('mappers/target_cluster_mapper');
 require('mappers/component_config_mapper');
 require('mappers/components_state_mapper');
-require('mappers/service_config_version_mapper');
 require('mappers/alert_definitions_mapper');
 require('mappers/alert_definition_summary_mapper');
 require('mappers/alert_instances_mapper');

+ 0 - 143
ambari-web/app/mappers/configs/config_versions_mapper.js

@@ -1,143 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-App.configVersionsMapper = App.QuickDataMapper.create({
-  model: App.ConfigVersion,
-  propertyModel: App.ConfigProperty,
-  config: {
-    service_name: 'service_name',
-    service_id: 'service_name',
-    version: "service_config_version",
-    create_time: 'createtime',
-    group_id: 'group_id',
-    group_name: 'group_name',
-    hosts: 'hosts',
-    author: 'user',
-    notes: 'service_config_version_note',
-    is_current: 'is_current',
-    index: 'index',
-    is_for_compare: 'is_for_compare'
-  },
-
-  map: function (json, isForCompare) {
-    console.time("App.configVersionsMapper execution time");
-    var configVersions = [];
-    var itemIds = {};
-    var serviceToHostMap = {};
-    var requestedProperties = [];
-
-    if (json && json.items) {
-      json.items.forEach(function (item, index) {
-        var parsedItem = this.parseIt(item, this.get('config'));
-        parsedItem.id = parsedItem.service_name + '_' + parsedItem.version;
-        parsedItem.is_requested = true;
-        itemIds[parsedItem.id] = true;
-        parsedItem.index = index;
-        parsedItem.config_properties = [];
-        parsedItem.is_for_compare = Boolean(isForCompare);
-
-        if (serviceToHostMap[item.service_name]) {
-          serviceToHostMap[item.service_name] = serviceToHostMap[item.service_name].concat(item.hosts);
-        } else {
-          serviceToHostMap[item.service_name] = item.hosts;
-        }
-
-        /**
-         * parsing config properties for config version
-         * @type {Array}
-         */
-        var properties = [];
-        if (item.configurations) {
-          item.configurations.forEach(function(config) {
-            var type = config.type;
-            var properties_array = Object.keys(config.properties);
-            for (var i = 0; i < properties_array.length; i++) {
-              var key = properties_array[i];
-
-              var property = {
-                id: key  + '_' + type + '_' + item.service_config_version,
-                name: key,
-                file_name: App.config.getOriginalFileName(type),
-                config_version_id: parsedItem.id,
-                stack_config_property_id: key  + '_' + type
-              };
-              property.value = property.recommended_value = config.properties[key];
-              property.is_final = property.recommended_is_final = !!item.properties_attributes && item.properties_attributes.final[key] === "true";
-
-              properties.push(property);
-              requestedProperties.push(property.id);
-            }
-          }, this);
-        }
-        parsedItem.config_properties = parsedItem.config_properties.concat(properties.mapProperty('id'));
-
-        App.store.loadMany(this.get('propertyModel'), properties);
-
-        configVersions.push(parsedItem);
-      }, this);
-
-      this.get('model').find().forEach(function (item) {
-        if (!itemIds[item.get('id')]) {
-          item.set('isRequested', false);
-        }
-      });
-      var itemTotal = parseInt(json.itemTotal);
-      if (!isNaN(itemTotal)) {
-        App.router.set('mainConfigHistoryController.filteredCount', itemTotal);
-      }
-
-      /**
-       * this code sets hostNames for default config group
-       * by excluding hostNames that belongs to not default groups
-       * from list of all hosts
-       */
-      Object.keys(serviceToHostMap).forEach(function(sName) {
-        var defaultHostNames = App.get('allHostNames');
-        for (var i = 0; i < serviceToHostMap[sName].length; i++) {
-          defaultHostNames = defaultHostNames.without(serviceToHostMap[sName][i]);
-        }
-        var defVer = configVersions.find(function(v) {
-          return v.is_current && v.group_id == -1 && v.service_name == sName;
-        });
-        if (defVer) {
-          defVer.hosts = defaultHostNames;
-        }
-      });
-      App.store.commit();
-      App.store.loadMany(this.get('model'), configVersions);
-
-      this.deleteUnusedProperties(requestedProperties);
-    }
-    console.timeEnd("App.configVersionsMapper execution time");
-  },
-
-
-  /**
-   * delete unused Properties
-   * @param requestedProperties
-   */
-  deleteUnusedProperties: function(requestedProperties) {
-    App.ConfigProperty.find().filterProperty('id').forEach(function(p) {
-      if (!requestedProperties.contains(p.get('id'))) {
-        this.deleteRecord(p);
-      }
-    }, this);
-  }
-});

+ 0 - 0
ambari-web/app/mappers/service_config_version_mapper.js → ambari-web/app/mappers/configs/service_config_version_mapper.js


+ 1 - 1
ambari-web/app/mappers/configs/stack_config_properties_mapper.js

@@ -86,7 +86,7 @@ App.stackConfigPropertiesMapper = App.QuickDataMapper.create({
           var attributes = config.StackConfigurations.property_value_attributes;
           if (attributes) {
             config.is_required = !attributes.empty_value_valid;
-            config.is_reconfigurable = !attributes.editable_only_at_install;
+            config.is_reconfigurable = !(attributes.editable_only_at_install || config.StackConfigurations.type === 'cluster-env.xml');
             config.is_editable = !attributes.read_only;
             config.is_required_by_agent = !attributes.ui_only_property;
           }

+ 0 - 1
ambari-web/app/mixins/common/serverValidator.js

@@ -121,7 +121,6 @@ App.ServerValidatorMixin = Em.Mixin.create({
    * @returns {*}
    */
   loadServerSideConfigsRecommendations: function() {
-    var self = this;
     // if extended controller doesn't support recommendations ignore this call but keep promise chain
     if (!this.get('isControllerSupportsEnhancedConfigs')) {
       return $.Deferred().resolve().promise();

+ 0 - 1
ambari-web/app/models.js

@@ -64,7 +64,6 @@ require('models/configs/theme/theme_condition');
 require('models/configs/service_config_version');
 require('models/configs/stack_config_property');
 require('models/configs/config_group');
-require('models/configs/config_version');
 require('models/configs/theme/tab');
 require('models/configs/theme/section');
 require('models/configs/theme/sub_section');

+ 0 - 236
ambari-web/app/models/configs/config_property.js

@@ -1,236 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-App.ConfigProperty = DS.Model.extend({
-
-  /**
-   * id is consist of property <code>name<code>+<code>fileName<code>+<code>configVersion.version<code>
-   */
-  id: DS.attr('string'),
-
-  /**
-   * config property name
-   * @property {string}
-   */
-  name: DS.attr('string'),
-
-  /**
-   * config property name
-   * @property {string}
-   */
-  fileName: DS.attr('string'),
-
-  /**
-   * value of property
-   * by default is same as <code>savedValue<code>
-   * @property {string}
-   */
-  value: DS.attr('string'),
-
-  /**
-   * saved value of property
-   * @property {string}
-   */
-  savedValue: DS.attr('string'),
-
-  /**
-   * recommended value of property
-   * that is returned from server
-   * @property {string}
-   */
-  recommendedValue: DS.attr('string'),
-
-  /**
-   * defines if property is final
-   * @property {boolean}
-   */
-  isFinal: DS.attr('boolean', {defaultValue: false}),
-
-
-  /**
-   * value saved on cluster
-   */
-  savedIsFinal: DS.attr('boolean', {defaultValue: false}),
-
-  /**
-   * value recommendedFrom Server
-   * @property {boolean}
-   */
-  recommendedIsFinal: DS.attr('boolean', {defaultValue: false}),
-
-  /**
-   * link to config version
-   * @property {App.ConfigVersion}
-   */
-  configVersion: DS.belongsTo('App.ConfigVersion'),
-
-  /**
-   * link to config version
-   * from this model we can get all static info about property
-   * @property {App.ConfigVersion}
-   */
-  stackConfigProperty: DS.belongsTo('App.StackConfigProperty'),
-
-  /**
-   * defines if property should be visible for user
-   * all properties that has <code>isVisible<code> false will be present in model
-   * and saved but will be hidden from user
-   * @property {boolean}
-   */
-  isVisible: DS.attr('boolean', {defaultValue: true}),
-
-  /**
-   * defines if property value is required
-   * in case user enter empty value error will be shown
-   * @property {boolean}
-   */
-  isRequired: DS.attr('boolean', {defaultValue: true}),
-
-  /**
-   * defines if property can be edited by user
-   * @property {boolean}
-   */
-  isEditable: DS.attr('boolean', {defaultValue: true}),
-
-  /**
-   * opposite to <code>isEditable<code> property
-   * @property {boolean}
-   */
-  isNotEditable: Ember.computed.not('isEditable'),
-
-  /**
-   * defines if property can contain overriden values
-   * @property {boolean}
-   */
-  isOverridable: DS.attr('boolean', {defaultValue: true}),
-
-  /**
-   * defines if property is used for security
-   * @property {boolean}
-   */
-  isSecureConfig: DS.attr('boolean', {defaultValue: false}),
-
-  /**
-   * if false - don't save property
-   * @property {boolean}
-   */
-  isRequiredByAgent: DS.attr('boolean', {defaultValue: true}),
-
-  /**
-   * if true - property is not saved
-   * used for properties added by user
-   * @property {boolean}
-   */
-  isNotSaved: DS.attr('boolean', {defaultValue: false}),
-
-  /**
-   * if true - don't show property
-   * @property {boolean}
-   */
-  isHiddenByFilter: DS.attr('boolean', {defaultValue: false}),
-
-  /**
-   * properties with this flag set to false will not be saved
-   * @property {boolean}
-   */
-  saveRecommended: DS.attr('boolean', {defaultValue: true}),
-
-  /**
-   * Don't show "Undo" for hosts on Installer Step7
-   * if value is true
-   * @property {boolean}
-   */
-  cantBeUndone: DS.attr('boolean', {defaultValue: false}),
-
-  /**
-   * error message; by default is empty
-   * if value is not correct or missing for required property
-   * this will contain error message
-   * @property {string}
-   */
-  errorMessage: DS.attr('string', {defaultValue: ''}),
-
-  /**
-   * warning message; by default is empty
-   * if value is out of recommended range
-   * this will contain warning message
-   * @property {string}
-   */
-  warnMessage: DS.attr('string', {defaultValue: ''}),
-
-  /**
-   * defines if property has errors
-   * @type {boolean}
-   */
-  hasErrors: Em.computed.notEqual('errorMessage', ''),
-
-  /**
-   * defines if property has warnings
-   * @type {boolean}
-   */
-  hasWarnings: Em.computed.notEqual('warnMessage', ''),
-
-  /**
-   * defines if property belongs to default config group
-   * if true it's config group is default
-   * @type {boolean}
-   */
-  isOriginalSCP: Em.computed.alias('configVersion.isDefault'),
-
-  /**
-   * defines if property is added by user
-   * @property {boolean}
-   */
-  isUserProperty: function() {
-    return Em.isNone(this.get('stackConfigProperty'));
-  }.property('stackConfigProperty'),
-
-  /**
-   * defines if this property is belongs to version
-   * with which we make comparison
-   * @property {boolean}
-   */
-  isForCompare: Em.computed.alias('configVersion.isForCompare'),
-
-  /**
-   * if this property can be final
-   * @property {boolean}
-   */
-  supportsFinal: Em.computed.or('stackConfigProperty.supportsFinal', 'isUserProperty'),
-  /**
-   * Indicates when value is not the default value.
-   * Returns false when there is no default value.
-   * @type {boolean}
-   */
-  isNotDefaultValue: function () {
-    return this.get('isEditable')
-      && (!Em.isNone(this.get('savedValue') && this.get('value') !== this.get('savedValue'))
-      || (this.get('supportsFinal') && !Em.isNone(this.get('savedIsFinal')) && this.get('isFinal') !== this.get('savedIsFinal')));
-  }.property('value', 'savedValue', 'isEditable', 'isFinal', 'savedIsFinal'),
-
-  /**
-   * opposite to <code>hasErrors<code>
-   */
-  isValid: Ember.computed.not('hasErrors')
-});
-
-
-App.ConfigProperty.FIXTURES = [];
-

+ 0 - 34
ambari-web/app/models/configs/config_version.js

@@ -1,34 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-var App = require('app');
-
-App.ConfigVersion = App.ServiceConfigVersion.extend({
-  configProperties: DS.hasMany('App.ConfigProperty'),
-
-  /**
-   * this flag is true when we compare some version with
-   * this config version
-   * this flag make influence on displaying properties
-   * @property {boolean} [isForCompare=false]
-   */
-  isForCompare: DS.attr('boolean', {defaultValue: false})
-});
-
-App.ConfigVersion.FIXTURES = [];

+ 1 - 1
ambari-web/app/models/configs/stack_config_property.js

@@ -17,7 +17,7 @@
  */
 
 var App = require('app');
-
+//TODO delete this file soon
 App.StackConfigProperty = DS.Model.extend({
   /**
    * id is consist of property <code>name<code>+<code>fileName<code>

+ 4 - 2
ambari-web/app/models/stack_service.js

@@ -211,9 +211,11 @@ App.StackService.configCategories = function () {
   var serviceConfigCategories = [];
   switch (this.get('serviceName')) {
     case 'HDFS':
+      serviceConfigCategories.pushObject(App.ServiceConfigCategory.create({ name: 'NAMENODE', displayName: 'NameNode', showHost: true}));
+      if (!App.get('isHaEnabled')) {
+        serviceConfigCategories.pushObject(App.ServiceConfigCategory.create({ name: 'SECONDARY_NAMENODE', displayName: 'Secondary NameNode', showHost: true}));
+      }
       serviceConfigCategories.pushObjects([
-        App.ServiceConfigCategory.create({ name: 'NAMENODE', displayName: 'NameNode', showHost: true}),
-        App.ServiceConfigCategory.create({ name: 'SECONDARY_NAMENODE', displayName: 'Secondary NameNode', showHost: true}),
         App.ServiceConfigCategory.create({ name: 'DATANODE', displayName: 'DataNode', showHost: true}),
         App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
         App.ServiceConfigCategory.create({ name: 'NFS_GATEWAY', displayName: 'NFS Gateway', showHost: true})

+ 3 - 67
ambari-web/app/utils/config.js

@@ -225,7 +225,6 @@ App.config = Em.Object.create({
    */
   mergePredefinedWithSaved: function (configGroups, serviceName, selectedConfigGroup, canEdit) {
     var configs = [];
-    var serviceByConfigTypeMap = this.get('serviceByConfigTypeMap');
 
     configGroups.forEach(function (siteConfig) {
       var filename = App.config.getOriginalFileName(siteConfig.type);
@@ -526,9 +525,9 @@ App.config = Em.Object.create({
   /**
    * create new ServiceConfig object by service name
    * @param {string} serviceName
-   * @param {App.ServiceConfigGroup[]} configGroups
-   * @param {App.ServiceConfigProperty[]} configs
-   * @param {Number} initConfigsLength
+   * @param {App.ServiceConfigGroup[]} [configGroups]
+   * @param {App.ServiceConfigProperty[]} [configs]
+   * @param {Number} [initConfigsLength]
    * @return {App.ServiceConfig}
    * @method createServiceConfig
    */
@@ -602,69 +601,6 @@ App.config = Em.Object.create({
     return configTypesInfo;
   },
 
-  /**
-   * Get properties from server by type and tag with properties, that belong to group
-   * push them to common {serviceConfigs} and call callback function
-   */
-  loadServiceConfigGroupOverrides: function (serviceConfigs, loadedGroupToOverrideSiteToTagMap, configGroups, callback, sender) {
-    var configKeyToConfigMap = {};
-    serviceConfigs.forEach(function (item) {
-      if (!configKeyToConfigMap[item.filename]) {
-        configKeyToConfigMap[item.filename] = {};
-      }
-      configKeyToConfigMap[item.filename][item.name] = item;
-    });
-    var typeTagToGroupMap = {};
-    var urlParams = [];
-    for (var group in loadedGroupToOverrideSiteToTagMap) {
-      var overrideTypeTags = loadedGroupToOverrideSiteToTagMap[group];
-      for (var type in overrideTypeTags) {
-        var tag = overrideTypeTags[type];
-        typeTagToGroupMap[type + "///" + tag] = configGroups.findProperty('name', group);
-        urlParams.push('(type=' + type + '&tag=' + tag + ')');
-      }
-    }
-    var params = urlParams.join('|');
-    if (urlParams.length) {
-      App.ajax.send({
-        name: 'config.host_overrides',
-        sender: this,
-        data: {
-          params: params,
-          configKeyToConfigMap: configKeyToConfigMap,
-          typeTagToGroupMap: typeTagToGroupMap,
-          callback: callback,
-          sender: sender,
-          serviceConfigs: serviceConfigs
-        },
-        success: 'loadServiceConfigGroupOverridesSuccess'
-      });
-    } else {
-      callback.call(sender, serviceConfigs);
-    }
-  },
-
-  loadServiceConfigGroupOverridesSuccess: function (data, opt, params) {
-    data.items.forEach(function (config) {
-      var group = params.typeTagToGroupMap[config.type + "///" + config.tag];
-      var properties = config.properties;
-      for (var prop in properties) {
-        var fileName = this.getOriginalFileName(config.type);
-        var serviceConfig = !!params.configKeyToConfigMap[fileName] ? params.configKeyToConfigMap[fileName][prop] : false;
-        var hostOverrideValue = this.formatPropertyValue(serviceConfig, properties[prop]);
-        var hostOverrideIsFinal = !!(config.properties_attributes && config.properties_attributes.final && config.properties_attributes.final[prop]);
-        if (serviceConfig) {
-          // Value of this property is different for this host.
-          if (!Em.get(serviceConfig, 'overrides')) Em.set(serviceConfig, 'overrides', []);
-          serviceConfig.overrides.pushObject({value: hostOverrideValue, group: group, isFinal: hostOverrideIsFinal});
-        } else {
-          params.serviceConfigs.push(this.createCustomGroupConfig(prop, config, group));
-        }
-      }
-    }, this);
-    params.callback.call(params.sender, params.serviceConfigs);
-  },
-
   /**
    * Create config with non default config group. Some custom config properties
    * can be created and assigned to non-default config group.

+ 20 - 1
ambari-web/app/utils/configs/config_initializer.js

@@ -265,6 +265,7 @@ App.ConfigInitializer = App.ConfigInitializerClass.create({
   },
 
   uniqueInitializers: {
+    'hadoop.registry.rm.enabled': '_setYarnSliderDependency',
     'ranger_admin_password': '_setRangerAdminPassword',
     'hive_database': '_initHiveDatabaseValue',
     'templeton.hive.properties': '_initTempletonHiveProperties',
@@ -298,7 +299,7 @@ App.ConfigInitializer = App.ConfigInitializerClass.create({
 
   /**
    * Some strange method that should define <code>ranger_admin_password</code>
-   * TODO DELETE as soon as <code>ranger_admin_password</code> will be defined in stack!
+   * TODO DELETE as soon as <code>ranger_admin_password</code> will be fetched from stack adviser!
    *
    * @param {configProperty} configProperty
    * @private
@@ -309,6 +310,24 @@ App.ConfigInitializer = App.ConfigInitializerClass.create({
     return configProperty;
   },
 
+
+  /**
+   * Set specific config for YARN that depends on SLIDER.
+   * TODO DELETE as soon as <code>hadoop.registry.rm.enabled</code> will be fetched from stack adviser!
+   *
+   * @param configProperty
+   * @param localDb
+   * @param dependencies
+   * @private
+   */
+  _setYarnSliderDependency: function(configProperty, localDb, dependencies) {
+    var res = (!!dependencies.sliderSelected).toString();
+    if (Em.get(configProperty, 'value') !== res) {
+      Em.set(configProperty, 'recommendedValue', res);
+      Em.set(configProperty, 'value', res);
+    }
+  },
+
   /**
    * Initializer for configs with value equal to hostName with needed component
    * Value example: 'hostName'

+ 2 - 2
ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js

@@ -67,7 +67,7 @@ describe('App.KerberosWizardStep4Controller', function() {
       sinon.stub(App.Service, 'find').returns(Em.A([
         { serviceName: 'HDFS' }
       ]));
-      sinon.stub(App.config, 'get').withArgs('preDefinedSiteProperties').returns([
+      sinon.stub(App.configsCollection, 'getAll').returns([
         {
           name: 'hadoop.security.auth_to_local',
           displayType: 'multiLine'
@@ -79,7 +79,7 @@ describe('App.KerberosWizardStep4Controller', function() {
 
     after(function() {
       App.Service.find.restore();
-      App.config.get.restore();
+      App.configsCollection.getAll.restore();
       App.router.get.restore();
     });
 

+ 2 - 2
ambari-web/test/controllers/main/admin/kerberos_test.js

@@ -56,7 +56,7 @@ describe('App.MainAdminKerberosController', function() {
     });
 
     it('should take displayType from predefinedSiteProperties', function () {
-      sinon.stub(App.config, 'get').withArgs('preDefinedSiteProperties').returns([
+      sinon.stub(App.configsCollection, 'getAll').returns([
         {
           name: 'hadoop.security.auth_to_local',
           displayType: 'multiLine'
@@ -68,7 +68,7 @@ describe('App.MainAdminKerberosController', function() {
           serviceName: 'HDFS'
         })
       ])[0].get('displayType')).to.equal('multiLine');
-      App.config.get.restore();
+      App.configsCollection.getAll.restore();
     });
   });
 

+ 0 - 82
ambari-web/test/controllers/main/admin/serviceAccounts_controller_test.js

@@ -25,88 +25,6 @@ describe('App.MainAdminServiceAccountsController', function () {
 
   var controller = App.MainAdminServiceAccountsController.create();
 
-  describe('#setContentProperty()', function () {
-    var testCases = [
-      {
-        title: 'key is null',
-        content: {
-          key: null,
-          configName: 'cc',
-          miscConfigs: []
-        },
-        result: {
-          output: false,
-          configValue: 'test'
-        }
-      },
-      {
-        title: 'configName is null',
-        content: {
-          key: 'key',
-          configName: null,
-          miscConfigs: []
-        },
-        result: {
-          output: false,
-          configValue: 'test'
-        }
-      },
-      {
-        title: 'misc configs array doesn\'t contain such a config',
-        content: {
-          key: 'key',
-          configName: 'config1',
-          miscConfigs: []
-        },
-        result: {
-          output: false,
-          configValue: 'test'
-        }
-      },
-      {
-        title: 'content doesn\'t contain such a key',
-        content: {
-          key: 'key',
-          configName: 'config1',
-          miscConfigs: [
-            Em.Object.create({
-              name: 'test_key'
-            })
-          ]
-        },
-        result: {
-          output: false,
-          configValue: 'test'
-        }
-      },
-      {
-        title: 'content property match config',
-        content: {
-          key: 'testKey',
-          configName: 'test_key',
-          miscConfigs: [
-            Em.Object.create({
-              name: 'test_key',
-              value: 'testValue'
-            })
-          ]
-        },
-        result: {
-          output: true,
-          configValue: 'testValue'
-        }
-      }
-    ];
-    controller.set('content', Em.Object.create({testKey: 'test'}));
-    testCases.forEach(function (test) {
-      it(test.title, function () {
-        var content = controller.get('content');
-        expect(controller.setContentProperty(test.content.key, test.content.configName, test.content.miscConfigs)).to.equal(test.result.output);
-        expect(content.get('testKey')).to.equal(test.result.configValue);
-      });
-    });
-  });
-
   describe('#sortByOrder()', function () {
     var testCases = [
       {

+ 4 - 229
ambari-web/test/controllers/wizard/step7_test.js

@@ -343,149 +343,6 @@ describe('App.InstallerStep7Controller', function () {
     });
   });
 
-  describe('#activateSpecialConfigs', function () {
-    var expected = [{
-       "smokeuser": {
-         "isEditable": true
-       },
-       "group": {
-         "isEditable": true
-       },
-       "services": [
-         {
-           "serviceName": "s1",
-           "isSelected": true,
-           "isInstalled": false
-         },
-         {
-           "serviceName": "s2",
-           "isSelected": false,
-           "isInstalled": false
-         },
-         {
-           "serviceName": "s3",
-           "isSelected": true,
-           "isInstalled": true
-         },
-         {
-           "serviceName": "s4",
-           "isSelected": false,
-           "isInstalled": false
-         },
-         {
-           "serviceName": "s5",
-           "isSelected": true,
-           "isInstalled": false
-         },
-         {
-           "serviceName": "s6",
-           "isSelected": false,
-           "isInstalled": false
-         },
-         {
-           "serviceName": "s7",
-           "isSelected": true,
-           "isInstalled": true
-         },
-         {
-           "serviceName": "s8",
-           "isSelected": false,
-           "isInstalled": false
-         }
-       ]
-      },[
-        {
-          "serviceName": "MISC",
-          "configs": [
-            {
-              "name": "smokeuser",
-              "value": {
-                "isEditable": true
-              },
-              "isEditable": false
-            },
-            {
-              "name": "user_group",
-              "value": {
-                "isEditable": true
-              },
-              "isEditable": false
-            },
-            {
-              "name": "kdc_type"
-            }
-          ]
-        },
-        {
-          "serviceName": "KERBEROS",
-          "configs": [
-            {
-              "name": "smokeuser",
-              "value": {
-                "isEditable": true
-              },
-              "isEditable": false
-            },
-            {
-              "name": "user_group",
-              "value": {
-                "isEditable": true
-              },
-              "isEditable": false
-            },
-            {
-              "name": "kdc_type"
-            }
-          ]
-        }
-      ]];
-      var allSelectedServiceNames = ['SLIDER', 'YARN'];
-      var configs = Em.A([Em.Object.create({
-        name: 'smokeuser',
-        value: ''
-      }),Em.Object.create({
-        name: 'user_group',
-        value: ''
-      }),Em.Object.create({
-        name: 'kdc_type',
-        value: ''
-      })]);
-      var stepConfigs = Em.A([Em.Object.create({serviceName: 'MISC', configs: configs}),
-                              Em.Object.create({serviceName: 'KERBEROS', configs: configs})]);
-      var content = Em.Object.create({
-        smokeuser: Em.Object.create({isEditable: true}),
-        group: Em.Object.create({isEditable: true}),
-        services: Em.A([
-          Em.Object.create({isSelected: true, isInstalled: false, serviceName: 's1'}),
-          Em.Object.create({isSelected: false, isInstalled: false, serviceName: 's2'}),
-          Em.Object.create({isSelected: true, isInstalled: true, serviceName: 's3'}),
-          Em.Object.create({isSelected: false, isInstalled: false, serviceName: 's4'}),
-          Em.Object.create({isSelected: true, isInstalled: false, serviceName: 's5'}),
-          Em.Object.create({isSelected: false, isInstalled: false, serviceName: 's6'}),
-          Em.Object.create({isSelected: true, isInstalled: true, serviceName: 's7'}),
-          Em.Object.create({isSelected: false, isInstalled: false, serviceName: 's8'})
-        ])
-      });
-    it('should return configs with true value', function () {
-      installerStep7Controller.set('wizardController', Em.Object.create(App.LocalStorage, {name: 'addServiceController'}));
-      installerStep7Controller.set('addMiscTabToPage',true);
-      installerStep7Controller.reopen({allSelectedServiceNames: allSelectedServiceNames});
-      installerStep7Controller.set('stepConfigs', stepConfigs);
-      installerStep7Controller.set('content', content);
-      installerStep7Controller.activateSpecialConfigs();
-      expect(JSON.parse(JSON.stringify(installerStep7Controller.get('content')))).to.be.eql(expected[0]);
-    });
-    it('should return stepsConfigs with true value', function () {
-      installerStep7Controller.set('wizardController', Em.Object.create(App.LocalStorage, {name: 'kerberosWizardController'}));
-      installerStep7Controller.set('addMiscTabToPage',true);
-      installerStep7Controller.reopen({allSelectedServiceNames: allSelectedServiceNames});
-      installerStep7Controller.set('stepConfigs', stepConfigs);
-      installerStep7Controller.set('content', content);
-      installerStep7Controller.activateSpecialConfigs();
-      expect(JSON.parse(JSON.stringify(installerStep7Controller.get('stepConfigs')))).to.be.eql(expected[1]);
-    });
-  });
-
   describe('#getConfigTagsSuccess', function () {
     beforeEach(function(){
       sinon.stub(App.StackService, 'find', function () {
@@ -652,68 +509,6 @@ describe('App.InstallerStep7Controller', function () {
     });
   });
 
-  describe('#resolveYarnConfigs', function () {
-    it('should set property to true', function () {
-      var allSelectedServiceNames = ['SLIDER', 'YARN'],
-        configs = [
-          {name: 'hadoop.registry.rm.enabled', value: 'false', recommendedValue: 'false'}
-        ],
-        expected = [
-          {name: 'hadoop.registry.rm.enabled', value: 'true', recommendedValue: 'true'}
-        ];
-      installerStep7Controller.reopen({allSelectedServiceNames: allSelectedServiceNames});
-      installerStep7Controller.resolveYarnConfigs(configs);
-      expect(configs[0]).to.eql(expected[0]);
-    });
-
-    it('should set property to false', function () {
-      var allSelectedServiceNames = ['YARN'],
-        configs = [
-          {name: 'hadoop.registry.rm.enabled', value: 'true', recommendedValue: 'true'}
-        ],
-        expected = [
-          {name: 'hadoop.registry.rm.enabled', value: 'false', recommendedValue: 'false'}
-        ];
-      installerStep7Controller.reopen({allSelectedServiceNames: allSelectedServiceNames});
-      installerStep7Controller.resolveYarnConfigs(configs);
-      expect(configs[0]).to.eql(expected[0]);
-    });
-
-    it('should skip setting property', function () {
-      var allSelectedServiceNames = ['YARN', 'SLIDER'],
-        configs = [
-          {name: 'hadoop.registry.rm.enabled', value: 'true', recommendedValue: 'true'}
-        ],
-        expected = [
-          {name: 'hadoop.registry.rm.enabled', value: 'true', recommendedValue: 'true'}
-        ];
-      installerStep7Controller.reopen({allSelectedServiceNames: allSelectedServiceNames});
-      installerStep7Controller.resolveYarnConfigs(configs);
-      expect(configs[0]).to.eql(expected[0]);
-    });
-  });
-
-  describe('#resolveServiceDependencyConfigs', function () {
-    beforeEach(function () {
-      sinon.stub(installerStep7Controller, 'resolveYarnConfigs', Em.K);
-    });
-    afterEach(function () {
-      installerStep7Controller.resolveYarnConfigs.restore();
-    });
-    [
-      {serviceName: 'YARN', method: "resolveYarnConfigs"}
-    ].forEach(function(t) {
-      it("should call " + t.method + " if serviceName is " + t.serviceName, function () {
-        var configs = [
-          {},
-          {}
-        ];
-        installerStep7Controller.resolveServiceDependencyConfigs(t.serviceName, configs);
-        expect(installerStep7Controller[t.method].calledWith(configs)).to.equal(true);
-      });
-    });
-  });
-
   describe('#selectedServiceObserver', function () {
     beforeEach(function () {
       installerStep7Controller.reopen({content: {services: []}});
@@ -1250,10 +1045,7 @@ describe('App.InstallerStep7Controller', function () {
       sinon.stub(installerStep7Controller, 'clearStep', Em.K);
       sinon.stub(installerStep7Controller, 'getConfigTags', Em.K);
       sinon.stub(installerStep7Controller, 'setInstalledServiceConfigs', Em.K);
-      sinon.stub(installerStep7Controller, 'resolveServiceDependencyConfigs', Em.K);
-      sinon.stub(installerStep7Controller, 'setStepConfigs', Em.K);
       sinon.stub(installerStep7Controller, 'checkHostOverrideInstaller', Em.K);
-      sinon.stub(installerStep7Controller, 'activateSpecialConfigs', Em.K);
       sinon.stub(installerStep7Controller, 'selectProperService', Em.K);
       sinon.stub(installerStep7Controller, 'applyServicesConfigs', Em.K);
       sinon.stub(App.router, 'send', Em.K);
@@ -1263,10 +1055,7 @@ describe('App.InstallerStep7Controller', function () {
       installerStep7Controller.clearStep.restore();
       installerStep7Controller.getConfigTags.restore();
       installerStep7Controller.setInstalledServiceConfigs.restore();
-      installerStep7Controller.resolveServiceDependencyConfigs.restore();
-      installerStep7Controller.setStepConfigs.restore();
       installerStep7Controller.checkHostOverrideInstaller.restore();
-      installerStep7Controller.activateSpecialConfigs.restore();
       installerStep7Controller.selectProperService.restore();
       installerStep7Controller.applyServicesConfigs.restore();
       App.router.send.restore();
@@ -1295,14 +1084,11 @@ describe('App.InstallerStep7Controller', function () {
       sinon.stub(App.config, 'fileConfigsIntoTextarea', function(configs) {
         return configs;
       });
-      sinon.stub(installerStep7Controller, 'resolveServiceDependencyConfigs', Em.K);
       sinon.stub(installerStep7Controller, 'loadServerSideConfigsRecommendations', function() {
         return $.Deferred().resolve();
       });
       sinon.stub(installerStep7Controller, 'checkHostOverrideInstaller', Em.K);
-      sinon.stub(installerStep7Controller, 'activateSpecialConfigs', Em.K);
       sinon.stub(installerStep7Controller, 'selectProperService', Em.K);
-      sinon.stub(installerStep7Controller, 'setStepConfigs', Em.K);
       sinon.stub(App.router, 'send', Em.K);
       sinon.stub(App.StackService, 'find', function () {
         return {
@@ -1320,23 +1106,18 @@ describe('App.InstallerStep7Controller', function () {
     });
     afterEach(function () {
       App.config.fileConfigsIntoTextarea.restore();
-      installerStep7Controller.resolveServiceDependencyConfigs.restore();
       installerStep7Controller.loadServerSideConfigsRecommendations.restore();
       installerStep7Controller.checkHostOverrideInstaller.restore();
-      installerStep7Controller.activateSpecialConfigs.restore();
       installerStep7Controller.selectProperService.restore();
-      installerStep7Controller.setStepConfigs.restore();
       App.router.send.restore();
       App.StackService.find.restore();
     });
 
     it('should run some methods' , function () {
-     installerStep7Controller.applyServicesConfigs({name: 'configs'}, {name: 'storedConfigs'});
+     installerStep7Controller.applyServicesConfigs([{name: 'configs'}]);
      expect(installerStep7Controller.loadServerSideConfigsRecommendations.calledOnce).to.equal(true);
      expect(installerStep7Controller.get('isRecommendedLoaded')).to.equal(true);
-     expect(installerStep7Controller.setStepConfigs.calledOnce).to.equal(true);
      expect(installerStep7Controller.checkHostOverrideInstaller.calledOnce).to.equal(true);
-     expect(installerStep7Controller.activateSpecialConfigs.calledOnce).to.equal(true);
      expect(installerStep7Controller.selectProperService.calledOnce).to.equal(true);
     });
 
@@ -1344,25 +1125,19 @@ describe('App.InstallerStep7Controller', function () {
       {
         allSelectedServiceNames: ['YARN'],
         fileConfigsIntoTextarea: true,
-        m: 'should run fileConfigsIntoTextarea and resolveServiceDependencyConfigs',
-        resolveServiceDependencyConfigs: true
+        m: 'should run fileConfigsIntoTextarea'
       }
     ]).forEach(function(t) {
       it(t.m, function () {
         installerStep7Controller.reopen({
           allSelectedServiceNames: t.allSelectedServiceNames
         });
-        installerStep7Controller.applyServicesConfigs({name: 'configs'}, {name: 'storedConfigs'});
+        installerStep7Controller.applyServicesConfigs([{name: 'configs'}]);
         if (t.fileConfigsIntoTextarea) {
-          expect(App.config.fileConfigsIntoTextarea.calledWith({name: 'configs'}, 'capacity-scheduler.xml')).to.equal(true);
+          expect(App.config.fileConfigsIntoTextarea.calledWith([{name: 'configs'}], 'capacity-scheduler.xml')).to.equal(true);
         } else {
           expect(App.config.fileConfigsIntoTextarea.calledOnce).to.equal(false);
         }
-        if (t.resolveServiceDependencyConfigs) {
-          expect(installerStep7Controller.resolveServiceDependencyConfigs.calledWith(t.allSelectedServiceNames[0], {name: 'configs'})).to.equal(true);
-        } else {
-          expect(installerStep7Controller.resolveServiceDependencyConfigs.calledOnce).to.equal(false);
-        }
       });
     });
   });

+ 1 - 1
ambari-web/test/data/HDP2.2/site_properties_test.js

@@ -26,7 +26,7 @@ describe('hdp2SiteProperties', function () {
    * @stackProperties: All the properties that are derived from stack definition
    */
   var stackProperties = siteProperties.filter(function(item){
-    return  (!(item.isRequiredByAgent === false || item.filename === 'alert_notification' || item.category === 'Ambari Principals' || item.name === 'oozie_hostname'))
+    return  !(item.isRequiredByAgent === false || item.category === 'Ambari Principals')
   });
 
   stackProperties.forEach(function(siteProperty){

+ 1 - 2
ambari-web/test/data/HDP2.3/site_properties_test.js

@@ -26,8 +26,7 @@ describe('hdp2SiteProperties', function () {
    * @stackProperties: All the properties that are derived from stack definition
    */
   var stackProperties = siteProperties.filter(function(item){
-    return  (!(item.isRequiredByAgent === false || item.filename === 'alert_notification' || item.category === 'Ambari Principals'
-    || item.name === 'oozie_hostname'))
+    return  !(item.isRequiredByAgent === false || item.category === 'Ambari Principals')
   });
 
   stackProperties.forEach(function(siteProperty){

+ 1 - 1
ambari-web/test/data/HDP2/site_properties_test.js

@@ -26,7 +26,7 @@ describe('hdp2SiteProperties', function () {
    * @stackProperties: All the properties that are derived from stack definition
    */
   var stackProperties = siteProperties.filter(function(item){
-    return  (!(item.isRequiredByAgent === false || item.filename === 'alert_notification' || item.category === 'Ambari Principals' || item.name === 'oozie_hostname'))
+    return  !(item.isRequiredByAgent === false || item.category === 'Ambari Principals')
   });
 
   stackProperties.forEach(function(siteProperty){

+ 24 - 24
ambari-web/test/mappers/configs/config_versions_mapper_test.js → ambari-web/test/mappers/configs/service_config_version_mapper_test.js

@@ -17,9 +17,9 @@
  */
 
 var App = require('app');
-require('mappers/configs/config_versions_mapper');
+require('mappers/configs/service_config_version_mapper');
 
-describe.skip('App.configVersionsMapper', function () {
+describe.skip('App.serviceConfigVersionsMapper', function () {
 
   var allHosts = App.get('allHostNames');
   var defaultAllHosts = ['host1', 'host2', 'host3'];
@@ -76,7 +76,7 @@ describe.skip('App.configVersionsMapper', function () {
     ]};
 
     beforeEach(function () {
-      App.resetDsStoreTypeMap(App.ConfigVersion);
+      App.resetDsStoreTypeMap(App.ServiceConfigVersion);
       sinon.stub(App.store, 'commit', Em.K);
     });
     afterEach(function(){
@@ -84,34 +84,34 @@ describe.skip('App.configVersionsMapper', function () {
     });
 
     it('should not do anything as there is no json', function() {
-      App.configVersionsMapper.map(null);
-      expect(App.ConfigVersion.find().get('length')).to.equal(0);
+      App.serviceConfigVersionsMapper.map(null);
+      expect(App.ServiceConfigVersion.find().get('length')).to.equal(0);
     });
 
     it('should load data to model', function() {
-      App.configVersionsMapper.map(json);
-      expect(App.ConfigVersion.find().get('length')).to.equal(2);
-      expect(App.ConfigVersion.find().mapProperty('id')).to.eql(['SERVICE1_1','SERVICE2_4']);
+      App.serviceConfigVersionsMapper.map(json);
+      expect(App.ServiceConfigVersion.find().get('length')).to.equal(2);
+      expect(App.ServiceConfigVersion.find().mapProperty('id')).to.eql(['SERVICE1_1','SERVICE2_4']);
 
       //SERVICE1_1
-      expect(App.ConfigVersion.find('SERVICE1_1').get('createTime')).to.eql(1425979244738);
-      expect(App.ConfigVersion.find('SERVICE1_1').get('groupId')).to.eql(-1);
-      expect(App.ConfigVersion.find('SERVICE1_1').get('hosts')).to.eql(defaultAllHosts);
-      expect(App.ConfigVersion.find('SERVICE1_1').get('isCurrent')).to.be.true;
-      expect(App.ConfigVersion.find('SERVICE1_1').get('version')).to.eql(1);
-      expect(App.ConfigVersion.find('SERVICE1_1').get('notes')).to.eql("Initial configurations for SERVICE1");
-      expect(App.ConfigVersion.find('SERVICE1_1').get('serviceName')).to.eql("SERVICE1");
-      expect(App.ConfigVersion.find('SERVICE1_1').get('author')).to.eql("admin");
+      expect(App.ServiceConfigVersion.find('SERVICE1_1').get('createTime')).to.eql(1425979244738);
+      expect(App.ServiceConfigVersion.find('SERVICE1_1').get('groupId')).to.eql(-1);
+      expect(App.ServiceConfigVersion.find('SERVICE1_1').get('hosts')).to.eql(defaultAllHosts);
+      expect(App.ServiceConfigVersion.find('SERVICE1_1').get('isCurrent')).to.be.true;
+      expect(App.ServiceConfigVersion.find('SERVICE1_1').get('version')).to.eql(1);
+      expect(App.ServiceConfigVersion.find('SERVICE1_1').get('notes')).to.eql("Initial configurations for SERVICE1");
+      expect(App.ServiceConfigVersion.find('SERVICE1_1').get('serviceName')).to.eql("SERVICE1");
+      expect(App.ServiceConfigVersion.find('SERVICE1_1').get('author')).to.eql("admin");
 
       //SERVICE1_2
-      expect(App.ConfigVersion.find('SERVICE2_4').get('createTime')).to.eql(1426088137115);
-      expect(App.ConfigVersion.find('SERVICE2_4').get('groupId')).to.eql(2);
-      expect(App.ConfigVersion.find('SERVICE2_4').get('hosts')).to.eql(["host1"]);
-      expect(App.ConfigVersion.find('SERVICE2_4').get('isCurrent')).to.be.false;
-      expect(App.ConfigVersion.find('SERVICE2_4').get('version')).to.eql(4);
-      expect(App.ConfigVersion.find('SERVICE2_4').get('notes')).to.eql("");
-      expect(App.ConfigVersion.find('SERVICE2_4').get('serviceName')).to.eql("SERVICE2");
-      expect(App.ConfigVersion.find('SERVICE2_4').get('author')).to.eql("admin");
+      expect(App.ServiceConfigVersion.find('SERVICE2_4').get('createTime')).to.eql(1426088137115);
+      expect(App.ServiceConfigVersion.find('SERVICE2_4').get('groupId')).to.eql(2);
+      expect(App.ServiceConfigVersion.find('SERVICE2_4').get('hosts')).to.eql(["host1"]);
+      expect(App.ServiceConfigVersion.find('SERVICE2_4').get('isCurrent')).to.be.false;
+      expect(App.ServiceConfigVersion.find('SERVICE2_4').get('version')).to.eql(4);
+      expect(App.ServiceConfigVersion.find('SERVICE2_4').get('notes')).to.eql("");
+      expect(App.ServiceConfigVersion.find('SERVICE2_4').get('serviceName')).to.eql("SERVICE2");
+      expect(App.ServiceConfigVersion.find('SERVICE2_4').get('author')).to.eql("admin");
     });
   });
 

+ 0 - 1
ambari-web/test/mappers/configs/themes_mapper_test.js

@@ -21,7 +21,6 @@ require('mappers/configs/themes_mapper');
 require('models/configs/theme/tab');
 require('models/configs/theme/section');
 require('models/configs/theme/sub_section');
-require('models/configs/stack_config_property');
 
 describe('App.themeMapper', function () {
 

+ 0 - 66
ambari-web/test/models/configs/config_property_test.js

@@ -1,66 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-require('models/configs/config_property');
-
-var model;
-
-describe('App.ConfigProperty', function () {
-  model = App.ConfigProperty.createRecord();
-
-  describe('#hasErrors', function () {
-    it('should set hasErrors to true', function () {
-      expect(model.setProperties({'errorMessage': 'some error'}).get('hasErrors')).to.eql(true);
-    });
-    it('should set hasErrors to false', function () {
-      expect(model.setProperties({'errorMessage': ''}).get('hasErrors')).to.eql(false);
-    });
-  });
-
-  describe('#hasWarnings', function () {
-    it('should set hasWarnings to true', function () {
-      expect(model.setProperties({'warnMessage': 'some warning'}).get('hasWarnings')).to.eql(true);
-    });
-    it('should set hasWarnings to false', function () {
-      expect(model.setProperties({'warnMessage': ''}).get('hasWarnings')).to.eql(false);
-    });
-  });
-
-  describe.skip('#isNotDefaultValue', function () {
-    var tests = [
-      { isEditable: false, value: 1, defaultValue: 2, supportsFinal: true, isFinal: true, defaultIsFinal: false, isNotDefaultValue: false },
-      { isEditable: true, value: 1, defaultValue: 1, supportsFinal: false, isFinal: true, defaultIsFinal: true, isNotDefaultValue: false },
-      { isEditable: true, value: 1, defaultValue: null, supportsFinal: false, isFinal: true, defaultIsFinal: true, isNotDefaultValue: false },
-      { isEditable: true, value: 1, defaultValue: 1, supportsFinal: true, isFinal: true, defaultIsFinal: true, isNotDefaultValue: false },
-
-      { isEditable: true, value: 2, defaultValue: 1, supportsFinal: true, isFinal: true, defaultIsFinal: true, isNotDefaultValue: true },
-      { isEditable: true, value: 2, defaultValue: 1, supportsFinal: false, isFinal: true, defaultIsFinal: false, isNotDefaultValue: true },
-      { isEditable: true, value: 1, defaultValue: 1, supportsFinal: true, isFinal: false, defaultIsFinal: true, isNotDefaultValue: true },
-    ];
-
-    tests.forEach(function(t, i) {
-      it('should set isNotDefaultValue to ' + t.isNotDefaultValue + ' situation ' + i, function () {
-        expect(model.setProperties({'isEditable': t.isEditable, 'value': t.value, defaultValue: t.defaultValue,
-          supportsFinal: t.supportsFinal, isFinal: t.isFinal, defaultIsFinal:t.defaultIsFinal}).get('isNotDefaultValue')).to.eql(t.isNotDefaultValue);
-      });
-    });
-  });
-
-});

+ 1 - 1
ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js

@@ -465,7 +465,7 @@ describe('App.SliderConfigWidgetView', function () {
 
     beforeEach(function() {
       viewInt.set('config', {});
-      stackConfigProperty = App.StackConfigProperty.createRecord({name: 'p1', widget: { units: [ { 'unit-name': "int"}]}, valueAttributes: {minimum: 1, maximum: 10, increment_step: 4, type: 'int'}});
+      stackConfigProperty = {name: 'p1', widget: { units: [ { 'unit-name': "int"}]}, valueAttributes: {minimum: 1, maximum: 10, increment_step: 4, type: 'int'}};
       viewInt.set('config.stackConfigProperty', stackConfigProperty);
       viewInt.set('config.isValid', true);
     });

+ 2 - 2
ambari-web/test/views/common/configs/widgets/time_interval_spinner_view_test.js

@@ -253,7 +253,7 @@ describe('App.TimeIntervalSpinnerView', function () {
 
     beforeEach(function() {
       view.set('config', Em.Object.create({}));
-      stackConfigProperty = App.StackConfigProperty.createRecord({
+      stackConfigProperty = {
         name: 'p1', valueAttributes: {
           minimum: 1, maximum: 10, increment_step: 4, type: 'int', unit: 'seconds'
         },
@@ -264,7 +264,7 @@ describe('App.TimeIntervalSpinnerView', function () {
             }
           ]
         }
-      });
+      };
       view.set('config.stackConfigProperty', stackConfigProperty);
       view.set('config.isValid', true);
       view.set('maxValue', [{"value":10,"type":"hours","minValue":0,"maxValue":10,"incrementStep":1,"enabled":true},{"value":0,"type":"minutes","minValue":0,"maxValue":59,"incrementStep":1,"enabled":true}]);