Fix global search results link navigation
@@ -117,28 +117,30 @@ constructor(private $scope: angular.IScope,
};
onSearchResultItemClick($event: any, result: any) {
+ let feedSystemName: any;
+ let categorySystemName: any;
+
switch (result.type) {
case "KYLO_DATA":
- this.StateService.Tables().navigateToTable(this.hiveDatasource.id, this.cleanValue(result.schemaName), this.cleanValue(result.tableName));
+ categorySystemName = result.schemaName;
+ feedSystemName = result.tableName;
+ this.FeedService.getFeedByName(categorySystemName + "." + feedSystemName)
+ .then((feed: any) => {
+ this.StateService.FeedManager().Feed().navigateToFeedDetails(feed.id);
+ });
break;
case "KYLO_SCHEMA":
- this.StateService.Tables().navigateToTable(this.hiveDatasource.id, this.cleanValue(result.databaseName), this.cleanValue(result.tableName));
+ categorySystemName = result.databaseName;
+ feedSystemName = result.tableName;
+ this.FeedService.getFeedByName(categorySystemName + "." + feedSystemName)
+ .then((feed: any) => {
+ this.StateService.FeedManager().Feed().navigateToFeedDetails(feed.id);
+ });
break;
case "KYLO_FEEDS":
- var category;
- var feed;
-
- this.CategoriesService.getCategoryById(this.cleanValue(result.feedCategoryId))
- .then((category1: any)=> {
- category = category1;
- this.FeedService.getFeedByName(category.systemName + "." + (result.feedSystemName.replace('[', '').replace(']', '')))
- .then((feed1: any) =>{
- feed = feed1;
- this.StateService.FeedManager().Feed().navigateToFeedDetails(feed.id);
- });
- });
+ this.StateService.FeedManager().Feed().navigateToFeedDetails(result.feedId);
break;
case "KYLO_CATEGORIES":
