Преглед изворни кода

AMBARI-18164. Enable Interactive Query should not be available in Add Service Wizard (akovalenko)

Aleksandr Kovalenko пре 9 година
родитељ
комит
4aa04a2c9e

+ 5 - 3
ambari-web/app/controllers/wizard/step7_controller.js

@@ -562,9 +562,11 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
           var notEditableText = " " + Em.I18n.t('installer.step7.addWizard.notEditable');
           serviceConfig.set('description', serviceConfig.get('description') + notEditableText);
           serviceConfig.set('isReconfigurable', false);
-          config.isReconfigurable = false;
           serviceConfig.set('isEditable', false);
+          serviceConfig.set('disabledAsComponentAction', true);
+          config.isReconfigurable = false;
           config.isEditable = false;
+          config.disabledAsComponentActio = true;
         }
       }
     }, this);
@@ -1178,9 +1180,9 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
       var isEditable = config.get('isEditable'),
         isServiceInstalled = this.get('installedServiceNames').contains(this.get('selectedService.serviceName'));
       if (isServiceInstalled) {
-        isEditable = config.get('isReconfigurable') && selectedGroup.get('isDefault');
+        isEditable = config.get('isReconfigurable') && selectedGroup.get('isDefault') && !config.get('disabledAsComponentAction');
       } else {
-        isEditable = selectedGroup.get('isDefault');
+        isEditable = selectedGroup.get('isDefault') && !config.get('disabledAsComponentAction');
       }
       if (config.get('group')) {
         isEditable = config.get('group.name') === this.get('selectedConfigGroup.name');

+ 1 - 0
ambari-web/app/models/configs/objects/service_config_property.js

@@ -121,6 +121,7 @@ App.ServiceConfigProperty = Em.Object.extend({
   isRequired: true, // by default a config property is required
   isReconfigurable: true, // by default a config property is reconfigurable
   isEditable: true, // by default a config property is editable
+  disabledAsComponentAction: false, // is true for component action configs
   isNotEditable: Em.computed.not('isEditable'),
   hideFinalIcon: Em.computed.and('!isFinal', 'isNotEditable'),
   isVisible: true,