Commit fe28c005 by Vishal Kadam

Vishal: Added no linage data message and retry

parent f7ce5a27
...@@ -24,8 +24,8 @@ angular.module('dgc.home.routes', []).config(['$stateProvider', ...@@ -24,8 +24,8 @@ angular.module('dgc.home.routes', []).config(['$stateProvider',
// states for my app // states for my app
$stateProvider.state('home', { $stateProvider.state('home', {
url: '/', url: '/',
templateUrl: '/modules/home/views/home.html' templateUrl: '/modules/home/views/home.html'
}); });
} }
]); ]);
...@@ -26,16 +26,18 @@ angular.module('dgc.lineage').controller('LineageController', ['$element', '$sco ...@@ -26,16 +26,18 @@ angular.module('dgc.lineage').controller('LineageController', ['$element', '$sco
tableName: tableData.tableName, tableName: tableData.tableName,
type: tableData.type type: tableData.type
}, function lineageSuccess(response) { }, function lineageSuccess(response) {
$scope.lineageData = transformData(response.results); if (!_.isEmpty(response.results.values.vertices)) {
if (callRender) { $scope.lineageData = transformData(response.results);
render(); if (callRender) {
render();
}
} }
$scope.requested = false;
}); });
} }
$scope.type = $element.parent().attr('data-table-type'); $scope.type = $element.parent().attr('data-table-type');
$scope.rendered = false; $scope.requested = false;
var requested = false;
function render() { function render() {
renderGraph($scope.lineageData, { renderGraph($scope.lineageData, {
...@@ -49,9 +51,9 @@ angular.module('dgc.lineage').controller('LineageController', ['$element', '$sco ...@@ -49,9 +51,9 @@ angular.module('dgc.lineage').controller('LineageController', ['$element', '$sco
$scope.$on('render-lineage', function(event, lineageData) { $scope.$on('render-lineage', function(event, lineageData) {
if (lineageData.type === $scope.type) { if (lineageData.type === $scope.type) {
if (!$scope.lineageData) { if (!$scope.lineageData) {
if (!requested) { if (!$scope.requested) {
getLineageData(lineageData, true); getLineageData(lineageData, true);
requested = true; $scope.requested = true;
} }
} else { } else {
render(); render();
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
--> -->
<div class="lineage-viz" data-ng-controller="LineageController"> <div class="lineage-viz" data-ng-controller="LineageController">
<i data-ng-hide="rendered" class="fa fa-spinner fa-spin fa-5x"></i> <h4 data-ng-if="!requested && !lineageData">No lineage data found</h4>
<i data-ng-if="requested" class="fa fa-spinner fa-spin fa-5x"></i>
<svg> <svg>
<g/> <g/>
</svg> </svg>
......
...@@ -106,6 +106,6 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio ...@@ -106,6 +106,6 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope.query = ($location.search()).query; $scope.query = ($location.search()).query;
if ($scope.query) { if ($scope.query) {
$scope.search($scope.query); $scope.search($scope.query);
} }
} }
]); ]);
...@@ -25,7 +25,7 @@ angular.module('dgc.search').config(['$stateProvider', ...@@ -25,7 +25,7 @@ angular.module('dgc.search').config(['$stateProvider',
$stateProvider.state('search', { $stateProvider.state('search', {
url: '/search?query', url: '/search?query',
templateUrl: '/modules/search/views/search.html', templateUrl: '/modules/search/views/search.html',
controller: 'SearchController', controller: 'SearchController'
}) });
} }
]); ]);
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