Browse Source

HUE-5853 [oozie] Port list of workflows to Hue 4

Enrico Berti 8 years ago
parent
commit
6eba212

+ 6 - 3
apps/oozie/src/oozie/templates/editor2/list_editor_workflows.mako

@@ -22,9 +22,11 @@
 <%namespace name="layout" file="../navigation-bar.mako" />
 <%namespace name="utils" file="../utils.inc.mako" />
 
+%if not is_embeddable:
 ${ commonheader(_("Workflows"), "oozie", user, request) | n,unicode }
-${ layout.menubar(section='workflows', is_editor=True) }
+%endif
 
+${ layout.menubar(section='workflows', is_editor=True) }
 
 <div id="editor">
 
@@ -92,7 +94,7 @@ ${ layout.menubar(section='workflows', is_editor=True) }
             <a data-bind="attr: { 'href': '${ url('oozie:open_old_workflow') }?workflow=' + id() }" data-row-selector="true"></a>
           <!-- /ko -->
           <!-- ko if: uuid() -->
-            <a data-bind="attr: { 'href': '${ url('oozie:edit_workflow') }?workflow=' + id() }" data-row-selector="true"></a>
+            <a data-bind="attr: { 'href': '${ is_embeddable and '/hue' or '' }${ url('oozie:edit_workflow') }?workflow=' + id() }" data-row-selector="true"></a>
           <!-- /ko -->
         </td>
         <td data-bind="text: name"></td>
@@ -296,5 +298,6 @@ ${ commonimportexport(request) | n,unicode }
   });
 </script>
 
-
+%if not is_embeddable:
 ${commonfooter(request, messages) | n,unicode}
+%endif

+ 2 - 1
apps/oozie/src/oozie/views/editor2.py

@@ -64,7 +64,8 @@ def list_editor_workflows(request):
     workflows.extend(workflows_v1)
 
   return render('editor2/list_editor_workflows.mako', request, {
-      'workflows_json': json.dumps(workflows, cls=JSONEncoderForHTML)
+    'workflows_json': json.dumps(workflows, cls=JSONEncoderForHTML),
+    'is_embeddable': request.GET.get('is_embeddable', False),
   })
 
 

+ 5 - 3
desktop/core/src/desktop/templates/hue.mako

@@ -524,7 +524,7 @@ ${ assist.assistPanel() }
         notebook: '/notebook',
         metastore: '/metastore/*',
         dashboard: '/dashboard/*',
-        oozie_workflow: '/oozie/editor/workflow/new/',
+        oozie_workflow: '/oozie/editor/workflow/*',
         oozie_coordinator: '/oozie/editor/coordinator/new/',
         oozie_bundle: '/oozie/editor/bundle/new/',
         jobbrowser: '/jobbrowser/apps',
@@ -553,7 +553,7 @@ ${ assist.assistPanel() }
         sqoop: '/sqoop',
       };
 
-      var SKIP_CACHE = ['dashboard', 'filebrowser', 'useradmin_users', 'useradmin_groups', 'useradmin_permissions', 'useradmin_configurations', 'useradmin_newuser', 'useradmin_addldap', 'useradmin_edituser'];
+      var SKIP_CACHE = ['oozie_workflow', 'dashboard', 'filebrowser', 'useradmin_users', 'useradmin_groups', 'useradmin_permissions', 'useradmin_configurations', 'useradmin_newuser', 'useradmin_addldap', 'useradmin_edituser'];
 
       var OnePageViewModel = function () {
         var self = this;
@@ -874,7 +874,9 @@ ${ assist.assistPanel() }
           self.loadApp('dashboard');
         });
 
-        page('/oozie/editor/workflow/new/', function(ctx){
+        page('/oozie/editor/workflow/*', function(ctx){
+          self.currentContextParams(ctx.params);
+          self.currentQueryString(ctx.querystring);
           self.loadApp('oozie_workflow');
         });