Commit b57420cd by Abhishek Kadam Committed by Madhan Neethiraj

ATLAS-2731: UI : attributes on table's detailsPage buffers forever due no access on that entity

parent e73a8099
......@@ -75,6 +75,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
var scope = options.scope,
valueObject = options.valueObject,
extractJSON = options.extractJSON,
relationshipAttributes = options.relationshipAttributes,
isTable = _.isUndefined(options.isTable) ? true : options.isTable,
attributeDefs = options.attributeDefs;
......@@ -104,11 +105,16 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
scope.$('td div[data-id="' + id + '"]').append(deleteButton);
}
},
cust_error: function() {
scope.$('td div[data-id="' + id + '"]').html('<div><span class="text-danger"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Not Authorized</span></div>');
},
complete: function() {}
});
},
extractObject = function(keyValue) {
var valueOfArray = [];
extractObject = function(opt) {
var valueOfArray = [],
keyValue = opt.keyValue,
key = opt.key;
if (!_.isArray(keyValue) && _.isObject(keyValue)) {
keyValue = [keyValue];
}
......@@ -163,10 +169,15 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
if (id && inputOutputField) {
var name = Utils.getName(inputOutputField);
if ((name === "-" || name === id) && !inputOutputField.attributes) {
var fetch = true;
var fetchId = (_.isObject(id) ? id.id : id);
fetchInputOutputValue(fetchId);
tempLink += '<div data-id="' + fetchId + '"><div class="value-loader"></div></div>';
var rAttrValue = relationshipAttributes && relationshipAttributes[key];
if (!rAttrValue) {
var fetch = true;
var fetchId = (_.isObject(id) ? id.id : id);
fetchInputOutputValue(fetchId);
tempLink += '<div data-id="' + fetchId + '"><div class="value-loader"></div></div>';
} else {
tempLink += '<div data-id="' + rAttrValue.guid + '"><a href="#!/detailPage/' + rAttrValue.guid + '">' + Utils.getName(rAttrValue) + '</a></div>';
}
} else {
tempLink += '<a href="#!/detailPage/' + id + '">' + name + '</a>'
}
......@@ -205,11 +216,11 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
if (defEntityType === 'date') {
keyValue = new Date(keyValue);
} else if (_.isObject(keyValue)) {
keyValue = extractObject(keyValue);
keyValue = extractObject({ "keyValue": keyValue, "key": key });
}
} else {
if (_.isObject(keyValue)) {
keyValue = extractObject(keyValue)
keyValue = extractObject({ "keyValue": keyValue, "key": key })
}
}
var val = "";
......
......@@ -87,7 +87,7 @@ define(['require',
this.ui.name.text(name);
if (parseDetailsObject) {
this.ui.auditHeaderValue.html('<th>Key</th><th>New Value</th>');
table = CommonViewFunction.propertyTable({ scope: this, valueObject: parseDetailsObject, attributeDefs: this.attributeDefs });
table = CommonViewFunction.propertyTable({ scope: this, valueObject: parseDetailsObject, relationshipAttributes: parseDetailsObject.relationshipAttributes, attributeDefs: this.attributeDefs });
if (table.length) {
this.ui.noData.hide();
this.ui.tableAudit.show();
......
......@@ -56,7 +56,7 @@ define(['require',
this.entityTableGenerate();
},
entityTableGenerate: function() {
var table = CommonViewFunction.propertyTable({ scope: this, valueObject: this.entity.attributes, attributeDefs: this.attributeDefs });
var table = CommonViewFunction.propertyTable({ scope: this, valueObject: this.entity.attributes, relationshipAttributes: this.entity.relationshipAttributes, attributeDefs: this.attributeDefs });
this.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