Browse Source

HUE-8966 [assist] Fix document type filter triggered from apps

Johan Ahlen 6 years ago
parent
commit
fa22c3287f

+ 6 - 0
desktop/core/src/desktop/js/ko/components/assist/ko.assistDocumentsPanel.js

@@ -342,6 +342,12 @@ class AssistDocumentsPanel {
       }
       }
     });
     });
 
 
+    huePubSub.subscribe('assist.documents.set.type.filter', docType => {
+      if (docType) {
+        this.setTypeFilter(docType);
+      }
+    });
+
     self.init();
     self.init();
   }
   }
 
 

+ 1 - 3
desktop/core/src/desktop/js/ko/components/assist/ko.assistPanel.js

@@ -233,9 +233,7 @@ class AssistPanel {
             if (self.visiblePanel() !== documentsPanel) {
             if (self.visiblePanel() !== documentsPanel) {
               self.visiblePanel(documentsPanel);
               self.visiblePanel(documentsPanel);
             }
             }
-            if (docType) {
-              documentsPanel.panelData.setTypeFilter(docType);
-            }
+            huePubSub.publish('assist.documents.set.type.filter', docType);
           });
           });
 
 
           if (window.HAS_GIT) {
           if (window.HAS_GIT) {