瀏覽代碼

AMBARI-3836. Unable to close manage-config-groups dialog when only Default group present (alexantonenko)

Alex Antonenko 11 年之前
父節點
當前提交
b77bf1c7dc

+ 13 - 6
ambari-web/app/controllers/main/service/item.js

@@ -279,17 +279,24 @@ App.MainServiceItemController = Em.Controller.extend({
       updateConfigGroupOnServicePage: function () {
         var mainServiceInfoConfigsController = App.get('router.mainServiceInfoConfigsController');
         var selectedConfigGroup = mainServiceInfoConfigsController.get('selectedConfigGroup');
+        var managedConfigGroups = this.get('subViewController.configGroups');
+
         //check whether selectedConfigGroup was selected
-        if (selectedConfigGroup) {
-          var managedConfigGroups = this.get('subViewController.configGroups');
+        if(!selectedConfigGroup){
+          return;
+        }
+
+        if(selectedConfigGroup.isDefault) {
+          mainServiceInfoConfigsController.set('selectedConfigGroup',  managedConfigGroups.findProperty('isDefault', true));
+        }else{
           selectedConfigGroup = managedConfigGroups.findProperty('id', selectedConfigGroup.id);
-          if (selectedConfigGroup) {
+          if(selectedConfigGroup){
             mainServiceInfoConfigsController.set('selectedConfigGroup', selectedConfigGroup);
-          } else {
-            mainServiceInfoConfigsController.set('selectedConfigGroup', managedConfigGroups.findProperty('isDefault', true));
+          }else{
+            mainServiceInfoConfigsController.set('selectedConfigGroup',  managedConfigGroups.findProperty('isDefault', true));
           }
         }
-        mainServiceInfoConfigsController.set('configGroups', this.get('subViewController.configGroups'));
+        mainServiceInfoConfigsController.set('configGroups',this.get('subViewController.configGroups'));
       },
       updateButtons: function(){
         var modified = this.get('subViewController.isHostsModified');

+ 2 - 2
ambari-web/app/messages.js

@@ -1100,8 +1100,8 @@ Em.I18n.translations = {
   'services.service.config.saved':'Saved Configuration Changes',
   'services.service.config.notSaved':'Unable to Save Configuration Changes',
   'services.service.config.restartService.TooltipMessage':'<b>Restart Service</b><br>Stale configuration used by {0} components on {1} hosts:{2}',
-  'services.service.config.restartService.needToRestart':'<strong>Restart Service</strong> ',
-  'services.service.config.restartService.needToRestartEnd':'should be restated',
+  'services.service.config.restartService.needToRestart':'<strong>Restart Required.</strong> ',
+  'services.service.config.restartService.needToRestartEnd':'should be restarted',
   'service.service.config.restartService.hostsShouldBeRestarted':'Hosts should be restarted',
   'service.service.config.restartService.componentsShouldBeRestarted':'Components should be restarted',
   'services.service.config.saved.message':'Service configuration changes saved successfully.',

+ 10 - 12
ambari-web/app/styles/application.less

@@ -4963,18 +4963,16 @@ i.icon-asterisks {
   }
 }
 
-.textarea-full-width {
-  padding-right: 10px;
-  textarea {
-    width: 100%;
-    margin: 0;
+.new-config-group-div {
+  td {
+    vertical-align: top;
   }
-}
-
-.textarea-full-width {
-  padding-right: 10px;
-  textarea {
-    width: 100%;
-    margin: 0;
+  .textarea-full-width {
+    padding-right: 10px;
+    textarea {
+      width: 100%;
+      margin: 0;
+    }
   }
 }
+

+ 1 - 1
ambari-web/app/templates/main/service/info/configs.hbs

@@ -23,7 +23,7 @@
         {{#if App.isAdmin}}
           <div>
             <div class="alert alert-warning clearfix">
-              <i class="icon-refresh"></i> {{{view.needToRestartMessage}}} <a href="#" {{action showComponentsShouldBeRestarted target="controller"}}>{{view.componentsCount}} {{t common.components}}</a> {{t on}} <a href="#" {{action showHostsShouldBeRestarted target="controller"}}>{{view.hostsCount}} {{t dashboard.services.hosts}}</a> {{t services.service.config.restartService.needToRestartEnd}}
+              <i class="icon-refresh"></i> {{{view.needToRestartMessage}}} {{t services.service.config.restartService.needToRestart}}  <a href="#" {{action showComponentsShouldBeRestarted target="controller"}}>{{view.componentsCount}} {{t common.components}}</a> {{t on}} <a href="#" {{action showHostsShouldBeRestarted target="controller"}}>{{view.hostsCount}} {{t dashboard.services.hosts}}</a> {{t services.service.config.restartService.needToRestartEnd}}
 
               <button {{bindAttr class=":btn :restart-components :pull-right view.startComponentsIsDisabled::btn-success view.startComponentsIsDisabled:disabled" }} {{action restartComponents target="controller"}}>
                 {{t hosts.host.details.needToRestart.startButton}}

+ 4 - 4
ambari-web/app/templates/main/service/new_config_group.hbs

@@ -16,7 +16,7 @@
 * limitations under the License.
 }}
 
-<p>
+<div class="new-config-group-div">
   <table>
     <tr>
       <td>{{t services.service.config_groups_popup.group_name_lable }}:</td>
@@ -24,9 +24,9 @@
     </tr>
     <tr>
       <td>{{t services.service.config_groups_popup.group_desc_lable }}:</td>
-      <td class="textarea-full-width" style="width: 100%;">
+      <td class="textarea-full-width">
         {{view Ember.TextArea valueBinding="configGroupDesc" rows="4"}}
       </td>
     </tr>
-</table>
-</p>
+  </table>
+</div>