Просмотр исходного кода

AMBARI-3942 Click Overview, create new accepts empty name. (ababiichuk)

aBabiichuk 11 лет назад
Родитель
Сommit
28b95f6fef
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      ambari-web/app/utils/config.js

+ 2 - 2
ambari-web/app/utils/config.js

@@ -1017,7 +1017,7 @@ App.config = Em.Object.create({
       selectedConfigGroup: selectedConfigGroup,
       newConfigGroupName: '',
       enablePrimary: function () {
-        return this.get('optionSelectConfigGroup') || (this.get('newConfigGroupName').length > 0 && !this.get('warningMessage'));
+        return this.get('optionSelectConfigGroup') || (this.get('newConfigGroupName').trim().length > 0 && !this.get('warningMessage'));
       }.property('newConfigGroupName', 'optionSelectConfigGroup', 'warningMessage'),
       onPrimary: function () {
         if (!this.get('enablePrimary')) {
@@ -1028,7 +1028,7 @@ App.config = Em.Object.create({
           this.hide();
           callback(selectedConfigGroup);
         } else {
-          var newConfigGroupName = this.get('newConfigGroupName');
+          var newConfigGroupName = this.get('newConfigGroupName').trim();
           var newConfigGroup = self.createNewConfigurationGroup(serviceId, newConfigGroupName, isInstaller);
           if (newConfigGroup) {
             newConfigGroup.set('parentConfigGroup', configGroups.findProperty('isDefault'));