فهرست منبع

[frontend] Fix issue with item non-unique item naming in the sidebar

Johan Ahlen 4 سال پیش
والد
کامیت
25e7f5bfc6
1فایلهای تغییر یافته به همراه11 افزوده شده و 9 حذف شده
  1. 11 9
      desktop/core/src/desktop/js/components/sidebar/HueSidebar.vue

+ 11 - 9
desktop/core/src/desktop/js/components/sidebar/HueSidebar.vue

@@ -239,10 +239,13 @@
     currentAppChanged(appName: string): void {
       let adaptedName;
 
+      const params = new URLSearchParams(location.search);
       switch (appName) {
+        case 'dashboard':
+          adaptedName = params.get('engine') ? `${appName}-${params.get('engine')}` : appName;
+          break;
         case 'editor':
-          const params = new URLSearchParams(location.search);
-          adaptedName = params.get('type') || appName;
+          adaptedName = params.get('type') ? `${appName}-${params.get('type')}` : appName;
           break;
         case 'filebrowser':
           if (location.href.indexOf('=S3A') !== -1) {
@@ -265,13 +268,13 @@
           adaptedName = 'tables';
           break;
         case 'oozie_bundle':
-          adaptedName = 'oozie-bundle';
+          adaptedName = 'scheduler-oozie-bundle';
           break;
         case 'oozie_coordinator':
-          adaptedName = 'oozie-coordinator';
+          adaptedName = 'scheduler-oozie-coordinator';
           break;
         case 'oozie_workflow':
-          adaptedName = 'oozie-workflow';
+          adaptedName = 'scheduler-oozie-workflow';
           break;
         case 'security_hive':
           adaptedName = 'security';
@@ -283,7 +286,6 @@
         case 'useradmin_users':
           adaptedName = 'user';
           break;
-        case 'dashboard':
         case 'hbase':
         case 'importer':
         case 'indexes':
@@ -355,7 +357,7 @@
             if (config.interpreters.length === 1) {
               appsItems.push({
                 type: 'navigation',
-                name: config.name,
+                name: `${appName}-${config.name}`,
                 displayName: config.displayName,
                 iconHtml: getIconHtml(config.name),
                 url: config.page,
@@ -372,7 +374,7 @@
                 }
                 const interpreterItem: SidebarAccordionSubItem = {
                   type: 'navigation',
-                  name: interpreter.type,
+                  name: `${appName}-${interpreter.type}`,
                   displayName: interpreter.displayName,
                   url: interpreter.page,
                   handler: (event: Event) => onHueLinkClick(event, interpreter.page)
@@ -393,7 +395,7 @@
                   : 'https://docs.gethue.com/administrator/configuration/connectors/';
                 subApps.push({
                   type: 'navigation',
-                  name: 'addMoreInterpreters',
+                  name: 'editor-AddMoreInterpreters',
                   displayName: I18n('Edit list...'),
                   url,
                   handler: (event: Event) => onHueLinkClick(event, url)