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) {
LABEL_ADD: "Label(s) Added",
LABEL_DELETE: "Label(s) Deleted",
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 = {
......@@ -49,6 +51,10 @@ define(['require'], function(require) {
STATUS_DELETED: true
}
Enums.isEntityPurged = {
PURGED: true
}
Enums.lineageUrlType = {
INPUT: 'inputs',
OUTPUT: 'outputs',
......@@ -213,4 +219,4 @@ define(['require'], function(require) {
1: "true"
};
return Enums;
});
});
\ No newline at end of file
......@@ -22,8 +22,9 @@ define(['require',
'utils/CommonViewFunction',
'utils/Utils',
'collection/VTagList',
'utils/Messages'
], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList, Messages) {
'utils/Messages',
'utils/Enums'
], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList, Messages, Enums) {
'use strict';
var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
......@@ -123,7 +124,8 @@ define(['require',
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
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;
} else {
return '<a title="' + model.get('typeName') + '" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>';
......
......@@ -40,6 +40,7 @@ define(['require'], function(require) {
LABEL_DELETE: "Label(s) Deleted",
ENTITY_PURGE: "Entity Purged",
BUSINESS_ATTRIBUTE_ADD: "Business Attribute(s) Added",
BUSINESS_ATTRIBUTE_UPDATE: "Business Attribute(s) Updated",
BUSINESS_ATTRIBUTE_DELETE: "Business Attribute(s) Deleted"
}
......@@ -50,6 +51,10 @@ define(['require'], function(require) {
STATUS_DELETED: true
}
Enums.isEntityPurged = {
PURGED: true
}
Enums.lineageUrlType = {
INPUT: 'inputs',
OUTPUT: 'outputs',
......
......@@ -22,8 +22,9 @@ define(['require',
'utils/CommonViewFunction',
'utils/Utils',
'collection/VTagList',
'utils/Messages'
], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList, Messages) {
'utils/Messages',
'utils/Enums'
], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList, Messages, Enums) {
'use strict';
var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
......@@ -123,7 +124,8 @@ define(['require',
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
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;
} else {
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