Commit 38d7b91e by kevalbhatt

ATLAS-3904: Regression: Glossary term deatils page not able to render the classfication tab

parent 80efe926
...@@ -29,7 +29,7 @@ define(['require', ...@@ -29,7 +29,7 @@ define(['require',
'use strict'; 'use strict';
var ReplicationAuditTableLayoutView = Backbone.Marionette.LayoutView.extend( var ReplicationAuditTableLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends TagDetailTableLayoutView */ /** @lends ReplicationAuditTableLayoutView */
{ {
_viewName: 'ReplicationAuditTableLayoutView', _viewName: 'ReplicationAuditTableLayoutView',
...@@ -48,7 +48,7 @@ define(['require', ...@@ -48,7 +48,7 @@ define(['require',
return events; return events;
}, },
/** /**
* intialize a new TagDetailTableLayoutView Layout * intialize a new ReplicationAuditTableLayoutView Layout
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
......
...@@ -232,7 +232,36 @@ define(['require', ...@@ -232,7 +232,36 @@ define(['require',
if (that.isDestroyed) { if (that.isDestroyed) {
return; return;
} }
that.data = data;
if (that.isTermView) { 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 = { var obj = {
"guid": that.guid, "guid": that.guid,
"entityDefCollection": that.entityDefCollection, "entityDefCollection": that.entityDefCollection,
...@@ -242,6 +271,7 @@ define(['require', ...@@ -242,6 +271,7 @@ define(['require',
"classificationDefCollection": that.classificationDefCollection, "classificationDefCollection": that.classificationDefCollection,
"glossaryCollection": that.glossaryCollection, "glossaryCollection": that.glossaryCollection,
"searchVent": that.searchVent, "searchVent": that.searchVent,
"tags": tags,
"getSelectedTermAttribute": function() { "getSelectedTermAttribute": function() {
return that.selectedTermAttribute; return that.selectedTermAttribute;
}, },
...@@ -253,7 +283,6 @@ define(['require', ...@@ -253,7 +283,6 @@ define(['require',
that.renderTagTableLayoutView(obj); that.renderTagTableLayoutView(obj);
that.renderRelationLayoutView(obj); that.renderRelationLayoutView(obj);
} }
that.data = data;
that.glossaryCollection.trigger("data:updated", $.extend(true, {}, data)); that.glossaryCollection.trigger("data:updated", $.extend(true, {}, data));
that.glossary.selectedItem.model = data; that.glossary.selectedItem.model = data;
that.glossary.selectedItem.guid = data.guid; that.glossary.selectedItem.guid = data.guid;
......
...@@ -29,7 +29,7 @@ define(['require', ...@@ -29,7 +29,7 @@ define(['require',
'use strict'; 'use strict';
var ReplicationAuditTableLayoutView = Backbone.Marionette.LayoutView.extend( var ReplicationAuditTableLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends TagDetailTableLayoutView */ /** @lends ReplicationAuditTableLayoutView */
{ {
_viewName: 'ReplicationAuditTableLayoutView', _viewName: 'ReplicationAuditTableLayoutView',
...@@ -48,7 +48,7 @@ define(['require', ...@@ -48,7 +48,7 @@ define(['require',
return events; return events;
}, },
/** /**
* intialize a new TagDetailTableLayoutView Layout * intialize a new ReplicationAuditTableLayoutView Layout
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
......
...@@ -247,7 +247,36 @@ define(['require', ...@@ -247,7 +247,36 @@ define(['require',
if (that.isDestroyed) { if (that.isDestroyed) {
return; return;
} }
that.data = data;
if (that.isTermView) { 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 = { var obj = {
"guid": that.guid, "guid": that.guid,
"entityDefCollection": that.entityDefCollection, "entityDefCollection": that.entityDefCollection,
...@@ -257,6 +286,7 @@ define(['require', ...@@ -257,6 +286,7 @@ define(['require',
"classificationDefCollection": that.classificationDefCollection, "classificationDefCollection": that.classificationDefCollection,
"glossaryCollection": that.glossaryCollection, "glossaryCollection": that.glossaryCollection,
"searchVent": that.searchVent, "searchVent": that.searchVent,
"tags": tags,
"getSelectedTermAttribute": function() { "getSelectedTermAttribute": function() {
return that.selectedTermAttribute; return that.selectedTermAttribute;
}, },
...@@ -268,7 +298,6 @@ define(['require', ...@@ -268,7 +298,6 @@ define(['require',
that.renderTagTableLayoutView(obj); that.renderTagTableLayoutView(obj);
that.renderRelationLayoutView(obj); that.renderRelationLayoutView(obj);
} }
that.data = data;
that.glossaryCollection.trigger("data:updated", $.extend(true, {}, data)); that.glossaryCollection.trigger("data:updated", $.extend(true, {}, data));
that.glossary.selectedItem.model = data; that.glossary.selectedItem.model = data;
that.glossary.selectedItem.guid = data.guid; that.glossary.selectedItem.guid = data.guid;
......
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