Browse Source

HUE-8330 [frontend] Remove double level menu links for now

Romain Rigaux 7 years ago
parent
commit
4555512ce1

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

@@ -187,13 +187,14 @@ ${ hueIcons.symbols() }
 
 
         <a class="brand" data-bind="hueLink: '/home/'" href="javascript: void(0);" title="${_('Documents')}">
         <a class="brand" data-bind="hueLink: '/home/'" href="javascript: void(0);" title="${_('Documents')}">
           % if IS_MULTICLUSTER_ONLY.get() and has_multi_cluster():
           % if IS_MULTICLUSTER_ONLY.get() and has_multi_cluster():
-            <img src="${ static('desktop/art/cloudera-dwx.svg') }" style="height: 18px;">
+            <img src="${ static('desktop/art/cloudera-data-warehouse.svg') }" style="height: 18px;">
           % else:
           % else:
             <svg style="height: 24px; width: 120px;"><use xlink:href="#hi-logo"></use></svg>
             <svg style="height: 24px; width: 120px;"><use xlink:href="#hi-logo"></use></svg>
           % endif
           % endif
         </a>
         </a>
         % endif
         % endif
 
 
+        % if not IS_MULTICLUSTER_ONLY.get():
         <div class="btn-group" data-bind="visible: true" style="display:none; margin-top: 8px">
         <div class="btn-group" data-bind="visible: true" style="display:none; margin-top: 8px">
           <!-- ko if: mainQuickCreateAction -->
           <!-- ko if: mainQuickCreateAction -->
           <!-- ko with: mainQuickCreateAction -->
           <!-- ko with: mainQuickCreateAction -->
@@ -210,6 +211,7 @@ ${ hueIcons.symbols() }
             <!-- ko template: 'quick-create-item-template' --><!-- /ko -->
             <!-- ko template: 'quick-create-item-template' --><!-- /ko -->
           </ul>
           </ul>
         </div>
         </div>
+        % endif
 
 
         <script type="text/html" id="quick-create-item-template">
         <script type="text/html" id="quick-create-item-template">
           <!-- ko if: item.dividerAbove -->
           <!-- ko if: item.dividerAbove -->

+ 11 - 7
desktop/core/src/desktop/templates/ko_components/ko_dw_sidebar.mako

@@ -72,13 +72,17 @@
         huePubSub.subscribe('set.current.app.name', function (appName) {
         huePubSub.subscribe('set.current.app.name', function (appName) {
           window.clearTimeout(throttle);
           window.clearTimeout(throttle);
           throttle = window.setTimeout(function () {
           throttle = window.setTimeout(function () {
-            self.items([
-              {displayName:"Apps", isCategory:true, children: [{displayName: "Editor", url: "/editor/?type=impala", icon: "editor"}]},
-              {displayName:"Apps", isCategory:true, children: [{displayName: "Catalog", url: "/metastore/tables", icon: "editor"}]},
-              {displayName:"Apps", isCategory:true, children: [{displayName: "Warehouses", url: "/hue/jobbrowser", icon: "editor"}]},
-              {displayName:"Apps", isCategory:true, children: [{displayName: "Importer", url: "/indexer/importer", icon: "editor"}]}
-              ]
-            );
+            self.items([{
+                displayName:"Apps",
+                isCategory:true,
+                children: [
+                  {displayName: "Editor", url: "/editor/?type=impala", icon: "editor"},
+                  {displayName: "Catalog", url: "/metastore/tables", icon: "tables"},
+                  {displayName: "Warehouses", url: "/hue/jobbrowser", icon: "yarn"},
+                  {displayName: "Importer", url: "/indexer/importer", icon: "hdfs"}
+                ]
+              }
+            ]);
             self.items().some(function (item) {
             self.items().some(function (item) {
               return item.children.some(function (child) {
               return item.children.some(function (child) {
                 if (child.url.indexOf(appName.replace('_', '/')) !== -1) {
                 if (child.url.indexOf(appName.replace('_', '/')) !== -1) {

+ 2 - 2
desktop/core/src/desktop/templates/ko_components/ko_job_browser_links.mako

@@ -19,7 +19,7 @@ from django.utils.translation import ugettext as _
 
 
 from notebook.conf import ENABLE_QUERY_SCHEDULING
 from notebook.conf import ENABLE_QUERY_SCHEDULING
 
 
-from desktop.conf import IS_EMBEDDED
+from desktop.conf import IS_EMBEDDED, IS_MULTICLUSTER_ONLY
 from desktop.lib.i18n import smart_unicode
 from desktop.lib.i18n import smart_unicode
 from desktop.views import _ko
 from desktop.views import _ko
 %>
 %>
@@ -29,7 +29,7 @@ from desktop.views import _ko
   <script type="text/html" id="hue-job-browser-links-template">
   <script type="text/html" id="hue-job-browser-links-template">
     <div class="btn-group pull-right">
     <div class="btn-group pull-right">
       <a class="btn btn-flat" style="padding-right: 4px" title="${_('Job browser')}" data-bind="hueLink: '/jobbrowser#!jobs', click: function() { huePubSub.publish('hide.jobs.panel'); }">
       <a class="btn btn-flat" style="padding-right: 4px" title="${_('Job browser')}" data-bind="hueLink: '/jobbrowser#!jobs', click: function() { huePubSub.publish('hide.jobs.panel'); }">
-        <span>${ _('Queries') if IS_EMBEDDED.get() else _('Jobs') }</span>
+        <span>${ _('Queries') if IS_EMBEDDED.get() or IS_MULTICLUSTER_ONLY.get() else _('Jobs') }</span>
       </a>
       </a>
       <button class="btn btn-flat btn-toggle-jobs-panel" title="${_('Jobs preview')}" data-bind="click: function() { huePubSub.publish('toggle.jobs.panel'); }, style: {'paddingLeft': jobCount() > 0 ? '0': '4px'}">
       <button class="btn btn-flat btn-toggle-jobs-panel" title="${_('Jobs preview')}" data-bind="click: function() { huePubSub.publish('toggle.jobs.panel'); }, style: {'paddingLeft': jobCount() > 0 ? '0': '4px'}">
         <span class="jobs-badge" data-bind="visible: jobCount() > 0, text: jobCount"></span>
         <span class="jobs-badge" data-bind="visible: jobCount() > 0, text: jobCount"></span>

+ 54 - 50
desktop/core/src/desktop/templates/ko_components/ko_multi_cluster_sidebar.mako

@@ -116,16 +116,19 @@ from desktop.views import _ko
 
 
           label: '${ _('Data Warehouse') }',
           label: '${ _('Data Warehouse') }',
           icon: 'altus-icon altus-adb-query',
           icon: 'altus-icon altus-adb-query',
-          items: [{
-              label: '${ _('Editor') }',
-              url: '/editor?type=impala'
-            },{
-              label: '${ _('Catalog') }',
-              url: '/metastore/tables'
-            },{
-              label: '${ _('Warehouses') }',
-              url: '/hue/jobbrowser',
-            },{
+          url: '/editor?type=impala'
+##          items: []
+##          {
+##              label: '${ _('Editor') }',
+##              url: '/editor?type=impala'
+##            },{
+##              label: '${ _('Catalog') }',
+##              url: '/metastore/tables'
+##            },{
+##              label: '${ _('Warehouses') }',
+##              url: '/hue/jobbrowser',
+##            },{
+
 ##              label: '${ _('Files') }',
 ##              label: '${ _('Files') }',
 ##              url: '/filebrowser/view=S3A://'
 ##              url: '/filebrowser/view=S3A://'
 ##            },{
 ##            },{
@@ -135,52 +138,53 @@ from desktop.views import _ko
 ##              label: '${ _('Scheduler') }',
 ##              label: '${ _('Scheduler') }',
 ##              url: '/oozie/editor/coordinator/new/'
 ##              url: '/oozie/editor/coordinator/new/'
 ##            },{
 ##            },{
-              label: '${ _('Importer') }',
-              url: '/indexer/importer'
-            }
-          ]
+
+##              label: '${ _('Importer') }',
+##              url: '/indexer/importer'
+##            }
+##          ]
           }, {
           }, {
             label: '${ _('Data Science') }',
             label: '${ _('Data Science') }',
             url: '/',
             url: '/',
-            icon: 'altus-icon altus-ds',
-            items: [{
-                label: '${ _('Projects') }',
-                url: '/editor?type=impala'
-              },{
-                label: '${ _('Sessions') }',
-                url: '/metastore/tables'
-              },{
-                label: '${ _('Experiments') }',
-                url: '/filebrowser/view=S3A://'
-              },{
-                label: '${ _('Models') }',
-                url: '/dashboard/new_search'
-              },{
-                label: '${ _('Jobs') }',
-                url: '/oozie/editor/coordinator/new/'
-              },{
-                label: '${ _('Settings') }',
-                url: '/indexer/importer'
-              }
-            ]
+            icon: 'altus-icon altus-ds'
+##            items: [{
+##                label: '${ _('Projects') }',
+##                url: '/editor?type=impala'
+##              },{
+##                label: '${ _('Sessions') }',
+##                url: '/metastore/tables'
+##              },{
+##                label: '${ _('Experiments') }',
+##                url: '/filebrowser/view=S3A://'
+##              },{
+##                label: '${ _('Models') }',
+##                url: '/dashboard/new_search'
+##              },{
+##                label: '${ _('Jobs') }',
+##                url: '/oozie/editor/coordinator/new/'
+##              },{
+##                label: '${ _('Settings') }',
+##                url: '/indexer/importer'
+##              }
+##            ]
           }, {
           }, {
             label: '${ _('Admin') }',
             label: '${ _('Admin') }',
             url: '/',
             url: '/',
-            icon: 'altus-icon altus-de',
-            items: [{
-                label: '${ _('Clusters') }',
-                url: '/hue/jobbrowser',
-              },{
-                label: '${ _('Catalog') }',
-                url: '/',
-              },{
-                label: '${ _('Environments') }',
-                url: '/',
-              },{
-                label: '${ _('Directory') }',
-                url: 'https://console.altus.cloudera.com/iam/index.html',
-              }
-            ]
+            icon: 'altus-icon altus-de'
+##            items: [{
+##                label: '${ _('Clusters') }',
+##                url: '/hue/jobbrowser',
+##              },{
+##                label: '${ _('Catalog') }',
+##                url: '/',
+##              },{
+##                label: '${ _('Environments') }',
+##                url: '/',
+##              },{
+##                label: '${ _('Directory') }',
+##                url: 'https://console.altus.cloudera.com/iam/index.html',
+##              }
+##            ]
           }
           }
         ]
         ]
       }];
       }];