ATLAS-2930: UI changes to handle error message based on softReference attribute
Signed-off-by: kevalbhatt <kbh...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/314569d7 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/314569d7 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/314569d7 Branch: refs/heads/branch-1.0 Commit: 314569d7f7282eebf795d0e9084724ef46f15e57 Parents: 6e0c97c Author: Abhishek Kadam <abhishek.kada...@gmail.com> Authored: Tue Oct 23 12:43:10 2018 +0530 Committer: Ashutosh Mestry <ames...@hortonworks.com> Committed: Thu Nov 1 15:42:58 2018 -0700 ---------------------------------------------------------------------- dashboardv2/public/js/utils/CommonViewFunction.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/314569d7/dashboardv2/public/js/utils/CommonViewFunction.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js index 0439177..4af5270 100644 --- a/dashboardv2/public/js/utils/CommonViewFunction.js +++ b/dashboardv2/public/js/utils/CommonViewFunction.js @@ -79,7 +79,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum attributeDefs = options.attributeDefs; var table = "", - fetchInputOutputValue = function(id) { + fetchInputOutputValue = function(id, defEntity) { var that = this; scope.entityModel.getEntityHeader(id, { success: function(serverData) { @@ -107,6 +107,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum cust_error: function(error, xhr) { if (xhr.status == 403) { 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>'); + } else if (defEntity && defEntity.options && defEntity.options.isSoftReference === "true") { + scope.$('td div[data-id="' + id + '"]').html('<div> ' + id + '</div>'); } else { scope.$('td div[data-id="' + id + '"]').html('<div><span class="text-danger"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> ' + Messages.defaultErrorMessage + '</span></div>'); } @@ -117,7 +119,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum extractObject = function(opt) { var valueOfArray = [], keyValue = opt.keyValue, - key = opt.key; + key = opt.key, + defEntity = opt.defEntity; if (!_.isArray(keyValue) && _.isObject(keyValue)) { keyValue = [keyValue]; } @@ -172,7 +175,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum if ((name === "-" || name === id) && !inputOutputField.attributes) { var fetch = true; var fetchId = (_.isObject(id) ? id.id : id); - fetchInputOutputValue(fetchId); + fetchInputOutputValue(fetchId, defEntity); tempLink += '<div data-id="' + fetchId + '"><div class="value-loader"></div></div>'; } else { tempLink += '<a href="#!/detailPage/' + id + '">' + name + '</a>' @@ -212,7 +215,7 @@ 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, "key": key }); + keyValue = extractObject({ "keyValue": keyValue, "key": key, 'defEntity': defEntity }); } } else { if (_.isObject(keyValue)) {