Explorar o código

[assist] Added documents icons

Enrico Berti %!s(int64=10) %!d(string=hai) anos
pai
achega
21d09f3

+ 4 - 3
desktop/core/src/desktop/static/desktop/js/assist/assistDocuments.js

@@ -35,9 +35,10 @@
    * @param {AssistDocument[]} documents
    * @constructor
    */
-  function AssistDocumentType(type, documents) {
+  function AssistDocumentType(name, type, documents) {
     var self = this;
-    self.name = type;
+    self.name = name || type;
+    self.type = type;
     self.documents = documents;
     self.open = ko.observable(false);
   }
@@ -73,7 +74,7 @@
 
       var types = [];
       $.each(documentsByType, function (key, value) {
-        types.push(new AssistDocumentType(self.i18n.documentTypes[key], value))
+        types.push(new AssistDocumentType(self.i18n.documentTypes[key], key, value))
       });
 
       self.availableTypes(types);

+ 30 - 1
desktop/core/src/desktop/templates/assist.mako

@@ -24,6 +24,14 @@ from desktop.views import _ko
 <%def name="assistPanel()">
   <style>
 
+    .assist-icon {
+      width: 16px;
+      height: 16px;
+      -webkit-filter: grayscale(1);
+      filter: grayscale(1);
+      opacity: .8;
+    }
+
     .assist {
       position: relative;
       height: 100%;
@@ -321,7 +329,28 @@ from desktop.views import _ko
       <ul class="assist-tables" data-bind="foreach: availableTypes">
         <li class="assist-table">
           <a class="assist-entry assist-table-link" href="javascript: void(0);" data-bind="click: function () { open(! open()) }">
-            <i class="fa fa-fw fa-question muted"></i>
+            <!-- ko if: type == 'query-hive' || type == 'query' -->
+            <img src="${ static('beeswax/art/icon_beeswax_48.png') }" class="assist-icon"/>
+            <!-- /ko -->
+            <!-- ko if: type == 'query-impala' -->
+            <img src="${ static('impala/art/icon_impala_48.png') }" class="assist-icon"/>
+            <!-- /ko -->
+            <!-- ko if: type == 'notebook' -->
+            <i class="fa fa-fw fa-tags muted"></i>
+            <!-- /ko -->
+            <!-- ko if: type == 'oozie-workflow2' -->
+            <img src="${ static('oozie/art/icon_oozie_workflow_48.png') }" class="assist-icon"/>
+            <!-- /ko -->
+            <!-- ko if: type == 'oozie-coordinator2' -->
+            <img src="${ static('oozie/art/icon_oozie_coordinator_48.png') }" class="assist-icon"/>
+            <!-- /ko -->
+            <!-- ko if: type == 'oozie-bundle2' -->
+            <img src="${ static('oozie/art/icon_oozie_bundle_48.png') }" class="assist-icon"/>
+            <!-- /ko -->
+            <!-- ko if: type == 'search-dashboard' -->
+            <i class="fa fa-fw fa-search muted"></i>
+            <!-- /ko -->
+
             <span data-bind="text: name"></span>
           </a>
           <ul data-bind="slideVisible: open, foreach: documents">

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

@@ -421,7 +421,7 @@ from django.utils.translation import ugettext as _
            % endif
            % if 'impala' in apps:
              <li><a href="/${apps['impala'].display_name}"><img src="${ static(apps['impala'].icon_path) }" class="app-icon"/> ${_('Impala')}</a></li>
-             % if USE_NEW_EDITOR.get(): # impala requies beeswax anyway
+             % if USE_NEW_EDITOR.get(): ## impala requires beeswax anyway
              <li><a href="${ url('notebook:editor') }?type=impala"><img src="${ static(apps['impala'].icon_path) }" class="app-icon"/> ${_('New Impala')}</a></li>
              % endif
            % endif