Prechádzať zdrojové kódy

HUE-6428 [editor] Java type does not provide fields for arguments

Romain Rigaux 8 rokov pred
rodič
commit
27584a1

+ 1 - 1
desktop/core/src/desktop/templates/config_ko_components.mako

@@ -614,7 +614,7 @@ from desktop.views import _ko
     <ul data-bind="sortable: { data: values, options: { axis: 'y', containment: 'parent', handle: '.move-widget' }}, visible: values().length" class="unstyled">
     <ul data-bind="sortable: { data: values, options: { axis: 'y', containment: 'parent', handle: '.move-widget' }}, visible: values().length" class="unstyled">
       <li>
       <li>
         <div class="input-append" style="margin-bottom: 4px">
         <div class="input-append" style="margin-bottom: 4px">
-          <input type="text" class="filechooser-input" data-bind="value: path, valueUpdate:'afterkeydown', filechooser: { value: path, isAddon: true }, filechooserOptions: { skipInitialPathIfEmpty: true }" placeholder="${ _('Path to the file, e.g. hdfs://localhost:8020/user/hue/file.hue') }"/>
+          <input type="text" class="filechooser-input input-xxlarge" data-bind="value: path, valueUpdate:'afterkeydown', filechooser: { value: path, isAddon: true }, filechooserOptions: { skipInitialPathIfEmpty: true }" placeholder="${ _('Path to the file, e.g. hdfs://localhost:8020/user/hue/file.hue') }"/>
           <span class="add-on move-widget muted" data-bind="visible: $parent.values().length > 1"><i class="fa fa-arrows"></i></span>
           <span class="add-on move-widget muted" data-bind="visible: $parent.values().length > 1"><i class="fa fa-arrows"></i></span>
           <a class="add-on muted" href="javascript: void(0);" data-bind="click: function(){ $parent.removeValue($data); }"><i class="fa fa-minus"></i></a>
           <a class="add-on muted" href="javascript: void(0);" data-bind="click: function(){ $parent.removeValue($data); }"><i class="fa fa-minus"></i></a>
         </div>
         </div>

+ 1 - 1
desktop/libs/notebook/src/notebook/connectors/oozie_batch.py

@@ -64,7 +64,7 @@ class OozieApi(Api):
     if not notebook.get('uuid', ''):
     if not notebook.get('uuid', ''):
       raise PopupException(_('Notebook is missing a uuid, please save the notebook before executing as a batch job.'))
       raise PopupException(_('Notebook is missing a uuid, please save the notebook before executing as a batch job.'))
 
 
-    if notebook['type'] == 'notebook':
+    if notebook['type'] == 'notebook' or notebook['type'] == 'query-java':
       # Convert notebook to workflow
       # Convert notebook to workflow
       workflow_doc = WorkflowBuilder().create_notebook_workflow(notebook=notebook, user=self.user, managed=True, name=_("%s for %s") % (OozieApi.BATCH_JOB_PREFIX, notebook['name'] or notebook['type']))
       workflow_doc = WorkflowBuilder().create_notebook_workflow(notebook=notebook, user=self.user, managed=True, name=_("%s for %s") % (OozieApi.BATCH_JOB_PREFIX, notebook['name'] or notebook['type']))
       workflow = Workflow(document=workflow_doc, user=self.user)
       workflow = Workflow(document=workflow_doc, user=self.user)

+ 6 - 0
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -1543,6 +1543,12 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
           <input type="text" class="input-xxlarge" data-bind="value: properties().class, valueUpdate: 'afterkeydown'" placeholder="${ _('Class name of application, e.g. org.apache.oozie.example.SparkFileCopy') }"/>
           <input type="text" class="input-xxlarge" data-bind="value: properties().class, valueUpdate: 'afterkeydown'" placeholder="${ _('Class name of application, e.g. org.apache.oozie.example.SparkFileCopy') }"/>
         </div>
         </div>
       </div>
       </div>
+      <div class="control-group">
+        <label class="control-label">${_('Variables')}</label>
+        <div class="controls">
+          <!-- ko template: { if: typeof properties().arguments != 'undefined', name: 'property', data: { type: 'csv-hdfs-files', label: '${ _ko("Arguments") }', value: properties().arguments, title: '${ _ko("Arguments for the script") }', placeholder: '${ _ko("e.g. MAX=10, PATH=$PATH:/user/path") }' } } --><!-- /ko -->
+        </div>
+      </div>
       <!-- /ko -->
       <!-- /ko -->
       <!-- ko if: type() == 'py'-->
       <!-- ko if: type() == 'py'-->
       <div class="control-group">
       <div class="control-group">