Commit 915b4ac6 by Vishal Kadam

Vishal: Added details page

parent 15f61140
{
"name": "dgc-metadata",
"description": "DGC Metadata",
"version": "1.0.0-SNAPSHOT",
"dependencies": {
"angular": "1.2.15",
"angular-resource": "1.2.15",
"angular-cookies": "1.2.15",
"angular-route": "1.2.15",
"angular-sanitize": "1.2.15",
"bootstrap": "~3.1.1",
"angular-bootstrap": "~0.12.0",
"angular-ui-router": "~0.2.13",
"lodash": "~3.0.0",
"angular-ui-utils": "~0.1.1",
"font-awesome": "~4.2.0"
}
"name": "dgc-metadata",
"description": "DGC Metadata",
"version": "1.0.0-SNAPSHOT",
"dependencies": {
"angular": "~1.2.15",
"angular-resource": "~1.2.15",
"angular-cookies": "~1.2.15",
"angular-route": "~1.2.15",
"angular-sanitize": "~1.2.15",
"bootstrap": "~3.1.1",
"angular-bootstrap": "~0.12.0",
"angular-ui-router": "~0.2.13",
"lodash": "~3.0.0",
"angular-ui-utils": "~0.1.1",
"font-awesome": "~4.2.0"
}
}
......@@ -83,7 +83,7 @@ module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
//Default task(s).
grunt.registerTask('default', ['bower', 'jsbeautifier:default']);
grunt.registerTask('default', ['bower', 'jshint', 'jsbeautifier:default']);
// Server task
grunt.registerTask('server', ['bower', 'jshint', 'concurrent']);
......
{
"name": "dgc-metadata",
"description": "DGC Metadata",
"version": "1.0.0-SNAPSHOT",
"private": true,
"bin": "server.js",
"repository": {
"type": "git",
"url": "https://github.com/hortonworks/metadata"
},
"engines": {
"node": "0.10.x",
"npm": "1.3.x"
},
"keywords": [
"DGC",
"HortonWorks"
],
"scripts": {
"postinstall": "node node_modules/bower/bin/bower install"
},
"dependencies": {
"body-parser": "^1.2.0",
"bower": "~1.3.1",
"compression": "^1.0.2",
"consolidate": "~0.10.0",
"cookie-parser": "^1.0.1",
"cookies": "~0.4.0",
"express": "~4.2.0",
"express-load": "^1.1.14",
"forever": "~0.11.1",
"lodash": "~2.4.1",
"method-override": "^1.0.0",
"morgan": "^1.0.1",
"path-extra": "~0.1.1",
"proxit": "^0.6.0",
"q": "~1.0.1",
"rc": "~0.3.4",
"serve-favicon": "^2.0.0",
"static-favicon": "^2.0.0-alpha",
"superagent": "^0.20.0",
"swig": "~1.3.2",
"view-helpers": "~0.1.4"
},
"devDependencies": {
"grunt": "~0.4.2",
"grunt-bower-task": "~0.4.0",
"grunt-cli": "~0.1.11",
"grunt-concurrent": "0.4.3",
"grunt-contrib-jshint": "0.9.2",
"grunt-contrib-watch": "0.6.0",
"grunt-jsbeautifier": "~0.2.6",
"grunt-nodemon": "0.2.0",
"load-grunt-tasks": "^2.0.0"
}
"name": "dgc-metadata",
"description": "DGC Metadata",
"version": "1.0.0-SNAPSHOT",
"private": true,
"bin": "server.js",
"repository": {
"type": "git",
"url": "https://github.com/hortonworks/metadata"
},
"engines": {
"node": "0.10.x",
"npm": "1.3.x"
},
"keywords": [
"DGC",
"HortonWorks"
],
"scripts": {
"postinstall": "node node_modules/bower/bin/bower install"
},
"dependencies": {
"body-parser": "^1.2.0",
"bower": "~1.3.1",
"compression": "^1.0.2",
"consolidate": "~0.10.0",
"cookie-parser": "^1.0.1",
"cookies": "~0.4.0",
"express": "~4.2.0",
"express-load": "^1.1.14",
"forever": "~0.11.1",
"lodash": "~2.4.1",
"method-override": "^1.0.0",
"morgan": "^1.0.1",
"path-extra": "~0.1.1",
"proxit": "^0.6.0",
"q": "~1.0.1",
"rc": "~0.3.4",
"serve-favicon": "^2.0.0",
"static-favicon": "^2.0.0-alpha",
"superagent": "^0.20.0",
"swig": "~1.3.2",
"view-helpers": "~0.1.4"
},
"devDependencies": {
"grunt": "~0.4.2",
"grunt-bower-task": "~0.4.0",
"grunt-cli": "~0.1.11",
"grunt-concurrent": "0.4.3",
"grunt-contrib-jshint": "0.9.2",
"grunt-contrib-watch": "0.6.0",
"grunt-jsbeautifier": "~0.2.6",
"grunt-nodemon": "0.2.0",
"load-grunt-tasks": "^2.0.0"
}
}
......@@ -6,7 +6,8 @@ angular.module('dgc', ['ngCookies',
'ui.router',
'dgc.system',
'dgc.home',
'dgc.search'
'dgc.search',
'dgc.details'
]);
angular.module('dgc.system', ['dgc.system.notification']);
......
'use strict';
//Setting up route
angular.module('dgc').config(['$locationProvider', '$urlRouterProvider', function($locationProvider, $urlRouterProvider) {
$locationProvider.hashPrefix('!');
// For unmatched routes:
$urlRouterProvider.otherwise('/');
$urlRouterProvider.when('/', '/search');
}]);
\ No newline at end of file
angular.module('dgc').config(['$locationProvider', '$urlRouterProvider',
function($locationProvider, $urlRouterProvider) {
$locationProvider.hashPrefix('!');
// For unmatched routes:
$urlRouterProvider.otherwise('/search');
}
]);
'use strict';
angular.module('dgc.details').controller('DetailsController', ['$scope', '$stateParams', 'DetailsResource',
function($scope, $stateParams, DetailsResource) {
$scope.details = DetailsResource.get({
id: $stateParams.id
});
$scope.isString = angular.isString;
}
]);
'use strict';
angular.module('dgc.details', []);
'use strict';
angular.module('dgc.details').factory('DetailsResource', ['$resource', function($resource) {
return $resource('/api/metadata/entities/definition/:id', {}, {
get: {
method: 'GET',
transformResponse: function(data) {
if (data) {
return angular.fromJson(data.definition);
}
},
responseType: 'json'
}
});
}]);
'use strict';
angular.module('dgc.details').config(['$stateProvider',
function($stateProvider) {
// states for my app
$stateProvider.state('details', {
url: '/details/:id',
templateUrl: '/modules/details/views/details.html'
});
}
]);
<h4>{{key}}:</h4>
<p>{{value}}</p>
\ No newline at end of file
<div class="container" data-ng-controller="DetailsController">
<div class="col-lg-12">
<tabset>
<tab data-heading="Wiki">
<div data-ng-repeat="(key,value) in details" data-ng-if="isString(value)" ng-include="'/modules/details/views/attribute.html'"></div>
</tab>
<tab data-heading="Raw">
<pre>{{details | json}}</pre>
</tab>
<tab data-heading="Lineage">Graph will be here soon...</tab>
</tabset>
</div>
</div>
\ No newline at end of file
......@@ -2,7 +2,7 @@
angular.module('dgc.home').controller('HeaderController', ['$scope', function($scope) {
$scope.menu = [{'state': 'search', 'title': 'Search'}];
$scope.menu = [];
$scope.isCollapsed = true;
$scope.isLoggedIn = function() {
......
'use strict';
angular.module('dgc.home', ['dgc.home.routes']);
\ No newline at end of file
angular.module('dgc.home', ['dgc.home.routes']);
......@@ -10,4 +10,4 @@ angular.module('dgc.home.routes', []).config(['$stateProvider',
templateUrl: '/modules/home/views/home.html'
});
}
]);
\ No newline at end of file
]);
......@@ -9,4 +9,4 @@ angular.module('dgc.system.notification', ['ui.router']).constant('ColorCoding',
NotificationService.reset();
}
});
});
\ No newline at end of file
});
......@@ -20,7 +20,9 @@ angular.module('dgc.system.notification').service('NotificationService', ['$time
service[key] = function(message) {
var notification = message;
if (_.isString(message)) {
notification = {message: message};
notification = {
message: message
};
}
notification.message = notification.msg || notification.message;
......
'use strict';
angular.module('dgc.search').controller('SearchController', ['$scope', function($scope) {
angular.module('dgc.search').controller('SearchController', ['$scope', '$state', '$stateParams', 'SearchResource', 'DetailsResource',
function($scope, $state, $stateParams, SearchResource, DetailsResource) {
$scope.types = [];
$scope.types = ['hive_table', 'hive_database'];
$scope.results = [];
$scope.search = function(query) {
SearchResource.get({
query: query
}, function(response) {
$scope.results = [];
angular.forEach(response.list, function(typeId) {
DetailsResource.get({
id: typeId
}, function(definition) {
$scope.results.push(definition);
});
});
$state.go('search.results', {
query: query
});
});
};
}]);
$scope.query = $stateParams.query;
if ($scope.query) {
$scope.search($stateParams.query);
}
}
]);
'use strict';
angular.module('dgc.search', ['dgc.search.routes']);
\ No newline at end of file
angular.module('dgc.search', ['dgc.details']);
'use strict';
angular.module('dgc.search').factory('SearchResource', ['$resource', function($resource) {
return $resource('/api/metadata/entities/list/:query', {
'query': '@id'
});
}]);
'use strict';
//Setting up route
angular.module('dgc.search.routes', []).config(['$stateProvider',
angular.module('dgc.search').config(['$stateProvider',
function($stateProvider) {
// states for my app
$stateProvider.state('search', {
url: '/search',
templateUrl: '/modules/search/views/search.html'
}).state('search.results', {
url: '/:query',
templateUrl: '/modules/search/views/searchResult.html'
});
}
]);
\ No newline at end of file
]);
<div class="container" data-ng-controller="SearchController">
<div class="row">
<div class="col-sm-offset-1 col-lg-5">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search">
<span class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search white "></i></button>
</span>
<form name="form" novalidate>
<div class="row">
<div class="col-sm-offset-1 col-lg-5">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" data-ng-model="query" data-typeahead="type for type in types" required/>
<span class="input-group-btn">
<button class="btn btn-default" type="submit" data-ng-disabled="form.$invalid" data-ng-click="search(query)"><i class="glyphicon glyphicon-search white "></i></button>
</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-offset-1 col-lg-6">
<small class="small-txt">Search : Hive,Table,xxxx</small>
<div class="row">
<div class="col-sm-offset-1 col-lg-6">
<small class="small-txt">Search : hive_table, hive_database</small>
</div>
</div>
<div class="row" data-ng-show="results.length > 0">
<div class="col-sm-offset-1 col-lg-11" data-ui-view=""></div>
</div>
</div>
</form>
</div>
\ No newline at end of file
<h4>{{query}} results</h4>
<ul class="list-unstyled">
<li ng-repeat="result in results">
<a data-ui-sref="details({id:result.$id$.id})">{{result.description}}</a>
</li>
</ul>
\ No newline at end of file
......@@ -28,8 +28,15 @@
<!-- Search Module -->
<script type="text/javascript" src="/modules/search/searchModule.js"></script>
<script type="text/javascript" src="/modules/search/searchRoutes.js"></script>
<script type="text/javascript" src="/modules/search/searchResource.js"></script>
<script type="text/javascript" src="/modules/search/searchController.js"></script>
<!-- Details Module -->
<script type="text/javascript" src="/modules/details/detailsModule.js"></script>
<script type="text/javascript" src="/modules/details/detailsRoutes.js"></script>
<script type="text/javascript" src="/modules/details/detailsResource.js"></script>
<script type="text/javascript" src="/modules/details/detailsController.js"></script>
<!-- Initialize the application -->
<script type="text/javascript" src="js/init.js"></script>
......
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