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