Quellcode durchsuchen

AMBARI-7086. FE: Slave and client validation errors should be shown in dialog. (Max Shepel via akovalenko)

Aleksandr Kovalenko vor 10 Jahren
Ursprung
Commit
85ccaede36

+ 21 - 1
ambari-web/app/controllers/wizard/step6_controller.js

@@ -125,6 +125,13 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
     return messages && messages.length > 0;
     return messages && messages.length > 0;
   }.property('generalWarningMessages', 'generalWarningMessages.@each'),
   }.property('generalWarningMessages', 'generalWarningMessages.@each'),
 
 
+  /**
+   * true if validation has any general (which is not related with concrete host) error or warning message
+   */
+  anyGeneralIssues: function () {
+    return this.get('anyGeneralErrors') || this.get('anyGeneralWarnings');
+  }.property('anyGeneralErrors', 'anyGeneralWarnings'),
+
   /**
   /**
    * true if validation has any error message (general or host specific)
    * true if validation has any error message (general or host specific)
    */
    */
@@ -139,6 +146,17 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
     return this.get('anyGeneralWarnings') || this.get('hosts').some(function(h) { return h.get('warnMessages').length > 0; });
     return this.get('anyGeneralWarnings') || this.get('hosts').some(function(h) { return h.get('warnMessages').length > 0; });
   }.property('anyGeneralWarnings', 'hosts.@each.warnMessages'),
   }.property('anyGeneralWarnings', 'hosts.@each.warnMessages'),
 
 
+  openSlavesAndClientsIssues: function () {
+    App.ModalPopup.show({
+      header: Em.I18n.t('installer.step6.validationSlavesAndClients.popup.header'),
+      bodyClass: Em.View.extend({
+        controller: this,
+        templateName: require('templates/wizard/step6/step6_issues_popup')
+      }),
+      secondary: null
+    });
+  },
+
   /**
   /**
    * Verify condition that at least one checkbox of each component was checked
    * Verify condition that at least one checkbox of each component was checked
    * @method clearError
    * @method clearError
@@ -616,7 +634,9 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
     var anyGeneralClientErrors = false; // any error/warning for any client component (under "CLIENT" alias)
     var anyGeneralClientErrors = false; // any error/warning for any client component (under "CLIENT" alias)
 
 
     var validationData = validationUtils.filterNotInstalledComponents(data);
     var validationData = validationUtils.filterNotInstalledComponents(data);
-    validationData.filterProperty('type', 'host-component').forEach(function (item) {
+    validationData.filterProperty('type', 'host-component').filter(function (i) {
+      return !(i['component-name'] && App.StackServiceComponent.find().findProperty('componentName', i['component-name']).get('isMaster'));
+    }).forEach(function (item) {
       var checkboxWithIssue = null;
       var checkboxWithIssue = null;
       var isGeneralClientValidationItem = clientComponents.contains(item['component-name']); // it is an error/warning for any client component (under "CLIENT" alias)
       var isGeneralClientValidationItem = clientComponents.contains(item['component-name']); // it is an error/warning for any client component (under "CLIENT" alias)
       var host = self.get('hosts').find(function (h) {
       var host = self.get('hosts').find(function (h) {

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

@@ -628,6 +628,11 @@ Em.I18n.translations = {
   'installer.step6.error.mustSelectOneForSlaveHost': 'You must assign at least one slave/client component to each host with no master component',
   'installer.step6.error.mustSelectOneForSlaveHost': 'You must assign at least one slave/client component to each host with no master component',
   'installer.step6.validationIssuesAttention.header': 'Validation Issues',
   'installer.step6.validationIssuesAttention.header': 'Validation Issues',
   'installer.step6.validationIssuesAttention': 'Slave and Client component assignments have issues that need attention.',
   'installer.step6.validationIssuesAttention': 'Slave and Client component assignments have issues that need attention.',
+  'installer.step6.validationSlavesAndClients.hasIssues': 'Your slave and client assignment has issues. ',
+  'installer.step6.validationSlavesAndClients.click': 'Click',
+  'installer.step6.validationSlavesAndClients.forDetails': ' for details.',
+  'installer.step6.validationSlavesAndClients.popup.header': 'Assign Slaves and Clients Issues',
+  'installer.step6.validationSlavesAndClients.popup.body': 'Assignment of slave and client components has the following issues',
 
 
   'installer.step7.header':'Customize Services',
   'installer.step7.header':'Customize Services',
   'installer.step7.body':'We have come up with recommended configurations for the services you selected. Customize them as you see fit.',
   'installer.step7.body':'We have come up with recommended configurations for the services you selected. Customize them as you see fit.',

+ 2 - 2
ambari-web/app/styles/application.less

@@ -794,7 +794,7 @@ h1 {
     a.deselected {
     a.deselected {
     }
     }
     i.icon-asterisks {
     i.icon-asterisks {
-      color: #FF4B4B;
+      color: #00688B;
     }
     }
   }
   }
   #step6 {
   #step6 {
@@ -5626,7 +5626,7 @@ li.break {
 }
 }
 
 
 i.icon-asterisks {
 i.icon-asterisks {
-  color: #FF4B4B;
+  color: #00688B;
 }
 }
 
 
 .rickshaw_legend {
 .rickshaw_legend {

+ 6 - 21
ambari-web/app/templates/wizard/step6.hbs

@@ -20,27 +20,12 @@
   <h2>{{view.title}}</h2>
   <h2>{{view.title}}</h2>
 
 
   <div class="alert alert-info">{{{view.label}}}</div>
   <div class="alert alert-info">{{{view.label}}}</div>
-  {{#if anyGeneralErrors}}
-    <div class="alert alert-error">
-      <ul>
-        {{#if errorMessage}}
-          <li>{{errorMessage}}</li>
-        {{/if}}
-        {{#each msg in controller.generalErrorMessages}}
-            <li>{{msg}}</li>
-        {{/each}}
-      </ul>
-    </div>
-  {{/if}}
-
-  {{#if anyGeneralWarnings}}
-    <div class="alert alert-warning">
-      <ul>
-        {{#each msg in controller.generalWarningMessages}}
-            <li>{{msg}}</li>
-        {{/each}}
-      </ul>
-    </div>
+  {{#if anyGeneralIssues}}
+  <div class="alert alert-error">
+    {{t installer.step6.validationSlavesAndClients.hasIssues}}
+    <a href="javascript:void(null);" {{action openSlavesAndClientsIssues target="controller"}}>{{t installer.step6.validationSlavesAndClients.click}}</a>
+    {{t installer.step6.validationSlavesAndClients.forDetails}}
+  </div>
   {{/if}}
   {{/if}}
 
 
   <div class="pre-scrollable">
   <div class="pre-scrollable">

+ 41 - 0
ambari-web/app/templates/wizard/step6/step6_issues_popup.hbs

@@ -0,0 +1,41 @@
+{{!
+* 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.step6.validationSlavesAndClients.popup.body}}</p>
+{{#if anyGeneralErrors}}
+  <div class="alert alert-error">
+    <ul>
+      {{#if errorMessage}}
+        <li>{{errorMessage}}</li>
+      {{/if}}
+      {{#each msg in controller.generalErrorMessages}}
+        <li>{{msg}}</li>
+      {{/each}}
+    </ul>
+  </div>
+{{/if}}
+
+{{#if anyGeneralWarnings}}
+  <div class="alert alert-warning">
+    <ul>
+      {{#each msg in controller.generalWarningMessages}}
+        <li>{{msg}}</li>
+      {{/each}}
+    </ul>
+  </div>
+{{/if}}

+ 1 - 1
ambari-web/app/templates/wizard/step7.hbs

@@ -17,7 +17,7 @@
 }}
 }}
 
 
 <div id="serviceConfig">
 <div id="serviceConfig">
-  <h2>{{t installer.step7.header}}</h2>
+  <h2>{{t installer.step7.header}}{{controller.finnalyLoaded}}</h2>
 
 
   <div class="alert alert-info">
   <div class="alert alert-info">
     {{t installer.step7.body}}
     {{t installer.step7.body}}