Explorar o código

HUE-6077 [frontend] Changed 'responsive' to simply 'hue'

Enrico Berti %!s(int64=8) %!d(string=hai) anos
pai
achega
e3c8bb7

+ 2 - 2
apps/metastore/src/metastore/static/metastore/js/metastore.ko.js

@@ -709,7 +709,7 @@ var MetastoreViewModel = (function () {
     self.partitionsLimit = options.partitionsLimit;
     self.assistAvailable = ko.observable(true);
     self.apiHelper = ApiHelper.getInstance(options);
-    self.isResponsive = ko.observable(options.responsive);
+    self.isHue4 = ko.observable(options.hue4);
     self.isLeftPanelVisible = ko.observable();
     self.apiHelper.withTotalStorage('assist', 'assist_panel_visible', self.isLeftPanelVisible, true);
     self.optimizerEnabled = ko.observable(options.optimizerEnabled || false);
@@ -802,7 +802,7 @@ var MetastoreViewModel = (function () {
 
     huePubSub.subscribe('metastore.url.change', function () {
       var prefix = '/metastore/';
-      if (self.isResponsive()){
+      if (self.isHue4()){
         prefix = '?app=metastore&path=';
       }
       if (self.database() && self.database().table()) {

+ 1 - 1
apps/metastore/src/metastore/templates/metastore.mako

@@ -1211,7 +1211,7 @@ ${ components.menubar() }
       var options = {
         user: '${ user.username }',
         % if is_embeddable:
-        responsive: true,
+        hue4: true,
         % endif
         i18n: {
           errorFetchingTableDetails: '${_('An error occurred fetching the table details. Please try again.')}',

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/document/hueFileEntry.js

@@ -511,7 +511,7 @@ var HueFileEntry = (function () {
     location.href = $(event.target).attr('href');
   };
 
-  HueFileEntry.prototype.openResponsiveLink = function (entry, event) {
+  HueFileEntry.prototype.openHue4Link = function (entry, event) {
     event.preventDefault();
     huePubSub.publish('open.link', $(event.target).attr('href'));
   };

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

@@ -645,27 +645,27 @@ from desktop.views import _ko
               <a class="inactive-action doc-browser-action" title="${_('New document')}" data-toggle="dropdown" data-bind="tooltip: { placement: 'bottom', delay: 750 }, css: { 'disabled': isTrash() || isTrashed() }" href="javascript:void(0);"><span class="fa-stack fa-fw" style="width: 1.28571429em"><i class="fa fa-file-o fa-stack-1x"></i><i class="fa fa-plus-circle fa-stack-1x" style="font-size: 14px; margin-left: 6px; margin-top: 6px;"></i></span></a>
               <ul class="dropdown-menu less-padding document-types" style="margin-top:10px; width: 175px;" role="menu">
                 % if 'beeswax' in apps:
-                  <li><a title="${_('Hive Query')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('notebook:editor') }?type=hive') }, click: ${ is_embeddable and 'openResponsiveLink' or 'openExternalLink' }"><img src="${ static(apps['beeswax'].icon_path) }" class="app-icon" alt="${ _('Hive icon') }"/> ${_('Hive Query')}</a></li>
+                  <li><a title="${_('Hive Query')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('notebook:editor') }?type=hive') }, click: ${ is_embeddable and 'openHue4Link' or 'openExternalLink' }"><img src="${ static(apps['beeswax'].icon_path) }" class="app-icon" alt="${ _('Hive icon') }"/> ${_('Hive Query')}</a></li>
                 % endif
                 % if 'impala' in apps:
-                  <li><a title="${_('Impala Query')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('notebook:editor') }?type=impala') }, click: ${ is_embeddable and 'openResponsiveLink' or 'openExternalLink' }"><img src="${ static(apps['impala'].icon_path) }" class="app-icon" alt="${ _('Impala icon') }"/> ${_('Impala Query')}</a></li>
+                  <li><a title="${_('Impala Query')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('notebook:editor') }?type=impala') }, click: ${ is_embeddable and 'openHue4Link' or 'openExternalLink' }"><img src="${ static(apps['impala'].icon_path) }" class="app-icon" alt="${ _('Impala icon') }"/> ${_('Impala Query')}</a></li>
                 % endif
                 % if 'pig' in apps:
-                  <li><a title="${_('Pig Script')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('pig:index') }') }, click: ${ is_embeddable and 'openResponsiveLink' or 'openExternalLink' }"><img src="${ static(apps['pig'].icon_path) }" class="app-icon" alt="${ _('Pig icon') }"/> ${_('Pig Script')}</a></li>
+                  <li><a title="${_('Pig Script')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('pig:index') }') }, click: ${ is_embeddable and 'openHue4Link' or 'openExternalLink' }"><img src="${ static(apps['pig'].icon_path) }" class="app-icon" alt="${ _('Pig icon') }"/> ${_('Pig Script')}</a></li>
                 % endif
                 <%
                 from notebook.conf import SHOW_NOTEBOOKS
                 %>
                 % if SHOW_NOTEBOOKS.get():
-                  <li><a title="${_('Notebook')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('notebook:index') }') }, click: ${ is_embeddable and 'openResponsiveLink' or 'openExternalLink' }"><i style="font-size: 24px; line-height: 24px; vertical-align: middle; color: #338BB8;" class="fa app-icon fa-fw fa-file-text-o"></i> ${_('Notebook')}</a></li>
+                  <li><a title="${_('Notebook')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('notebook:index') }') }, click: ${ is_embeddable and 'openHue4Link' or 'openExternalLink' }"><i style="font-size: 24px; line-height: 24px; vertical-align: middle; color: #338BB8;" class="fa app-icon fa-fw fa-file-text-o"></i> ${_('Notebook')}</a></li>
                 % endif
                 % if 'oozie' in apps:
-                  <li><a title="${_('Oozie Workflow')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('oozie:new_workflow') }') }, click: ${ is_embeddable and 'openResponsiveLink' or 'openExternalLink' }"><img src="${ static('oozie/art/icon_oozie_workflow_48.png') }" class="app-icon" alt="${ _('Oozie workflow icon') }"/> ${_('Oozie Workflow')}</a></li>
-                  <li><a title="${_('Oozie Coordinator')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('oozie:new_coordinator') }') }, click: ${ is_embeddable and 'openResponsiveLink' or 'openExternalLink' }"><img src="${ static('oozie/art/icon_oozie_coordinator_48.png') }" class="app-icon" alt="${ _('Oozie coordinator icon') }"/> ${_('Oozie Coordinator')}</a></li>
-                  <li><a title="${_('Oozie Bundle')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('oozie:new_bundle') }') }, click: ${ is_embeddable and 'openResponsiveLink' or 'openExternalLink' }"><img src="${ static('oozie/art/icon_oozie_bundle_48.png') }" class="app-icon" alt="${ _('Oozie bundle icon') }"/> ${_('Oozie Bundle')}</a></li>
+                  <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')}</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')}</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')}</a></li>
                 % endif
                 % if 'search' in apps:
-                  <li><a title="${_('Solr Search')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('search:index') }') }, click: ${ is_embeddable and 'openResponsiveLink' or 'openExternalLink' }"><img src="${ static('search/art/icon_search_48.png') }" class="app-icon" alt="${ _('Search icon') }"/> ${_('Search Dashboard')}</a></li>
+                  <li><a title="${_('Solr Search')}" data-bind="attr: { href: addDirectoryParamToUrl('${ url('search:index') }') }, click: ${ is_embeddable and 'openHue4Link' or 'openExternalLink' }"><img src="${ static('search/art/icon_search_48.png') }" class="app-icon" alt="${ _('Search icon') }"/> ${_('Search Dashboard')}</a></li>
                 % endif
               </ul>
             </span>

+ 0 - 0
desktop/core/src/desktop/templates/responsive.mako → desktop/core/src/desktop/templates/hue.mako


+ 2 - 2
desktop/core/src/desktop/urls.py

@@ -93,8 +93,8 @@ dynamic_patterns += patterns('desktop.views',
 
   # Mobile
   (r'^assist_m', 'assist_m'),
-  # Responsive
-  (r'^responsive', 'responsive'),
+  # Hue 4
+  (r'^hue', 'hue'),
 
   # KO components, change to doc?name=ko_editor or similar
   (r'^ko_editor', 'ko_editor'),

+ 3 - 3
desktop/core/src/desktop/views.py

@@ -67,10 +67,10 @@ def is_alive(request):
   return HttpResponse('')
 
 
-def responsive(request):
+def hue(request):
   apps = appmanager.get_apps_dict(request.user)
 
-  return render('responsive.mako', request, {
+  return render('hue.mako', request, {
     'apps': apps,
     'tours_and_tutorials': Settings.get_settings().tours_and_tutorials,
     'interpreters': get_ordered_interpreters(request.user),
@@ -349,7 +349,7 @@ def index(request):
     return redirect(reverse('about:index'))
   else:
     if IS_HUE_4.get():
-      return responsive(request)
+      return hue(request)
     elif USE_NEW_EDITOR.get():
       return home2(request)
     else:

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

@@ -295,7 +295,7 @@ var EditorViewModel = (function() {
       }
     });
 
-    // TODO: It should only publish if this belongs to the currently active app in responsive
+    // TODO: It should only publish if this belongs to the currently active app in Hue 4
     huePubSub.subscribe('get.active.snippet.type', function () {
       if (self.inFocus() || notebook.snippets().length === 1) {
         huePubSub.publish('set.active.snippet.type', self.type());
@@ -1055,8 +1055,8 @@ var EditorViewModel = (function() {
 
         if (vm.editorMode() && data.history_id && ! vm.isNotificationManager()) {
           var url = '/notebook/editor' + (vm.isMobile() ? '_m' : '') + '?editor=' + data.history_id;
-          if (vm.isResponsive()){
-            url = vm.URLS.responsive + '&editor=' + data.history_id;
+          if (vm.isHue4()){
+            url = vm.URLS.hue4 + '&editor=' + data.history_id;
           }
           vm.changeURL(url);
           notebook.id(data.history_id);
@@ -1977,16 +1977,16 @@ var EditorViewModel = (function() {
               self.schedulerViewModel.coordinator.refreshParameters();
             }
 
-            if (vm.isResponsive()){
-              vm.changeURL(vm.URLS.responsive + '&editor=' + data.id);
+            if (vm.isHue4()){
+              vm.changeURL(vm.URLS.hue4 + '&editor=' + data.id);
             }
             else {
               vm.changeURL('/notebook/editor' + (vm.isMobile() ? '_m' : '') + '?editor=' + data.id);
             }
           }
           else {
-            if (vm.isResponsive()){
-              vm.changeURL(vm.URLS.responsive_notebook + '&notebook=' + data.id);
+            if (vm.isHue4()){
+              vm.changeURL(vm.URLS.hue4_notebook + '&notebook=' + data.id);
             }
             else {
               vm.changeURL('/notebook/notebook?notebook=' + data.id);
@@ -2168,8 +2168,8 @@ var EditorViewModel = (function() {
         if (self.isHistory()) {
           self.id(null);
           self.uuid(UUID());
-          if (vm.isResponsive()) {
-            vm.changeURL(vm.URLS.responsive + '&type=' + vm.editorType());
+          if (vm.isHue4()) {
+            vm.changeURL(vm.URLS.hue4 + '&type=' + vm.editorType());
           }
           else {
             vm.changeURL('/notebook/editor' + (vm.isMobile() ? '_m' : '') + '?type=' + vm.editorType());
@@ -2319,14 +2319,14 @@ var EditorViewModel = (function() {
       editor: '/notebook/editor',
       editorMobile: '/notebook/editor_m',
       notebook: '/notebook/notebook',
-      responsive: '/responsive?app=editor',
-      responsive_notebook: '/responsive?app=notebook'
+      hue4: '/hue?app=editor',
+      hue4_notebook: '/hue?app=notebook'
     }
 
     self.user = options.user;
     self.userId = options.userId;
     self.isMobile = ko.observable(options.mobile);
-    self.isResponsive = ko.observable(options.responsive);
+    self.isHue4 = ko.observable(options.hue4);
     self.isNotificationManager = ko.observable(options.is_notification_manager || false);
     self.editorType = ko.observable(options.editor_type);
     self.editorType.subscribe(function(newVal) {
@@ -2576,16 +2576,16 @@ var EditorViewModel = (function() {
           self.loadNotebook(notebook, queryTab);
           if (typeof skipUrlChange === 'undefined' && ! self.isNotificationManager()){
             if (self.editorMode()) {
-              if (self.isResponsive()){
-                self.changeURL(self.URLS.responsive + '&editor=' + data.document.id);
+              if (self.isHue4()){
+                self.changeURL(self.URLS.hue4 + '&editor=' + data.document.id);
               }
               else {
                 self.changeURL((self.isMobile() ? self.URLS.editorMobile : self.URLS.editor) + '?editor=' + data.document.id);
               }
             }
             else {
-              if (self.isResponsive()){
-                self.changeURL(self.URLS.responsive_notebook + '&notebook=' + data.document.id);
+              if (self.isHue4()){
+                self.changeURL(self.URLS.hue4_notebook + '&notebook=' + data.document.id);
               }
               else {
                 self.changeURL(self.URLS.notebook + '&notebook=' + data.document.id);
@@ -2618,23 +2618,23 @@ var EditorViewModel = (function() {
             $.totalStorage('hue.notebook.lastWrittenSnippet.' + self.user +  '.' + window.location.getParameter('type'), '');
           }
           if (window.location.getParameter('type')) {
-            if (self.isResponsive()){
-              self.changeURL(self.URLS.responsive + '&type=' + window.location.getParameter('type'));
+            if (self.isHue4()){
+              self.changeURL(self.URLS.hue4 + '&type=' + window.location.getParameter('type'));
             }
             else {
               self.changeURL((self.isMobile() ? self.URLS.editorMobile : self.URLS.editor) + '?type=' + window.location.getParameter('type'));
             }
           } else {
-            if (self.isResponsive()){
-              self.changeURL(self.URLS.responsive + '&type=' + self.editorType());
+            if (self.isHue4()){
+              self.changeURL(self.URLS.hue4 + '&type=' + self.editorType());
             }
             else {
               self.changeURL((self.isMobile() ? self.URLS.editorMobile : self.URLS.editor) + '?type=' + self.editorType());
             }
           }
         } else {
-          if (self.isResponsive()){
-            self.changeURL(self.URLS.responsive_notebook);
+          if (self.isHue4()){
+            self.changeURL(self.URLS.hue4_notebook);
           }
           else {
             self.changeURL('/notebook/notebook');

+ 1 - 1
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -2695,7 +2695,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
       user: '${ user.username }',
       userId: ${ user.id },
       % if is_embeddable:
-      responsive: true,
+      hue4: true,
       % endif
       assistAvailable: true,
       % if conf.USE_NEW_AUTOCOMPLETER.get():