Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
a10b34d1
Commit
a10b34d1
authored
May 27, 2015
by
dileep bhimineni
Committed by
Vishal Kadam
May 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes for search results show more keys
parent
0f1c94d0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
9 deletions
+40
-9
common.css
dashboard/v2/public/css/common.css
+13
-0
searchController.js
dashboard/v2/public/modules/search/searchController.js
+9
-2
searchResult.html
dashboard/v2/public/modules/search/views/searchResult.html
+18
-7
No files found.
dashboard/v2/public/css/common.css
View file @
a10b34d1
...
...
@@ -108,3 +108,15 @@ footer.navbar-bottom img {
border-bottom-right-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
dashboard/v2/public/modules/search/searchController.js
View file @
a10b34d1
...
...
@@ -24,9 +24,11 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope
.
types
=
[
'table'
,
'column'
,
'db'
,
'view'
,
'loadprocess'
,
'storagedesc'
];
$scope
.
results
=
[];
$scope
.
resultCount
=
0
;
$scope
.
isCollapsed
=
true
;
$scope
.
search
=
function
(
query
)
{
$scope
.
results
=
[];
NotificationService
.
reset
();
$scope
.
limit
=
4
;
SearchResource
.
search
({
query
:
query
},
function
searchSuccess
(
response
)
{
$scope
.
results
=
response
.
results
;
$scope
.
resultCount
=
response
.
count
;
...
...
@@ -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
;
};
$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
=
{};
angular
.
forEach
(
items
,
function
(
value
,
key
)
{
if
(
!
(
typeof
value
==
'object'
))
res
[
key
]
=
value
+
','
;
res
[
key
]
=
value
;
});
return
res
;
}
...
...
dashboard/v2/public/modules/search/views/searchResult.html
View file @
a10b34d1
...
...
@@ -22,9 +22,21 @@
<div
data-ng-if=
"typeAvailable()"
>
<h4><a
data-ui-sref=
"details({id:result['$id$'].id})"
>
{{result.name}}
</a></h4>
<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>
<h5>
Tags :
<a
ng-repeat=
"(key, value) in result['$traits$']"
data-ui-sref=
"search.results({query: key})"
>
{{key}}
</a>
</h5>
</div>
<div
data-ng-if=
"!typeAvailable()"
data-ng-include=
"'/modules/search/views/types/guid.html'"
></div>
</li>
</ul>
\ No newline at end of file
<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>
</div>
<div
data-ng-if=
"!typeAvailable()"
data-ng-include=
"'/modules/search/views/types/guid.html'"
></div>
</li>
</ul>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment