Эх сурвалжийг харах

HUE-9141 [frontend] Add owner and modified data in the context popover footer for documents

Johan Ahlen 5 жил өмнө
parent
commit
a30b31cb40

+ 4 - 0
desktop/core/src/desktop/api2.py

@@ -973,6 +973,8 @@ def search_entities(request):
           'hue_name': _highlight(search_text, escape(e.name)),
           'hue_description': _highlight(search_text, escape(e.description)),
           'type': 'HUE',
+          'last_modified': e.last_modified,
+          'owner': escape(e.owner),
           'doc_type': escape(e.type),
           'originalName': escape(e.name),
           'link': e.get_absolute_url()
@@ -1003,6 +1005,8 @@ def search_entities_interactive(request):
           'hue_description': _highlight(search_text, escape(e.description)),
           'link': e.get_absolute_url(),
           'doc_type': escape(e.type),
+          'last_modified': e.last_modified,
+          'owner': escape(e.owner),
           'type': 'HUE',
           'uuid': e.uuid,
           'parentUuid': e.parent_directory.uuid,

+ 14 - 0
desktop/core/src/desktop/js/ko/components/contextPopover/ko.contextPopover.js

@@ -67,6 +67,20 @@ const SUPPORT_TEMPLATES = `
         <!-- /ko -->
         <!-- /ko -->
       </div>
+      <!-- ko if: isDocument -->
+        <div class="context-popover-bottom-attributes">
+        <!-- ko with: contents -->
+          <!-- ko if: data && data.owner -->
+          <div><span>${I18n('Owner')}</span> <span data-bind="text: data.owner"></span></div>
+          <!-- /ko -->
+          <!-- ko if: data && data.last_modified -->
+          <div><span>${I18n(
+            'Modified'
+          )}</span> <span data-bind="text: data.last_modified"></span></div>
+          <!-- /ko -->
+        <!-- /ko -->
+        </div>
+      <!-- /ko -->
     </div>
   </script>
 

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue.css


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue3-extra.css


+ 21 - 0
desktop/core/src/desktop/static/desktop/less/components/hue-popover.less

@@ -324,6 +324,27 @@
   margin-left: 10px;
 }
 
+.context-popover-bottom-attributes {
+  padding: 7px 0 0 7px;
+  .nowrap-ellipsis;
+
+  > div {
+    display: inline-block;
+    font-size: 12px;
+    margin-right: 5px;
+
+    > span:first-child {
+      color: @cui-gray-700;
+      margin-right: 3px;
+    }
+
+    > span:last-child {
+      font-weight: 300;
+      color: @cui-gray-900;
+    }
+  }
+}
+
 .context-popover-inline-search {
   border-radius: 8px !important;
   min-height: 18px !important;

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно