Commit f6ea040a by kevalbhatt Committed by Madhan Neethiraj

ATLAS-1760: UI update to render property value per attribute type in entity definition

parent e8a73821
......@@ -57,7 +57,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'guid', 'entity', 'entityName'));
_.extend(this, _.pick(options, 'guid', 'entity', 'entityName', 'entityDef'));
this.entityCollection = new VEntityList();
this.count = 26;
this.entityCollection.url = UrlLinks.entityCollectionaudit(this.guid);
......@@ -227,9 +227,9 @@ define(['require',
'views/audit/CreateAuditTableLayoutView',
], function(Modal, CreateAuditTableLayoutView) {
that.action = $(e.target).data("action");
var eventModel = that.entityCollection.findWhere({ 'eventKey': $(e.currentTarget).data('modalid') }).toJSON(),
var eventModel = that.entityCollection.fullCollection.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, entityName: that.entityName });
view = new CreateAuditTableLayoutView({ guid: that.guid, entityModel: collectionModel, action: that.action, entity: that.entity, entityName: that.entityName, entityDef: that.entityDef });
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', 'entityName'));
_.extend(this, _.pick(options, 'guid', 'entityModel', 'action', 'entity', 'entityName', 'entityDef'));
},
bindEvents: function() {},
onRender: function() {
......@@ -85,7 +85,7 @@ define(['require',
} else if (parseDetailsObject && parseDetailsObject.values) {
this.ui.auditHeaderValue.html('<th>Key</th><th>New Value</th>');
//CommonViewFunction.findAndmergeRefEntity(attributeObject, that.referredEntities);
table = CommonViewFunction.propertyTable(values, this);
table = CommonViewFunction.propertyTable(this, values, this.entityDef);
if (table.length) {
this.ui.noData.hide();
this.ui.tableAudit.show();
......
......@@ -173,8 +173,7 @@ define(['require',
entityDefCollection: this.entityDefCollection,
fetchCollection: this.fetchCollection.bind(that)
}
this.renderEntityDetailTableLayoutView(obj);
this.renderAuditTableLayoutView(obj);
this.getEntityDef(obj);
this.renderTagTableLayoutView(obj);
this.renderTermTableLayoutView(_.extend({}, obj, { term: true }));
// To render Schema check attribute "schemaElementsAttribute"
......@@ -240,6 +239,17 @@ define(['require',
fetchCollection: function() {
this.collection.fetch({ reset: true });
},
getEntityDef: function(obj) {
var data = this.entityDefCollection.fullCollection.findWhere({ name: obj.entity.typeName }).toJSON();
var entityDef = Utils.getNestedSuperTypeObj({
data: data,
attrMerge: true,
collection: this.entityDefCollection
});
obj['entityDef'] = entityDef;
this.renderEntityDetailTableLayoutView(obj);
this.renderAuditTableLayoutView(obj);
},
onClickTagCross: function(e) {
var tagName = $(e.currentTarget).parent().text(),
tagOrTerm = $(e.target).data("type"),
......
......@@ -48,7 +48,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'entity', 'referredEntities', 'typeHeaders'));
_.extend(this, _.pick(options, 'entity', 'referredEntities', 'typeHeaders', 'entityDef'));
this.entityModel = new VEntity({});
},
bindEvents: function() {},
......@@ -65,7 +65,7 @@ define(['require',
});
attributeObject.columns = valueSorted;
}
var table = CommonViewFunction.propertyTable(attributeObject, this);
var table = CommonViewFunction.propertyTable(this, attributeObject, this.entityDef);
that.ui.detailValue.append(table);
}
});
......
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