ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-13768 Ranger install: Required properties shows up with back button but with no indication of which property. (atkach)
Date Fri, 06 Nov 2015 14:16:56 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk a8a238742 -> 6b3599a00


AMBARI-13768 Ranger install: Required properties shows up with back button but with no indication
of which property. (atkach)


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

Branch: refs/heads/trunk
Commit: 6b3599a002eaaa5ed8eb15c2ef33f71fe1552417
Parents: a8a2387
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Fri Nov 6 16:16:44 2015 +0200
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Fri Nov 6 16:16:44 2015 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/info/configs.js      | 5 +++--
 ambari-web/app/controllers/wizard/step7_controller.js        | 2 +-
 ambari-web/app/mappers/configs/themes_mapper.js              | 2 ++
 ambari-web/app/models/configs/objects/service_config.js      | 4 ++--
 .../app/models/configs/objects/service_config_property.js    | 7 +++++++
 ambari-web/app/models/configs/stack_config_property.js       | 6 ++++++
 ambari-web/app/utils/config.js                               | 4 ++--
 .../views/common/configs/service_config_layout_tab_view.js   | 8 ++++----
 ambari-web/test/controllers/main/service/info/config_test.js | 8 ++++----
 ambari-web/test/controllers/wizard/step7_test.js             | 8 ++++----
 .../test/models/configs/objects/service_config_test.js       | 8 ++++----
 ambari-web/test/utils/config_test.js                         | 2 +-
 12 files changed, 40 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3599a0/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 b51711e..b464537 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -131,7 +131,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
    */
   errorsCount: function () {
     return this.get('selectedService.configs').filter(function (config) {
-      return Em.isNone(config.get('widget'));
+      return Em.isNone(config.get('widgetType'));
     }).filter(function(config) {
       return !config.get('isValid') || (config.get('overrides') || []).someProperty('isValid',
false);
     }).filterProperty('isVisible').length;
@@ -447,7 +447,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
           serviceName: advanced.get('serviceName'),
           supportsFinal: advanced.get('supportsFinal'),
           category: 'Advanced ' + App.config.getConfigTagFromFileName(advanced.get('fileName')),
-          widget: advanced.get('widget')
+          widget: advanced.get('widget'),
+          widgetType: advanced.get('widgetType')
         }));
       }
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3599a0/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 e34f4ad..c879acc 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -140,7 +140,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin,
App.E
    */
   errorsCount: function () {
     return this.get('selectedService.configs').filter(function (config) {
-      return Em.isNone(config.get('widget'));
+      return Em.isNone(config.get('widgetType'));
     }).filter(function(config) {
       return !config.get('isValid') || (config.get('overrides') || []).someProperty('isValid',
false);
     }).filterProperty('isVisible').length;

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3599a0/ambari-web/app/mappers/configs/themes_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/configs/themes_mapper.js b/ambari-web/app/mappers/configs/themes_mapper.js
index e6ef5e2..5815955 100644
--- a/ambari-web/app/mappers/configs/themes_mapper.js
+++ b/ambari-web/app/mappers/configs/themes_mapper.js
@@ -298,6 +298,7 @@ App.themesMapper = App.QuickDataMapper.create({
 
       if (configProperty.get('id')) {
         configProperty.set('widget', widget.widget);
+        configProperty.set('widgetType', Em.get(widget, 'widget.type'));
       } else {
         var split = widget.config.split("/");
         var fileName =  split[0] + '.xml';
@@ -305,6 +306,7 @@ App.themesMapper = App.QuickDataMapper.create({
         var uiOnlyProperty = App.uiOnlyConfigDerivedFromTheme.filterProperty('filename',fileName).findProperty('name',configName);
         if (uiOnlyProperty) {
           uiOnlyProperty.set('widget', widget.widget);
+          uiOnlyProperty.set('widgetType', Em.get(widget, 'widget.type'));
         }
       }
     }, this);

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3599a0/ambari-web/app/models/configs/objects/service_config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/objects/service_config.js b/ambari-web/app/models/configs/objects/service_config.js
index c4bad57..5d827b7 100644
--- a/ambari-web/app/models/configs/objects/service_config.js
+++ b/ambari-web/app/models/configs/objects/service_config.js
@@ -57,11 +57,11 @@ App.ServiceConfig = Ember.Object.extend({
     });
     configs.forEach(function (item) {
       var category = configCategories.findProperty('name', item.get('category'));
-      if (category && !item.get('isValid') && item.get('isVisible') &&
!item.get('widget')) {
+      if (category && !item.get('isValid') && item.get('isVisible') &&
!item.get('widgetType')) {
         category.incrementProperty('nonSlaveErrorCount');
         masterErrors++;
       }
-      if (!item.get('isValid') && item.get('widget') && item.get('isVisible')
&& !item.get('hiddenBySection')) {
+      if (!item.get('isValid') && item.get('widgetType') && item.get('isVisible')
&& !item.get('hiddenBySection')) {
         enhancedConfigsErrors++;
       }
       if (item.get('overrides')) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3599a0/ambari-web/app/models/configs/objects/service_config_property.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/objects/service_config_property.js b/ambari-web/app/models/configs/objects/service_config_property.js
index 33ca761..b4756c1 100644
--- a/ambari-web/app/models/configs/objects/service_config_property.js
+++ b/ambari-web/app/models/configs/objects/service_config_property.js
@@ -103,6 +103,13 @@ App.ServiceConfigProperty = Em.Object.extend({
   placeholderText: '',
 
   /**
+   * type of widget View
+   * @type {string}
+   * @default null
+   */
+  widgetType: null,
+
+  /**
    * Placeholder used for configs with input type text
    */
   placeholder: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3599a0/ambari-web/app/models/configs/stack_config_property.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/stack_config_property.js b/ambari-web/app/models/configs/stack_config_property.js
index a02c8df..39a4857 100644
--- a/ambari-web/app/models/configs/stack_config_property.js
+++ b/ambari-web/app/models/configs/stack_config_property.js
@@ -107,6 +107,12 @@ App.StackConfigProperty = DS.Model.extend({
   widget: DS.attr('object', {defaultValue: null}),
 
   /**
+   * widget type
+   * @property {string}
+   */
+  widgetType: DS.attr('string', {defaultValue: null}),
+
+  /**
    * this property contains array of properties which value
    * is dependent from current property
    * @property {array}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3599a0/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 62424a3..d9ba911 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -338,7 +338,7 @@ App.config = Em.Object.create({
       options: null,
       radioName: null,
       belongsToService: [],
-      widget: null
+      widgetType: null
     };
     return Object.keys(coreObject|| {}).length ?
       $.extend(tpl, coreObject) : tpl;
@@ -633,7 +633,7 @@ App.config = Em.Object.create({
         if (advanced.get('id')) {
           configData = this.mergeStaticProperties(configData, advanced, null, ['name', 'filename']);
           configData.value = configData.recommendedValue = this.formatPropertyValue(advanced,
advanced.get('value'));
-          configData.widget = advanced.get('widget');
+          configData.widgetType = advanced.get('widget.type');
         }
 
         mergedConfigs.push(configData);

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3599a0/ambari-web/app/views/common/configs/service_config_layout_tab_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/service_config_layout_tab_view.js b/ambari-web/app/views/common/configs/service_config_layout_tab_view.js
index 1aec1fa..9029448 100644
--- a/ambari-web/app/views/common/configs/service_config_layout_tab_view.js
+++ b/ambari-web/app/views/common/configs/service_config_layout_tab_view.js
@@ -110,12 +110,12 @@ App.ServiceConfigLayoutTabView = Em.View.extend(App.ConfigOverridable,
{
       if (!configProperty) return;
 
       containerObject.get('configs').pushObject(configProperty);
-      var configWidgetType = config.get('widget.type');
-      var widget = self.get('widgetTypeMap')[configWidgetType];
-      Em.assert('Unknown config widget view for config ' + configProperty.get('id') + ' with
type ' + configWidgetType, widget);
+      var configWidgetType = config.get('widgetType');
+      var widgetView = self.get('widgetTypeMap')[configWidgetType];
+      Em.assert('Unknown config widget view for config ' + configProperty.get('id') + ' with
type ' + configWidgetType, widgetView);
 
       var additionalProperties = {
-        widget: widget,
+        widget: widgetView,
         stackConfigProperty: config
       };
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3599a0/ambari-web/test/controllers/main/service/info/config_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/info/config_test.js b/ambari-web/test/controllers/main/service/info/config_test.js
index e48d9fd..4016527 100644
--- a/ambari-web/test/controllers/main/service/info/config_test.js
+++ b/ambari-web/test/controllers/main/service/info/config_test.js
@@ -770,8 +770,8 @@ describe("App.MainServiceInfoConfigsController", function () {
 
       mainServiceInfoConfigsController.reopen({selectedService: {
         configs: [
-          Em.Object.create({isVisible: true, widget: Em.View, isValid: false}),
-          Em.Object.create({isVisible: true, widget: Em.View, isValid: true}),
+          Em.Object.create({isVisible: true, widgetType: 'type', isValid: false}),
+          Em.Object.create({isVisible: true, widgetType: 'type', isValid: true}),
           Em.Object.create({isVisible: true, isValid: true}),
           Em.Object.create({isVisible: true, isValid: false})
         ]
@@ -785,8 +785,8 @@ describe("App.MainServiceInfoConfigsController", function () {
 
       mainServiceInfoConfigsController.reopen({selectedService: {
         configs: [
-          Em.Object.create({isVisible: true, widget: Em.View, isValid: false}),
-          Em.Object.create({isVisible: true, widget: Em.View, isValid: true}),
+          Em.Object.create({isVisible: true, widgetType: 'type', isValid: false}),
+          Em.Object.create({isVisible: true, widgetType: 'type', isValid: true}),
           Em.Object.create({isVisible: false, isValid: false}),
           Em.Object.create({isVisible: true, isValid: true}),
           Em.Object.create({isVisible: true, isValid: false})

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3599a0/ambari-web/test/controllers/wizard/step7_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js
index eaa5108..45e0b87 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -1932,8 +1932,8 @@ describe('App.InstallerStep7Controller', function () {
 
       installerStep7Controller.reopen({selectedService: {
         configs: [
-          Em.Object.create({isVisible: true, widget: Em.View, isValid: false}),
-          Em.Object.create({isVisible: true, widget: Em.View, isValid: true}),
+          Em.Object.create({isVisible: true, widgetType: 'type', isValid: false}),
+          Em.Object.create({isVisible: true, widgetType: 'type', isValid: true}),
           Em.Object.create({isVisible: true, isValid: true}),
           Em.Object.create({isVisible: true, isValid: false})
         ]
@@ -1947,8 +1947,8 @@ describe('App.InstallerStep7Controller', function () {
 
       installerStep7Controller.reopen({selectedService: {
         configs: [
-          Em.Object.create({isVisible: true, widget: Em.View, isValid: false}),
-          Em.Object.create({isVisible: true, widget: Em.View, isValid: true}),
+          Em.Object.create({isVisible: true, widgetType: 'type', isValid: false}),
+          Em.Object.create({isVisible: true, widgetType: 'type', isValid: true}),
           Em.Object.create({isVisible: false, isValid: false}),
           Em.Object.create({isVisible: true, isValid: true}),
           Em.Object.create({isVisible: true, isValid: false})

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3599a0/ambari-web/test/models/configs/objects/service_config_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/models/configs/objects/service_config_test.js b/ambari-web/test/models/configs/objects/service_config_test.js
index ff848b2..f223c87 100644
--- a/ambari-web/test/models/configs/objects/service_config_test.js
+++ b/ambari-web/test/models/configs/objects/service_config_test.js
@@ -146,25 +146,25 @@ describe('App.ServiceConfig', function () {
         configs: [
           Em.Object.create({
             isValid: false,
-            widget: Em.View,
+            widgetType: 'type',
             isVisible: true,
             category: 'some1'
           }),
           Em.Object.create({
             isValid: false,
-            widget: Em.View,
+            widgetType: 'type',
             isVisible: true,
             category: 'some2'
           }),
           Em.Object.create({
             isValid: false,
-            widget: null,
+            widgetType: null,
             isVisible: true,
             category: 'some2'
           }),
           Em.Object.create({
             isValid: false,
-            widget: Em.View,
+            widgetType: 'type',
             isVisible: true
           })
         ],

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3599a0/ambari-web/test/utils/config_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js
index 8ea0d67..ecc1fa8 100644
--- a/ambari-web/test/utils/config_test.js
+++ b/ambari-web/test/utils/config_test.js
@@ -1006,7 +1006,7 @@ describe('App.config', function () {
       options: null,
       radioName: null,
       belongsToService: [],
-      widget: null
+      widgetType: null
     };
     it('create default config object', function () {
       expect(App.config.createDefaultConfig('pName', 'pServiceName', 'pFileName', true)).to.eql(res);


Mime
View raw message