Commit 7b650f7a by kevalbhatt

ATLAS-3750 : UI: Disable "Propagated from" button inside classification tab if…

ATLAS-3750 : UI: Disable "Propagated from" button inside classification tab if entity status is purged
parent 5afa5723
...@@ -39,7 +39,9 @@ define(['require'], function(require) { ...@@ -39,7 +39,9 @@ define(['require'], function(require) {
LABEL_ADD: "Label(s) Added", LABEL_ADD: "Label(s) Added",
LABEL_DELETE: "Label(s) Deleted", LABEL_DELETE: "Label(s) Deleted",
ENTITY_PURGE: "Entity Purged", ENTITY_PURGE: "Entity Purged",
BUSINESS_ATTRIBUTE_UPDATE: "Business Attribute(s) Updated" BUSINESS_ATTRIBUTE_ADD: "Business Attribute(s) Added",
BUSINESS_ATTRIBUTE_UPDATE: "Business Attribute(s) Updated",
BUSINESS_ATTRIBUTE_DELETE: "Business Attribute(s) Deleted"
} }
Enums.entityStateReadOnly = { Enums.entityStateReadOnly = {
...@@ -49,6 +51,10 @@ define(['require'], function(require) { ...@@ -49,6 +51,10 @@ define(['require'], function(require) {
STATUS_DELETED: true STATUS_DELETED: true
} }
Enums.isEntityPurged = {
PURGED: true
}
Enums.lineageUrlType = { Enums.lineageUrlType = {
INPUT: 'inputs', INPUT: 'inputs',
OUTPUT: 'outputs', OUTPUT: 'outputs',
...@@ -213,4 +219,4 @@ define(['require'], function(require) { ...@@ -213,4 +219,4 @@ define(['require'], function(require) {
1: "true" 1: "true"
}; };
return Enums; return Enums;
}); });
\ No newline at end of file
...@@ -22,8 +22,9 @@ define(['require', ...@@ -22,8 +22,9 @@ define(['require',
'utils/CommonViewFunction', 'utils/CommonViewFunction',
'utils/Utils', 'utils/Utils',
'collection/VTagList', 'collection/VTagList',
'utils/Messages' 'utils/Messages',
], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList, Messages) { 'utils/Enums'
], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList, Messages, Enums) {
'use strict'; 'use strict';
var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend( var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
...@@ -123,7 +124,8 @@ define(['require', ...@@ -123,7 +124,8 @@ define(['require',
formatter: _.extend({}, Backgrid.CellFormatter.prototype, { formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) { fromRaw: function(rawValue, model) {
if (that.guid !== model.get('entityGuid')) { if (that.guid !== model.get('entityGuid')) {
var propagtedFrom = ' <span class="btn btn-action btn-sm btn-icon btn-blue" title="Propagated From" data-guid=' + model.get('entityGuid') + ' data-id="propagatedFromClick"><span> Propagated From </span></span>'; var purgeEntityBtn = (Enums.isEntityPurged[model.get('entityStatus')]) ? ' title="Entity not available" disabled' : ' title="Propagated From" data-id="propagatedFromClick"',
propagtedFrom = ' <span class="btn btn-action btn-sm btn-icon btn-blue" data-guid=' + model.get('entityGuid') + purgeEntityBtn + '><span> Propagated From </span></span>';
return '<a title="" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>' + propagtedFrom; return '<a title="" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>' + propagtedFrom;
} else { } else {
return '<a title="' + model.get('typeName') + '" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>'; return '<a title="' + model.get('typeName') + '" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>';
......
...@@ -40,6 +40,7 @@ define(['require'], function(require) { ...@@ -40,6 +40,7 @@ define(['require'], function(require) {
LABEL_DELETE: "Label(s) Deleted", LABEL_DELETE: "Label(s) Deleted",
ENTITY_PURGE: "Entity Purged", ENTITY_PURGE: "Entity Purged",
BUSINESS_ATTRIBUTE_ADD: "Business Attribute(s) Added", BUSINESS_ATTRIBUTE_ADD: "Business Attribute(s) Added",
BUSINESS_ATTRIBUTE_UPDATE: "Business Attribute(s) Updated",
BUSINESS_ATTRIBUTE_DELETE: "Business Attribute(s) Deleted" BUSINESS_ATTRIBUTE_DELETE: "Business Attribute(s) Deleted"
} }
...@@ -50,6 +51,10 @@ define(['require'], function(require) { ...@@ -50,6 +51,10 @@ define(['require'], function(require) {
STATUS_DELETED: true STATUS_DELETED: true
} }
Enums.isEntityPurged = {
PURGED: true
}
Enums.lineageUrlType = { Enums.lineageUrlType = {
INPUT: 'inputs', INPUT: 'inputs',
OUTPUT: 'outputs', OUTPUT: 'outputs',
......
...@@ -22,8 +22,9 @@ define(['require', ...@@ -22,8 +22,9 @@ define(['require',
'utils/CommonViewFunction', 'utils/CommonViewFunction',
'utils/Utils', 'utils/Utils',
'collection/VTagList', 'collection/VTagList',
'utils/Messages' 'utils/Messages',
], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList, Messages) { 'utils/Enums'
], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList, Messages, Enums) {
'use strict'; 'use strict';
var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend( var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
...@@ -123,7 +124,8 @@ define(['require', ...@@ -123,7 +124,8 @@ define(['require',
formatter: _.extend({}, Backgrid.CellFormatter.prototype, { formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) { fromRaw: function(rawValue, model) {
if (that.guid !== model.get('entityGuid')) { if (that.guid !== model.get('entityGuid')) {
var propagtedFrom = ' <span class="btn btn-action btn-sm btn-icon btn-blue" title="Propagated From" data-guid=' + model.get('entityGuid') + ' data-id="propagatedFromClick"><span> Propagated From </span></span>'; var purgeEntityBtn = (Enums.isEntityPurged[model.get('entityStatus')]) ? ' title="Entity not available" disabled' : ' title="Propagated From" data-id="propagatedFromClick"',
propagtedFrom = ' <span class="btn btn-action btn-sm btn-icon btn-blue" data-guid=' + model.get('entityGuid') + purgeEntityBtn + '><span> Propagated From </span></span>';
return '<a title="" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>' + propagtedFrom; return '<a title="" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>' + propagtedFrom;
} else { } else {
return '<a title="' + model.get('typeName') + '" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>'; return '<a title="' + model.get('typeName') + '" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment