atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject incubator-atlas git commit: ATLAS-1658: UI updates to fix incorrect terms display in search results and detail pages
Date Wed, 08 Mar 2017 07:44:27 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/0.8-incubating 943e480c0 -> a0bd93945


ATLAS-1658: UI updates to fix incorrect terms display in search results and detail pages

Signed-off-by: Madhan Neethiraj <madhan@apache.org>
(cherry picked from commit 9ca6136e2e6e431b0f463344e7e3a731af69646b)


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

Branch: refs/heads/0.8-incubating
Commit: a0bd93945cd45457bbf34a8cb819d4fa4ba72964
Parents: 943e480
Author: kevalbhatt <kbhatt@apache.org>
Authored: Wed Mar 8 12:57:27 2017 +0530
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Tue Mar 7 23:44:22 2017 -0800

----------------------------------------------------------------------
 dashboardv2/public/js/utils/CommonViewFunction.js           | 8 +++++---
 dashboardv2/public/js/utils/Utils.js                        | 8 ++++++++
 .../public/js/views/detail_page/DetailPageLayoutView.js     | 9 ++++-----
 3 files changed, 17 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a0bd9394/dashboardv2/public/js/utils/CommonViewFunction.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index e1c22a1..a601d81 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -307,7 +307,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
             entityName = Utils.getName(obj);
         if (traits) {
             traits.map(function(term) {
-                if (term.split(".").length > 1) {
+                var checkTagOrTerm = Utils.checkTagOrTerm(term);
+                if (checkTagOrTerm.term) {
                     terms.push({
                         deleteHtml: '<a class="pull-left" title="Remove Term"><i
class="fa fa-trash" data-id="tagClick" data-type="term" data-assetname="' + entityName + '"
data-name="' + term + '" data-guid="' + obj.guid + '" ></i></a>',
                         url: _.unescape(term).split(".").join("/"),
@@ -322,7 +323,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
                 className += "showHideDiv hide";
             }
             obj['valueUrl'] = CommonViewFunction.breadcrumbUrlMaker(obj.url);
-            html += '<div class="' + className + '" dataterm-name="' + entityName + '"><div
class="liContent"></div>' + obj.deleteHtml + '</div>';
+            html += '<div class="' + className + '" dataterm-name="' + obj.name + '"><div
class="liContent"></div>' + obj.deleteHtml + '</div>';
         })
         if (terms.length > 1) {
             html += '<div><a  href="javascript:void(0)" data-id="showMoreLessTerm"
class="inputTag inputTagGreen"><span>Show More </span><i class="fa fa-angle-right"></i></a></div>'
@@ -349,7 +350,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
             entityName = Utils.getName(obj);
         if (traits) {
             traits.map(function(tag) {
-                if (tag.split(".").length === 1) {
+                var checkTagOrTerm = Utils.checkTagOrTerm(tag);
+                if (checkTagOrTerm.tag) {
                     var className = "inputTag";
                     if (count >= 1) {
                         popTag += '<a class="' + className + '" data-id="tagClick"><span
class="inputValue">' + tag + '</span><i class="fa fa-times" data-id="delete" 
data-assetname="' + entityName + '"data-name="' + tag + '" data-type="tag" data-guid="' +
obj.guid + '" ></i></a>';

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a0bd9394/dashboardv2/public/js/utils/Utils.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/Utils.js b/dashboardv2/public/js/utils/Utils.js
index f214c50..b96bc9b 100644
--- a/dashboardv2/public/js/utils/Utils.js
+++ b/dashboardv2/public/js/utils/Utils.js
@@ -295,6 +295,11 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
                 fullName: value
             }
         }
+        if (value && _.isString(value)) {
+            value = {
+                typeName: value
+            }
+        }
         if (_.isObject(value)) {
             var name = "";
             if (value && value.$typeName$) {
@@ -306,11 +311,14 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
                 return {}
             }
             name = _.escape(name).split('.');
+
             var trem = false;
             if (value['taxonomy.namespace']) {
                 trem = true;
             } else if (value.values && value.values['taxonomy.namespace']) {
                 trem = true;
+            } else if (name.length > 1) {
+                trem = true; // Temp fix
             }
 
             if (trem) {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a0bd9394/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
index 41be98d..49953fd 100644
--- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
@@ -247,12 +247,11 @@ define(['require',
                     termData = "";
 
                 _.each(tagObject, function(val) {
-                    //var isTerm = Utils.checkTagOrTerm(val);
-                    if (val.typeName && val.typeName.split('.').length === 1) {
-                        tagData += '<span class="inputTag" data-id="tagClick"><span
class="inputValue">' + val.typeName + '</span><i class="fa fa-close" data-id="deleteTag"
data-type="tag"></i></span>';
-                    }
-                    if (val.typeName && val.typeName.split('.').length > 1) {
+                    var checkTagOrTerm = Utils.checkTagOrTerm(val);
+                    if (checkTagOrTerm.term) {
                         termData += '<span class="inputTag term" data-id="tagClick" data-href="'
+ val.typeName + '"><span class="inputValue">' + val.typeName + '</span><i
class="fa fa-close" data-id="deleteTag" data-type="term"></i></span>';
+                    } else {
+                        tagData += '<span class="inputTag" data-id="tagClick"><span
class="inputValue">' + val.typeName + '</span><i class="fa fa-close" data-id="deleteTag"
data-type="tag"></i></span>';
                     }
                 });
                 this.ui.tagList.find("span.inputTag").remove();


Mime
View raw message