You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ni...@apache.org on 2019/03/05 14:38:44 UTC

[atlas] branch master updated: ATLAS-3066 : UI : Fix various table layouts & improvements.

This is an automated email from the ASF dual-hosted git repository.

nixon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
     new 18ac31d  ATLAS-3066 : UI : Fix various table layouts & improvements.
18ac31d is described below

commit 18ac31dbd2e5ab546f04281fa9a754e253618553
Author: gutkaBinit <bi...@gmail.com>
AuthorDate: Tue Mar 5 16:28:38 2019 +0530

    ATLAS-3066 : UI : Fix various table layouts & improvements.
    
    Signed-off-by: nixonrodrigues <ni...@apache.org>
---
 dashboardv2/public/css/scss/common.scss                        |  2 +-
 dashboardv2/public/js/utils/CommonViewFunction.js              | 10 +++++-----
 dashboardv2/public/js/views/audit/AuditTableLayoutView.js      |  2 +-
 .../public/js/views/detail_page/DetailPageLayoutView.js        |  2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dashboardv2/public/css/scss/common.scss b/dashboardv2/public/css/scss/common.scss
index 35acc43..484879b 100644
--- a/dashboardv2/public/css/scss/common.scss
+++ b/dashboardv2/public/css/scss/common.scss
@@ -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;
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index f5f4fdc..2c0fbaf 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -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 {
diff --git a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
index a30158c..5874a18 100644
--- a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
+++ b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
@@ -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.
diff --git a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
index 4bfdbf4..6727d6a 100644
--- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
@@ -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({