Commit 18ac31db by gutkaBinit Committed by nixonrodrigues

ATLAS-3066 : UI : Fix various table layouts & improvements.

parent 5c844562
......@@ -118,7 +118,7 @@ pre {
overflow: hidden;
&.shrink {
height: 100px;
height: 112px;
white-space: -moz-pre-wrap;
/* Mozilla, supported since 1999 */
white-space: -pre-wrap;
......
......@@ -89,7 +89,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
return numberFormat(val);
}
} else {
return val;
return val || "N/A";
}
},
fetchInputOutputValue = function(id, defEntity) {
......@@ -252,16 +252,16 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
}
if (isTable) {
var htmlTag = '<div class="scroll-y">' + getValue(val) + '</div>';
if (_.isObject(valueObject[key])) {
if (_.isObject(valueObject[key]) && !_.isEmpty(valueObject[key])) {
var matchedLinkString = val.match(/href|value-loader\w*/g),
matchedJson = val.match(/json-value|json-string\w*/g),
isMatchLinkStringIsSingle = matchedLinkString && matchedLinkString.length == 1,
isMatchLinkStringIsSingle = matchedLinkString && matchedLinkString.length <= 5,
isMatchJSONStringIsSingle = matchedJson && matchedJson.length == 1,
expandCollapseButton = "";
if ((matchedJson && !isMatchJSONStringIsSingle) || (matchedLinkString && !isMatchLinkStringIsSingle)) {
var expandCollapseButton = '<button class="expand-collapse-button"><i class="fa"></i></button>'
expandCollapseButton = '<button class="expand-collapse-button"><i class="fa"></i></button>';
htmlTag = '<pre class="shrink code-block ' + (isMatchJSONStringIsSingle ? 'fixed-height' : '') + '">' + expandCollapseButton + '<code>' + val + '</code></pre>';
}
var htmlTag = '<pre class="shrink code-block ' + (isMatchJSONStringIsSingle ? 'fixed-height' : '') + '">' + expandCollapseButton + '<code>' + val + '</code></pre>';
}
table += '<tr><td>' + _.escape(key) + '</td><td>' + htmlTag + '</td></tr>';
} else {
......
......@@ -153,9 +153,9 @@ define(['require',
if (that.pervOld.length === 0) {
options.previous.attr('disabled', true);
}
that.renderTableLayoutView();
}
}
that.renderTableLayoutView();
that.$('.fontLoader').hide();
that.$('.tableOverlay').hide();
that.$('.auditTable').show(); // Only for first time table show because we never hide after first render.
......
......@@ -259,7 +259,7 @@ define(['require',
if (schemaOptions && schemaOptions.hasOwnProperty('schemaElementsAttribute') && schemaOptions.schemaElementsAttribute !== "") {
this.$('.schemaTable').show();
this.renderSchemaLayoutView(_.extend({}, obj, {
attribute: collectionJSON.attributes[schemaOptions.schemaElementsAttribute]
attribute: collectionJSON.attributes[schemaOptions.schemaElementsAttribute] || collectionJSON.relationshipAttributes[schemaOptions.schemaElementsAttribute]
}));
} else if (this.value && this.value.tabActive == "schema") {
Utils.setUrl({
......
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