Commit e5b6438f by kalyanikk Committed by Madhan Neethiraj

ATLAS-1421: Regression : HTML is displayed for deleted entities in search-result…

ATLAS-1421: Regression : HTML is displayed for deleted entities in search-result and entity-details pages Signed-off-by: 's avatarMadhan Neethiraj <madhan@apache.org>
parent c9911730
......@@ -128,14 +128,14 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
var subLink = "";
for (var i = 0; i < keyValue.length; i++) {
var inputOutputField = keyValue[i],
id = inputOutputField.guid,
id = inputOutputField.guid || inputOutputField.id,
tempLink = "",
readOnly = false;
if (_.isString(inputOutputField) || _.isBoolean(inputOutputField) || _.isNumber(inputOutputField)) {
if (inputOutputField.indexOf("$") == -1) {
valueOfArray.push('<span>' + _.escape(inputOutputField) + '</span>');
}
} else if (_.isObject(inputOutputField) && !inputOutputField.attributes && !id) {
} else if (_.isObject(inputOutputField) && !id) {
_.each(inputOutputField, function(objValue, objKey) {
var value = objValue;
if (objKey.indexOf("$") == -1) {
......@@ -156,7 +156,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
} else if (inputOutputField.typeName) {
tempLink += '<a href="#!/detailPage/' + id + '">' + _.escape(inputOutputField.typeName) + '</a>'
} else {
tempLink += '<a href="#!/detailPage/' + id + '">' + id + '</a>'
tempLink += '<a href="#!/detailPage/' + id + '">' + _.escape(id) + '</a>'
}
} else if (inputOutputField.name) {
tempLink += '<a href="#!/detailPage/' + id + '">' + _.escape(inputOutputField.name) + '</a>';
......@@ -164,8 +164,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
tempLink += '<a href="#!/detailPage/' + id + '">' + _.escape(inputOutputField.qualifiedName) + '</a>'
} else {
var fetch = true;
fetchInputOutputValue(id);
tempLink += '<div data-id="' + id + '"></div>';
var fetchId = (_.isObject(id) ? id.id : id);
fetchInputOutputValue(fetchId);
tempLink += '<div data-id="' + fetchId + '"></div>';
}
}
......@@ -192,14 +193,14 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
if (searchTable) {
table = subLink;
} else {
table += '<tr><td>' + key + '</td><td>' + _.escape(subLink) + '</td></tr>';
table += '<tr><td>' + _.escape(key) + '</td><td>' + subLink + '</td></tr>';
}
} else {
if (key.indexOf("Time") !== -1 || key == "retention") {
if (searchTable) {
table = new Date(valueObject[key]);
} else {
table += '<tr><td>' + key + '</td><td>' + new Date(valueObject[key]) + '</td></tr>';
table += '<tr><td>' + _.escape(key) + '</td><td>' + new Date(valueObject[key]) + '</td></tr>';
}
} else {
if (searchTable) {
......@@ -209,7 +210,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
table = valueObject[key];
}
} else {
table += '<tr><td>' + key + '</td><td>' + _.escape(valueObject[key]) + '</td></tr>';
table += '<tr><td>' + _.escape(key) + '</td><td>' + _.escape(valueObject[key]) + '</td></tr>';
}
}
}
......
......@@ -58,7 +58,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'guid', 'vent'));
_.extend(this, _.pick(options, 'globalVent', 'guid', 'vent', 'entityObject'));
this.entityCollection = new VEntityList();
this.count = 26;
this.entityCollection.url = UrlLinks.entityCollectionaudit(this.guid);
......@@ -239,7 +239,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 });
view = new CreateAuditTableLayoutView({ guid: that.guid, entityModel: collectionModel, action: that.action, entityObject: that.entityObject });
var modal = new Modal({
title: that.action,
content: view,
......
......@@ -53,7 +53,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'guid', 'entityModel', 'action'));
_.extend(this, _.pick(options, 'globalVent', 'guid', 'entityModel', 'action', 'entityObject'));
},
bindEvents: function() {},
onRender: function() {
......@@ -69,7 +69,7 @@ define(['require',
//Append string for JSON parse
var valueObject = detailsObject.values;
if (this.action == Enums.auditAction.TAG_ADD) {
this.ui.auditHeaderValue.html('<th>Tag</th>');
this.ui.auditHeaderValue.html('<th>' + Enums.auditAction.TAG_ADD + '</th>');
this.ui.auditValue.html("<tr><td>" + _.escape(detailsObject.typeName) + "</td></tr>");
} else {
this.ui.auditHeaderValue.html('<th>Key</th><th>New Value</th>');
......@@ -83,10 +83,10 @@ define(['require',
this.ui.tableAudit.hide();
}
}
} else if (this.action == Enums.auditAction.TAG_DELETE) {
var appendedString = this.entityModel.get('details').split(':');
this.ui.auditHeaderValue.html('<th>Tag</th>');
this.ui.auditValue.html("<tr><td>" + _.escape(appendedString[1]) + "</td></tr>");
} else if (this.action == Enums.auditAction.TAG_DELETE || Enums.auditAction.ENTITY_DELETE) {
//var appendedString = this.entityModel.get('details').split(':');
this.ui.auditHeaderValue.html('<th>' + this.action + '</th>');
this.ui.auditValue.html("<tr><td>" + this.entityObject.name + "</td></tr>");
}
},
......
......@@ -177,6 +177,7 @@ define(['require',
this.renderEntityDetailTableLayoutView();
this.renderTagTableLayoutView(tagGuid);
this.renderTermTableLayoutView(tagGuid);
this.renderAuditTableLayoutView(this.id, collectionJSON.attributes);
}, this);
},
onRender: function() {
......@@ -184,7 +185,7 @@ define(['require',
this.ui.editBox.hide();
this.renderLineageLayoutView(this.id);
this.renderSchemaLayoutView(this.id);
this.renderAuditTableLayoutView(this.id);
},
fetchCollection: function() {
this.collection.fetch({ reset: true });
......@@ -340,13 +341,14 @@ define(['require',
}));
});
},
renderAuditTableLayoutView: function(tagGuid) {
renderAuditTableLayoutView: function(tagGuid, entityObject) {
var that = this;
require(['views/audit/AuditTableLayoutView'], function(AuditTableLayoutView) {
that.RAuditTableLayoutView.show(new AuditTableLayoutView({
globalVent: that.globalVent,
guid: tagGuid,
vent: that.auditVent
vent: that.auditVent,
entityObject: entityObject
}));
});
},
......
......@@ -451,7 +451,7 @@ define(['require',
}
if (model.get('$id$') && model.get('$id$').state && Enums.entityStateReadOnly[model.get('$id$').state]) {
nameHtml += '<button type="button" title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
return '<div class="readOnly readOnlyLink">' + _.escape(nameHtml) + '</div>';
return '<div class="readOnly readOnlyLink">' + nameHtml + '</div>';
} else {
nameHtml += '<button title="Edit" data-id="editEntityButton" data-giud= "' + (model.get('$id$').id || model.get('$id$')) + '" class="btn btn-atlasAction btn-atlas editBtn"><i class="fa fa-pencil"></i></button>'
return nameHtml;
......
......@@ -9,7 +9,13 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al
ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES:
ATLAS-1391 Add exclusion mechanism for Atlas audit
ATLAS-1421 Regression : HTML is displayed for deleted entities in search-result and entity-details pages (Kalyanikashikar via mneethiraj)
ATLAS-1417 HIveHook: synchronous execution fails to notify (sumasai via mneethiraj)
ATLAS-1391 Add exclusion mechanism for Atlas audit (guptaneeru via mneethiraj)
ATLAS-1424 Avoid stack-trace in REST API error response (nixonrodrigues via mneethiraj)
ATLAS-1415 fix potential NPE issues found by Coverity scan (mneethiraj)
ATLAS-1412 delete AtlasApiEntities, as it is not used (david_radley via mneethiraj)
ATLAS-1402 UI issues due to v2 API integration (Kalyanikashikar via mneethiraj)
ATLAS-1407 improve LOG statement performance (apoorvnaik via mneethiraj)
ATLAS-1350 update authorization to handle v2 REST endpoints (saqeeb.s via mneethiraj)
ATLAS-1311 Integration tests for V2 Entity APIs (apoorvnaik via mneethiraj)
......
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