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

AMBARI-7083. Recommendations: dialog text needs adjustment. (Max Shepel via akovalenko)

Aleksandr Kovalenko 11 лет назад
Родитель
Сommit
7f889c5a79

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

@@ -650,7 +650,8 @@ Em.I18n.translations = {
   'installer.step7.popup.validation.failed.header': 'Validation failed.',
   'installer.step7.popup.validation.failed.header': 'Validation failed.',
   'installer.step7.popup.validation.failed.body': 'Some services are not properly configured. You have to change the highlighted configs according to the recommended values.',
   'installer.step7.popup.validation.failed.body': 'Some services are not properly configured. You have to change the highlighted configs according to the recommended values.',
   'installer.step7.popup.validation.request.failed.body': 'Config validaition failed.',
   'installer.step7.popup.validation.request.failed.body': 'Config validaition failed.',
-  'installer.step7.popup.validation.warning.body': 'Some services are not properly configured. Recommended to change the highlighted configs. Are you sure you want to proceed witout changing configs?',
+  'installer.step7.popup.validation.warning.header': 'Configurations',
+  'installer.step7.popup.validation.warning.body': 'Some service configurations are not configured properly. We recommend you review and change the highlighted configuration values. Are you sure you want to proceed without correcting configurations?',
 
 
   'installer.step7.oozie.database.new': 'New Derby Database',
   'installer.step7.oozie.database.new': 'New Derby Database',
   'installer.step7.hive.database.new': 'New MySQL Database',
   'installer.step7.hive.database.new': 'New MySQL Database',

+ 17 - 3
ambari-web/app/mixins/common/serverValidator.js

@@ -264,14 +264,28 @@ App.ServerValidatorMixin = Em.Mixin.create({
    * @returns {*}
    * @returns {*}
    */
    */
   warnUser: function(deferred) {
   warnUser: function(deferred) {
+    var self = this;
     if (this.get('configValidationFailed')) {
     if (this.get('configValidationFailed')) {
       deferred.reject();
       deferred.reject();
       return App.showAlertPopup(Em.I18n.t('installer.step7.popup.validation.failed.header'), Em.I18n.t('installer.step7.popup.validation.request.failed.body'));
       return App.showAlertPopup(Em.I18n.t('installer.step7.popup.validation.failed.header'), Em.I18n.t('installer.step7.popup.validation.request.failed.body'));
     } else if (this.get('configValidationWarning') || this.get('configValidationError')) {
     } else if (this.get('configValidationWarning') || this.get('configValidationError')) {
       // Motivation: for server-side validation warnings and EVEN errors allow user to continue wizard
       // Motivation: for server-side validation warnings and EVEN errors allow user to continue wizard
-      return App.showConfirmationPopup(function () { deferred.resolve(); },
-          Em.I18n.t('installer.step7.popup.validation.warning.body'),
-          function () { deferred.reject(); });
+      return App.ModalPopup.show({
+        header: Em. I18n.t('installer.step7.popup.validation.warning.header'),
+        primary: Em.I18n.t('common.proceedAnyway'),
+        onPrimary: function () {
+          this.hide();
+          deferred.resolve();
+        },
+        onSecondary: function () {
+          this.hide();
+          deferred.reject();
+        },
+        bodyClass: Em.View.extend({
+          controller: self,
+          templateName: require('templates/common/configs/config_recommendation_popup')
+        })
+      });
     } else {
     } else {
       deferred.resolve();
       deferred.resolve();
     }
     }

+ 28 - 0
ambari-web/app/templates/common/configs/config_recommendation_popup.hbs

@@ -0,0 +1,28 @@
+{{!
+* 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.
+}}
+
+<p>{{t installer.step7.popup.validation.warning.body}}</p>
+<div class="alert alert-warning">
+    {{#each service in stepConfigs}}
+      {{#each property in service.configs}}
+        {{#if property.warn}}
+          <strong>{{property.displayName}}</strong>: {{property.warnMessage}}<br />
+        {{/if}}
+      {{/each}}
+    {{/each}}
+</div>