Browse Source

AMBARI-7454. Slider View: Create Slider App wizard should show message when no app-types available. (akovalenko)

Aleksandr Kovalenko 11 years ago
parent
commit
3715605d0a

+ 8 - 0
contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js

@@ -58,6 +58,14 @@ App.CreateAppWizardStep1Controller = Ember.Controller.extend({
    */
   nameErrorMessage: '',
 
+  /**
+   * Define if there are existing App types
+   * @type {Boolean}
+   */
+  isAppTypesError: function(){
+    return !this.get('availableTypes.content.length');
+  }.property('availableTypes.content.length'),
+
   /**
    * Define description depending on selected App type
    * @type {string}

+ 5 - 0
contrib/views/slider/src/main/resources/ui/app/styles/application.less

@@ -432,6 +432,11 @@ select {
       margin-bottom: 30px;
     }
   }
+  #step1 {
+    .app-types-alert {
+      margin-top: 20px;
+    }
+  }
   .app-wiz-configs {
     .accordion-toggle {
       display: block;

+ 25 - 16
contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step1.hbs

@@ -15,24 +15,33 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 }}
-<h4>{{t wizard.step1.header}}</h4>
-<div class="row">
-  <div class="col-xs-6">
-    {{view view.availableTypesSelect contentBinding="controller.availableTypes" optionLabelPath="content.displayName" multiple="true" class="type-select"}}
-  </div>
-  <div class="col-xs-6">
-    <div {{bind-attr class=":control-group controller.isNameError:error"}}>
-      <label>{{t common.name}}: {{input id="app-name-input" valueBinding="controller.newAppName"}}</label>
+<div id="step1">
+  <h4>{{t wizard.step1.header}}</h4>
+  <div class="row">
+    <div class="col-xs-6">
+      {{view view.availableTypesSelect contentBinding="controller.availableTypes" optionLabelPath="content.displayName" multiple="true" class="type-select"}}
+    </div>
+    <div class="col-xs-6">
+      <div {{bind-attr class=":control-group controller.isNameError:error"}}>
+        <label>{{t common.name}}: {{input id="app-name-input" valueBinding="controller.newAppName"}}</label>
+      </div>
+      {{#if controller.isNameError}}
+        <div class="alert alert-danger">
+          {{controller.nameErrorMessage}}
+        </div>
+      {{/if}}
+      <h5>{{t wizard.step1.description}}:</h5>
+      <p>
+        {{controller.typeDescription}}
+      </p>
     </div>
-    {{#if controller.isNameError}}
-      <div class="alert alert-danger">
-        {{controller.nameErrorMessage}}
+    {{#if controller.isAppTypesError}}
+      <div class="col-xs-12">
+          <div class="alert alert-info app-types-alert">
+              {{t wizard.step1.noAppTypesError}}
+          </div>
       </div>
     {{/if}}
-    <h5>{{t wizard.step1.description}}:</h5>
-    <p>
-      {{controller.typeDescription}}
-    </p>
   </div>
+  <button class="btn btn-success pull-right next-btn" {{bind-attr disabled="controller.isSubmitDisabled"}} {{action submit target="controller"}}>{{t common.next}} &rarr;</button>
 </div>
-<button class="btn btn-success pull-right next-btn" {{bind-attr disabled="controller.isSubmitDisabled"}} {{action submit target="controller"}}>{{t common.next}} &rarr;</button>

+ 1 - 0
contrib/views/slider/src/main/resources/ui/app/translations.js

@@ -109,6 +109,7 @@ Em.I18n.translations = {
   'wizard.step1.typeDescription': 'Deploys {0} cluster on YARN.',
   'wizard.step1.nameFormatError': 'App Name should consist only of letters, numbers, \'-\', \'_\' and first character should be a letter.',
   'wizard.step1.nameRepeatError': 'App with entered Name already exists.',
+  'wizard.step1.noAppTypesError': 'No Slider Application packages have been installed on this server. Please contact your Ambari server administrator to install Slider Application packages into /var/lib/ambari-server/resources/apps/ folder.',
   'wizard.step2.name': 'Allocate Resources',
   'wizard.step2.header': 'HBase application requires resources to be allocated on the cluster. Provide resource allocation requests for each component of the application below.',
   'wizard.step2.table.instances': 'Number of Instances',