Browse Source

HUE-3727 [home] Add new query links action on homepage in old Hue

Romain Rigaux 8 years ago
parent
commit
bb0b167

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

@@ -650,7 +650,7 @@ from desktop.views import _ko
                     % if is_embeddable:
                     % if is_embeddable:
                       data-bind="click: function() { huePubSub.publish('open.editor.new.query', {type: 'hive', 'directoryUuid': getDirectory()}); }" href="javascript:void(0);"
                       data-bind="click: function() { huePubSub.publish('open.editor.new.query', {type: 'hive', 'directoryUuid': getDirectory()}); }" href="javascript:void(0);"
                     % else:
                     % else:
-                      data-bind="attr: { href: addDirectoryParamToUrl('${ url('notebook:editor') }?type=hive')}"
+                      data-bind="attr: { href: addDirectoryParamToUrl('${ url('notebook:editor') }?type=hive') }, click: openExternalLink"
                     % endif
                     % endif
                     >
                     >
                       <img src="${ static(apps['beeswax'].icon_path) }" class="app-icon" alt="${ _('Hive icon') }"/> ${_('Hive Query')}
                       <img src="${ static(apps['beeswax'].icon_path) }" class="app-icon" alt="${ _('Hive icon') }"/> ${_('Hive Query')}
@@ -662,8 +662,8 @@ from desktop.views import _ko
                     <a title="${_('Impala Query')}"
                     <a title="${_('Impala Query')}"
                     % if is_embeddable:
                     % if is_embeddable:
                       data-bind="click: function() { huePubSub.publish('open.editor.new.query', {type: 'impala', 'directoryUuid': getDirectory()}); }" href="javascript:void(0);"
                       data-bind="click: function() { huePubSub.publish('open.editor.new.query', {type: 'impala', 'directoryUuid': getDirectory()}); }" href="javascript:void(0);"
-                    else:
-                      data-bind="attr: { href: addDirectoryParamToUrl('${ url('notebook:editor') }?type=impala') }, click: ${ is_embeddable and 'openHue4Link' or 'openExternalLink' }"
+                    % else:
+                      data-bind="attr: { href: addDirectoryParamToUrl('${ url('notebook:editor') }?type=impala') }, click: openExternalLink"
                     % endif
                     % endif
                     >
                     >
                       <img src="${ static(apps['impala'].icon_path) }" class="app-icon" alt="${ _('Impala icon') }"/> ${_('Impala Query')}
                       <img src="${ static(apps['impala'].icon_path) }" class="app-icon" alt="${ _('Impala icon') }"/> ${_('Impala Query')}

+ 2 - 2
desktop/core/src/desktop/templates/hue.mako

@@ -193,7 +193,7 @@ ${ hueIcons.symbols() }
           %>
           %>
           <button class="btn"
           <button class="btn"
           % if view_profile:
           % if view_profile:
-            data-bind="click: function(){ page('/home') }" title="${ _('View Profile') if is_ldap_setup else _('Edit Profile') }"
+            data-bind="click: function(){ page('/useradmin/users/') }" title="${ _('View Profile') if is_ldap_setup else _('Edit Profile') }"
           % endif
           % endif
           >
           >
           ${ user.username }
           ${ user.username }
@@ -571,7 +571,7 @@ ${ assist.assistPanel() }
               hueUtils.waitForObservable(viewModel.selectedNotebook, function(){
               hueUtils.waitForObservable(viewModel.selectedNotebook, function(){
                 viewModel.selectedNotebook().selectedSnippet(type);
                 viewModel.selectedNotebook().selectedSnippet(type);
                 viewModel.editorType(type);
                 viewModel.editorType(type);
-                viewModel.newNotebook();
+                viewModel.newNotebook(type);
               });
               });
             }
             }
           })
           })

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

@@ -2606,7 +2606,7 @@ var EditorViewModel = (function() {
 
 
     self.newNotebook = function (editorType, callback) {
     self.newNotebook = function (editorType, callback) {
       $.post("/notebook/api/create_notebook", {
       $.post("/notebook/api/create_notebook", {
-        type: options.editor_type || editorType || 'hive',
+        type: editorType || options.editor_type,
         directory_uuid: window.location.getParameter('directory_uuid')
         directory_uuid: window.location.getParameter('directory_uuid')
       }, function (data) {
       }, function (data) {
         self.loadNotebook(data.notebook);
         self.loadNotebook(data.notebook);