瀏覽代碼

HUE-6465 [home] Properly load the editor when creating a new document from home

Romain Rigaux 8 年之前
父節點
當前提交
45e9e71

+ 3 - 3
desktop/core/src/desktop/templates/document_browser.mako

@@ -372,17 +372,17 @@ from desktop.views import _ko
                 % if 'oozie' in apps:
                   <li>
                     <a title="${_('Oozie Workflow')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('oozie:new_workflow') }') }, click: ${ is_embeddable and 'openHue4Link' or 'openExternalLink' }">
-                      <img src="${ static('oozie/art/icon_oozie_workflow_48.png') }" class="app-icon" alt="${ _('Oozie workflow icon') }"/> ${_('Oozie Workflow')}
+                      <img src="${ static('oozie/art/icon_oozie_workflow_48.png') }" class="app-icon" alt="${ _('Oozie workflow icon') }"/> ${_('Workflow') if is_embeddable else _('Oozie Workflow')}
                     </a>
                   </li>
                   <li>
                     <a title="${_('Oozie Coordinator')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('oozie:new_coordinator') }') }, click: ${ is_embeddable and 'openHue4Link' or 'openExternalLink' }">
-                      <img src="${ static('oozie/art/icon_oozie_coordinator_48.png') }" class="app-icon" alt="${ _('Oozie coordinator icon') }"/> ${_('Oozie Coordinator')}
+                      <img src="${ static('oozie/art/icon_oozie_coordinator_48.png') }" class="app-icon" alt="${ _('Oozie coordinator icon') }"/> ${_('Coordinator') if is_embeddable else _('Oozie Coordinator')}
                     </a>
                   </li>
                   <li>
                     <a title="${_('Oozie Bundle')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('oozie:new_bundle') }') }, click: ${ is_embeddable and 'openHue4Link' or 'openExternalLink' }">
-                      <img src="${ static('oozie/art/icon_oozie_bundle_48.png') }" class="app-icon" alt="${ _('Oozie bundle icon') }"/> ${_('Oozie Bundle')}
+                      <img src="${ static('oozie/art/icon_oozie_bundle_48.png') }" class="app-icon" alt="${ _('Oozie bundle icon') }"/> ${_('Bundle') if is_embeddable else _('Oozie Bundle')}
                     </a>
                   </li>
                 % endif

+ 4 - 3
desktop/core/src/desktop/templates/hue.mako

@@ -653,10 +653,11 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
           self.loadApp('editor');
 
           self.getActiveAppViewModel(function (viewModel) {
-            var editorType = statementOptions['type'] || 'hive'; // Next: use file extensions and default type of Editor for SQL
+            var editorType = statementOptions['type'] || 'hive'; // Next: use file extensions and default type of Editor for SQL            
             viewModel.newNotebook(editorType, function() {
-              if (statementOptions['statementType']) {
-                viewModel.selectedNotebook().snippets()[0].statementType(statementOptions['statementType']);
+              self.changeEditorType(statementOptions['statementType'] || editorType);
+
+              if (statementOptions['statementPath']) {
                 viewModel.selectedNotebook().snippets()[0].statementPath(statementOptions['statementPath']);
               }
               if (statementOptions['directoryUuid']) {