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
31e21002
Commit
31e21002
authored
Jan 31, 2015
by
Vishal Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Type specific views and env variable fix
parent
b03dd70a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
12 deletions
+17
-12
searchController.js
public/modules/search/searchController.js
+5
-1
searchResult.html
public/modules/search/views/searchResult.html
+4
-1
guid.html
public/modules/search/views/types/guid.html
+0
-0
hiveLineage.html
public/modules/search/views/types/hiveLineage.html
+2
-0
hive_table.html
public/modules/search/views/types/hive_table.html
+0
-0
server.js
server.js
+4
-9
config.js
server/config/config.js
+2
-1
No files found.
public/modules/search/searchController.js
View file @
31e21002
...
...
@@ -11,7 +11,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
SearchResource
.
search
(
$location
.
search
(
query
).
search
(),
function
(
response
)
{
$scope
.
results
=
response
;
if
(
$scope
.
results
.
length
<
1
)
{
NotificationService
.
error
(
"No Result found"
,
false
);
NotificationService
.
error
(
'No Result found'
,
false
);
}
$state
.
go
(
'search.results'
,
{},
{
location
:
false
...
...
@@ -19,6 +19,10 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
});
};
$scope
.
typeAvailable
=
function
()
{
return
[
'hive_table'
].
indexOf
(
this
.
result
.
type
&&
this
.
result
.
type
.
toLowerCase
())
>
-
1
;
};
var
urlParts
=
$location
.
url
().
split
(
'?'
);
$scope
.
query
=
urlParts
.
length
>
1
?
urlParts
[
1
]
:
null
;
if
(
$scope
.
query
)
{
...
...
public/modules/search/views/searchResult.html
View file @
31e21002
<h4>
"{{query}}" results
</h4>
<ul
class=
"list-unstyled"
>
<li
ng-repeat=
"result in results"
>
<ng-include
src=
"'/modules/search/views/'+result.type+'.html'"
/>
<div
data-ng-if=
"typeAvailable()"
data-ng-include=
"'/modules/search/views/types/'+result.type.toLowerCase()+'.html'"
></div>
<div
data-ng-if=
"!typeAvailable()"
data-ng-include=
"'/modules/search/views/types/guid.html'"
></div>
</li>
</ul>
\ No newline at end of file
public/modules/search/views/
hiveLineage
.html
→
public/modules/search/views/
types/guid
.html
View file @
31e21002
File moved
public/modules/search/views/types/hiveLineage.html
0 → 100644
View file @
31e21002
<a
data-ui-sref=
"details({id:result.guid})"
>
{{result.guid}}
</a>
\ No newline at end of file
public/modules/search/views/hive_table.html
→
public/modules/search/views/
types/
hive_table.html
View file @
31e21002
File moved
server.js
View file @
31e21002
...
...
@@ -13,13 +13,8 @@ var express = require('express');
*/
// Initializing system variables
var
config
=
require
(
'./server/config/config'
);
// Load configurations
// Set the node enviornment variable if not set before
process
.
env
.
NODE_ENV
=
config
.
nodeEnv
;
var
app
=
express
();
var
config
=
require
(
'./server/config/config'
),
app
=
express
();
// Express settings
require
(
'./server/config/express'
)(
app
);
...
...
@@ -28,8 +23,8 @@ require('./server/config/express')(app);
var
port
=
process
.
env
.
PORT
||
config
.
port
;
app
.
listen
(
port
);
console
.
log
(
'Environment is = "'
+
process
.
env
.
NODE_ENV
+
'"'
);
console
.
log
(
'Express app started on port '
+
port
+
' using config
\
n'
,
config
);
console
.
log
(
'Environment is = "'
+
config
.
nodeEnv
+
'"'
);
console
.
log
(
'Express app started on port '
+
port
+
' using config
\
n'
,
JSON
.
stringify
(
config
,
null
,
4
)
);
// Expose app
module
.
exports
=
app
;
server/config/config.js
View file @
31e21002
...
...
@@ -25,5 +25,6 @@ var path = require('path'),
}]
}
});
// Set the node enviornment variable if not set before
config
.
nodeEnv
=
process
.
env
.
NODE_ENV
=
process
.
env
.
NODE_ENV
||
config
.
nodeEnv
;
module
.
exports
=
config
;
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