Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 d5ca279bc -> 72cae9eda


ATLAS-2747: UI : Tag attributes of type array are displayed with an extra '>' 
character

Signed-off-by: nixonrodrigues <ni...@apache.org>
(cherry picked from commit cbc4b8a3fea2529c79f3a6addd273feae6c41433)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/72cae9ed
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/72cae9ed
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/72cae9ed

Branch: refs/heads/branch-1.0
Commit: 72cae9eda703ab38674810f37219fea1e6856172
Parents: d5ca279
Author: Abhishek Kadam <abhishek.kada...@gmail.com>
Authored: Fri Jun 8 19:26:04 2018 +0530
Committer: Madhan Neethiraj <mad...@apache.org>
Committed: Tue Jun 12 12:44:06 2018 -0700

----------------------------------------------------------------------
 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/72cae9ed/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/72cae9ed/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/72cae9ed/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>";
                                     }

Reply via email to