Browse Source

HUE-7441 [core] Allow to blacklist all the apps but dbms and file browser

Note: still a few 404 on javascript files but overall it works well
Romain Rigaux 8 năm trước cách đây
mục cha
commit
1186643d52

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

@@ -839,7 +839,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, get_ord
       <!-- ko if: typeof isSource === 'undefined' || !isSource -->
       <a class="inactive-action" href="javascript:void(0)" data-bind="click: toggleSearch, css: { 'blue' : isSearchVisible }"><i class="pointer fa fa-filter" title="${_('Filter')}"></i></a>
       <!-- /ko -->
-      % if ENABLE_NEW_CREATE_TABLE.get():
+      % if hasattr(ENABLE_NEW_CREATE_TABLE, 'get') and ENABLE_NEW_CREATE_TABLE.get():
         <!-- ko if: sourceType === 'hive' || sourceType === 'impala' -->
         <!-- ko if: typeof databaseName !== 'undefined' -->
           <a class="inactive-action" data-bind="hueLink: '${ url('indexer:importer_prefill', source_type='all', target_type='table') }' + databaseName + '/?sourceType=' + sourceType" title="${_('Create table')}" href="javascript:void(0)">
@@ -1646,7 +1646,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, get_ord
         });
 
         huePubSub.subscribe('assist.openCollections', function () {
-          % if ENABLE_NEW_INDEXER.get():
+          % if hasattr(ENABLE_NEW_INDEXER, 'get') and ENABLE_NEW_INDEXER.get():
             if (IS_HUE_4) {
               huePubSub.publish('open.link', '/indexer/indexes/');
             }
@@ -1668,7 +1668,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, get_ord
           if (entry.parent && entry.parent.definition.name !== '/') {
             definitionName = entry.parent.definition.name;
           }
-          % if ENABLE_NEW_INDEXER.get():
+          % if hasattr(ENABLE_NEW_INDEXER, 'get') and ENABLE_NEW_INDEXER.get():
             if (IS_HUE_4) {
               huePubSub.publish('open.link', '/indexer/indexes/' + definitionName);
             }

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

@@ -559,11 +559,11 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
         home: { url: '/home*', title: '${_('Home')}' },
         indexer: { url: '/indexer/indexer/', title: '${_('Indexer')}' },
         collections: { url: '/dashboard/admin/collections', title: '${_('Search')}' },
-        % if ENABLE_NEW_INDEXER.get():
+        % if hasattr(ENABLE_NEW_INDEXER, 'get') and ENABLE_NEW_INDEXER.get():
         indexes: { url: '/indexer/indexes/*', title: '${_('Indexes')}' },
-        %else:
+        % else:
         indexes: { url: '/indexer/', title: '${_('Indexes')}' },
-        %endif
+        % endif
         importer: { url: '/indexer/importer/', title: '${_('Importer')}' },
         useradmin_users: { url: '/useradmin/users', title: '${_('User Admin - Users')}' },
         useradmin_groups: { url: '/useradmin/groups', title: '${_('User Admin - Groups')}' },
@@ -600,7 +600,7 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
           'useradmin_permissions', 'useradmin_editpermission', 'useradmin_configurations', 'useradmin_newuser',
           'useradmin_addldapusers', 'useradmin_addldapgroups', 'useradmin_edituser', 'importer',
           'security_hive', 'security_hdfs', 'security_hive2', 'security_solr', 'logs',
-          % if ENABLE_NEW_INDEXER.get():
+          % if hasattr(ENABLE_NEW_INDEXER, 'get') and ENABLE_NEW_INDEXER.get():
             'indexes',
           % endif
           % if other_apps: