This is an automated email from the ASF dual-hosted git repository. kbhatt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push: new 38d7b91 ATLAS-3904: Regression: Glossary term deatils page not able to render the classfication tab 38d7b91 is described below commit 38d7b91e4aa205f89d71f85328a513cc61516266 Author: kevalbhatt <kbh...@apache.org> AuthorDate: Wed Jul 29 18:55:18 2020 +0530 ATLAS-3904: Regression: Glossary term deatils page not able to render the classfication tab --- .../views/audit/ReplicationAuditTableLayoutView.js | 4 +-- .../js/views/glossary/GlossaryDetailLayoutView.js | 31 +++++++++++++++++++++- .../views/audit/ReplicationAuditTableLayoutView.js | 4 +-- .../js/views/glossary/GlossaryDetailLayoutView.js | 31 +++++++++++++++++++++- 4 files changed, 64 insertions(+), 6 deletions(-) diff --git a/dashboardv2/public/js/views/audit/ReplicationAuditTableLayoutView.js b/dashboardv2/public/js/views/audit/ReplicationAuditTableLayoutView.js index 0d7c95d..f48470b 100644 --- a/dashboardv2/public/js/views/audit/ReplicationAuditTableLayoutView.js +++ b/dashboardv2/public/js/views/audit/ReplicationAuditTableLayoutView.js @@ -29,7 +29,7 @@ define(['require', 'use strict'; var ReplicationAuditTableLayoutView = Backbone.Marionette.LayoutView.extend( - /** @lends TagDetailTableLayoutView */ + /** @lends ReplicationAuditTableLayoutView */ { _viewName: 'ReplicationAuditTableLayoutView', @@ -48,7 +48,7 @@ define(['require', return events; }, /** - * intialize a new TagDetailTableLayoutView Layout + * intialize a new ReplicationAuditTableLayoutView Layout * @constructs */ initialize: function(options) { diff --git a/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js b/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js index 465c4ab..d9f1fb9 100644 --- a/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js +++ b/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js @@ -232,7 +232,36 @@ define(['require', if (that.isDestroyed) { return; } + that.data = data; if (that.isTermView) { + var tags = { + 'self': [], + 'propagated': [], + 'propagatedMap': {}, + 'combineMap': {} + }; + if (that.data) { + var tagObject = that.data.classifications; + _.each(tagObject, function(val) { + var typeName = val.typeName; + if (val.entityGuid === that.guid) { + tags['self'].push(val) + } else { + tags['propagated'].push(val); + if (tags.propagatedMap[typeName]) { + tags.propagatedMap[typeName]["count"] += tags.propagatedMap[typeName]["count"]; + } else { + tags.propagatedMap[typeName] = val; + tags.propagatedMap[typeName]["count"] = 1; + } + } + if (tags.combineMap[typeName] === undefined) { + tags.combineMap[typeName] = val; + } + }); + tags.self = _.sortBy(tags.self, "typeName"); + tags.propagated = _.sortBy(tags.propagated, "typeName"); + } var obj = { "guid": that.guid, "entityDefCollection": that.entityDefCollection, @@ -242,6 +271,7 @@ define(['require', "classificationDefCollection": that.classificationDefCollection, "glossaryCollection": that.glossaryCollection, "searchVent": that.searchVent, + "tags": tags, "getSelectedTermAttribute": function() { return that.selectedTermAttribute; }, @@ -253,7 +283,6 @@ define(['require', that.renderTagTableLayoutView(obj); that.renderRelationLayoutView(obj); } - that.data = data; that.glossaryCollection.trigger("data:updated", $.extend(true, {}, data)); that.glossary.selectedItem.model = data; that.glossary.selectedItem.guid = data.guid; diff --git a/dashboardv3/public/js/views/audit/ReplicationAuditTableLayoutView.js b/dashboardv3/public/js/views/audit/ReplicationAuditTableLayoutView.js index 0d7c95d..f48470b 100644 --- a/dashboardv3/public/js/views/audit/ReplicationAuditTableLayoutView.js +++ b/dashboardv3/public/js/views/audit/ReplicationAuditTableLayoutView.js @@ -29,7 +29,7 @@ define(['require', 'use strict'; var ReplicationAuditTableLayoutView = Backbone.Marionette.LayoutView.extend( - /** @lends TagDetailTableLayoutView */ + /** @lends ReplicationAuditTableLayoutView */ { _viewName: 'ReplicationAuditTableLayoutView', @@ -48,7 +48,7 @@ define(['require', return events; }, /** - * intialize a new TagDetailTableLayoutView Layout + * intialize a new ReplicationAuditTableLayoutView Layout * @constructs */ initialize: function(options) { diff --git a/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js b/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js index a807dd3..951281c 100644 --- a/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js +++ b/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js @@ -247,7 +247,36 @@ define(['require', if (that.isDestroyed) { return; } + that.data = data; if (that.isTermView) { + var tags = { + 'self': [], + 'propagated': [], + 'propagatedMap': {}, + 'combineMap': {} + }; + if (that.data) { + var tagObject = that.data.classifications; + _.each(tagObject, function(val) { + var typeName = val.typeName; + if (val.entityGuid === that.guid) { + tags['self'].push(val) + } else { + tags['propagated'].push(val); + if (tags.propagatedMap[typeName]) { + tags.propagatedMap[typeName]["count"] += tags.propagatedMap[typeName]["count"]; + } else { + tags.propagatedMap[typeName] = val; + tags.propagatedMap[typeName]["count"] = 1; + } + } + if (tags.combineMap[typeName] === undefined) { + tags.combineMap[typeName] = val; + } + }); + tags.self = _.sortBy(tags.self, "typeName"); + tags.propagated = _.sortBy(tags.propagated, "typeName"); + } var obj = { "guid": that.guid, "entityDefCollection": that.entityDefCollection, @@ -257,6 +286,7 @@ define(['require', "classificationDefCollection": that.classificationDefCollection, "glossaryCollection": that.glossaryCollection, "searchVent": that.searchVent, + "tags": tags, "getSelectedTermAttribute": function() { return that.selectedTermAttribute; }, @@ -268,7 +298,6 @@ define(['require', that.renderTagTableLayoutView(obj); that.renderRelationLayoutView(obj); } - that.data = data; that.glossaryCollection.trigger("data:updated", $.extend(true, {}, data)); that.glossary.selectedItem.model = data; that.glossary.selectedItem.guid = data.guid;