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 ...@@ -128,14 +128,14 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
var subLink = ""; var subLink = "";
for (var i = 0; i < keyValue.length; i++) { for (var i = 0; i < keyValue.length; i++) {
var inputOutputField = keyValue[i], var inputOutputField = keyValue[i],
id = inputOutputField.guid, id = inputOutputField.guid || inputOutputField.id,
tempLink = "", tempLink = "",
readOnly = false; readOnly = false;
if (_.isString(inputOutputField) || _.isBoolean(inputOutputField) || _.isNumber(inputOutputField)) { if (_.isString(inputOutputField) || _.isBoolean(inputOutputField) || _.isNumber(inputOutputField)) {
if (inputOutputField.indexOf("$") == -1) { if (inputOutputField.indexOf("$") == -1) {
valueOfArray.push('<span>' + _.escape(inputOutputField) + '</span>'); valueOfArray.push('<span>' + _.escape(inputOutputField) + '</span>');
} }
} else if (_.isObject(inputOutputField) && !inputOutputField.attributes && !id) { } else if (_.isObject(inputOutputField) && !id) {
_.each(inputOutputField, function(objValue, objKey) { _.each(inputOutputField, function(objValue, objKey) {
var value = objValue; var value = objValue;
if (objKey.indexOf("$") == -1) { if (objKey.indexOf("$") == -1) {
...@@ -156,7 +156,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -156,7 +156,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
} else if (inputOutputField.typeName) { } else if (inputOutputField.typeName) {
tempLink += '<a href="#!/detailPage/' + id + '">' + _.escape(inputOutputField.typeName) + '</a>' tempLink += '<a href="#!/detailPage/' + id + '">' + _.escape(inputOutputField.typeName) + '</a>'
} else { } else {
tempLink += '<a href="#!/detailPage/' + id + '">' + id + '</a>' tempLink += '<a href="#!/detailPage/' + id + '">' + _.escape(id) + '</a>'
} }
} else if (inputOutputField.name) { } else if (inputOutputField.name) {
tempLink += '<a href="#!/detailPage/' + id + '">' + _.escape(inputOutputField.name) + '</a>'; tempLink += '<a href="#!/detailPage/' + id + '">' + _.escape(inputOutputField.name) + '</a>';
...@@ -164,8 +164,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -164,8 +164,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
tempLink += '<a href="#!/detailPage/' + id + '">' + _.escape(inputOutputField.qualifiedName) + '</a>' tempLink += '<a href="#!/detailPage/' + id + '">' + _.escape(inputOutputField.qualifiedName) + '</a>'
} else { } else {
var fetch = true; var fetch = true;
fetchInputOutputValue(id); var fetchId = (_.isObject(id) ? id.id : id);
tempLink += '<div data-id="' + id + '"></div>'; fetchInputOutputValue(fetchId);
tempLink += '<div data-id="' + fetchId + '"></div>';
} }
} }
...@@ -192,14 +193,14 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -192,14 +193,14 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
if (searchTable) { if (searchTable) {
table = subLink; table = subLink;
} else { } else {
table += '<tr><td>' + key + '</td><td>' + _.escape(subLink) + '</td></tr>'; table += '<tr><td>' + _.escape(key) + '</td><td>' + subLink + '</td></tr>';
} }
} else { } else {
if (key.indexOf("Time") !== -1 || key == "retention") { if (key.indexOf("Time") !== -1 || key == "retention") {
if (searchTable) { if (searchTable) {
table = new Date(valueObject[key]); table = new Date(valueObject[key]);
} else { } 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 { } else {
if (searchTable) { if (searchTable) {
...@@ -209,7 +210,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -209,7 +210,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
table = valueObject[key]; table = valueObject[key];
} }
} else { } 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', ...@@ -58,7 +58,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'guid', 'vent')); _.extend(this, _.pick(options, 'globalVent', 'guid', 'vent', 'entityObject'));
this.entityCollection = new VEntityList(); this.entityCollection = new VEntityList();
this.count = 26; this.count = 26;
this.entityCollection.url = UrlLinks.entityCollectionaudit(this.guid); this.entityCollection.url = UrlLinks.entityCollectionaudit(this.guid);
...@@ -239,7 +239,7 @@ define(['require', ...@@ -239,7 +239,7 @@ define(['require',
that.action = $(e.target).data("action"); that.action = $(e.target).data("action");
var eventModel = that.entityCollection.findWhere({ 'eventKey': $(e.currentTarget).data('modalid') }).toJSON(), var eventModel = that.entityCollection.findWhere({ 'eventKey': $(e.currentTarget).data('modalid') }).toJSON(),
collectionModel = new that.entityCollection.model(eventModel), 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({ var modal = new Modal({
title: that.action, title: that.action,
content: view, content: view,
......
...@@ -53,7 +53,7 @@ define(['require', ...@@ -53,7 +53,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'guid', 'entityModel', 'action')); _.extend(this, _.pick(options, 'globalVent', 'guid', 'entityModel', 'action', 'entityObject'));
}, },
bindEvents: function() {}, bindEvents: function() {},
onRender: function() { onRender: function() {
...@@ -69,7 +69,7 @@ define(['require', ...@@ -69,7 +69,7 @@ define(['require',
//Append string for JSON parse //Append string for JSON parse
var valueObject = detailsObject.values; var valueObject = detailsObject.values;
if (this.action == Enums.auditAction.TAG_ADD) { 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>"); this.ui.auditValue.html("<tr><td>" + _.escape(detailsObject.typeName) + "</td></tr>");
} else { } else {
this.ui.auditHeaderValue.html('<th>Key</th><th>New Value</th>'); this.ui.auditHeaderValue.html('<th>Key</th><th>New Value</th>');
...@@ -83,10 +83,10 @@ define(['require', ...@@ -83,10 +83,10 @@ define(['require',
this.ui.tableAudit.hide(); this.ui.tableAudit.hide();
} }
} }
} else if (this.action == Enums.auditAction.TAG_DELETE) { } else if (this.action == Enums.auditAction.TAG_DELETE || Enums.auditAction.ENTITY_DELETE) {
var appendedString = this.entityModel.get('details').split(':'); //var appendedString = this.entityModel.get('details').split(':');
this.ui.auditHeaderValue.html('<th>Tag</th>'); this.ui.auditHeaderValue.html('<th>' + this.action + '</th>');
this.ui.auditValue.html("<tr><td>" + _.escape(appendedString[1]) + "</td></tr>"); this.ui.auditValue.html("<tr><td>" + this.entityObject.name + "</td></tr>");
} }
}, },
......
...@@ -177,6 +177,7 @@ define(['require', ...@@ -177,6 +177,7 @@ define(['require',
this.renderEntityDetailTableLayoutView(); this.renderEntityDetailTableLayoutView();
this.renderTagTableLayoutView(tagGuid); this.renderTagTableLayoutView(tagGuid);
this.renderTermTableLayoutView(tagGuid); this.renderTermTableLayoutView(tagGuid);
this.renderAuditTableLayoutView(this.id, collectionJSON.attributes);
}, this); }, this);
}, },
onRender: function() { onRender: function() {
...@@ -184,7 +185,7 @@ define(['require', ...@@ -184,7 +185,7 @@ define(['require',
this.ui.editBox.hide(); this.ui.editBox.hide();
this.renderLineageLayoutView(this.id); this.renderLineageLayoutView(this.id);
this.renderSchemaLayoutView(this.id); this.renderSchemaLayoutView(this.id);
this.renderAuditTableLayoutView(this.id);
}, },
fetchCollection: function() { fetchCollection: function() {
this.collection.fetch({ reset: true }); this.collection.fetch({ reset: true });
...@@ -340,13 +341,14 @@ define(['require', ...@@ -340,13 +341,14 @@ define(['require',
})); }));
}); });
}, },
renderAuditTableLayoutView: function(tagGuid) { renderAuditTableLayoutView: function(tagGuid, entityObject) {
var that = this; var that = this;
require(['views/audit/AuditTableLayoutView'], function(AuditTableLayoutView) { require(['views/audit/AuditTableLayoutView'], function(AuditTableLayoutView) {
that.RAuditTableLayoutView.show(new AuditTableLayoutView({ that.RAuditTableLayoutView.show(new AuditTableLayoutView({
globalVent: that.globalVent, globalVent: that.globalVent,
guid: tagGuid, guid: tagGuid,
vent: that.auditVent vent: that.auditVent,
entityObject: entityObject
})); }));
}); });
}, },
......
...@@ -451,7 +451,7 @@ define(['require', ...@@ -451,7 +451,7 @@ define(['require',
} }
if (model.get('$id$') && model.get('$id$').state && Enums.entityStateReadOnly[model.get('$id$').state]) { 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>'; 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 { } 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>' 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; return nameHtml;
......
...@@ -9,7 +9,13 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al ...@@ -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) ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES: 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-1407 improve LOG statement performance (apoorvnaik via mneethiraj)
ATLAS-1350 update authorization to handle v2 REST endpoints (saqeeb.s 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) 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