atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suma...@apache.org
Subject incubator-atlas git commit: ATLAS-1056 : Differentiate between tag and term using attribute "taxonomy.namespace"
Date Wed, 27 Jul 2016 00:45:30 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master 5de10081c -> 425237d59


ATLAS-1056 : Differentiate between tag and term using attribute "taxonomy.namespace"


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

Branch: refs/heads/master
Commit: 425237d59cc0344abfa74819f6e16f7214a59945
Parents: 5de1008
Author: keval <kevalbhatt18@gmail.com>
Authored: Wed Jul 27 00:31:18 2016 +0530
Committer: Suma Shivaprasad <sumasai.shivaprasad@gmail.com>
Committed: Tue Jul 26 17:44:57 2016 -0700

----------------------------------------------------------------------
 dashboardv2/public/css/scss/breadcrumb.scss     |  4 +-
 dashboardv2/public/css/scss/theme.scss          | 42 ++++++++++++++------
 .../business_catalog/BusinessCatalogHeader.html |  8 ++--
 .../public/js/templates/site/header.html        |  8 ++--
 .../public/js/utils/CommonViewFunction.js       | 38 ++++++------------
 dashboardv2/public/js/utils/Messages.js         |  4 +-
 dashboardv2/public/js/utils/Utils.js            | 41 ++++++++++++++++---
 .../BusinessCatalogDetailLayoutView.js          |  2 +-
 .../js/views/business_catalog/TreeLayoutView.js | 25 +++++++-----
 .../views/detail_page/DetailPageLayoutView.js   | 33 +++++++--------
 .../public/js/views/schema/SchemaLayoutView.js  | 29 ++++++++------
 .../public/js/views/search/SearchLayoutView.js  |  4 --
 .../js/views/search/SearchResultLayoutView.js   | 25 +++++++-----
 .../public/js/views/tag/CreateTagLayoutView.js  |  6 +--
 .../js/views/tag/TagDetailTableLayoutView.js    |  7 ++--
 .../public/js/views/tag/TagLayoutView.js        | 18 ++++-----
 .../public/js/views/tag/addTagModalView.js      |  7 +---
 release-log.txt                                 |  1 +
 18 files changed, 166 insertions(+), 136 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/css/scss/breadcrumb.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/breadcrumb.scss b/dashboardv2/public/css/scss/breadcrumb.scss
index cf3324e..dbd17b4 100644
--- a/dashboardv2/public/css/scss/breadcrumb.scss
+++ b/dashboardv2/public/css/scss/breadcrumb.scss
@@ -53,8 +53,8 @@
     display: none !important;
 }
 
-.breadcrumb-dropdown .popover.bottom {
-    margin-top: 45px;
+#new-header .breadcrumb-dropdown .popover.bottom {
+    margin-top: 45px !important;
 }
 
 .breadcrumb>li:last-child a {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/css/scss/theme.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/theme.scss b/dashboardv2/public/css/scss/theme.scss
index 80ed9f2..2874e23 100644
--- a/dashboardv2/public/css/scss/theme.scss
+++ b/dashboardv2/public/css/scss/theme.scss
@@ -19,15 +19,32 @@
 
 /* theme.scss */
 
-.user-dropdown {
-    display: inline-block;
-    padding: 14px;
-    color: $color_ironside_gray_approx;
-    .user-circle {
-        padding: 8px 10px;
-        border: 1px solid $color_ironside_gray_approx;
-        border-radius: 20px;
-        margin: 0px 4px;
+.header-menu {
+    .dropdown-menu > li > a {
+        color: $color_ironside_gray_approx;
+        &:hover {
+            color: $color_jungle_green_approx;
+        }
+        i {
+            padding-right: 3px;
+        }
+    }
+    >a {
+        display: inline-block;
+        color: $color_ironside_gray_approx;
+        padding: 16px 14px;
+        &:hover {
+            border-bottom: 2px solid $color_jungle_green_approx;
+            padding: 14px 14px;
+            color: $color_jungle_green_approx;
+        }
+        span {
+            padding: 5px;
+        }
+        i {
+            margin-top: 7px;
+            font-size: 18px;
+        }
     }
 }
 
@@ -132,6 +149,7 @@
         color: $color_jungle_green_approx;
     }
 }
-.position-relative{
-    position:relative;
-}
\ No newline at end of file
+
+.position-relative {
+    position: relative;
+}

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/js/templates/business_catalog/BusinessCatalogHeader.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/business_catalog/BusinessCatalogHeader.html b/dashboardv2/public/js/templates/business_catalog/BusinessCatalogHeader.html
index 9798b2c..99cf5cf 100644
--- a/dashboardv2/public/js/templates/business_catalog/BusinessCatalogHeader.html
+++ b/dashboardv2/public/js/templates/business_catalog/BusinessCatalogHeader.html
@@ -17,15 +17,15 @@
 <ol class="breadcrumb col-md-6">
 </ol>
 <header class="clearfix">
-    <div class="btn-group pull-right">
-        <a href="javascript:void(0);" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
class="user-dropdown"><span class="userName"></span><i class="fa fa-user
user-circle"></i></a>
+    <div class="btn-group pull-right header-menu">
+        <a target="_blank" href="https://cwiki.apache.org/confluence/display/ATLAS/Atlas+Home"
title="Help"><i class="fa  fa-question-circle"></i></a>
+        <a href="javascript:void(0);" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i
class="fa fa-user user-circle"></i><span class="userName"></span></a>
         <ul class="dropdown-menu">
             <!--    <li><a href="#">Edit Profile</a></li>
             <li><a href="#">Change Password</a></li> -->
             <li class="aboutAtlas"><a href="javascript:void(0)">About</a></li>
-            <li><a target="_blank" href="https://cwiki.apache.org/confluence/display/ATLAS/Atlas+Home">Help</a></li>
             <li role="separator" class="divider"></li>
-            <li><a href="logout.html">Logout</a></li>
+            <li><a href="logout.html"><i class="fa fa-sign-out"></i>Logout</a></li>
         </ul>
     </div>
 </header>

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/js/templates/site/header.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/site/header.html b/dashboardv2/public/js/templates/site/header.html
index 9f8a1ea..272e81c 100644
--- a/dashboardv2/public/js/templates/site/header.html
+++ b/dashboardv2/public/js/templates/site/header.html
@@ -15,16 +15,16 @@
  * limitations under the License.
 -->
 <header class="clearfix">
-    <div class="btn-group pull-right">
-        <a href="javascript:void(0);" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
class="user-dropdown"><span class="userName"></span><i class="fa fa-user
user-circle "></i></a>
+    <div class="btn-group pull-right header-menu ">
+        <a target="_blank" href="https://cwiki.apache.org/confluence/display/ATLAS/Atlas+Home"
title="Help"><i class="fa  fa-question-circle"></i></a>
+        <a href="javascript:void(0);" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
class="user-dropdown"><i class="fa fa-user user-circle "></i><span class="userName"></span></a>
         <ul class="dropdown-menu">
             <!--    <li><a href="#">Edit Profile</a></li>
             <li><a href="#">Change Password</a></li> -->
             <li class="aboutAtlas"><a href="javascript:void(0)">About</a></li>
-            <li><a target="_blank" href="https://cwiki.apache.org/confluence/display/ATLAS/Atlas+Home">Help</a></li>
             <li role="separator" class="divider"></li>
             <li>
-                <a href="logout.html"> <i class="fa fa-sign-out"></i> Logout</a>
+                <a href="logout.html"><i class="fa fa-sign-out"></i>Logout</a>
             </li>
         </ul>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/js/utils/CommonViewFunction.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index 997060f..79e50b7 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -39,20 +39,10 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
                 tagModel.deleteTag(options.guid, options.tagName, {
                     success: function(data) {
                         var msg = "Tag " + name.name + Messages.removeSuccessMessage;
-                        if (data.traitName) {
-                            var tagOrTerm = Utils.checkTagOrTerm(data.traitName);
-                            if (tagOrTerm.term) {
-                                msg = "Term " + data.traitName + Messages.removeSuccessMessage;
-                            } else {
-                                msg = "Tag " + data.traitName + Messages.removeSuccessMessage;
-                            }
-                        } else {
-                            var tagOrTerm = Utils.checkTagOrTerm(options.tagName);
-                            if (tagOrTerm.term) {
-                                msg = "Term " + data.traitName + Messages.removeSuccessMessage;
-                            } else {
-                                msg = "Tag " + data.traitName + Messages.removeSuccessMessage;
-                            }
+                        if (options.tagOrTerm === "term") {
+                            msg = "Term " + options.tagName + Messages.removeSuccessMessage;
+                        } else if (options.tagOrTerm === "tag") {
+                            msg = "Tag " + options.tagName + Messages.removeSuccessMessage;
                         }
                         Utils.notifySuccess({
                             content: msg
@@ -405,14 +395,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages',
'utils/Glob
             id = model.get('$id$').id,
             terms = [];
         _.keys(traits).map(function(key) {
-            if (traits[key].$typeName$) {
-                var tagName = Utils.checkTagOrTerm(traits[key].$typeName$);
-            } else {
-                var tagName = Utils.checkTagOrTerm(traits[key].typeName);
+            if (traits[key]) {
+                var tagName = Utils.checkTagOrTerm(traits[key]);
             }
             if (tagName.term) {
                 terms.push({
-                    deleteHtml: '<a class="pull-left" title="Remove Term"><i class="fa
fa-trash" data-id="tagClick" data-assetname="' + model.get("name") + '" data-name="' + tagName.fullName+
'" data-guid="' + model.get('$id$').id + '" ></i></a>',
+                    deleteHtml: '<a class="pull-left" title="Remove Term"><i class="fa
fa-trash" data-id="tagClick" data-type="term" data-assetname="' + model.get("name") + '" data-name="'
+ tagName.fullName + '" data-guid="' + model.get('$id$').id + '" ></i></a>',
                     url: tagName.fullName.split(".").join("/"),
                     name: tagName.fullName
                 });
@@ -447,17 +435,15 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages',
'utils/Glob
             popTag = "",
             count = 0;
         _.keys(model.get('$traits$')).map(function(key) {
-            if (traits[key].$typeName$) {
-                var tagName = Utils.checkTagOrTerm(traits[key].$typeName$);
-            } else {
-                var tagName = Utils.checkTagOrTerm(traits[key].typeName);
+            if (traits[key]) {
+                var tagName = Utils.checkTagOrTerm(traits[key]);
             }
             var className = "inputTag";
-            if (!tagName.term) {
+            if (tagName.tag) {
                 if (count >= 1) {
-                    popTag += '<a class="' + className + '" data-id="tagClick"><span
class="inputValue">' + tagName.name + '</span><i class="fa fa-times" data-id="delete"
 data-assetname="' + model.get("name") + '"data-name="' + tagName.name + '" data-guid="' +
model.get('$id$').id + '" ></i></a>';
+                    popTag += '<a class="' + className + '" data-id="tagClick"><span
class="inputValue">' + tagName.fullName + '</span><i class="fa fa-times" data-id="delete"
 data-assetname="' + model.get("name") + '"data-name="' + tagName.fullName + '" data-type="tag"
data-guid="' + model.get('$id$').id + '" ></i></a>';
                 } else {
-                    atags += '<a class="' + className + '" data-id="tagClick"><span
class="inputValue">' + tagName.name + '</span><i class="fa fa-times" data-id="delete"
data-assetname="' + model.get("name") + '" data-name="' + tagName.name + '" data-guid="' +
model.get('$id$').id + '" ></i></a>';
+                    atags += '<a class="' + className + '" data-id="tagClick"><span
class="inputValue">' + tagName.fullName + '</span><i class="fa fa-times" data-id="delete"
data-assetname="' + model.get("name") + '" data-name="' + tagName.fullName + '"  data-type="tag"
data-guid="' + model.get('$id$').id + '" ></i></a>';
                 }
                 ++count;
             }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/js/utils/Messages.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/Messages.js b/dashboardv2/public/js/utils/Messages.js
index 6bb8453..9ecdc67 100644
--- a/dashboardv2/public/js/utils/Messages.js
+++ b/dashboardv2/public/js/utils/Messages.js
@@ -24,8 +24,8 @@ define(['require'], function(require) {
         addErrorMessage: " could not be Created",
         addTermToEntitySuccessMessage: " has been added to entity",
         deleteTerm: "Delete Term",
-        removeTag: "Remove Tag",
-        removeTerm: "Remove Term",
+        removeTag: "Remove Tag Assignment",
+        removeTerm: "Remove Term Assignment",
         deleteSuccessMessage: " has been deleted successfully",
         deleteErrorMessage: " could not be deleted",
         removeSuccessMessage: " has been removed successfully",

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/js/utils/Utils.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/Utils.js b/dashboardv2/public/js/utils/Utils.js
index 7ddae5b..7fcde19 100644
--- a/dashboardv2/public/js/utils/Utils.js
+++ b/dashboardv2/public/js/utils/Utils.js
@@ -233,20 +233,51 @@ define(['require', 'utils/Globals'], function(require, Globals) {
             }
         }
     }
-    Utils.checkTagOrTerm = function(value) {
-        if (value && _.isString(value)) {
+    Utils.checkTagOrTerm = function(value, isTermView) {
+        if (value && _.isString(value) && isTermView) {
+            // For string break
+            if (value == "TaxonomyTerm") {
+                return {}
+            }
             var name = value.split('.');
-            if (name.length > 1) {
+            return {
+                term: true,
+                tag: false,
+                name: name[name.length - 1],
+                fullName: value
+            }
+        }
+        if (_.isObject(value)) {
+            var name = "";
+            if (value && value.$typeName$) {
+                name = value.$typeName$;
+            } else if (value && value.typeName) {
+                name = value.typeName;
+            }
+            if (name === "TaxonomyTerm") {
+                return {}
+            }
+            name = name.split('.');
+            var trem = false;
+            if (value['taxonomy.namespace']) {
+                trem = true;
+            } else if (value.values && value.values['taxonomy.namespace']) {
+                trem = true;
+            }
+
+            if (trem) {
                 return {
                     term: true,
+                    tag: false,
                     name: name[name.length - 1],
-                    fullName: value
+                    fullName: name.join('.')
                 }
             } else {
                 return {
                     term: false,
+                    tag: true,
                     name: name[name.length - 1],
-                    fullName: value
+                    fullName: name.join('.')
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/js/views/business_catalog/BusinessCatalogDetailLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/business_catalog/BusinessCatalogDetailLayoutView.js
b/dashboardv2/public/js/views/business_catalog/BusinessCatalogDetailLayoutView.js
index c73a2ea..d592d1e 100644
--- a/dashboardv2/public/js/views/business_catalog/BusinessCatalogDetailLayoutView.js
+++ b/dashboardv2/public/js/views/business_catalog/BusinessCatalogDetailLayoutView.js
@@ -97,7 +97,7 @@ define(['require',
                         createdDate = this.model.get('creation_time');
                     if (name) {
                         this.ui.title.show();
-                        this.termName = Utils.checkTagOrTerm(name);
+                        this.termName = Utils.checkTagOrTerm(name, true);
                         this.ui.title.html('<span>' + this.termName.name + '</span>');
                     } else {
                         this.ui.title.hide();

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/js/views/business_catalog/TreeLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/business_catalog/TreeLayoutView.js b/dashboardv2/public/js/views/business_catalog/TreeLayoutView.js
index 3cf14d7..616e40f 100644
--- a/dashboardv2/public/js/views/business_catalog/TreeLayoutView.js
+++ b/dashboardv2/public/js/views/business_catalog/TreeLayoutView.js
@@ -382,13 +382,14 @@ define(['require',
                                 }
                             }
                         }
-                        var name = Utils.checkTagOrTerm(model.get('name'));
-                        if (that.viewBased) {
-                            parentLi = '<div class="tools"><i class="fa fa-refresh
fa-spin-custom taxanomyloader"></i><i class="fa fa-ellipsis-h termPopover"></i></div><i
class="fa fa-angle-right toggleArrow" data-id="expandArrow" data-href="' + hrefUrl + '"></i><a
href="javascript:void(0)" data-href="' + hrefUrl + '" data-name="`' + model.get('name') +
'`">' + name.name + '</a>';
-                        } else {
-                            parentLi = '<div class="tools"><i class="fa fa-refresh
fa-spin-custom taxanomyloader"></i></div><i class="fa fa-angle-right toggleArrow"
data-id="expandArrow" data-href="' + hrefUrl + '"></i><a href="javascript:void(0)"
data-href="' + hrefUrl + '" data-name="`' + model.get('name') + '`">' + name.name + '</a>';
+                        var name = Utils.checkTagOrTerm(model.get('name'), true);
+                        if (name.name) {
+                            if (that.viewBased) {
+                                parentLi = '<div class="tools"><i class="fa fa-refresh
fa-spin-custom taxanomyloader"></i><i class="fa fa-ellipsis-h termPopover"></i></div><i
class="fa fa-angle-right toggleArrow" data-id="expandArrow" data-href="' + hrefUrl + '"></i><a
href="javascript:void(0)" data-href="' + hrefUrl + '" data-name="`' + model.get('name') +
'`">' + name.name + '</a>';
+                            } else {
+                                parentLi = '<div class="tools"><i class="fa fa-refresh
fa-spin-custom taxanomyloader"></i></div><i class="fa fa-angle-right toggleArrow"
data-id="expandArrow" data-href="' + hrefUrl + '"></i><a href="javascript:void(0)"
data-href="' + hrefUrl + '" data-name="`' + model.get('name') + '`">' + name.name + '</a>';
+                            }
                         }
-
                     });
                     if (href) {
                         var hrefUrl = "/api" + href.split("/api")[1];
@@ -401,12 +402,14 @@ define(['require',
 
                 function createTerm() {
                     _.each(that.childCollection.fullCollection.models, function(model, key)
{
-                        var name = Utils.checkTagOrTerm(model.get('name'));
+                        var name = Utils.checkTagOrTerm(model.get('name'), true);
                         var hrefUrl = "/api" + model.get('href').split("/api")[1];
-                        if (that.viewBased) {
-                            childLi += '<li class="children"><div class="tools"><i
class="fa fa-refresh fa-spin-custom taxanomyloader"></i><i class="fa fa-ellipsis-h
termPopover" ></i></div><i class="fa fa-angle-right toggleArrow" data-id="expandArrow"
data-href="' + hrefUrl + '"></i><a href="javascript:void(0)" data-href="' + hrefUrl
+ '" data-name="`' + model.get('name') + '`">' + name.name + '</a></li>';
-                        } else {
-                            childLi += '<li class="children"><div class="tools"><i
class="fa fa-refresh fa-spin-custom taxanomyloader"></i></div><i class="fa
fa-angle-right toggleArrow" data-id="expandArrow" data-href="' + hrefUrl + '"></i><a
href="javascript:void(0)" data-href="' + hrefUrl + '" data-name="`' + model.get('name') +
'`">' + name.name + '</a></li>';
+                        if (name.name) {
+                            if (that.viewBased) {
+                                childLi += '<li class="children"><div class="tools"><i
class="fa fa-refresh fa-spin-custom taxanomyloader"></i><i class="fa fa-ellipsis-h
termPopover" ></i></div><i class="fa fa-angle-right toggleArrow" data-id="expandArrow"
data-href="' + hrefUrl + '"></i><a href="javascript:void(0)" data-href="' + hrefUrl
+ '" data-name="`' + model.get('name') + '`">' + name.name + '</a></li>';
+                            } else {
+                                childLi += '<li class="children"><div class="tools"><i
class="fa fa-refresh fa-spin-custom taxanomyloader"></i></div><i class="fa
fa-angle-right toggleArrow" data-id="expandArrow" data-href="' + hrefUrl + '"></i><a
href="javascript:void(0)" data-href="' + hrefUrl + '" data-name="`' + model.get('name') +
'`">' + name.name + '</a></li>';
+                            }
                         }
                     });
                     that.ui.childList.html(childLi);

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/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 4546bb4..35f5811 100644
--- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
@@ -167,8 +167,7 @@ define(['require',
                             }
                         }
                         if (collectionJSON[0].traits) {
-                            this.tagElement = _.keys(collectionJSON[0].traits);
-                            this.addTagToTerms(this.tagElement);
+                            this.addTagToTerms(collectionJSON[0].traits);
                         }
                     }
 
@@ -194,34 +193,37 @@ define(['require',
             },
             onClickTagCross: function(e) {
                 var tagName = $(e.currentTarget).parent().text(),
+                    tagOrTerm = $(e.target).data("type"),
                     that = this;
-                var tagOrTerm = Utils.checkTagOrTerm(tagName);
-                if (tagOrTerm.term) {
+                if (tagOrTerm === "term") {
                     var modal = CommonViewFunction.deleteTagModel({
                         msg: "<div class='ellipsis'>Remove: " + "<b>" + tagName
+ "</b> assignment from" + " " + "<b>" + this.name + "?</b></div>",
                         titleMessage: Messages.removeTerm,
                         buttonText: "Remove"
                     });
-                } else {
+                } else if (tagOrTerm === "tag") {
                     var modal = CommonViewFunction.deleteTagModel({
                         msg: "<div class='ellipsis'>Remove: " + "<b>" + tagName
+ "</b> assignment from" + " " + "<b>" + this.name + "?</b></div>",
                         titleMessage: Messages.removeTag,
                         buttonText: "Remove"
                     });
                 }
-                modal.on('ok', function() {
-                    that.deleteTagData(e);
-                });
-                modal.on('closeModal', function() {
-                    modal.trigger('cancel');
-                });
+                if (modal) {
+                    modal.on('ok', function() {
+                        that.deleteTagData(e, tagOrTerm);
+                    });
+                    modal.on('closeModal', function() {
+                        modal.trigger('cancel');
+                    });
+                }
             },
-            deleteTagData: function(e) {
+            deleteTagData: function(e, tagOrTerm) {
                 var that = this,
                     tagName = $(e.currentTarget).text();
                 CommonViewFunction.deleteTag({
                     'tagName': tagName,
                     'guid': that.id,
+                    'tagOrTerm': tagOrTerm,
                     callback: function() {
                         that.fetchCollection();
                     }
@@ -234,13 +236,12 @@ define(['require',
 
                 _.each(tagObject, function(val) {
                     var isTerm = Utils.checkTagOrTerm(val);
-                    if (!isTerm.term) {
-                        tagData += '<span class="inputTag" data-id="tagClick"><span
class="inputValue">' + val + '</span><i class="fa fa-close" data-id="deleteTag"></i></span>';
+                    if (isTerm.tag) {
+                        tagData += '<span class="inputTag" data-id="tagClick"><span
class="inputValue">' + isTerm.fullName + '</span><i class="fa fa-close" data-id="deleteTag"
data-type="tag"></i></span>';
                     }
                     if (isTerm.term) {
-                        termData += '<span class="inputTag term" data-id="tagClick" data-href="'
+ val + '"><span class="inputValue">' + val + '</span><i class="fa fa-close"
data-id="deleteTag"></i></span>';
+                        termData += '<span class="inputTag term" data-id="tagClick" data-href="'
+ isTerm.fullName + '"><span class="inputValue">' + isTerm.fullName + '</span><i
class="fa fa-close" data-id="deleteTag" data-type="term"></i></span>';
                     }
-
                 });
                 this.ui.tagList.find("span.inputTag").remove();
                 this.ui.termList.find("span.inputTag").remove();

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/js/views/schema/SchemaLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/schema/SchemaLayoutView.js b/dashboardv2/public/js/views/schema/SchemaLayoutView.js
index c22c5fb..13896ab 100644
--- a/dashboardv2/public/js/views/schema/SchemaLayoutView.js
+++ b/dashboardv2/public/js/views/schema/SchemaLayoutView.js
@@ -321,37 +321,40 @@ define(['require',
             },
             onClickTagCross: function(e) {
                 var tagName = $(e.target).data("name"),
+                    guid = $(e.target).data("guid"),
                     assetName = $(e.target).data("assetname"),
+                    tagOrTerm = $(e.target).data("type"),
                     that = this;
-                var tagOrTerm = Utils.checkTagOrTerm(tagName);
-                if (tagOrTerm.term) {
+                if (tagOrTerm === "term") {
                     var modal = CommonViewFunction.deleteTagModel({
-                        msg: "<div class='ellipsis'>Remove: " + "<b>" + tagName
+ "</b> assignment from" + " " + "<b>" + assetName + "?</b></div>",
+                        msg: "<div class='ellipsis'>Remove: " + "<b>" + tagName
+ "</b> assignment from" + " " + "<b>" + assetName + " ?</b></div>",
                         titleMessage: Messages.removeTerm,
                         buttonText: "Remove"
                     });
-                } else {
+                } else if (tagOrTerm === "tag") {
                     var modal = CommonViewFunction.deleteTagModel({
-                        msg: "<div class='ellipsis'>Remove: " + "<b>" + tagName
+ "</b> assignment from" + " " + "<b>" + assetName + "?</b></div>",
+                        msg: "<div class='ellipsis'>Remove: " + "<b>" + tagName
+ "</b> assignment from" + " " + "<b>" + assetName + " ?</b></div>",
                         titleMessage: Messages.removeTag,
                         buttonText: "Remove"
                     });
                 }
-
-                modal.on('ok', function() {
-                    that.deleteTagData(e);
-                });
-                modal.on('closeModal', function() {
-                    modal.trigger('cancel');
-                });
+                if (modal) {
+                    modal.on('ok', function() {
+                        that.deleteTagData(e, tagOrTerm);
+                    });
+                    modal.on('closeModal', function() {
+                        modal.trigger('cancel');
+                    });
+                }
             },
-            deleteTagData: function(e) {
+            deleteTagData: function(e, tagOrTerm) {
                 var that = this,
                     tagName = $(e.target).data("name"),
                     guid = $(e.target).data("guid");
                 CommonViewFunction.deleteTag({
                     'tagName': tagName,
                     'guid': guid,
+                    'tagOrTerm': tagOrTerm,
                     callback: function() {
                         that.fetchCollection();
                     }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/js/views/search/SearchLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/search/SearchLayoutView.js b/dashboardv2/public/js/views/search/SearchLayoutView.js
index 730c451..625f90d 100644
--- a/dashboardv2/public/js/views/search/SearchLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchLayoutView.js
@@ -79,10 +79,6 @@ define(['require',
                     }
                 });
                 this.type = "fulltext";
-                this.tagCollection = new VTagList();
-                $.extend(this.tagCollection.queryParams, { type: 'TRAIT' });
-                this.typeCollection = new VTagList();
-                $.extend(this.typeCollection.queryParams, { type: 'CLASS' });
                 this.bindEvents();
             },
             bindEvents: function(param) {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/js/views/search/SearchResultLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
index b30de40..964bb8a 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -545,35 +545,38 @@ define(['require',
                 var tagName = $(e.target).data("name"),
                     guid = $(e.target).data("guid"),
                     assetName = $(e.target).data("assetname"),
-                    that = this,
-                    tagOrTerm = Utils.checkTagOrTerm(tagName);
-                if (tagOrTerm.term) {
+                    tagOrTerm = $(e.target).data("type"),
+                    that = this;
+                if (tagOrTerm === "term") {
                     var modal = CommonViewFunction.deleteTagModel({
                         msg: "<div class='ellipsis'>Remove: " + "<b>" + tagName
+ "</b> assignment from" + " " + "<b>" + assetName + " ?</b></div>",
                         titleMessage: Messages.removeTerm,
                         buttonText: "Remove"
                     });
-                } else {
+                } else if (tagOrTerm === "tag") {
                     var modal = CommonViewFunction.deleteTagModel({
                         msg: "<div class='ellipsis'>Remove: " + "<b>" + tagName
+ "</b> assignment from" + " " + "<b>" + assetName + " ?</b></div>",
                         titleMessage: Messages.removeTag,
                         buttonText: "Remove"
                     });
                 }
-                modal.on('ok', function() {
-                    that.deleteTagData(e);
-                });
-                modal.on('closeModal', function() {
-                    modal.trigger('cancel');
-                });
+                if (modal) {
+                    modal.on('ok', function() {
+                        that.deleteTagData(e, tagOrTerm);
+                    });
+                    modal.on('closeModal', function() {
+                        modal.trigger('cancel');
+                    });
+                }
             },
-            deleteTagData: function(e) {
+            deleteTagData: function(e, tagOrTerm) {
                 var that = this,
                     tagName = $(e.target).data("name"),
                     guid = $(e.target).data("guid");
                 CommonViewFunction.deleteTag({
                     'tagName': tagName,
                     'guid': guid,
+                    'tagOrTerm': tagOrTerm,
                     callback: function() {
                         that.fetchCollection();
                     }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/js/views/tag/CreateTagLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/CreateTagLayoutView.js b/dashboardv2/public/js/views/tag/CreateTagLayoutView.js
index 2930ac3..fa16de4 100644
--- a/dashboardv2/public/js/views/tag/CreateTagLayoutView.js
+++ b/dashboardv2/public/js/views/tag/CreateTagLayoutView.js
@@ -85,11 +85,7 @@ define(['require',
                     placeholder: "Search Tags",
                     allowClear: true
                 });
-            },
-            fetchCollection: function() {
-                $.extend(this.tagCollection.queryParams, { type: 'TRAIT' });
-                this.tagCollection.fetch({ reset: true });
-            },
+            }
         });
     return CreateTagLayoutView;
 });

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/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 51d644e..283b889 100644
--- a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
@@ -67,14 +67,13 @@ define(['require',
                     tagTermList = [],
                     that = this;
                 _.each(tagorterm, function(object) {
+                    var checkTagOrTerm = Utils.checkTagOrTerm(object);
                     if (that.term) {
-                        var checkTagOrTerm = Utils.checkTagOrTerm(object.typeName);
                         if (checkTagOrTerm.term) {
                             tagTermList.push(object);
                         }
                     } else {
-                        var checkTagOrTerm = Utils.checkTagOrTerm(object.typeName);
-                        if (!checkTagOrTerm.term) {
+                        if (checkTagOrTerm.tag) {
                             tagTermList.push(object);
                         }
                     }
@@ -191,7 +190,6 @@ define(['require',
                     });
                 }
 
-
                 modal.on('ok', function() {
                     that.deleteTagData(e);
                 });
@@ -205,6 +203,7 @@ define(['require',
                 CommonViewFunction.deleteTag({
                     'tagName': tagName,
                     'guid': that.guid,
+                    'tagOrTerm': (that.term ? "term" : "tag"),
                     callback: function() {
                         that.$('.fontLoader').show();
                         that.collection.fetch({ reset: true });

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/dashboardv2/public/js/views/tag/TagLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/TagLayoutView.js b/dashboardv2/public/js/views/tag/TagLayoutView.js
index 3a05167..5304737 100644
--- a/dashboardv2/public/js/views/tag/TagLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagLayoutView.js
@@ -103,7 +103,7 @@ define(['require',
                 });
             },
             fetchCollections: function() {
-                $.extend(this.tagCollection.queryParams, { type: 'TRAIT', });
+                $.extend(this.tagCollection.queryParams, { type: 'TRAIT', notsupertype: 'TaxonomyTerm'
});
                 this.tagCollection.fetch({ reset: true });
                 this.ui.offLineSearchTag.val("");
             },
@@ -159,18 +159,14 @@ define(['require',
                     str = '';
                 _.each(this[collection].fullCollection.models, function(model) {
                     var tagName = model.get("tags");
-                    var tagOrTerm = Utils.checkTagOrTerm(tagName);
-                    if (!tagOrTerm.term) {
-                        if (searchString) {
-                            if (tagName.search(new RegExp(searchString, "i")) != -1) {
-                                str = '<li class="parent-node" data-id="tags"><div
class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a
href="#!/tag/tagAttribute/' + tagName + '"  data-name="`' + tagName + '`" >' + tagName
+ '</a></li>' + str;
-                            } else {
-                                return;
-                            }
+                    if (searchString) {
+                        if (tagName.search(new RegExp(searchString, "i")) != -1) {
+                            str = '<li class="parent-node" data-id="tags"><div class="tools"><i
class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/'
+ tagName + '"  data-name="`' + tagName + '`" >' + tagName + '</a></li>' +
str;
                         } else {
-                            //str = '<li class="parent-node" data-id="tags"><div
class="tools"><i class="fa fa-trash-o" data-id="deleteTerm"></i></div><a
href="#!/tag/tagAttribute/' + tagName + '">' + tagName + '</a></li>' + str;
-                            str = '<li class="parent-node" data-id="tags"><div class="tools"><i
class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/'
+ tagName + '"  data-name="`' + tagName + '`">' + tagName + '</a></li>' + str;
+                            return;
                         }
+                    } else {
+                        str = '<li class="parent-node" data-id="tags"><div class="tools"><i
class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/'
+ tagName + '"  data-name="`' + tagName + '`">' + tagName + '</a></li>' + str;
                     }
                 });
                 this.ui.tagsParent.empty().html(str);

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/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 d51be9f..877c64d 100644
--- a/dashboardv2/public/js/views/tag/addTagModalView.js
+++ b/dashboardv2/public/js/views/tag/addTagModalView.js
@@ -67,7 +67,7 @@ define(['require',
         },
 
         onRender: function() {
-            $.extend(this.collection.queryParams, { type: 'TRAIT' });
+            $.extend(this.collection.queryParams, { type: 'TRAIT', notsupertype: 'TaxonomyTerm'
});
             this.collection.fetch({ reset: true });
         },
         bindEvents: function() {
@@ -81,10 +81,7 @@ define(['require',
         tagsCollection: function() {
             var str = '<option selected="selected" disabled="disabled">-- Select a
tag from the dropdown list --</option>';
             _.each(this.collection.fullCollection.models, function(obj, key) {
-                var tagOrTerm = Utils.checkTagOrTerm(obj.get('tags'));
-                if (!tagOrTerm.term) {
-                    str += '<option>' + obj.get('tags') + '</option>';
-                }
+                str += '<option>' + obj.get('tags') + '</option>';
             });
             this.ui.addTagOptions.html(str);
             this.ui.addTagOptions.select2({

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/425237d5/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 3c5db92..20accdd 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
 
 
 ALL CHANGES:
+ATLAS-1056 Differentiate between tag and term using attribute "taxonomy.namespace" (kevalbhat18
via sumasai)
 ATLAS-1059 Change log level to debug for search APIs(sumasai)
 ATLAS-1049 Fix validation while filtering by supertypes(mneethiraj via sumasai)
 ATLAS-1053 Fix issues flagged by Coverity scan - potential NPE (mneethiraj via sumasai)



Mime
View raw message