Commit a10b34d1 by dileep bhimineni Committed by Vishal Kadam

changes for search results show more keys

parent 0f1c94d0
...@@ -108,3 +108,15 @@ footer.navbar-bottom img { ...@@ -108,3 +108,15 @@ footer.navbar-bottom img {
border-bottom-right-radius: 4px; border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px; border-bottom-left-radius: 4px;
} }
.searchresults hr {
margin: 0;
border: 0;
}
.searchresults .well {
background-color: #fff;
border: 0;
box-shadow: none;
height: auto;
min-height: 0;
padding: 5px 5px 5px 0;
}
\ No newline at end of file
...@@ -24,9 +24,11 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio ...@@ -24,9 +24,11 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope.types = ['table','column','db','view','loadprocess','storagedesc']; $scope.types = ['table','column','db','view','loadprocess','storagedesc'];
$scope.results = []; $scope.results = [];
$scope.resultCount=0; $scope.resultCount=0;
$scope.isCollapsed = true;
$scope.search = function(query) { $scope.search = function(query) {
$scope.results = []; $scope.results = [];
NotificationService.reset(); NotificationService.reset();
$scope.limit = 4;
SearchResource.search({query:query}, function searchSuccess(response) { SearchResource.search({query:query}, function searchSuccess(response) {
$scope.results = response.results; $scope.results = response.results;
$scope.resultCount=response.count; $scope.resultCount=response.count;
...@@ -45,12 +47,17 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio ...@@ -45,12 +47,17 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
return $scope.types.indexOf(this.results.dataType.typeName && this.results.dataType.typeName.toLowerCase()) > -1; return $scope.types.indexOf(this.results.dataType.typeName && this.results.dataType.typeName.toLowerCase()) > -1;
}; };
$scope.filterSearchResults = function(items) { /* $scope.$watch("currentPage + numPerPage", function() {
var begin = (($scope.currentPage - 1) * $scope.numPerPage);
var end = begin + $scope.numPerPage;
$scope.filteredResults = $scope.rows.slice(begin, end);
});*/
$scope.filterSearchResults = function(items) {
var res = {}; var res = {};
angular.forEach(items, function(value, key) { angular.forEach(items, function(value, key) {
if(!(typeof value == 'object')) if(!(typeof value == 'object'))
res[key] = value + ','; res[key] = value;
}); });
return res; return res;
} }
......
...@@ -22,9 +22,21 @@ ...@@ -22,9 +22,21 @@
<div data-ng-if="typeAvailable()"> <div data-ng-if="typeAvailable()">
<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.name}}</a></h4>
<p>{{result.description}}</p> <p>{{result.description}}</p>
<span ng-repeat="(key, value) in filterSearchResults(result)" ><span ng-show="$index < 4"><b>{{key}}: </b>{{value}}</span></span><a data-ui-sref="details({id:result.guid})">..show more</a> <span ng-repeat="(key, value) in filterSearchResults(result)" >
<span ng-show="$index < 4"><b>{{key}}: </b>{{value}}{{$index+1 === limit ? '' : ', '}}</span>
</span>
<div collapse="isCollapsed">
<span class="well well-lg"><span ng-repeat="(key, value) in filterSearchResults(result)" >
<span ng-show="$index > 4"><b>{{key}}: </b>{{value}}{{$last ? '' : ', '}}</span>
</span></span>
</div>
<a href="javascript: void(0);" class="show-more" ng-click="isCollapsed = !isCollapsed">..show more</a>
<!-- <a href="javascript: void(0);" bn-slide-show class="show-more" ng-click="doToggle(!isCollapsed)">..show more</a>-->
<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5> <h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5>
</div> </div>
<div data-ng-if="!typeAvailable()" data-ng-include="'/modules/search/views/types/guid.html'"></div> <div data-ng-if="!typeAvailable()" data-ng-include="'/modules/search/views/types/guid.html'"></div>
</li> </li>
</ul> </ul>
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