Commit 15baa4da by kevalbhatt Committed by Madhan Neethiraj

ATLAS-1521 : Update UI to eliminate REST calls to obtain schema data (#2)

parent dd744765
......@@ -57,7 +57,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'guid', 'entity'));
_.extend(this, _.pick(options, 'guid', 'entity', 'entityName'));
this.entityCollection = new VEntityList();
this.count = 26;
this.entityCollection.url = UrlLinks.entityCollectionaudit(this.guid);
......@@ -224,7 +224,7 @@ define(['require',
that.action = $(e.target).data("action");
var eventModel = that.entityCollection.findWhere({ 'eventKey': $(e.currentTarget).data('modalid') }).toJSON(),
collectionModel = new that.entityCollection.model(eventModel),
view = new CreateAuditTableLayoutView({ guid: that.guid, entityModel: collectionModel, action: that.action, entity: that.entity });
view = new CreateAuditTableLayoutView({ guid: that.guid, entityModel: collectionModel, action: that.action, entity: that.entity, entityName: that.entityName });
var modal = new Modal({
title: that.action,
content: view,
......
......@@ -54,7 +54,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'guid', 'entityModel', 'action', 'entity'));
_.extend(this, _.pick(options, 'guid', 'entityModel', 'action', 'entity', 'entityName'));
},
bindEvents: function() {},
onRender: function() {
......@@ -79,7 +79,7 @@ define(['require',
var values = parseDetailsObject.values;
if (this.action && (Enums.auditAction.ENTITY_CREATE !== this.action && Enums.auditAction.ENTITY_UPDATE !== this.action) && name) {
this.ui.auditHeaderValue.html('<th>' + this.action + '</th>');
this.ui.auditValue.html("<tr><td>" + name + "</td></tr>");
this.ui.auditValue.html("<tr><td>" + (name ? name : this.entityName) + "</td></tr>");
} else if (parseDetailsObject && parseDetailsObject.values) {
this.ui.auditHeaderValue.html('<th>Key</th><th>New Value</th>');
//CommonViewFunction.findAndmergeRefEntity(attributeObject, that.referredEntities);
......@@ -93,6 +93,11 @@ define(['require',
this.ui.tableAudit.hide();
}
}
} else {
if (Enums.auditAction.ENTITY_DELETE === this.action) {
this.ui.auditHeaderValue.html('<th>' + this.action + '</th>');
this.ui.auditValue.html("<tr><td>" + (name ? name : this.entityName) + "</td></tr>");
}
}
},
......
......@@ -166,7 +166,7 @@ define(['require',
entity: collectionJSON,
referredEntities: entityObject.referredEntities,
guid: this.id,
assetName: this.name,
entityName: this.name,
entityDefCollection: this.entityDefCollection,
fetchCollection: this.fetchCollection.bind(that)
}
......@@ -176,7 +176,7 @@ define(['require',
this.renderTermTableLayoutView(_.extend({}, obj, { term: true }));
this.renderLineageLayoutView(obj);
// To render Schema check attribute "schemaElementsAttribute"
var schemaOptions = this.entityDefCollection.find({ name: collectionJSON.typeName }).get('options');
var schemaOptions = this.entityDefCollection.fullCollection.find({ name: collectionJSON.typeName }).get('options');
if (schemaOptions && schemaOptions.hasOwnProperty('schemaElementsAttribute') && schemaOptions.schemaElementsAttribute !== "") {
this.$('.schemaTable').show();
this.renderSchemaLayoutView(_.extend({}, obj, {
......
......@@ -144,7 +144,7 @@ define(['require',
onRender: function() {
var that = this;
_.each(this.attribute, function(obj) {
var defObj = that.entityDefCollection.find({ name: obj.typeName });
var defObj = that.entityDefCollection.fullCollection.find({ name: obj.typeName });
if (defObj && defObj.get('options') && defObj.get('options').schemaAttributes) {
try {
var mapObj = JSON.parse(defObj.get('options').schemaAttributes);
......
......@@ -60,7 +60,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'entity', 'guid', 'term', 'assetName'));
_.extend(this, _.pick(options, 'entity', 'guid', 'term', 'entityName'));
this.collectionObject = this.entity;
this.tagTermCollection = new VTagList();
var tagorterm = _.toArray(this.collectionObject.classifications),
......@@ -176,13 +176,13 @@ define(['require',
that = this;
if (that.term) {
var modal = CommonViewFunction.deleteTagModel({
msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + this.assetName + "?</b></div>",
msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + this.entityName + "?</b></div>",
titleMessage: Messages.removeTerm,
buttonText: "Remove",
});
} else {
var modal = CommonViewFunction.deleteTagModel({
msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + this.assetName + "?</b></div>",
msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + this.entityName + "?</b></div>",
titleMessage: Messages.removeTag,
buttonText: "Remove",
});
......
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