Browse Source

AMBARI-5724. View: Pig bug fixes and ui cleanup. (jaimin)

Jaimin Jetly 11 years ago
parent
commit
86d76395cf

+ 10 - 0
contrib/views/pig/src/main/resources/ui/pig-web/app/styles/style.less

@@ -293,3 +293,13 @@ a.list-group-item.active{
   .base-transition(border-color 200ms linear, background-color 200ms linear;);
   .base-transition(border-color 200ms linear, background-color 200ms linear;);
 }
 }
 
 
+.empty-table-footer {
+  text-align: center;
+  font-size: 13pt;
+  color: #666666;
+}
+
+.panel-heading {
+  font-size: 1.1em;
+  font-weight: bold;
+}

+ 4 - 0
contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/history.hbs

@@ -43,4 +43,8 @@
     {{/each}}
     {{/each}}
     </tbody>
     </tbody>
   </table>
   </table>
+
+  {{#unless content}}
+    <div class="panel-footer empty-table-footer">{{t 'job.noJobs'}}</div>
+  {{/unless}}
 </div>
 </div>

+ 5 - 2
contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/createScript.hbs

@@ -22,11 +22,14 @@
 </div>
 </div>
 <div class="modal-body">
 <div class="modal-body">
 <div class="form-group">
 <div class="form-group">
+  {{#if error}}
+    <div class="alert alert-danger">{{error}}</div>
+  {{/if}}
     <label for="exampleInputEmail1">{{t 'scripts.title'}}</label>
     <label for="exampleInputEmail1">{{t 'scripts.title'}}</label>
-    {{input class="form-control" placeholderTranslation="udfs.modal.udf_name" valueBinding="content.title"}}
+    {{input class="form-control" placeholderTranslation="scripts.modal.script_title_placeholder" valueBinding="content.title"}}
   </div>
   </div>
   <div class="form-group">
   <div class="form-group">
-    <label for="exampleInputPassword1">{{t 'common.path'}}</label>
+    <label for="exampleInputPassword1">{{t 'scripts.path'}}</label>
     {{input class="form-control" placeholderTranslation="scripts.modal.file_path_placeholder" valueBinding="filePath"}}
     {{input class="form-control" placeholderTranslation="scripts.modal.file_path_placeholder" valueBinding="filePath"}}
     <small class="pull-right help-block">{{t 'scripts.modal.file_path_hint'}}</small>
     <small class="pull-right help-block">{{t 'scripts.modal.file_path_hint'}}</small>
   </div>
   </div>

+ 6 - 3
contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptList.hbs

@@ -30,9 +30,9 @@
         <th></th> 
         <th></th> 
       </tr>
       </tr>
     </thead>
     </thead>
-    <tbody> 
+    <tbody>
     {{#each content}}
     {{#each content}}
-      <tr> 
+      <tr>
 
 
         <td class="first">{{#link-to 'pig.scriptEdit' this.id}}
         <td class="first">{{#link-to 'pig.scriptEdit' this.id}}
           {{#if this.isNew}}
           {{#if this.isNew}}
@@ -43,7 +43,7 @@
           {{/unless}}
           {{/unless}}
         {{/link-to}}</td>
         {{/link-to}}</td>
         <td><span class="date">{{showDate this.dateCreated 'YYYY-MM-DD HH:mm'}}</span></td>
         <td><span class="date">{{showDate this.dateCreated 'YYYY-MM-DD HH:mm'}}</span></td>
-        <td> 
+        <td>
           {{#unless this.isNew}}
           {{#unless this.isNew}}
             <a>{{t 'common.history'}}</a> - <a>{{t 'common.clone'}}</a> - <a href="#" {{action "deletescript" this}}>{{t 'common.delete'}}</a>
             <a>{{t 'common.history'}}</a> - <a>{{t 'common.clone'}}</a> - <a href="#" {{action "deletescript" this}}>{{t 'common.delete'}}</a>
           {{/unless}}
           {{/unless}}
@@ -52,6 +52,9 @@
     {{/each}}
     {{/each}}
     </tbody>
     </tbody>
   </table>
   </table>
+  {{#unless content}}
+    <div class="panel-footer empty-table-footer">{{t 'scripts.noScripts'}}</div>
+  {{/unless}}
 </div>
 </div>
 
 
 {{outlet modal}}
 {{outlet modal}}

+ 4 - 0
contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/udfs.hbs

@@ -42,4 +42,8 @@
     {{/each}}
     {{/each}}
     </tbody>
     </tbody>
   </table>
   </table>
+
+  {{#unless content}}
+    <div class="panel-footer empty-table-footer">{{t 'udfs.noUDFs'}}</div>
+  {{/unless}}
 </div>
 </div>

+ 9 - 2
contrib/views/pig/src/main/resources/ui/pig-web/app/translations.js

@@ -34,13 +34,18 @@ Ember.I18n.translations = {
   'scripts':{
   'scripts':{
     'scripts':"Scripts",
     'scripts':"Scripts",
     'newscript': "New Script",
     'newscript': "New Script",
-    'title': "Title",
+    'title': "Name",
+    'path': "Script HDFS Location (optional)",
+    'noScripts': "No scripts to display",
     'modal':{
     'modal':{
-      'create_script':'Create script',
+      'create_script':'New Script',
+      'script_title_placeholder': 'Script name',
       'file_path_placeholder':'Full path to script file',
       'file_path_placeholder':'Full path to script file',
       'file_path_hint':'Leave empty to create file automatically.',
       'file_path_hint':'Leave empty to create file automatically.',
       'file_path_hint':'Leave empty to create file automatically.',
       'file_path_hint':'Leave empty to create file automatically.',
 
 
+      'error_empty_title':'Title can not be empty!',
+
       'confirm_delete':'Confirm Delete',
       'confirm_delete':'Confirm Delete',
       'confirm_delete_massage':'Are you sure you want to delete {{title}} script?'
       'confirm_delete_massage':'Are you sure you want to delete {{title}} script?'
     },
     },
@@ -71,6 +76,7 @@ Ember.I18n.translations = {
     'job_status':'Job status: ',
     'job_status':'Job status: ',
     'status':'Status',
     'status':'Status',
     'started':'Started',
     'started':'Started',
+    'noJobs': "No jobs to display",
     'alert':{
     'alert':{
       'job_started' :'Job started!',
       'job_started' :'Job started!',
       'job_killed' :'{{title}} job killed!',
       'job_killed' :'{{title}} job killed!',
@@ -95,6 +101,7 @@ Ember.I18n.translations = {
     'tooltips':{
     'tooltips':{
       'path':'Path of this script file on HDFS',
       'path':'Path of this script file on HDFS',
     },
     },
+    'noUDFs': "No UDFs to display",
     'alert':{
     'alert':{
       'udf_created':'{{name}} created!',
       'udf_created':'{{name}} created!',
       'udf_deleted':'{{name}} deleted!',
       'udf_deleted':'{{name}} deleted!',

+ 5 - 0
contrib/views/pig/src/main/resources/ui/pig-web/app/views/pig/modal/createScript.js

@@ -22,6 +22,11 @@ App.CreateScriptView = App.PigModalView.extend({
   templateName: 'pig/modal/createScript',
   templateName: 'pig/modal/createScript',
   actions:{
   actions:{
     create: function(script) {
     create: function(script) {
+      var title = this.controller.get('title');
+      if (!title) {
+        this.controller.set('error', Em.I18n.t('scripts.modal.error_empty_title'))
+        return;
+      }
       var filePath = this.controller.get('filePath');
       var filePath = this.controller.get('filePath');
       $(this.get('element')).find('.modal').modal('hide');
       $(this.get('element')).find('.modal').modal('hide');
       return this.controller.send('confirmcreate',script,filePath);
       return this.controller.send('confirmcreate',script,filePath);

+ 1 - 1
contrib/views/pig/src/main/resources/ui/pig-web/config.coffee

@@ -42,7 +42,7 @@ exports.config =
 
 
 
 
   paths:
   paths:
-    public: '/usr/lib/ambari-server/web/pig'
+    public: '/usr/lib/ambari-server/web/views-debug/PIG/PIG_1/'
 
 
   overrides:
   overrides:
     production:
     production: