[assist] Accept different kind of dashboard engines for the right assistant
@@ -2751,16 +2751,19 @@ from desktop.views import _ko
};
var i18n = {};
+ var activeDashboardCollection = huePubSub.subscribe('set.active.dashboard.collection', function(collection) {
+ var collectionName = collection.name();
+
var assistDbSource = new AssistDbSource({
i18n : i18n,
- type: 'solr',
- name: 'solr',
+ type: collection.engine(),
+ name: collection.engine(),
navigationSettings: navigationSettings
});
var assistFakeDb = new AssistDbEntry(
{
- name: 'default',
+ name: collectionName.indexOf('.') > -1 ? collectionName.split('.')[0] : 'default',
type: 'database',
isDatabase: true
},
@@ -2772,13 +2775,12 @@ from desktop.views import _ko
{}
);
- var activeDashboardCollection = huePubSub.subscribe('set.active.dashboard.collection', function(collection) {
var collection = new AssistDbEntry(
{
- name: collection.name(),
+ name: collectionName.indexOf('.') > -1 ? collectionName.split('.')[1] : collectionName,
type: 'table',
isTable: true,
- displayName: collection.name().toLowerCase()
+ displayName: collectionName.toLowerCase()
},
assistFakeDb,
assistDbSource,
