You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2018/05/16 15:38:09 UTC

[1/2] atlas git commit: ATLAS-2679 #2

Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 24bee5a0a -> 326282fc4


ATLAS-2679 #2

Change-Id: I00ce22fe7dc58ef193f9fe884a36316171abbcb2
(cherry picked from commit 8119492fc6b6475bdb6e09a2e04572c6e185f5f0)


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

Branch: refs/heads/branch-1.0
Commit: 6f57b41002923826d052a88cc45aeff316dfc056
Parents: 24bee5a
Author: apoorvnaik <ap...@apache.org>
Authored: Tue May 15 23:39:54 2018 -0700
Committer: apoorvnaik <ap...@apache.org>
Committed: Tue May 15 23:47:51 2018 -0700

----------------------------------------------------------------------
 .../apache/atlas/glossary/GlossaryService.java  | 33 +++++++++++++-------
 .../atlas/glossary/GlossaryServiceTest.java     |  4 ---
 2 files changed, 21 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/6f57b410/repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java b/repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java
index 9a8676b..bae2ea1 100644
--- a/repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java
+++ b/repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java
@@ -136,7 +136,8 @@ public class GlossaryService {
         if (StringUtils.isEmpty(atlasGlossary.getQualifiedName())) {
             if (StringUtils.isEmpty(atlasGlossary.getDisplayName())) {
                 throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_QUALIFIED_NAME_CANT_BE_DERIVED);
-            } else if (isNameInvalid(atlasGlossary.getDisplayName())){
+            }
+            if (isNameInvalid(atlasGlossary.getDisplayName())){
                 throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
             } else {
                 atlasGlossary.setQualifiedName(atlasGlossary.getDisplayName());
@@ -326,11 +327,16 @@ public class GlossaryService {
         if (Objects.isNull(glossaryTerm.getAnchor())) {
             throw new AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ANCHOR);
         }
-        if (StringUtils.isEmpty(glossaryTerm.getDisplayName())) {
-            throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_TERM_QUALIFIED_NAME_CANT_BE_DERIVED);
-        }
-        if (isNameInvalid(glossaryTerm.getDisplayName())) {
-            throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
+        if (StringUtils.isEmpty(glossaryTerm.getQualifiedName())) {
+            if (StringUtils.isEmpty(glossaryTerm.getDisplayName())) {
+                throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_TERM_QUALIFIED_NAME_CANT_BE_DERIVED);
+            }
+
+            if (isNameInvalid(glossaryTerm.getDisplayName())){
+                throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
+            } else {
+                glossaryTerm.setQualifiedName(glossaryTerm.getDisplayName());
+            }
         }
 
         // This might fail for the case when the term's qualifiedName has been updated and the duplicate request comes in with old name
@@ -507,14 +513,17 @@ public class GlossaryService {
         if (Objects.isNull(glossaryCategory.getAnchor())) {
             throw new AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ANCHOR);
         }
-        if (Objects.isNull(glossaryCategory.getDisplayName())) {
-            throw new AtlasBaseException(AtlasErrorCode.MISSING_CATEGORY_DISPLAY_NAME);
-        }
-        if (isNameInvalid(glossaryCategory.getDisplayName())) {
-            throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
+        if (StringUtils.isEmpty(glossaryCategory.getQualifiedName())) {
+            if (StringUtils.isEmpty(glossaryCategory.getDisplayName())) {
+                throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_CATEGORY_QUALIFIED_NAME_CANT_BE_DERIVED);
+            }
+            if (isNameInvalid(glossaryCategory.getDisplayName())){
+                throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
+            } else {
+                glossaryCategory.setQualifiedName(glossaryCategory.getDisplayName());
+            }
         }
 
-
         // This might fail for the case when the category's qualifiedName has been updated during a hierarchy change
         // and the duplicate request comes in with old name
         if (categoryExists(glossaryCategory)) {

http://git-wip-us.apache.org/repos/asf/atlas/blob/6f57b410/repository/src/test/java/org/apache/atlas/glossary/GlossaryServiceTest.java
----------------------------------------------------------------------
diff --git a/repository/src/test/java/org/apache/atlas/glossary/GlossaryServiceTest.java b/repository/src/test/java/org/apache/atlas/glossary/GlossaryServiceTest.java
index 6a6b971..c72e642 100644
--- a/repository/src/test/java/org/apache/atlas/glossary/GlossaryServiceTest.java
+++ b/repository/src/test/java/org/apache/atlas/glossary/GlossaryServiceTest.java
@@ -126,7 +126,6 @@ public class GlossaryServiceTest {
 
         // Category
         accountCategory = new AtlasGlossaryCategory();
-        accountCategory.setQualifiedName("acc@testBankingGlossary");
         accountCategory.setDisplayName("Account categorization");
         accountCategory.setShortDescription("Short description");
         accountCategory.setLongDescription("Long description");
@@ -138,14 +137,12 @@ public class GlossaryServiceTest {
         customerCategory.setLongDescription("Long description");
 
         mortgageCategory = new AtlasGlossaryCategory();
-        mortgageCategory.setQualifiedName("mtg@testBankingGlossary");
         mortgageCategory.setDisplayName("Mortgage categorization");
         mortgageCategory.setShortDescription("Short description");
         mortgageCategory.setLongDescription("Long description");
 
         // Terms
         checkingAccount = new AtlasGlossaryTerm();
-        checkingAccount.setQualifiedName("chk_acc@testBankingGlossary");
         checkingAccount.setDisplayName("A checking account");
         checkingAccount.setShortDescription("Short description");
         checkingAccount.setLongDescription("Long description");
@@ -163,7 +160,6 @@ public class GlossaryServiceTest {
         savingsAccount.setUsage("N/A");
 
         fixedRateMortgage = new AtlasGlossaryTerm();
-        fixedRateMortgage.setQualifiedName("fixed_mtg@testBankingGlossary");
         fixedRateMortgage.setDisplayName("Conventional mortgage");
         fixedRateMortgage.setShortDescription("Short description");
         fixedRateMortgage.setLongDescription("Long description");


[2/2] atlas git commit: ATLAS-2692: updated UI to render deleted relationships differently from active ones

Posted by ma...@apache.org.
ATLAS-2692: updated UI to render deleted relationships differently from active ones

Signed-off-by: Madhan Neethiraj <ma...@apache.org>
(cherry picked from commit 4d28dc241568010192f55a3d34cb7f7f1f88a9b2)


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

Branch: refs/heads/branch-1.0
Commit: 326282fc41206e340eb0c92c62ca24a3c395a194
Parents: 6f57b41
Author: kevalbhatt <kb...@apache.org>
Authored: Wed May 16 18:58:46 2018 +0530
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Wed May 16 08:38:00 2018 -0700

----------------------------------------------------------------------
 dashboardv2/public/css/scss/common.scss         |  6 ++++++
 dashboardv2/public/css/scss/relationship.scss   | 14 +++++++++++--
 .../js/views/graph/RelationshipLayoutView.js    | 22 +++++++++++++++++++-
 3 files changed, 39 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/326282fc/dashboardv2/public/css/scss/common.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/common.scss b/dashboardv2/public/css/scss/common.scss
index 761fa76..c6c369b 100644
--- a/dashboardv2/public/css/scss/common.scss
+++ b/dashboardv2/public/css/scss/common.scss
@@ -34,6 +34,12 @@
         &.btn[data-id="addTag"] {
             display: none;
         }
+        &.btn[data-id="addTerm"] {
+            display: none;
+        }
+        &.btn[data-id="editButton"] {
+            display: none;
+        }
         &.editbutton[data-id="editButton"] {
             display: none !important;
         }

http://git-wip-us.apache.org/repos/asf/atlas/blob/326282fc/dashboardv2/public/css/scss/relationship.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/relationship.scss b/dashboardv2/public/css/scss/relationship.scss
index aad8063..f3e98b6 100644
--- a/dashboardv2/public/css/scss/relationship.scss
+++ b/dashboardv2/public/css/scss/relationship.scss
@@ -30,7 +30,7 @@
         box-shadow: 4px 13px 14px -12px;
         background: #e7e7e7;
         transform: scaleX(0);
-        width: 200px;
+        width: 240px;
         transition: transform 0.3s ease-in;
         &.open {
             transform: scaleX(1);
@@ -55,12 +55,22 @@
             overflow: auto;
             list-style-type: decimal;
             list-style-position: outside;
-            padding-left: 30px;
+            padding-left: 15px;
         }
         ul>li {
             word-wrap: break-word;
             margin-bottom: 5px;
             text-align: left;
+
+            &.deleted-relation {
+                a {
+                    color: #BB5838 !important;
+                }
+                .deleteBtn {
+                    padding: 2px 8px !important;
+                    margin: 5px 5px !important;
+                }
+            }
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/326282fc/dashboardv2/public/js/views/graph/RelationshipLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/graph/RelationshipLayoutView.js b/dashboardv2/public/js/views/graph/RelationshipLayoutView.js
index 7a51796e..edb7672 100644
--- a/dashboardv2/public/js/views/graph/RelationshipLayoutView.js
+++ b/dashboardv2/public/js/views/graph/RelationshipLayoutView.js
@@ -118,7 +118,9 @@ define(['require',
                 this.$("[data-id='typeName']").text(typeName);
                 var getElement = function(options) {
                     var name = options.entityName ? options.entityName : Utils.getName(options, "displayText");
-                    return "<li><a href=#!/detailPage/" + options.guid + "?tabActive=relationship>" + _.escape(name) + " (" + options.typeName + ")</a></li>";
+                    return "<li class=" + (Enums.entityStateReadOnly[options.relationshipStatus] ? "deleted-relation" : '') + "><a href=#!/detailPage/" + options.guid + "?tabActive=relationship>" + _.escape(name) + " (" + options.typeName + ")</a>" +
+                        '<button type="button" title="Deleted" class="btn btn-sm deleteBtn deletedTableBtn ' + (Enums.entityStateReadOnly[options.relationshipStatus] ? "" : 'hide') + '"><i class="fa fa-trash"></i></button>' +
+                        "</li>";
                 }
                 if (_.isArray(data)) {
                     if (data.length > 1) {
@@ -304,6 +306,20 @@ define(['require',
                         });
                     }
                 })
+
+                function isSingleRelationDeleted(data) {
+                    var d = $.extend(true, {}, data);
+                    if (!_.isArray(d.value)) {
+                        d.value = [d.value];
+                    }
+                    if (d && _.isArray(d.value)) {
+                        if (d.value.length == 1 && Enums.entityStateReadOnly[_.first(d.value).relationshipStatus]) {
+                            return true;
+                        } else {
+                            return false;
+                        }
+                    }
+                }
                 circleContainer.append("circle")
                     .attr("cx", 0)
                     .attr("cy", 0)
@@ -314,6 +330,8 @@ define(['require',
                     .attr("fill", function(d) {
                         if (d && d.value && d.value.guid == that.guid) {
                             return activeEntityColor;
+                        } else if (isSingleRelationDeleted(d)) {
+                            return "#BB5838";
                         } else {
                             return "#e0e0e0";
                         }
@@ -343,6 +361,8 @@ define(['require',
                     .attr("fill", function(d) {
                         if (d && d.value && d.value.guid == that.guid) {
                             return "#fff";
+                        } else if (isSingleRelationDeleted(d)) {
+                            return "#fff";
                         } else {
                             return "#000";
                         }