Commit cbc4b8a3 by Abhishek Kadam Committed by nixonrodrigues

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

parent fff94633
...@@ -68,6 +68,12 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq ...@@ -68,6 +68,12 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq
} else { } else {
return val; 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) { var getPopoverEl = function(e) {
......
...@@ -341,8 +341,10 @@ define(['require', ...@@ -341,8 +341,10 @@ define(['require',
'<select class="form-control attributeInputVal attrName" data-key="' + name + '">' + str + '</select></div>'); '<select class="form-control attributeInputVal attrName" data-key="' + name + '">' + str + '</select></div>');
} else { } else {
var textElement = that.getElement(name, typeName); var textElement = that.getElement(name, typeName);
if (_.isTypePrimitive(typeName)) {
that.ui.tagAttribute.append('<div class="form-group"><label>' + name + '</label>' + ' (' + typeName + ')' + textElement + '</div>'); that.ui.tagAttribute.append('<div class="form-group"><label>' + name + '</label>' + ' (' + typeName + ')' + textElement + '</div>');
} }
}
}); });
that.$('input[data-type="date"]').each(function() { that.$('input[data-type="date"]').each(function() {
if (!$(this).data('daterangepicker')) { if (!$(this).data('daterangepicker')) {
......
...@@ -150,10 +150,13 @@ define(['require', ...@@ -150,10 +150,13 @@ define(['require',
}), 'sortKey'), function(sortedObj) { }), 'sortKey'), function(sortedObj) {
var val = _.isNull(values[sortedObj.name]) ? "-" : values[sortedObj.name], var val = _.isNull(values[sortedObj.name]) ? "-" : values[sortedObj.name],
key = sortedObj.name; key = sortedObj.name;
if (_.isObject(val)) {
val = JSON.stringify(val);
}
if (sortedObj.typeName === "date") { if (sortedObj.typeName === "date") {
val = new Date(val) 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>"; 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>";
} }
......
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