Quellcode durchsuchen

HUE-2559 [jb] Experimenting with addition of History in responsive menu

Romain Rigaux vor 9 Jahren
Ursprung
Commit
cdbeb850e7

+ 2 - 5
apps/jobbrowser/src/jobbrowser/templates/apps.mako

@@ -49,14 +49,11 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
 <script src="${ static('desktop/js/ko.charts.js') }"></script>
 <script src="${ static('desktop/ext/js/knockout-sortable.min.js') }"></script>
 <script src="${ static('desktop/js/ko.editable.js') }"></script>
+<script src="${ static('oozie/js/list-oozie-coordinator.ko.js') }"></script>
 
 % if not is_embeddable:
 
 ${ assist.assistJSModels() }
-
-<script src="${ static('oozie/js/list-oozie-coordinator.ko.js') }"></script>
-
-
 ${ assist.assistPanel() }
 
 <a title="${_('Toggle Assist')}" class="pointer show-assist" data-bind="visible: !$root.isLeftPanelVisible() && $root.assistAvailable(), click: function() { $root.isLeftPanelVisible(true); }">
@@ -200,7 +197,7 @@ ${ assist.assistPanel() }
 
 
 <script type="text/html" id="job-page">
-  <!-- ko if: type() == 'MAPREDUCE' -->
+  <!-- ko if: type() == 'MR2' -->
     <div data-bind="template: { name: 'job-mapreduce-page', data: $root.job() }"></div>
   <!-- /ko -->
 

+ 10 - 3
desktop/core/src/desktop/templates/responsive.mako

@@ -170,8 +170,7 @@ ${ hueIcons.symbols() }
       </div>
     </div>
     <div class="top-nav-right">
-      % if user.is_authenticated() and section != 'login':
-
+      % if user.is_authenticated() and section != 'login':        
         <div class="compose-action btn-group">
           <%
             view_profile = user.has_hue_permission(action="access_view:useradmin:edit_user", app="useradmin") or user.is_superuser
@@ -200,7 +199,14 @@ ${ hueIcons.symbols() }
         </div>
 
         <div class="compose-action btn-group">
-          <button class="btn" title="${_('Running jobs and workflows')}" data-bind="click: function(){ onePageViewModel.currentApp('jobbrowser') }">${ _('Jobs') } <div class="jobs-badge">20</div></button>
+          <button class="btn" title="${_('Submission history')}" data-bind="toggle: historyPanelVisible"><i class="fa fa-history"></i>  <div class="jobs-badge">20</div></button>
+        </div>
+        <div class="jobs-panel" data-bind="visible: historyPanelVisible" style="display: none;">
+          <span style="font-size: 15px; font-weight: 300">${_('Workflows')} (20)</span>
+        </div>
+
+        <div class="compose-action btn-group">
+          <button class="btn" title="${_('Running jobs and workflows')}" data-bind="click: function(){ onePageViewModel.currentApp('jobbrowser') }">${ _('Jobs') } </button>
           <button class="btn dropdown-toggle" data-bind="toggle: jobsPanelVisible">
             <span class="caret"></span>
           </button>
@@ -668,6 +674,7 @@ ${ assist.assistPanel() }
         self.searchHasFocus = ko.observable(false);
         self.searchInput = ko.observable();
         self.jobsPanelVisible = ko.observable(false);
+        self.historyPanelVisible = ko.observable(false);
 
         // TODO: Extract to common module (shared with nav search autocomplete)
         var SEARCH_FACET_ICON = 'fa-tags';

+ 3 - 0
desktop/libs/notebook/src/notebook/views.py

@@ -180,6 +180,7 @@ def execute_and_watch(request):
   elif action == 'index_query':
     if not destination:
       destination = _get_snippet_name(notebook)
+
     sql, success_url = api.export_data_as_table(notebook, snippet, destination, is_temporary=True, location='')
     editor = make_notebook(name='Execute and watch', editor_type=editor_type, statement=sql, status='ready-execute')
 
@@ -200,6 +201,8 @@ def execute_and_watch(request):
         ]
     }
 
+    file_format['inputFormat'] = 'hs2_handle'
+
     job_handle = _index(request, file_format, destination, query=notebook['uuid'])
     return redirect(reverse('oozie:list_oozie_workflow', kwargs={'job_id': job_handle['handle']['id']}))
   else: