Преглед изворни кода

HUE-4627 [editor] More intuitive names for query export to a directory task

Romain Rigaux пре 8 година
родитељ
комит
0847c6d

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

@@ -230,7 +230,7 @@ from desktop.views import _ko
             </div>
             <div class="clearfix"></div>
             <strong data-bind="text: name, attr: { title: uuid }"></strong>
-            <div data-bind="highlight: { value: 'statement' }"></div>
+            <div data-bind="highlight: { value: query }"></div>
           </li>
           <!-- /ko -->
         </ul>

+ 4 - 3
desktop/libs/notebook/src/notebook/api.py

@@ -29,7 +29,7 @@ from desktop.lib.i18n import smart_str
 from desktop.lib.django_util import JsonResponse
 from desktop.models import Document2, Document
 
-from notebook.connectors.base import get_api, Notebook, QueryExpired, SessionExpired, QueryError
+from notebook.connectors.base import get_api, Notebook, QueryExpired, SessionExpired, QueryError, _get_snippet_name
 from notebook.decorators import api_error_handler, check_document_access_permission, check_document_modify_permission
 from notebook.models import escape_rows, make_notebook
 from notebook.views import upgrade_session_properties
@@ -435,7 +435,7 @@ def get_history(request):
   for doc in docs.order_by('-last_modified')[:limit]:
     notebook = Notebook(document=doc).get_data()
     if 'snippets' in notebook:
-      statement = _get_statement(notebook)
+      statement = notebook['description'] if is_notification_manager else _get_statement(notebook)
       history.append({
         'name': doc.name,
         'id': doc.id,
@@ -645,7 +645,8 @@ def export_result(request):
       sql, success_url = api.export_large_data_to_hdfs(notebook, snippet, destination)
 
       task = make_notebook(
-        name='Execute and watch',
+        name=_('Export %s to directory') % snippet['type'],
+        description=_('Query %s to %s') % (_get_snippet_name(notebook), success_url),
         editor_type=snippet['type'],
         statement=sql,
         status='ready-execute',

+ 1 - 1
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1086,7 +1086,7 @@ var EditorViewModel = (function() {
             notebook.history.unshift(
               notebook._makeHistoryRecord(
                 url,
-                data.handle.statement,
+                vm.isNotificationManager() ? notebook.description() : data.handle.statement,
                 self.lastExecuted(),
                 self.status(),
                 notebook.name(),

+ 1 - 1
desktop/libs/notebook/src/notebook/views.py

@@ -23,7 +23,7 @@ from django.db.models import Q
 from django.shortcuts import redirect
 from django.utils.translation import ugettext as _
 
-from desktop.conf import USE_NEW_EDITOR, IS_HUE_4
+from desktop.conf import USE_NEW_EDITOR
 from desktop.lib.django_util import render, JsonResponse
 from desktop.lib.exceptions_renderable import PopupException
 from desktop.lib.json_utils import JSONEncoderForHTML