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

[atlas] branch branch-1.0 updated (4898788 -> b0d7e35)

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

kbhatt pushed a change to branch branch-1.0
in repository https://gitbox.apache.org/repos/asf/atlas.git.


    from 4898788  ATLAS-3054: improved batch processing in notificaiton handler to avoid processing of an entity multiple times - #2
     new 9968913  ATLAS-2945 UI - If a Term is assigned to an Category then to user is able to assign the same term again
     new b0d7e35  ATLAS-3072:UI : Increasing the width of the Lineage slider.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 dashboardv2/public/css/scss/graph.scss             |  6 ++-
 dashboardv2/public/js/utils/CommonViewFunction.js  | 14 ++++-
 .../js/views/detail_page/DetailPageLayoutView.js   | 17 ++++++-
 .../public/js/views/glossary/GlossaryLayoutView.js | 59 +++++++++++++---------
 4 files changed, 68 insertions(+), 28 deletions(-)


[atlas] 02/02: ATLAS-3072:UI : Increasing the width of the Lineage slider.

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kbhatt pushed a commit to branch branch-1.0
in repository https://gitbox.apache.org/repos/asf/atlas.git

commit b0d7e3591f26e9efd49aeb0127ffbdeefae7f745
Author: gutkaBinit <bi...@gmail.com>
AuthorDate: Tue Mar 12 16:42:35 2019 +0530

    ATLAS-3072:UI : Increasing the width of the Lineage slider.
    
    Signed-off-by: nixonrodrigues <ni...@apache.org>
    (cherry picked from commit 4493653e07cb5a2ed6e564ea817c82ade2d95995)
    Signed-off-by: kevalbhatt <kb...@apache.org>
---
 dashboardv2/public/css/scss/graph.scss                     | 6 ++++--
 dashboardv2/public/js/views/glossary/GlossaryLayoutView.js | 8 ++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/dashboardv2/public/css/scss/graph.scss b/dashboardv2/public/css/scss/graph.scss
index 77fc53e..b72236a 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -415,8 +415,10 @@ span#zoom_in {
 
 .lineage-node-detail {
     .table-quickMenu {
-        td {
-            word-break: break-all;
+        td:nth-child(1n) {
+            width: 150px;
         }
+
+        word-break: break-all;
     }
 }
\ No newline at end of file
diff --git a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
index ab951ea..6da687c 100644
--- a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
+++ b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
@@ -214,7 +214,7 @@ define(['require',
             generateCategoryData: function(options) {
                 return _.map(options.data, function(obj) {
                     return {
-                        "text": obj.displayText,
+                        "text": _.escape(obj.displayText),
                         "icon": "fa fa-files-o",
                         "guid": obj.categoryGuid,
                         "id": obj.categoryGuid,
@@ -295,7 +295,7 @@ define(['require',
                 return this.glossaryCollection.fullCollection.map(function(model, i) {
                     var obj = model.toJSON(),
                         parent = {
-                            "text": obj.name,
+                            "text": _.escape(obj.name),
                             "icon": "fa fa-folder-o",
                             "guid": obj.guid,
                             "id": obj.guid,
@@ -318,7 +318,7 @@ define(['require',
                             var typeName = category.typeName || "GlossaryCategory",
                                 guid = category.categoryGuid,
                                 categoryObj = {
-                                    "text": category.displayText,
+                                    "text": _.escape(category.displayText),
                                     "type": typeName,
                                     "gType": "category",
                                     "guid": guid,
@@ -352,7 +352,7 @@ define(['require',
                                 var typeName = term.typeName || "GlossaryTerm",
                                     guid = term.termGuid,
                                     termObj = {
-                                        "text": term.displayText,
+                                        "text": _.escape(term.displayText),
                                         "type": typeName,
                                         "gType": "term",
                                         "guid": guid,


[atlas] 01/02: ATLAS-2945 UI - If a Term is assigned to an Category then to user is able to assign the same term again

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kbhatt pushed a commit to branch branch-1.0
in repository https://gitbox.apache.org/repos/asf/atlas.git

commit 99689137ef5642b66f7ffc0517170ef9ceaa62d7
Author: Abhishek <ab...@gmail.com>
AuthorDate: Thu Feb 7 15:57:34 2019 +0530

    ATLAS-2945 UI - If a Term is assigned to an Category then to user is able to assign the same term again
    
    Signed-off-by: nixonrodrigues <ni...@apache.org>
    (cherry picked from commit d561404b0a93282a4dd9b0296f5c91b4230146a3)
    Signed-off-by: kevalbhatt <kb...@apache.org>
---
 dashboardv2/public/js/utils/CommonViewFunction.js  | 14 +++++-
 .../js/views/detail_page/DetailPageLayoutView.js   | 17 ++++++-
 .../public/js/views/glossary/GlossaryLayoutView.js | 53 ++++++++++++++--------
 3 files changed, 61 insertions(+), 23 deletions(-)

diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index e9477c3..2c0fbaf 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enums', 'moment'], function(require, Utils, Modal, Messages, Enums, moment) {
+define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Globals', 'utils/Enums', 'moment'], function(require, Utils, Modal, Messages, Globals, Enums, moment) {
     'use strict';
 
     var CommonViewFunction = {};
@@ -332,6 +332,18 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
         }
         if (!Enums.entityStateReadOnly[obj.status]) {
             if (obj.guid) {
+                var newD = { "guid": obj.guid, "termLinks": obj.meanings };
+                Globals.termMeanings = Globals.termMeanings ? Globals.termMeanings : [];
+                if (Globals.termMeanings.length > 0) {
+                    for (var x in Globals.termMeanings) {
+                        if (Globals.termMeanings[x]['guid'] == obj.guid) {
+                            Globals.termMeanings[x].termLinks = obj.meanings;
+                        }
+                    }
+                }
+                if (newD.termLinks.length > 0 && Globals.termMeanings == 0) {
+                    Globals.termMeanings.push(newD);
+                }
                 addTerm += '<a href="javascript:void(0)" data-id="addTerm" class="btn btn-action btn-sm assignTag" data-guid="' + obj.guid + '" ><i class="fa fa-plus"></i></a>';
             } else {
                 addTerm += '<a href="javascript:void(0)" data-id="addTerm" class="btn btn-action btn-sm assignTag"><i style="right:0" class="fa fa-plus"></i></a>';
diff --git a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
index 18c545b..a7dca45 100644
--- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
@@ -186,7 +186,7 @@ define(['require',
                             this.generateTag([]);
                         }
                         if (collectionJSON.relationshipAttributes && collectionJSON.relationshipAttributes.meanings) {
-                            this.generateTerm(collectionJSON.relationshipAttributes.meanings);
+                            this.generateTerm(collectionJSON.relationshipAttributes.meanings, collectionJSON);
                         }
                         if (Globals.entityTypeConfList && _.isEmptyArray(Globals.entityTypeConfList)) {
                             this.ui.editButtonContainer.html(ButtonsTmpl({ btn_edit: true }));
@@ -403,10 +403,23 @@ define(['require',
                 this.ui.propagatedTagList.html(propagatedTagListData);
 
             },
-            generateTerm: function(data) {
+            generateTerm: function(data, obj) {
                 var that = this,
                     termData = "";
+                var newD = { "guid": obj.guid, "termLinks": obj.relationshipAttributes.meanings };
+                Globals.termMeanings = Globals.termMeanings ? Globals.termMeanings : [];
+                if (Globals.termMeanings.length > 0) {
+                    for (var x in Globals.termMeanings) {
+                        if (Globals.termMeanings[x]['guid'] == obj.guid) {
+                            Globals.termMeanings[x].termLinks = obj.relationshipAttributes.meanings;
+                        }
+                    }
+                }
+                if (newD.termLinks.length > 0 && Globals.termMeanings == 0) {
+                    Globals.termMeanings.push(newD);
+                }
                 _.each(data, function(val) {
+                    console.log(val.guid)
                     if (val.relationshipStatus == "ACTIVE") {
                         termData += '<span class="btn btn-action btn-sm btn-icon btn-blue" title=' + val.displayText + ' data-id="termClick"><span>' + val.displayText + '</span><i class="fa fa-close" data-id="deleteTerm" data-guid="' + val.guid + '" data-type="term" title="Remove Term"></i></span>';
                     }
diff --git a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
index 85b5be7..ab951ea 100644
--- a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
+++ b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
@@ -248,6 +248,7 @@ define(['require',
             },
             generateData: function(opt) {
                 var that = this,
+                    selectedGuid = that.guid,
                     type = opt.type;
                 if (opt.type == this.viewType) {
                     this.query[opt.type].isNodeNotFoundAtLoad = true;
@@ -338,27 +339,38 @@ define(['require',
                         });
                     }
                     if (type == "term" && obj.terms) {
+                        var theTerm = _.find(Globals.termMeanings, function(obj, index) {
+                            if (obj.guid == selectedGuid) {
+                                return obj;
+                            }
+                        });
                         _.each(obj.terms, function(term) {
-                            var typeName = term.typeName || "GlossaryTerm",
-                                guid = term.termGuid,
-                                termObj = {
-                                    "text": term.displayText,
-                                    "type": typeName,
-                                    "gType": "term",
-                                    "guid": guid,
-                                    "id": guid,
-                                    "parent": obj,
-                                    "glossaryName": obj.name,
-                                    "glossaryId": obj.guid,
-                                    "model": term,
-                                    "icon": "fa fa-file-o"
-                                }
-                            termObj.state = getSelectedState({
-                                index: i,
-                                node: termObj,
-                                objGuid: guid
-                            })
-                            parent.children.push(termObj);
+                            var includedTerms = _.map(theTerm && theTerm.termLinks, function(obj, index) {
+                                return obj.termGuid || obj.guid;
+                            });
+                            if ((!includedTerms.includes(term.termGuid))) {
+                                var typeName = term.typeName || "GlossaryTerm",
+                                    guid = term.termGuid,
+                                    termObj = {
+                                        "text": term.displayText,
+                                        "type": typeName,
+                                        "gType": "term",
+                                        "guid": guid,
+                                        "id": guid,
+                                        "parent": obj,
+                                        "glossaryName": obj.name,
+                                        "glossaryId": obj.guid,
+                                        "model": term,
+                                        "icon": "fa fa-file-o"
+                                    }
+                                termObj.state = getSelectedState({
+                                    index: i,
+                                    node: termObj,
+                                    objGuid: guid
+                                })
+                                parent.children.push(termObj);
+
+                            }
                         });
                     }
                     return parent;
@@ -398,6 +410,7 @@ define(['require',
                 var $termTree = this.ui.termTree,
                     $categoryTree = this.ui.categoryTree,
                     that = this,
+                    this_guid = that.guid,
                     getTreeConfig = function(options) {
                         return {
                             "plugins": ["search", "themes", "core", "wholerow", "sort", "conditionalselect"],