Commit 52227873 by Vishal Kadam

HDPDGI-53:Vishal: Use guid for link when name not exists

parent 161939b7
......@@ -18,10 +18,9 @@
'use strict';
angular.module('dgc.search').controller('SearchController', ['$scope', '$location', '$http', '$state', '$stateParams', 'SearchResource', 'NotificationService',
function($scope, $location, $http, $state, $stateParams, SearchResource, NotificationService) {
angular.module('dgc.search').controller('SearchController', ['$scope', '$location', '$http', '$state', '$stateParams', 'lodash', 'SearchResource', 'NotificationService',
function($scope, $location, $http, $state, $stateParams, _, SearchResource, NotificationService) {
$scope.types = ['table', 'column', 'db', 'view', 'loadprocess', 'storagedesc'];
$scope.results = [];
$scope.resultCount = 0;
$scope.isCollapsed = true;
......@@ -99,6 +98,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope.filterSearchResults = function(items) {
var res = {};
var count = 0;
items = _.omit(items, ['name', 'description', 'guid']);
angular.forEach(items, function(value, key) {
if (typeof value !== 'object' && (key.indexOf('$$') < 0)) {
res[key] = value;
......
......@@ -37,7 +37,7 @@
<h4 ng-show="searchMessage">{{searchMessage}}</h4>
<ul class="list-unstyled">
<li ng-repeat="result in filteredResults" class="searchresults">
<h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4>
<h4><a data-ui-sref="details({id:result['$id$'].id || result.guid})">{{result.name || result.guid}}</a></h4>
<p>{{result.description}}</p>
<span ng-repeat="(key, value) in filterSearchResults(result)">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment