Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 989F8200B16 for ; Mon, 20 Jun 2016 20:50:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 973D7160A65; Mon, 20 Jun 2016 18:50:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DC692160A26 for ; Mon, 20 Jun 2016 20:50:08 +0200 (CEST) Received: (qmail 33827 invoked by uid 500); 20 Jun 2016 18:50:08 -0000 Mailing-List: contact commits-help@atlas.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@atlas.incubator.apache.org Delivered-To: mailing list commits@atlas.incubator.apache.org Received: (qmail 33818 invoked by uid 99); 20 Jun 2016 18:50:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2016 18:50:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A3F6CC193D for ; Mon, 20 Jun 2016 18:50:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id tuLU6GXv9PrY for ; Mon, 20 Jun 2016 18:50:04 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 58E7E5F3F3 for ; Mon, 20 Jun 2016 18:50:03 +0000 (UTC) Received: (qmail 33569 invoked by uid 99); 20 Jun 2016 18:50:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2016 18:50:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 44A48E0159; Mon, 20 Jun 2016 18:50:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sumasai@apache.org To: commits@atlas.incubator.apache.org Date: Mon, 20 Jun 2016 18:50:05 -0000 Message-Id: In-Reply-To: <9b169ca1afe64116bb4cbb2892247b5f@git.apache.org> References: <9b169ca1afe64116bb4cbb2892247b5f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/9] incubator-atlas git commit: ATLAS-725 : UI : Filter out or highlight deleted entities in search result outputs(dsl, text) , schema view, and lineage graph archived-at: Mon, 20 Jun 2016 18:50:10 -0000 ATLAS-725 : UI : Filter out or highlight deleted entities in search result outputs(dsl, text) , schema view, and lineage graph Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/9dd0f5c6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/9dd0f5c6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/9dd0f5c6 Branch: refs/heads/0.7-incubating Commit: 9dd0f5c63dfa8ecb19544843d0a74368fe8bf52d Parents: c0cd9f0 Author: Keval Bhatt Authored: Fri Jun 17 20:52:33 2016 +0530 Committer: Suma Shivaprasad Committed: Fri Jun 17 18:19:14 2016 -0700 ---------------------------------------------------------------------- dashboardv2/public/css/scss/form.scss | 17 ++++++ dashboardv2/public/css/scss/main.scss | 44 ++++++++++++++ dashboardv2/public/img/icon-gear-delete.png | Bin 0 -> 17677 bytes dashboardv2/public/img/icon-table-delete.png | Bin 0 -> 14117 bytes dashboardv2/public/js/utils/Globals.js | 4 ++ dashboardv2/public/js/utils/Overrides.js | 2 + .../views/detail_page/DetailPageLayoutView.js | 13 +++- .../public/js/views/graph/LineageLayoutView.js | 43 ++++++++----- .../js/views/search/SearchResultLayoutView.js | 60 ++++++++++++++----- 9 files changed, 154 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/9dd0f5c6/dashboardv2/public/css/scss/form.scss ---------------------------------------------------------------------- diff --git a/dashboardv2/public/css/scss/form.scss b/dashboardv2/public/css/scss/form.scss index 29c96ed..470dbf7 100644 --- a/dashboardv2/public/css/scss/form.scss +++ b/dashboardv2/public/css/scss/form.scss @@ -188,3 +188,20 @@ button:focus { } } } + +.deleteBtn { + border-color: $color_mountain_mist_approx; + color: $color_mountain_mist_approx; + cursor: default; + margin: 10px; + &:hover { + border-color: $color_mountain_mist_approx; + color: $color_mountain_mist_approx; + background-color: $transparent; + } + &:focus { + border-color: $color_mountain_mist_approx; + color: $color_mountain_mist_approx; + background-color: $transparent; + } +} http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/9dd0f5c6/dashboardv2/public/css/scss/main.scss ---------------------------------------------------------------------- diff --git a/dashboardv2/public/css/scss/main.scss b/dashboardv2/public/css/scss/main.scss index c810596..85a68b1 100644 --- a/dashboardv2/public/css/scss/main.scss +++ b/dashboardv2/public/css/scss/main.scss @@ -83,6 +83,7 @@ $color_mountain_mist_approx: #999; $color_suva_gray_approx: #868686; // $tag_color:#9599a0; $tag_color:#4A90E2; +$delete_link:#BB5838; //urls $url_0: url(../img/loading.gif); .card { @@ -238,3 +239,46 @@ ul { word-wrap: break-word; } } + +.readOnly { + .addTag-dropdown { + display: none; + } + span { + &.inputTag[data-id="tagClick"] { + i.fa-close[data-id="deleteTag"] { + display: none; + } + } + } + &.readOnlyLink { + display: inline-block; + .deleteBtn { + padding: 0px 5px; + } + a { + color: $delete_link; + } + } + a { + &.inputTag[data-id="addTag"] { + display: none; + } + &.inputTag[data-id="tagClick"] { + i.fa-times[data-id="delete"] { + display: none; + } + } + i { + &.fa-trash[data-guid] { + display: none; + } + &.fa-trash[data-id="delete"] { + display: none; + } + } + &.inputAssignTag[data-id="addTerm"] { + display: none; + } + } +} http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/9dd0f5c6/dashboardv2/public/img/icon-gear-delete.png ---------------------------------------------------------------------- diff --git a/dashboardv2/public/img/icon-gear-delete.png b/dashboardv2/public/img/icon-gear-delete.png new file mode 100644 index 0000000..90590fc Binary files /dev/null and b/dashboardv2/public/img/icon-gear-delete.png differ http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/9dd0f5c6/dashboardv2/public/img/icon-table-delete.png ---------------------------------------------------------------------- diff --git a/dashboardv2/public/img/icon-table-delete.png b/dashboardv2/public/img/icon-table-delete.png new file mode 100644 index 0000000..67a6c8f Binary files /dev/null and b/dashboardv2/public/img/icon-table-delete.png differ http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/9dd0f5c6/dashboardv2/public/js/utils/Globals.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/utils/Globals.js b/dashboardv2/public/js/utils/Globals.js index 4b3cbbc..344e0f1 100644 --- a/dashboardv2/public/js/utils/Globals.js +++ b/dashboardv2/public/js/utils/Globals.js @@ -41,6 +41,10 @@ define(['require'], function(require) { TAG_ADD: "Tag Added", TAG_DELETE: "Tag Deleted" } + Globals.entityStateReadOnly = { + ACTIVE: false, + DELETED: true + } Globals.userLogedIn = { status: false, response: {} http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/9dd0f5c6/dashboardv2/public/js/utils/Overrides.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/utils/Overrides.js b/dashboardv2/public/js/utils/Overrides.js index 3f9dd0c..b2af8e1 100644 --- a/dashboardv2/public/js/utils/Overrides.js +++ b/dashboardv2/public/js/utils/Overrides.js @@ -45,6 +45,8 @@ define(['require', 'backgrid', 'asBreadcrumbs'], function(require) { Backgrid.Cell.prototype.initialize = function() { cellInit.apply(this, arguments); var className = this.column.get('className'); + var rowClassName = this.column.get('rowClassName'); + if (rowClassName) this.$el.addClass(rowClassName); if (className) this.$el.addClass(className); } /* http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/9dd0f5c6/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 f2838b1..cb96c79 100644 --- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js +++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js @@ -117,9 +117,16 @@ define(['require', bindEvents: function() { var that = this; this.listenTo(this.collection, 'reset', function() { + var collectionJSON = this.collection.toJSON(); if (collectionJSON[0].id && collectionJSON[0].id.id) { var tagGuid = collectionJSON[0].id.id; + this.readOnly = Globals.entityStateReadOnly[collectionJSON[0].id.state]; + } + if (this.readOnly) { + this.$el.addClass('readOnly'); + } else { + this.$el.removeClass('readOnly'); } if (collectionJSON && collectionJSON.length) { if (collectionJSON[0].values) { @@ -127,7 +134,11 @@ define(['require', this.description = collectionJSON[0].values.description; if (this.name) { this.ui.title.show(); - this.ui.title.html('' + this.name + ''); + var titleName = '' + this.name + ''; + if (this.readOnly) { + titleName += '' + } + this.ui.title.html(titleName); } else { this.ui.title.hide(); } http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/9dd0f5c6/dashboardv2/public/js/views/graph/LineageLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js b/dashboardv2/public/js/views/graph/LineageLayoutView.js index ebdeec6..c4796d9 100644 --- a/dashboardv2/public/js/views/graph/LineageLayoutView.js +++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js @@ -23,8 +23,9 @@ define(['require', 'models/VEntity', 'utils/Utils', 'dagreD3', - 'd3-tip' -], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, Utils, dagreD3, d3Tip) { + 'd3-tip', + 'utils/Globals' +], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, Utils, dagreD3, d3Tip, Globals) { 'use strict'; var LineageLayoutView = Backbone.Marionette.LayoutView.extend( @@ -110,19 +111,24 @@ define(['require', function addValueInObject(data) { var obj = {}; - if (data && data.definition && data.definition.values) { - var values = data.definition.values; - obj['label'] = values.name.trunc(20); - obj['toolTiplabel'] = values.name; - obj['id'] = data.GUID; - if (values.queryText) { - obj['queryText'] = values.queryText; + if (data && data.definition) { + if (data.definition.values) { + var values = data.definition.values; + obj['label'] = values.name.trunc(20); + obj['toolTiplabel'] = values.name; + obj['id'] = data.GUID; + if (values.queryText) { + obj['queryText'] = values.queryText; + } + if (data.definition.id && data.definition.id.state) { + obj['state'] = data.definition.id.state; + } } - obj['shape'] = "img"; } else { - obj['label'] = vertices[val].values.name; - obj['toolTiplabel'] = values.name; + obj['label'] = "" + obj['toolTiplabel'] = ""; } + obj['shape'] = "img"; obj['class'] = "type-TOP"; if (data.GUID) { that.g.setNode(data.GUID, obj); @@ -177,6 +183,11 @@ define(['require', obj['class'] = "type-TOP"; obj['shape'] = "img"; obj['typeName'] = vertices[val].values.vertexId.values.typeName; + if (vertices[val].values.state) { + obj['state'] = vertices[val].values.state; + } else if (vertices[val].values.vertexId.values.state) { + obj['state'] = vertices[val].values.vertexId.values.state; + } if (val && obj) { that.g.setNode(val, obj); } @@ -283,13 +294,17 @@ define(['require', .attr("xlink:href", function(d) { if (node) { if (node.typeName) { - if (node.id == that.guid) { + if (Globals.entityStateReadOnly[node.state]) { + return '../img/icon-table-delete.png'; + } else if (node.id == that.guid) { return '../img/icon-table-active.png'; } else { return '../img/icon-table.png'; } } else { - if (node.id == that.guid) { + if (Globals.entityStateReadOnly[node.state]) { + return '../img/icon-gear-delete.png'; + } else if (node.id == that.guid) { return '../img/icon-gear-active.png'; } else { return '../img/icon-gear.png'; http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/9dd0f5c6/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 f792baa..75bf6ef 100644 --- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js +++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js @@ -289,10 +289,17 @@ define(['require', return new Date(rawValue); } if (model.get('name') == rawValue) { + var nameHtml = ""; if (model.get('$id$')) { - return '' + rawValue + ''; + nameHtml = '' + rawValue + ''; } else { - return '' + rawValue + ''; + nameHtml = '' + rawValue + ''; + } + if (Globals.entityStateReadOnly[model.get('$id$').state]) { + nameHtml += ''; + return ''; + } else { + return nameHtml; } } else { return rawValue; @@ -313,7 +320,12 @@ define(['require', className: 'searchTag', formatter: _.extend({}, Backgrid.CellFormatter.prototype, { fromRaw: function(rawValue, model) { - return CommonViewFunction.tagForTable(model); + if (Globals.entityStateReadOnly[model.get('$id$').state]) { + return '
' + CommonViewFunction.tagForTable(model); + '
'; + } else { + return CommonViewFunction.tagForTable(model); + } + } }) }; @@ -330,7 +342,11 @@ define(['require', if (returnObject.object) { that.bradCrumbList.push(returnObject.object); } - return returnObject.html; + if (Globals.entityStateReadOnly[model.get('$id$').state]) { + return '
' + returnObject.html + '
'; + } else { + return returnObject.html; + } } }) }; @@ -375,10 +391,18 @@ define(['require', model.getEntity(guid, { beforeSend: function() {}, success: function(data) { - if (data.definition && data.definition.values && data.definition.values.name) { - return that.$('td a[data-id="' + guid + '"]').html(data.definition.values.name); - } else { - return that.$('td a[data-id="' + guid + '"]').html(data.definition.id.id); + if (data.definition) { + if (data.definition.id && data.definition.id.state) { + if (Globals.entityStateReadOnly[data.definition.id.state]) { + that.$('td a[data-id="' + guid + '"]').parent().addClass('readOnly readOnlyLink'); + that.$('td a[data-id="' + guid + '"]').parent().append(''); + } + } + if (data.definition.values && data.definition.values.name) { + return that.$('td a[data-id="' + guid + '"]').html(data.definition.values.name); + } else { + return that.$('td a[data-id="' + guid + '"]').html(data.definition.id.id); + } } }, error: function(error, data, status) {}, @@ -387,17 +411,25 @@ define(['require', that.checkTableFetch(); } }); - return ''; + return '
'; } else if (!modelObject.$typeName$) { var guid = model.toJSON().guid; ++that.fetchList; model.getEntity(guid, { beforeSend: function() {}, success: function(data) { - if (data.definition && data.definition.values && data.definition.values.name) { - return that.$('td a[data-id="' + guid + '"]').html(data.definition.values.name); - } else { - return that.$('td a[data-id="' + guid + '"]').html(data.definition.id.id); + if (data.definition) { + if (data.definition.id && data.definition.id.state) { + if (Globals.entityStateReadOnly[data.definition.id.state]) { + that.$('td a[data-id="' + guid + '"]').parent().addClass('readOnly readOnlyLink'); + that.$('td a[data-id="' + guid + '"]').parent().append(''); + } + } + if (data.definition.values && data.definition.values.name) { + return that.$('td a[data-id="' + guid + '"]').html(data.definition.values.name); + } else { + return that.$('td a[data-id="' + guid + '"]').html(data.definition.id.id); + } } }, error: function(error, data, status) {}, @@ -406,7 +438,7 @@ define(['require', that.checkTableFetch(); } }); - return ''; + return '
'; } } })