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
eb811153
Commit
eb811153
authored
Jun 07, 2015
by
dileep bhimineni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes for search results issue when results are not defined or error response from server
parent
d1a7872f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
searchController.js
dashboard/v2/public/modules/search/searchController.js
+3
-2
No files found.
dashboard/v2/public/modules/search/searchController.js
View file @
eb811153
...
...
@@ -47,7 +47,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope
.
totalItems
=
$scope
.
resultCount
;
$scope
.
transformedResults
=
{};
$scope
.
dataTransitioned
=
false
;
if
(
response
.
results
.
dataType
.
typeName
.
indexOf
(
'__'
)
===
0
)
{
if
(
response
.
results
.
dataType
&&
response
.
results
.
dataType
.
typeName
.
indexOf
(
'__'
)
===
0
)
{
$scope
.
dataTransitioned
=
true
;
var
attrDef
=
response
.
results
.
dataType
.
attributeDefinitions
;
angular
.
forEach
(
attrDef
,
function
(
value
)
{
...
...
@@ -67,7 +67,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope
.
$watch
(
'currentPage + itemsPerPage'
,
function
()
{
var
begin
=
((
$scope
.
currentPage
-
1
)
*
$scope
.
itemsPerPage
),
end
=
begin
+
$scope
.
itemsPerPage
;
$scope
.
filteredResults
=
$scope
.
transformedResults
.
slice
(
begin
,
end
);
if
(
$scope
.
transformedResults
)
$scope
.
filteredResults
=
$scope
.
transformedResults
.
slice
(
begin
,
end
);
$scope
.
pageCount
=
function
()
{
return
Math
.
ceil
(
$scope
.
resultCount
/
$scope
.
itemsPerPage
);
};
...
...
@@ -76,6 +76,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
}
});
},
function
searchError
(
err
)
{
$scope
.
searchMessage
=
'0 results matching your search query '
+
$scope
.
query
+
' were found'
;
NotificationService
.
error
(
'Error occurred during executing search query, error status code = '
+
err
.
status
+
', status text = '
+
err
.
statusText
,
false
);
});
$state
.
go
(
'search'
,
{
...
...
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