Browse Source

HUE-6077 [frontend] Fixed some Oozie workflow URLs

Enrico Berti 8 năm trước cách đây
mục cha
commit
e384d4fb4e

+ 6 - 1
apps/oozie/src/oozie/static/oozie/js/workflow-editor.ko.js

@@ -1241,7 +1241,12 @@ var WorkflowEditorViewModel = function (layout_json, workflow_json, credentials_
 
   self.schedule = function () {
     logGA('schedule');
-    window.location.replace('/oozie/editor/coordinator/new/?workflow=' + self.workflow.uuid());
+    if (IS_HUE_4) {
+      huePubSub.publish('page.route', '/oozie/editor/coordinator/new/?workflow=' + self.workflow.uuid());
+    }
+    else {
+      window.location.replace('/oozie/editor/coordinator/new/?workflow=' + self.workflow.uuid());
+    }
   };
 
   function bareWidgetBuilder(name, type) {

+ 3 - 3
apps/oozie/src/oozie/templates/editor2/workflow_editor.mako

@@ -431,7 +431,7 @@ ${ workflow.render() }
 
           <!-- ko if: name() == 'workflow' && $root.getSubWorkflow(value())-->
           <span data-bind="with: $root.getSubWorkflow(value())">
-            <a href="#" data-bind="attr: { href: '${ url('oozie:edit_workflow') }' + '?workflow=' + $data.value() }" target="_blank" title="${ _('Open') }">
+            <a href="#" data-bind="attr: { href: '${is_embeddable and '/hue' or ''}${ url('oozie:edit_workflow') }' + '?workflow=' + $data.value() }" target="_blank" title="${ _('Open') }">
               <i class="fa fa-external-link-square"></i>
             </a>
           </span>
@@ -518,7 +518,7 @@ ${ workflow.render() }
       <!-- ko foreach: $root.history -->
       <tr>
         <td data-bind="text: $data.date"></td>
-        <td><a data-bind="attr:{'href': '/oozie/list_oozie_workflow/' + $data.history.oozie_id() + '/' }, text: $data.history.oozie_id" target="_blank"></a></td>
+        <td><a data-bind="attr:{'href': '${is_embeddable and '/hue' or ''}/oozie/list_oozie_workflow/' + $data.history.oozie_id() + '/' }, text: $data.history.oozie_id" target="_blank"></a></td>
         <td><a class="pointer" data-bind="click: function(){$data.expanded(!$data.expanded())}"><i class="fa fa-info-circle"></i></a></td>
       </tr>
       <tr data-bind="slideVisible: $data.expanded">
@@ -529,7 +529,7 @@ ${ workflow.render() }
           <dd>
             <!-- ko if: typeof $parent.history.properties[$data] == 'function' -->
               <!-- ko if: typeof $parent.history.properties[$data]() == 'string' && $parent.history.properties[$data]().indexOf('/') == 0 -->
-                <a data-bind="text: $parent.history.properties[$data], attr: { href: '/filebrowser/view=' + $root.workflow.properties.deployment_dir() }" target="_blank"></a>
+                <a data-bind="text: $parent.history.properties[$data], attr: { href: '${is_embeddable and '/hue' or ''}/filebrowser/view=' + $root.workflow.properties.deployment_dir() }" target="_blank"></a>
               <!-- /ko -->
               <!-- ko ifnot: typeof $parent.history.properties[$data]() == 'string' && $parent.history.properties[$data]().indexOf('/') == 0 -->
               <span data-bind="text: $parent.history.properties[$data]"></span>