Repository: atlas Updated Branches: refs/heads/master fc17b38ee -> 6d999b0aa
ATLAS-2562 : UI: Support Business Terms and Categories (bug fixes) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/6d999b0a Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/6d999b0a Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/6d999b0a Branch: refs/heads/master Commit: 6d999b0aa6ded46d678b5880da05b80e37d4b124 Parents: fc17b38 Author: kevalbhatt <kbh...@apache.org> Authored: Wed Apr 18 12:40:53 2018 +0530 Committer: kevalbhatt <kbh...@apache.org> Committed: Wed Apr 18 12:48:12 2018 +0530 ---------------------------------------------------------------------- dashboardv2/public/js/utils/CommonViewFunction.js | 6 +++--- .../public/js/views/detail_page/DetailPageLayoutView.js | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/6d999b0a/dashboardv2/public/js/utils/CommonViewFunction.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js index bc5c170..b7e2c72 100644 --- a/dashboardv2/public/js/utils/CommonViewFunction.js +++ b/dashboardv2/public/js/utils/CommonViewFunction.js @@ -683,7 +683,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum } CommonViewFunction.removeCategoryTermAssociation = function(options) { if (options) { - var selectedGuid = options.guid, + var selectedGuid = options.selectedGuid, termGuid = options.termGuid, isCategoryView = options.isCategoryView, isTermView = options.isTermView, @@ -728,9 +728,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum } else { var data = _.extend({}, model); if (isTermView) { - data.categories = _.reject(data.categories, function(term) { return term.categoryGuid != selectedGuid }); + data.categories = _.reject(data.categories, function(term) { return term.categoryGuid == selectedGuid }); } else { - data.terms = _.reject(data.terms, function(term) { return term.termGuid != selectedGuid }); + data.terms = _.reject(data.terms, function(term) { return term.termGuid == selectedGuid }); } newModel[isTermView ? "createEditTerm" : "createEditCategory"](_.extend(ajaxOptions, { http://git-wip-us.apache.org/repos/asf/atlas/blob/6d999b0a/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 9c2d146..eb17504 100644 --- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js +++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js @@ -412,7 +412,9 @@ define(['require', var that = this, termData = ""; _.each(data, function(val) { - termData += '<span class="btn btn-action btn-sm btn-icon btn-blue" title=' + val.displayText + ' data-id="termClick"><span>' + val.displayText + '</span><i class="fa fa-close" data-id="deleteTerm" data-guid="' + val.guid + '" data-type="term" title="Remove Term"></i></span>'; + if (val.relationshipStatus == "ACTIVE") { + termData += '<span class="btn btn-action btn-sm btn-icon btn-blue" title=' + val.displayText + ' data-id="termClick"><span>' + val.displayText + '</span><i class="fa fa-close" data-id="deleteTerm" data-guid="' + val.guid + '" data-type="term" title="Remove Term"></i></span>'; + } }); this.ui.termList.find("span.btn").remove(); this.ui.termList.prepend(termData);