Bläddra i källkod

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

Enrico Berti 8 år sedan
förälder
incheckning
9fc8033

+ 6 - 1
apps/oozie/src/oozie/templates/editor2/list_editor_bundles.mako

@@ -23,7 +23,10 @@
 <%namespace name="layout" file="../navigation-bar.mako" />
 <%namespace name="utils" file="../utils.inc.mako" />
 
+%if not is_embeddable:
 ${ commonheader(_("Bundles"), "oozie", user, request) | n,unicode }
+%endif
+
 ${ layout.menubar(section='bundles', is_editor=True) }
 
 <div id="editor">
@@ -92,7 +95,7 @@ ${ layout.menubar(section='bundles', is_editor=True) }
             <a data-bind="attr: { 'href': '${ url('oozie:open_old_bundle') }?bundle=' + id() }" data-row-selector="true"></a>
           <!-- /ko -->
           <!-- ko if: uuid() -->
-            <a data-bind="attr: { 'href': '${ url('oozie:edit_bundle') }?bundle=' + id() }" data-row-selector="true"></a>
+            <a data-bind="attr: { 'href': '${ is_embeddable and '/hue' or '' }${ url('oozie:edit_bundle') }?bundle=' + id() }" data-row-selector="true"></a>
           <!-- /ko -->
         </td>
         <td data-bind="text: name"></td>
@@ -297,4 +300,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

@@ -726,7 +726,8 @@ def list_editor_bundles(request):
     bundles.extend(bundles_v1)
 
   return render('editor2/list_editor_bundles.mako', request, {
-      'bundles_json': json.dumps(bundles, cls=JSONEncoderForHTML)
+    'bundles_json': json.dumps(bundles, cls=JSONEncoderForHTML),
+    'is_embeddable': request.GET.get('is_embeddable', False),
   })
 
 

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

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