atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [2/2] incubator-atlas git commit: ATLAS-1437: UI update to disallow tag association changes to deleted entities
Date Fri, 20 Jan 2017 16:57:09 GMT
ATLAS-1437: UI update to disallow tag association changes to deleted entities

Signed-off-by: Madhan Neethiraj <madhan@apache.org>


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

Branch: refs/heads/master
Commit: 49453f280bcf221cbe35ee018c26b6be61ad6443
Parents: cc08c51
Author: kalyanikk <kalyani.kashikar@freestoneinfotech.com>
Authored: Fri Jan 20 11:16:47 2017 +0530
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Fri Jan 20 08:56:56 2017 -0800

----------------------------------------------------------------------
 dashboardv2/public/css/scss/main.scss           |  5 +++
 .../business_catalog/AddTermView_tmpl.html      |  9 +++---
 .../business_catalog/BusinessCatalogHeader.html |  2 --
 .../entity/CreateEntityLayoutView_tmpl.html     |  1 -
 .../templates/graph/LineageLayoutView_tmpl.html |  3 --
 .../public/js/templates/site/header.html        |  2 --
 .../tag/TagDetailTableLayoutView_tmpl.html      |  3 +-
 .../templates/tag/createTagLayoutView_tmpl.html |  1 -
 .../public/js/utils/CommonViewFunction.js       | 10 +++---
 dashboardv2/public/js/utils/Globals.js          |  3 --
 dashboardv2/public/js/utils/Messages.js         |  3 +-
 dashboardv2/public/js/utils/TableLayout.js      | 24 --------------
 .../js/views/audit/AuditTableLayoutView.js      |  3 --
 .../AddTermToEntityLayoutView.js                | 23 ++++++++++---
 .../business_catalog/BusinessCatalogHeader.js   |  1 -
 .../views/detail_page/DetailPageLayoutView.js   | 10 +++++-
 .../js/views/search/SearchResultLayoutView.js   | 34 +++++++++++---------
 .../public/js/views/tag/TagDetailLayoutView.js  |  4 +--
 .../public/js/views/tag/TagLayoutView.js        | 11 +------
 .../public/js/views/tag/addTagModalView.js      | 23 ++++++++++---
 release-log.txt                                 |  1 +
 21 files changed, 84 insertions(+), 92 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/css/scss/main.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/main.scss b/dashboardv2/public/css/scss/main.scss
index f60e547..1d10bab 100644
--- a/dashboardv2/public/css/scss/main.scss
+++ b/dashboardv2/public/css/scss/main.scss
@@ -310,6 +310,11 @@ ul {
             display: none;
         }
     }
+    button {
+        &.editbutton[data-id="editButton"] {
+            display: none;
+        }
+    }
 }
 
 @media (min-width: 768px) {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/js/templates/business_catalog/AddTermView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/business_catalog/AddTermView_tmpl.html b/dashboardv2/public/js/templates/business_catalog/AddTermView_tmpl.html
index e784e6a..b8d28eb 100644
--- a/dashboardv2/public/js/templates/business_catalog/AddTermView_tmpl.html
+++ b/dashboardv2/public/js/templates/business_catalog/AddTermView_tmpl.html
@@ -15,14 +15,13 @@
  * limitations under the License.
 -->
 <form name="tagDefinitionform" class="css-form" onsubmit="return false;">
-    <!-- <h4 style="margin-bottom:30px">Add Term</h4> -->
     <div class="form-group">
-    	{{#if defaultTerm}}
-    	<input class="form-control" data-id="termName" placeholder="Enter Taxonomy Name"
autofocus>
+        {{#if defaultTerm}}
+        <input class="form-control" data-id="termName" placeholder="Enter Taxonomy Name"
autofocus>
         <p class='alertTerm' style='display:none'>Taxonomy name should not have spaces</p>
-    	{{else}}
+        {{else}}
         <input class="form-control" data-id="termName" placeholder="Name(Required)" autofocus>
-         <p class='alertTerm' style='display:none'>Term name should not have spaces</p>
+        <p class='alertTerm' style='display:none'>Term name should not have spaces</p>
         {{/if}}
     </div>
     <div class="form-group">

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/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 7ff7106..ae172cc 100644
--- a/dashboardv2/public/js/templates/business_catalog/BusinessCatalogHeader.html
+++ b/dashboardv2/public/js/templates/business_catalog/BusinessCatalogHeader.html
@@ -21,8 +21,6 @@
         <a target="_blank" href="http://atlas.incubator.apache.org/"><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 role="separator" class="divider"></li>
             <li><a href="logout.html"><i class="fa fa-sign-out"></i>Logout</a></li>

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html b/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
index 01f2aa0..d3220b3 100644
--- a/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
@@ -15,7 +15,6 @@
  * limitations under the License.
 -->
 <form name="entityDefinitionform" class="css-form">
-    <!-- <h4 style="margin-bottom:30px"></h4> -->
     <div class="form-group">
         <div class="col-sm-12">
             <div class="row">

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
index 6a2e81c..f67e811 100644
--- a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<!-- <div class="panel-heading">
-    <h3 class="panel-title">Lineage</h3>
-</div> -->
 <div class="panel-body graph-bg resize-graph" align="center">
     <div class="graph" id="tree-container">
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/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 623d802..558dd67 100644
--- a/dashboardv2/public/js/templates/site/header.html
+++ b/dashboardv2/public/js/templates/site/header.html
@@ -19,8 +19,6 @@
         <a target="_blank" href="http://atlas.incubator.apache.org/"><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 role="separator" class="divider"></li>
             <li>

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html b/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html
index 4be7cc2..c215128 100644
--- a/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html
@@ -15,9 +15,8 @@
  * limitations under the License.
 -->
 <div>
-    <!--     <button class="add-tag btn btn-success pull-right" data-id="addTag" style="margin-bottom:10px">Add
Tag</button> -->
 </div>
 <div class="fontLoader">
     <i class="fa fa-refresh fa-spin-custom"></i>
 </div>
-<div id="r_tagTermTableLayoutView"></div>
\ No newline at end of file
+<div id="r_tagTermTableLayoutView"></div>

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/js/templates/tag/createTagLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/createTagLayoutView_tmpl.html b/dashboardv2/public/js/templates/tag/createTagLayoutView_tmpl.html
index 668b09d..256209b 100644
--- a/dashboardv2/public/js/templates/tag/createTagLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/createTagLayoutView_tmpl.html
@@ -15,7 +15,6 @@
  * limitations under the License.
 -->
 <form name="tagDefinitionform" class="css-form" data-id="createTagForm">
-    <!-- <h4 style="margin-bottom:30px"></h4> -->
     <div class="form-group">
         {{#if create}}
         <input class="form-control row-margin-bottom" data-id="tagName" placeholder="Name(required)"
autofocus>

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/js/utils/CommonViewFunction.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index ac14dfe..7d41c1c 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -80,7 +80,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
                     success: function(data) {
                         var value = "",
                             deleteButton = "";
-
                         if (data && data.attributes) {
                             if (data.attributes.name) {
                                 value = data.attributes.name;
@@ -92,11 +91,10 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
                         }
                         var id = "";
                         if (data.guid) {
-                            if (Enums.entityStateReadOnly[data.attributes.state]) {
+                            if (Enums.entityStateReadOnly[data.status]) {
                                 deleteButton += '<button title="Deleted" class="btn btn-atlasAction
btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
                             }
                             id = data.guid;
-
                         }
                         if (value.length > 1) {
                             scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/'
+ id + '">' + _.escape(value) + '</a>');
@@ -131,6 +129,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
                         id = inputOutputField.guid || inputOutputField.id,
                         tempLink = "",
                         readOnly = false;
+                    if (Enums.entityStateReadOnly[inputOutputField.status]) {
+                        readOnly = inputOutputField.status
+                    }
                     if (_.isString(inputOutputField) || _.isBoolean(inputOutputField) ||
_.isNumber(inputOutputField)) {
                         if (inputOutputField.indexOf("$") == -1) {
                             valueOfArray.push('<span>' + _.escape(inputOutputField)
+ '</span>');
@@ -169,7 +170,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
                             tempLink += '<div data-id="' + fetchId + '"></div>';
                         }
                     }
-
                     if (readOnly) {
                         if (!fetch) {
                             tempLink += '<button title="Deleted" class="btn btn-atlasAction
btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
@@ -364,10 +364,10 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages',
'utils/Enum
         require(['models/VCatalog'], function(Vcatalog) {
             var VCatalog = new Vcatalog();
             var name = options.termName;
+            ++that.asyncFetchCounter;
             VCatalog.url = function() {
                 return "api/atlas/v1/entities/" + options.guid + "/tags/" + name;
             };
-            ++that.asyncFetchCounter;
             VCatalog.save(null, {
                 success: function(data) {
                     Utils.notifySuccess({

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/js/utils/Globals.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/Globals.js b/dashboardv2/public/js/utils/Globals.js
index fb95bc6..a5be29d 100644
--- a/dashboardv2/public/js/utils/Globals.js
+++ b/dashboardv2/public/js/utils/Globals.js
@@ -20,8 +20,6 @@ define(['require'], function(require) {
     'use strict';
 
     var Globals = {};
-
-    //Globals.baseURL = '/api/atlas';
     Globals.settings = {};
     Globals.settings.PAGE_SIZE = 25;
     Globals.saveApplicationState = {
@@ -38,6 +36,5 @@ define(['require'], function(require) {
         status: false,
         response: {}
     }
-
     return Globals;
 });

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/js/utils/Messages.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/Messages.js b/dashboardv2/public/js/utils/Messages.js
index 6776903..d6acc32 100644
--- a/dashboardv2/public/js/utils/Messages.js
+++ b/dashboardv2/public/js/utils/Messages.js
@@ -33,7 +33,8 @@ define(['require'], function(require) {
         addAttributeSuccessMessage: "Tag attribute is added successfully",
         updateTagDescriptionMessage: "Tag description is updated successfully",
         updateTermDescriptionMessage: "Term description is updated successfully",
-        editSuccessMessage: " has been updated successfully"
+        editSuccessMessage: " has been updated successfully",
+        assignDeletedEntity: " entity is deleted, Tag cannot be assign"
     };
     return Messages;
 });

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/js/utils/TableLayout.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/TableLayout.js b/dashboardv2/public/js/utils/TableLayout.js
index fb1ad9f..7a2a155 100644
--- a/dashboardv2/public/js/utils/TableLayout.js
+++ b/dashboardv2/public/js/utils/TableLayout.js
@@ -181,30 +181,6 @@ define(['require',
                     this.collection.trigger("sort");
                 });
 
-                /*this.listenTo(this.collection, 'remove', function(model, collection, response){
-                    if (model.isNew() || !this.includePagination) {
-                        return;
-                    }
-                    if (this.collection.state && this.collection.state.totalRecords>0)
{
-                        this.collection.state.totalRecords-=1;
-                    }
-                    if (this.collection.length===0 && this.collection.state &&
this.collection.state.totalRecords>0) {
-
-                        if (this.collection.state.totalRecords>this.collection.state.currentPage*this.collection.state.pageSize)
{
-                            this.collection.fetch({reset:true});
-                        } else {
-                            if (this.collection.state.currentPage>0) {
-                                this.collection.state.currentPage-=1;
-                                this.collection.fetch({reset:true});
-                            }
-                        }
-
-                    } else if (this.collection.length===0 && this.collection.state
&& this.collection.state.totalRecords===0) {
-                        this.collection.state.currentPage=0;
-                        this.collection.fetch({reset:true});
-                    }
-                }, this);*/
-
                 // It will show tool tip when td has ellipsis  Property
                 this.listenTo(this.collection, "backgrid:refresh", function() {
                     /*this.$('.table td').bind('mouseenter', function() {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
index b8b65e2..dd4adda 100644
--- a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
+++ b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
@@ -39,7 +39,6 @@ define(['require',
 
             /** ui selector cache */
             ui: {
-                auditValue: "[data-id='auditValue']",
                 auditCreate: "[data-id='auditCreate']",
                 previousAuditData: "[data-id='previousAuditData']",
                 nextAuditData: "[data-id='nextAuditData']",
@@ -80,8 +79,6 @@ define(['require',
                 };
                 this.currPage = 1;
                 this.bindEvents();
-                // this.pageFrom = 1;
-                // this.pageTo = this.count;
             },
             onRender: function() {
                 $.extend(this.entityCollection.queryParams, { count: this.count });

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/js/views/business_catalog/AddTermToEntityLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/business_catalog/AddTermToEntityLayoutView.js b/dashboardv2/public/js/views/business_catalog/AddTermToEntityLayoutView.js
index fddaf09..dd45e48 100644
--- a/dashboardv2/public/js/views/business_catalog/AddTermToEntityLayoutView.js
+++ b/dashboardv2/public/js/views/business_catalog/AddTermToEntityLayoutView.js
@@ -23,8 +23,9 @@ define(['require',
     'modules/Modal',
     'collection/VCatalogList',
     'utils/CommonViewFunction',
-    'utils/Messages'
-], function(require, Backbone, AddTermToEntityLayoutViewTmpl, Utils, Modal, VCatalogList,
CommonViewFunction, Messages) {
+    'utils/Messages',
+    'utils/Enums'
+], function(require, Backbone, AddTermToEntityLayoutViewTmpl, Utils, Modal, VCatalogList,
CommonViewFunction, Messages, Enums) {
     'use strict';
 
     var AddTermToEntityLayoutView = Backbone.Marionette.LayoutView.extend(
@@ -50,7 +51,7 @@ define(['require',
              * @constructs
              */
             initialize: function(options) {
-                _.extend(this, _.pick(options, 'guid', 'modalCollection', 'callback', 'multiple',
'showLoader'));
+                _.extend(this, _.pick(options, 'guid', 'modalCollection', 'callback', 'multiple',
'showLoader', 'hideLoader'));
                 this.vCatalogList = new VCatalogList();
                 var that = this;
                 this.modal = new Modal({
@@ -73,9 +74,21 @@ define(['require',
                             }
                             var obj = {
                                 termName: termName,
-                                guid: that.multiple[i].id.id
+                                guid: that.multiple[i].id.id,
+                                deletedEntity: Enums.entityStateReadOnly[that.multiple[i].id.state],
+                                entityName: that.multiple[i].model.get('name')
                             };
-                            CommonViewFunction.saveTermToAsset(obj, that);
+                            if (obj.deletedEntity) {
+                                Utils.notifyError({
+                                    content: obj.entityName + Messages.assignDeletedEntity
+                                });
+                                if (that.multiple.length === 1 || (that.multiple.length ==
(i + 1) && that.asyncFetchCounter == 0)) {
+                                    that.hideLoader();
+                                }
+                            } else {
+                                CommonViewFunction.saveTermToAsset(obj, that);
+                            }
+
                         }
                     } else {
                         that.asyncFetchCounter = 0;

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/js/views/business_catalog/BusinessCatalogHeader.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/business_catalog/BusinessCatalogHeader.js b/dashboardv2/public/js/views/business_catalog/BusinessCatalogHeader.js
index 75ed98c..7247ac0 100644
--- a/dashboardv2/public/js/views/business_catalog/BusinessCatalogHeader.js
+++ b/dashboardv2/public/js/views/business_catalog/BusinessCatalogHeader.js
@@ -31,7 +31,6 @@ define(['require',
         initialize: function(options) {
             _.extend(this, _.pick(options, 'globalVent', 'url', 'collection'));
             this.value = [];
-
         },
         /**
          * After Page Render createBrudCrum called.

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/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 8da3b00..d63bb5a 100644
--- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
@@ -67,7 +67,9 @@ define(['require',
             /** ui events hash */
             events: function() {
                 var events = {};
-                events["click " + this.ui.editButton] = 'onClickEditEntity';
+                if (Globals.entityCrud) {
+                    events["click " + this.ui.editButton] = 'onClickEditEntity';
+                }
                 events["click " + this.ui.tagClick] = function(e) {
                     if (e.target.nodeName.toLocaleLowerCase() != "i") {
                         var scope = $(e.currentTarget);
@@ -111,9 +113,15 @@ define(['require',
                     var collectionJSON = this.collection.first().toJSON();
                     if (collectionJSON && collectionJSON.guid) {
                         var tagGuid = collectionJSON.guid;
+                        this.readOnly = Enums.entityStateReadOnly[collectionJSON.status];
                     } else {
                         var tagGuid = this.id;
                     }
+                    if (this.readOnly) {
+                        this.$el.addClass('readOnly');
+                    } else {
+                        this.$el.removeClass('readOnly');
+                    }
                     if (collectionJSON) {
                         if (collectionJSON.attributes) {
                             if (collectionJSON.attributes.name) {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/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 35a1152..f389515 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -209,9 +209,7 @@ define(['require',
                 if (value && (value.query === undefined || value.query.trim() ===
"")) {
                     return;
                 }
-                this.$('.fontLoader').show();
-                this.$('.searchTable').hide();
-                this.$('.searchResult').hide();
+                this.showLoader();
                 if (Globals.searchApiCallRef) {
                     Globals.searchApiCallRef.abort();
                 }
@@ -312,9 +310,7 @@ define(['require',
             checkTableFetch: function() {
                 if (this.asyncFetchCounter <= 0) {
                     this.$('div[data-id="r_tableSpinner"]').removeClass('show');
-                    this.$('.fontLoader').hide();
-                    this.$('.searchTable').show();
-                    this.$('.searchResult').show();
+                    this.hideLoader();
                 }
             },
             getEntityTableColumns: function() {
@@ -453,7 +449,9 @@ define(['require',
                                     nameHtml += '<button type="button" title="Deleted"
class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
                                     return '<div class="readOnly readOnlyLink">' +
nameHtml + '</div>';
                                 } else {
-                                    nameHtml += '<button title="Edit" data-id="editEntityButton"
 data-giud= "' + (model.get('$id$').id || model.get('$id$')) + '" class="btn btn-atlasAction
btn-atlas editBtn"><i class="fa fa-pencil"></i></button>'
+                                    if (Globals.entityCrud) {
+                                        nameHtml += '<button title="Edit" data-id="editEntityButton"
 data-giud= "' + (model.get('$id$').id || model.get('$id$')) + '" class="btn btn-atlasAction
btn-atlas editBtn"><i class="fa fa-pencil"></i></button>'
+                                    }
                                     return nameHtml;
                                 }
                             }
@@ -563,16 +561,24 @@ define(['require',
                             that.fetchCollection();
                             that.arr = [];
                         },
-                        showLoader: function() {
-                            that.$('.fontLoader').show();
-                            that.$('.searchTable').hide();
-                        }
+                        showLoader: that.showLoader.bind(that),
+                        hideLoader: that.hideLoader.bind(that)
                     });
                     // view.saveTagData = function() {
                     //override saveTagData function 
                     // }
                 });
             },
+            showLoader: function() {
+                this.$('.fontLoader').show();
+                this.$('.searchTable').hide();
+                this.$('.searchResult').hide();
+            },
+            hideLoader: function() {
+                this.$('.fontLoader').hide();
+                this.$('.searchTable').show();
+                this.$('.searchResult').show();
+            },
             checkedValue: function(e) {
                 var guid = "",
                     that = this;
@@ -605,10 +611,8 @@ define(['require',
                             that.fetchCollection();
                             that.arr = [];
                         },
-                        showLoader: function() {
-                            that.$('.fontLoader').show();
-                            that.$('.searchTable').hide();
-                        }
+                        showLoader: that.showLoader.bind(that),
+                        hideLoader: that.hideLoader.bind(that)
                     });
                 });
             },

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/dashboardv2/public/js/views/tag/TagDetailLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/TagDetailLayoutView.js b/dashboardv2/public/js/views/tag/TagDetailLayoutView.js
index e9e1ab4..3e98755 100644
--- a/dashboardv2/public/js/views/tag/TagDetailLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagDetailLayoutView.js
@@ -72,9 +72,7 @@ define(['require',
                         collection: that.collection
                     }));
                 });
-            },
-
-
+            }
         });
     return TagDetailLayoutView;
 });

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/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 0ac3745..9ed7ae9 100644
--- a/dashboardv2/public/js/views/tag/TagLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagLayoutView.js
@@ -19,13 +19,11 @@
 define(['require',
     'backbone',
     'hbs!tmpl/tag/TagLayoutView_tmpl',
-    'collection/VTagList',
-    'collection/VEntityList',
     'utils/Utils',
     'utils/Messages',
     'utils/Globals',
     'utils/UrlLinks'
-], function(require, Backbone, TagLayoutViewTmpl, VTagList, VEntityList, Utils, Messages,
Globals, UrlLinks) {
+], function(require, Backbone, TagLayoutViewTmpl, Utils, Messages, Globals, UrlLinks) {
     'use strict';
 
     var TagLayoutView = Backbone.Marionette.LayoutView.extend(
@@ -44,7 +42,6 @@ define(['require',
                 createTag: "[data-id='createTag']",
                 tags: "[data-id='tags']",
                 offLineSearchTag: "[data-id='offlineSearchTag']",
-                deleteTerm: "[data-id='deleteTerm']",
                 refreshTag: '[data-id="refreshTag"]'
             },
             /** ui events hash */
@@ -53,7 +50,6 @@ define(['require',
                 events["click " + this.ui.createTag] = 'onClickCreateTag';
                 events["click " + this.ui.tags] = 'onTagList';
                 events["keyup " + this.ui.offLineSearchTag] = 'offlineSearchTag';
-                events["click " + this.ui.deleteTerm] = 'onDeleteTerm';
                 events['click ' + this.ui.refreshTag] = 'fetchCollections';
                 return events;
             },
@@ -265,7 +261,6 @@ define(['require',
                     }
                 });
             },
-
             setUrl: function(url, create) {
                 Utils.setUrl({
                     url: url,
@@ -277,10 +272,6 @@ define(['require',
                 });
             },
             onTagList: function(e, toggle) {
-                /*if (toggle) {
-                    var assetUl = $(e.currentTarget).siblings('.tagAsset')
-                    assetUl.slideToggle("slow");
-                }*/
                 this.ui.tagsParent.find('li').removeClass("active");
                 $(e.currentTarget).addClass("active");
             },

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/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 649cad5..9c82d5c 100644
--- a/dashboardv2/public/js/views/tag/addTagModalView.js
+++ b/dashboardv2/public/js/views/tag/addTagModalView.js
@@ -23,8 +23,10 @@ define(['require',
     'modules/Modal',
     'models/VEntity',
     'utils/Utils',
-    'utils/UrlLinks'
-], function(require, AddTagModalViewTmpl, VTagList, VCommonList, Modal, VEntity, Utils, UrlLinks)
{
+    'utils/UrlLinks',
+    'utils/Enums',
+    'utils/Messages',
+], function(require, AddTagModalViewTmpl, VTagList, VCommonList, Modal, VEntity, Utils, UrlLinks,
Enums, Messages) {
     'use strict';
 
     var AddTagModel = Marionette.LayoutView.extend({
@@ -46,7 +48,7 @@ define(['require',
          */
         initialize: function(options) {
             var that = this;
-            _.extend(this, _.pick(options, 'vent', 'modalCollection', 'guid', 'callback',
'multiple', 'showLoader'));
+            _.extend(this, _.pick(options, 'vent', 'modalCollection', 'guid', 'callback',
'multiple', 'showLoader', 'hideLoader'));
             this.collection = new VTagList();
             this.commonCollection = new VTagList();
             this.asyncAttrFetchCounter = 0;
@@ -76,9 +78,20 @@ define(['require',
                         var obj = {
                             tagName: tagName,
                             tagAttributes: tagAttributes,
-                            guid: (_.isObject(that.multiple[i].id) ? that.multiple[i].id.id
: that.multiple[i].id)
+                            guid: (_.isObject(that.multiple[i].id) ? that.multiple[i].id.id
: that.multiple[i].id),
+                            deletedEntity: Enums.entityStateReadOnly[that.multiple[i].id.state],
+                            entityName: that.multiple[i].model.get('name')
+                        }
+                        if (obj.deletedEntity) {
+                            Utils.notifyError({
+                                content: obj.entityName + Messages.assignDeletedEntity
+                            });
+                            if (that.multiple.length === 1 || (that.multiple.length == (i
+ 1) && that.asyncFetchCounter == 0)) {
+                                that.hideLoader();
+                            }
+                        } else {
+                            that.saveTagData(obj);
                         }
-                        that.saveTagData(obj);
                     }
                 } else {
                     that.asyncFetchCounter = 0;

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/49453f28/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 4cd0a18..87b3a9f 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -9,6 +9,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements
for al
 ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
 
 ALL CHANGES:
+ATLAS-1437 UI update to disallow tag association changes to deleted entities (Kalyanikashikar
via mneethiraj)
 ATLAS-1352 fix for error in redirecting to Knox gateway URL (nixonrodrigues via mneethiraj)
 ATLAS-1467 instance create/full-Update implementation (sumasai via mneethiraj)
 ATLAS-1463 option to exclude specific entity attributes in audit records (sarath.kum4r@gmail.com
via mneethiraj)


Mime
View raw message