Repository: atlas Updated Branches: refs/heads/master 8119492fc -> 4d28dc241
ATLAS-2692: updated UI to render deleted relationships differently from active ones Signed-off-by: Madhan Neethiraj <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/4d28dc24 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/4d28dc24 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/4d28dc24 Branch: refs/heads/master Commit: 4d28dc241568010192f55a3d34cb7f7f1f88a9b2 Parents: 8119492 Author: kevalbhatt <[email protected]> Authored: Wed May 16 18:58:46 2018 +0530 Committer: Madhan Neethiraj <[email protected]> Committed: Wed May 16 08:36:25 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/4d28dc24/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/4d28dc24/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/4d28dc24/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"; }
