Commit 414b7bbc by kevalbhatt Committed by Madhan Neethiraj

ATLAS-1549: Remove unwanted API call for Lineage

parent 938af9ee
......@@ -139,6 +139,7 @@ module.exports = function(grunt) {
},
files: {
'bootstrap/css': 'bootstrap/dist/css/bootstrap.min.css',
'bootstrap/fonts': 'bootstrap/fonts/glyphicons-halflings-regular.woff2',
'backgrid/css': 'backgrid/lib/backgrid.css',
'backgrid-filter/css': 'backgrid-filter/backgrid-filter.min.css',
'backgrid-orderable-columns/css': 'backgrid-orderable-columns/backgrid-orderable-columns.css',
......
......@@ -49,7 +49,11 @@
<div class="atlast-tabbable">
<h4 class="lineageLabel">LINEAGE</h4>
<div class="panel panel-default lineageLayout">
<div id="r_lineageLayoutView"></div>
<div id="r_lineageLayoutView" style="height:385px">
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
</div>
</div>
......
......@@ -108,8 +108,8 @@ define(['require',
bindEvents: function() {
var that = this;
this.listenTo(this.collection, 'reset', function() {
var entityObject = this.collection.first().toJSON();
var collectionJSON = entityObject.entity;
this.entityObject = this.collection.first().toJSON();
var collectionJSON = this.entityObject.entity;
if (collectionJSON && collectionJSON.guid) {
var tagGuid = collectionJSON.guid;
this.readOnly = Enums.entityStateReadOnly[collectionJSON.status];
......@@ -164,7 +164,7 @@ define(['require',
this.hideLoader();
var obj = {
entity: collectionJSON,
referredEntities: entityObject.referredEntities,
referredEntities: this.entityObject.referredEntities,
guid: this.id,
entityName: this.name,
entityDefCollection: this.entityDefCollection,
......@@ -174,7 +174,6 @@ define(['require',
this.renderAuditTableLayoutView(obj);
this.renderTagTableLayoutView(obj);
this.renderTermTableLayoutView(_.extend({}, obj, { term: true }));
this.renderLineageLayoutView(obj);
// To render Schema check attribute "schemaElementsAttribute"
var schemaOptions = this.entityDefCollection.fullCollection.find({ name: collectionJSON.typeName }).get('options');
if (schemaOptions && schemaOptions.hasOwnProperty('schemaElementsAttribute') && schemaOptions.schemaElementsAttribute !== "") {
......@@ -197,6 +196,7 @@ define(['require',
var that = this;
Utils.showTitleLoader(this.$('.page-title .fontLoader'), this.$('.entityDetail'));
this.$('.fontLoader').show(); // to show tab loader
this.renderLineageLayoutView({ guid: this.id, entityDefCollection: this.entityDefCollection });
},
fetchCollection: function() {
this.collection.fetch({ reset: true });
......@@ -270,7 +270,7 @@ define(['require',
require(['views/tag/addTagModalView'], function(AddTagModalView) {
var view = new AddTagModalView({
guid: that.id,
tagList: _.map(that.collection.first().toJSON().classifications, function(obj) {
tagList: _.map(that.entityObject.entity.classifications, function(obj) {
return obj.typeName;
}),
callback: function() {
......
......@@ -56,7 +56,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'guid'));
_.extend(this, _.pick(options, 'guid', 'entityDefCollection'));
this.entityModel = new VEntity();
this.collection = new VLineageList();
this.typeMap = {};
......@@ -113,29 +113,6 @@ define(['require',
generateData: function(relations, guidEntityMap) {
var that = this;
function fetchEntity(name) {
++that.asyncFetchCounter;
that.entityModel.getEntityDef(name, {
success: function(data) {
if (that.typeMap[data.name]) {
_.keys(that.fromToObj).map(function(key) {
var obj = that.fromToObj[key];
if (obj.typeName === data.name) {
that.fromToObj[key]['isProcess'] = _.contains(data.superTypes, "Process") ? true : false;
}
});
}
that.typeMap[data.name] = data.superTypes;
},
complete: function() {
--that.asyncFetchCounter;
if (that.asyncFetchCounter == 0) {
that.createGraph();
}
}
});
}
function makeNodeObj(relationObj) {
var obj = {};
obj['shape'] = "img";
......@@ -147,12 +124,11 @@ define(['require',
if (relationObj.status) {
obj['status'] = relationObj.status;
}
if (that.typeMap && that.typeMap[relationObj.typeName]) {
obj['isProcess'] = _.contains(that.typeMap[relationObj.typeName], "Process") ? true : false;
} else {
that.typeMap[relationObj.typeName] = { fetch: true };
fetchEntity(relationObj.typeName);
var entityDef = that.entityDefCollection.fullCollection.find({ name: relationObj.typeName });
if (entityDef && entityDef.get('superTypes')) {
obj['isProcess'] = _.contains(entityDef.get('superTypes'), "Process") ? true : false;
}
return obj;
}
......
......@@ -329,10 +329,14 @@ define(['require',
},
addTagModalView: function(guid, multiple) {
var that = this;
var tagList = that.schemaCollection.find({ 'guid': guid });
require(['views/tag/addTagModalView'], function(AddTagModalView) {
var view = new AddTagModalView({
guid: guid,
multiple: multiple,
tagList: _.map((tagList ? tagList.get('classifications') : []), function(obj) {
return obj.typeName;
}),
callback: function() {
that.fetchCollection();
that.arr = [];
......
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