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
ffed01af
Commit
ffed01af
authored
Jan 30, 2015
by
Vishal Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated search result page according to new api change
parent
915b4ac6
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
42 additions
and
31 deletions
+42
-31
app.js
public/js/app.js
+1
-2
notificationService.js
public/modules/notification/notificationService.js
+2
-2
notifications.html
public/modules/notification/views/notifications.html
+2
-1
searchController.js
public/modules/search/searchController.js
+15
-19
searchResource.js
public/modules/search/searchResource.js
+13
-2
searchRoutes.js
public/modules/search/searchRoutes.js
+1
-1
hiveLineage.html
public/modules/search/views/hiveLineage.html
+2
-0
hive_table.html
public/modules/search/views/hive_table.html
+2
-0
search.html
public/modules/search/views/search.html
+1
-1
searchResult.html
public/modules/search/views/searchResult.html
+3
-3
No files found.
public/js/app.js
View file @
ffed01af
...
@@ -6,8 +6,7 @@ angular.module('dgc', ['ngCookies',
...
@@ -6,8 +6,7 @@ angular.module('dgc', ['ngCookies',
'ui.router'
,
'ui.router'
,
'dgc.system'
,
'dgc.system'
,
'dgc.home'
,
'dgc.home'
,
'dgc.search'
,
'dgc.search'
'dgc.details'
]);
]);
angular
.
module
(
'dgc.system'
,
[
'dgc.system.notification'
]);
angular
.
module
(
'dgc.system'
,
[
'dgc.system.notification'
]);
...
...
public/modules/notification/notificationService.js
View file @
ffed01af
...
@@ -17,7 +17,7 @@ angular.module('dgc.system.notification').service('NotificationService', ['$time
...
@@ -17,7 +17,7 @@ angular.module('dgc.system.notification').service('NotificationService', ['$time
};
};
_
.
each
(
colorCoding
,
function
(
value
,
key
)
{
_
.
each
(
colorCoding
,
function
(
value
,
key
)
{
service
[
key
]
=
function
(
message
)
{
service
[
key
]
=
function
(
message
,
timeout
)
{
var
notification
=
message
;
var
notification
=
message
;
if
(
_
.
isString
(
message
))
{
if
(
_
.
isString
(
message
))
{
notification
=
{
notification
=
{
...
@@ -28,7 +28,7 @@ angular.module('dgc.system.notification').service('NotificationService', ['$time
...
@@ -28,7 +28,7 @@ angular.module('dgc.system.notification').service('NotificationService', ['$time
notification
.
message
=
notification
.
msg
||
notification
.
message
;
notification
.
message
=
notification
.
msg
||
notification
.
message
;
delete
notification
.
msg
;
delete
notification
.
msg
;
notification
.
type
=
value
;
notification
.
type
=
value
;
notification
.
timeout
=
_
.
isUndefined
(
notification
.
timeout
)
?
true
:
notification
.
timeout
;
notification
.
timeout
=
_
.
isUndefined
(
timeout
)
?
(
_
.
isUndefined
(
notification
.
timeout
)
?
true
:
notification
.
timeout
)
:
timeout
;
notifications
.
push
(
notification
);
notifications
.
push
(
notification
);
if
(
notification
.
timeout
)
{
if
(
notification
.
timeout
)
{
...
...
public/modules/notification/views/notifications.html
View file @
ffed01af
<div
data-ng-controller=
"NotificationController"
>
<div
data-ng-controller=
"NotificationController"
>
<alert
data-ng-repeat=
"notification in getNotifications()"
type=
"notification.type"
close=
"close(notification)"
>
<alert
data-ng-repeat=
"notification in getNotifications()"
data-type=
"{{notification.type}}"
data-
close=
"close(notification)"
>
{{notification.message}}
{{notification.message}}
</alert>
</alert>
</div>
</div>
\ No newline at end of file
public/modules/search/searchController.js
View file @
ffed01af
'use strict'
;
'use strict'
;
angular
.
module
(
'dgc.search'
).
controller
(
'SearchController'
,
[
'$scope'
,
'$
state'
,
'$stateParams'
,
'SearchResource'
,
'DetailsResour
ce'
,
angular
.
module
(
'dgc.search'
).
controller
(
'SearchController'
,
[
'$scope'
,
'$
location'
,
'$http'
,
'$state'
,
'$stateParams'
,
'SearchResource'
,
'NotificationServi
ce'
,
function
(
$scope
,
$
state
,
$stateParams
,
SearchResource
,
DetailsResour
ce
)
{
function
(
$scope
,
$
location
,
$http
,
$state
,
$stateParams
,
SearchResource
,
NotificationServi
ce
)
{
$scope
.
types
=
[
'hive_table'
,
'hive_database'
];
$scope
.
types
=
[];
$scope
.
results
=
[];
$scope
.
results
=
[];
$scope
.
search
=
function
(
query
)
{
$scope
.
search
=
function
(
query
)
{
SearchResource
.
get
({
$scope
.
results
=
[];
query
:
query
NotificationService
.
reset
();
},
function
(
response
)
{
SearchResource
.
search
(
$location
.
search
(
query
).
$$search
,
function
(
response
)
{
$scope
.
results
=
[];
$scope
.
results
=
response
;
angular
.
forEach
(
response
.
list
,
function
(
typeId
)
{
if
(
$scope
.
results
.
length
<
1
)
{
DetailsResource
.
get
({
NotificationService
.
error
(
"No Result found"
,
false
);
id
:
typeId
}
},
function
(
definition
)
{
$state
.
go
(
'search.results'
,
{},
{
$scope
.
results
.
push
(
definition
);
location
:
false
});
});
$state
.
go
(
'search.results'
,
{
query
:
query
});
});
});
});
};
};
$scope
.
query
=
$stateParams
.
query
;
var
urlParts
=
$location
.
$$url
.
split
(
'?'
);
$scope
.
query
=
urlParts
.
length
>
1
?
urlParts
[
1
]
:
null
;
if
(
$scope
.
query
)
{
if
(
$scope
.
query
)
{
$scope
.
search
(
$s
tateParams
.
query
);
$scope
.
search
(
$s
cope
.
query
);
}
}
}
}
]);
]);
public/modules/search/searchResource.js
View file @
ffed01af
'use strict'
;
'use strict'
;
angular
.
module
(
'dgc.search'
).
factory
(
'SearchResource'
,
[
'$resource'
,
function
(
$resource
)
{
angular
.
module
(
'dgc.search'
).
factory
(
'SearchResource'
,
[
'$resource'
,
function
(
$resource
)
{
return
$resource
(
'/api/metadata/entities/list/:query'
,
{
return
$resource
(
'/api/metadata/discovery/search/fulltext'
,
{},
{
'query'
:
'@id'
search
:
{
'method'
:
'GET'
,
'responseType'
:
'json'
,
'isArray'
:
true
,
'transformResponse'
:
function
(
data
)
{
var
results
=
[];
angular
.
forEach
(
data
&&
data
.
vertices
,
function
(
val
)
{
results
.
push
(
val
);
});
return
results
;
}
}
});
});
}]);
}]);
public/modules/search/searchRoutes.js
View file @
ffed01af
...
@@ -9,7 +9,7 @@ angular.module('dgc.search').config(['$stateProvider',
...
@@ -9,7 +9,7 @@ angular.module('dgc.search').config(['$stateProvider',
url
:
'/search'
,
url
:
'/search'
,
templateUrl
:
'/modules/search/views/search.html'
templateUrl
:
'/modules/search/views/search.html'
}).
state
(
'search.results'
,
{
}).
state
(
'search.results'
,
{
url
:
'/
:query
'
,
url
:
'/
?
'
,
templateUrl
:
'/modules/search/views/searchResult.html'
templateUrl
:
'/modules/search/views/searchResult.html'
});
});
}
}
...
...
public/modules/search/views/hiveLineage.html
0 → 100644
View file @
ffed01af
<a
data-ui-sref=
"details({id:result.guid})"
>
{{result.guid}}
</a>
\ No newline at end of file
public/modules/search/views/hive_table.html
0 → 100644
View file @
ffed01af
<a
data-ui-sref=
"details({id:result.guid})"
>
{{result["hive_table.name"]}}
</a>
\ No newline at end of file
public/modules/search/views/search.html
View file @
ffed01af
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<small
class=
"small-txt"
>
Search : hive_table, hive_database
</small>
<small
class=
"small-txt"
>
Search : hive_table, hive_database
</small>
</div>
</div>
</div>
</div>
<div
class=
"row"
data-ng-show=
"results.length > 0"
>
<div
class=
"row"
>
<div
class=
"col-sm-offset-1 col-lg-11"
data-ui-view=
""
></div>
<div
class=
"col-sm-offset-1 col-lg-11"
data-ui-view=
""
></div>
</div>
</div>
</form>
</form>
...
...
public/modules/search/views/searchResult.html
View file @
ffed01af
<h4>
{{query}} results
</h4>
<h4>
"{{query}}" results
</h4>
<ul
class=
"list-unstyled"
>
<ul
class=
"list-unstyled"
>
<li
ng-repeat=
"result in results"
>
<li
ng-repeat=
"result in results"
>
<
a
data-ui-sref=
"details({id:result.$id$.id})"
>
{{result.description}}
</a
>
<
ng-include
src=
"'/modules/search/views/'+result.type+'.html'"
/
>
</li>
</li>
</ul>
</ul>
\ No newline at end of file
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