Explorar o código

HUE-3450 [assit] Add more links and icons to the search

Romain Rigaux %!s(int64=9) %!d(string=hai) anos
pai
achega
9b0fb2f

+ 20 - 0
desktop/core/src/desktop/templates/assist.mako

@@ -792,6 +792,21 @@ from desktop.views import _ko
               <!-- ko if: type === 'SOURCE' -->
               <i class="fa fa-fw fa-server valign-middle"></i>
               <!-- /ko -->
+              <!-- ko if: type === 'SUB_OPERATION' -->
+              <i class="fa fa-fw fa-code-fork valign-middle"></i>
+              <!-- /ko -->
+              <!-- ko if: type === 'FIELD' -->
+              <i class="fa fa-fw fa-code-columns valign-middle"></i>
+              <!-- /ko -->
+              <!-- ko if: type === 'OPERATION_EXECUTION' -->
+              <i class="fa fa-fw fa-cog valign-middle"></i>
+              <!-- /ko -->
+              <!-- ko if: type === 'OPERATION' -->
+              <i class="fa fa-fw fa-cogs valign-middle"></i>
+              <!-- /ko -->
+              <!-- ko if: type === 'PARTITION' -->
+              <i class="fa fa-fw fa-th valign-middle"></i>
+              <!-- /ko -->
             </div>
             <div class="doc-col">
               <a data-bind="attr: { 'href': link }, text: originalName" target="_blank" ></a>
@@ -802,6 +817,9 @@ from desktop.views import _ko
               <div class="doc-desc" data-bind="text: originalDescription"></div>
               <div class="doc-desc" data-bind="text: parentPath"></div>
               <!-- /ko -->
+              <!-- ko if: type === 'SUB_OPERATION' -->
+              <div class="doc-desc" data-bind="text: metaClassName"></div>
+              <!-- /ko -->
               <!-- ko if: type === 'SOURCE' -->
               <div class="doc-desc" data-bind="text: 'Cluster: ' + clusterName"></div>
               <!-- /ko -->
@@ -1148,6 +1166,8 @@ from desktop.views import _ko
                     entity.link = '/metastore/table' + entity.parentPath + '/' + entity.originalName;
                   } else if (entity.type === 'SOURCE') {
                     entity.link = entity.sourceUrl;
+                  } else if (entity.type === 'OPERATION_EXECUTION') {
+                    entity.link = '/jobbrowser/jobs/' + entity.jobID;
                   } else if (entity.type === 'DIRECTORY' || entity.type === 'FILE') {
                     entity.link = '/filebrowser/#' + entity.fileSystemPath;
                   } else {

+ 2 - 2
desktop/libs/metadata/src/metadata/optimizer_tests.py

@@ -128,7 +128,7 @@ class TestOptimizerApi(object):
     resp = self.api.authenticate()
     token = resp['token']
 
-    resp = self.api.table_details(table_name='orders', token=token)
+    resp = self.api.table_details(table_name='store_sales', token=token)
 
     assert_equal('success', resp['status'], resp)
 
@@ -140,7 +140,7 @@ class TestOptimizerApi(object):
 
     resp = self.api.query_compatibility(source_platform=source_platform, target_platform=target_platform, query=query)
 
-    assert_equal('success', resp['status'], resp)
+    assert_equal('successs', resp['status'], resp)
 
     details = json.loads(resp['details']) # Auto fix suggestion is empty in most of the cases currently