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

AMBARI-3991 Manage config group links needed in save config-group confirmation

aBabiichuk 11 лет назад
Родитель
Сommit
796eab5e5c

+ 6 - 0
ambari-web/app/messages.js

@@ -1722,5 +1722,11 @@ Em.I18n.translations = {
   'config.group.selection.dialog.no.groups': 'There are no existing {{serviceName}} Configuration Groups.',
   'config.group.host.switch.dialog.title': 'Change Group',
 
+  'config.group.save.confirmation.header': 'Save Configuration Group',
+  'config.group.save.confirmation.msg': 'Click <em>Manage Hosts</em> to manage host membership to the configuration group',
+  'config.group.save.confirmation.configGroup': 'Configuration Group',
+  'config.group.save.confirmation.saved': 'has been successfully saved',
+  'config.group.save.confirmation.manage.button': 'Manage Hosts',
+
   'utils.ajax.errorMessage': 'Error message'
 };

+ 7 - 0
ambari-web/app/styles/application.less

@@ -4955,6 +4955,13 @@ i.icon-asterisks {
   }
 }
 
+#config-group-confirm-save {
+  .message{
+    color: #777;
+    padding-left: 10px;
+  }
+}
+
 .manage-configuration-group-popup {
   .modal{
     max-height: 600px;

+ 21 - 0
ambari-web/app/templates/common/configs/saveConfigGroup.hbs

@@ -0,0 +1,21 @@
+{{!
+* 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.
+}}
+<div id="config-group-confirm-save">
+  <div class="alert alert-success">{{t config.group.save.confirmation.configGroup}} <em>{{groupName}}</em> {{t config.group.save.confirmation.saved}}</div>
+  <div class="message">{{t config.group.save.confirmation.msg}}</div>
+</div>

+ 19 - 0
ambari-web/app/utils/config.js

@@ -986,6 +986,23 @@ App.config = Em.Object.create({
    * @param callback  Callback function which is invoked when dialog
    *  is closed, cancelled or OK is pressed.
    */
+
+  saveGroupConfirmationPopup: function(groupName,isInstaller) {
+    App.ModalPopup.show({
+      header: Em.I18n.t('config.group.save.confirmation.header'),
+      secondary: Em.I18n.t('config.group.save.confirmation.manage.button'),
+      groupName: groupName,
+      bodyClass: Ember.View.extend({
+        templateName: require('templates/common/configs/saveConfigGroup')
+      }),
+      onSecondary: function() {
+        var controller = isInstaller ? App.router.get('wizardStep7Controller') : undefined;
+        App.router.get('mainServiceInfoConfigsController').manageConfigurationGroups(controller);
+        this.hide();
+      }
+    });
+  },
+
   launchConfigGroupSelectionCreationDialog : function(serviceId, configGroups, usedConfigGroupNames, configProperty, callback, isInstaller) {
     var self = this;
     var availableConfigGroups = configGroups.slice();
@@ -1026,6 +1043,7 @@ App.config = Em.Object.create({
         if (this.get('optionSelectConfigGroup')) {
           var selectedConfigGroup = this.get('selectedConfigGroup');
           this.hide();
+          self.saveGroupConfirmationPopup(selectedConfigGroup,isInstaller);
           callback(selectedConfigGroup);
         } else {
           var newConfigGroupName = this.get('newConfigGroupName').trim();
@@ -1034,6 +1052,7 @@ App.config = Em.Object.create({
             newConfigGroup.set('parentConfigGroup', configGroups.findProperty('isDefault'));
             configGroups.pushObject(newConfigGroup);
             this.hide();
+            self.saveGroupConfirmationPopup(newConfigGroupName,isInstaller);
             callback(newConfigGroup);
           }
         }