Repository: atlas Updated Branches: refs/heads/master fff94633d -> cbc4b8a3f
ATLAS-2747: UI : Tag attributes of type array are displayed with an extra '>' character Signed-off-by: nixonrodrigues <ni...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/cbc4b8a3 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/cbc4b8a3 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/cbc4b8a3 Branch: refs/heads/master Commit: cbc4b8a3fea2529c79f3a6addd273feae6c41433 Parents: fff9463 Author: Abhishek Kadam <abhishek.kada...@gmail.com> Authored: Fri Jun 8 19:26:04 2018 +0530 Committer: nixonrodrigues <ni...@apache.org> Committed: Mon Jun 11 17:40:11 2018 +0530 ---------------------------------------------------------------------- dashboardv2/public/js/utils/Overrides.js | 6 ++++++ dashboardv2/public/js/views/tag/AddTagModalView.js | 4 +++- dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/cbc4b8a3/dashboardv2/public/js/utils/Overrides.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/utils/Overrides.js b/dashboardv2/public/js/utils/Overrides.js index a96fc2c..aa69b9b 100644 --- a/dashboardv2/public/js/utils/Overrides.js +++ b/dashboardv2/public/js/utils/Overrides.js @@ -68,6 +68,12 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq } else { return val; } + }, + isTypePrimitive: function(type) { + if (type === "int" || type === "byte" || type === "short" || type === "long" || type === "float" || type === "double" || type === "string" || type === "boolean" || type === "date") { + return true; + } + return false; } }); var getPopoverEl = function(e) { http://git-wip-us.apache.org/repos/asf/atlas/blob/cbc4b8a3/dashboardv2/public/js/views/tag/AddTagModalView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/tag/AddTagModalView.js b/dashboardv2/public/js/views/tag/AddTagModalView.js index e442f57..c256ef3 100644 --- a/dashboardv2/public/js/views/tag/AddTagModalView.js +++ b/dashboardv2/public/js/views/tag/AddTagModalView.js @@ -341,7 +341,9 @@ define(['require', '<select class="form-control attributeInputVal attrName" data-key="' + name + '">' + str + '</select></div>'); } else { var textElement = that.getElement(name, typeName); - that.ui.tagAttribute.append('<div class="form-group"><label>' + name + '</label>' + ' (' + typeName + ')' + textElement + '</div>'); + if (_.isTypePrimitive(typeName)) { + that.ui.tagAttribute.append('<div class="form-group"><label>' + name + '</label>' + ' (' + typeName + ')' + textElement + '</div>'); + } } }); that.$('input[data-type="date"]').each(function() { http://git-wip-us.apache.org/repos/asf/atlas/blob/cbc4b8a3/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js index 35e0f87..07f9b70 100644 --- a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js +++ b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js @@ -150,10 +150,13 @@ define(['require', }), 'sortKey'), function(sortedObj) { var val = _.isNull(values[sortedObj.name]) ? "-" : values[sortedObj.name], key = sortedObj.name; + if (_.isObject(val)) { + val = JSON.stringify(val); + } if (sortedObj.typeName === "date") { val = new Date(val) } - stringValue += "<tr><td class='html-cell string-cell renderable'>" + _.escape(key) + "</td><td class='html-cell string-cell renderable' data-type=" + sortedObj.typeName + ">" + _.escape(val) + "</td>"; + stringValue += "<tr><td class='html-cell string-cell renderable'>" + _.escape(key) + "</td><td class='html-cell string-cell renderable' data-type='"+sortedObj.typeName+"'>" + _.escape(val) + "</td>"; }); tagValue = "<div class='mainAttrTable'><table class='attriTable'><tr><th class='html-cell string-cell renderable'>Name</th><th class='html-cell string-cell renderable'>Value</th>" + stringValue + "</table></div>"; }