This is an automated email from the ASF dual-hosted git repository. pinal pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/atlas.git
commit 8d3c4ab0e8844f04e29f66acb3577e9d40de9a16 Author: prasad pawar <prasad.pa...@freestoneinfotech.com> AuthorDate: Fri Apr 23 15:12:20 2021 +0530 ATLAS-4252: UI (New): Deleting subclassifications results in endless loading, fixed Signed-off-by: Pinal <pinal-shah> --- .../search/tree/ClassificationTreeLayoutView.js | 32 +++++++++++++++------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js index d23ddea..b64b101 100644 --- a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js +++ b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js @@ -201,14 +201,19 @@ define([ var that = this; this.listenTo( this.classificationDefCollection.fullCollection, - "reset add remove", - function() { - if (this.ui.classificationSearchTree.jstree(true)) { - that.classificationTreeUpdate = true; - that.ui.classificationSearchTree.jstree(true).refresh(); - } else { - this.renderClassificationTree(); - } + "reset add", + function(model) { + that.classificationTreeUpdate = true; + that.classificationTreeRefresh(); + }, + this + ); + this.listenTo( + this.classificationDefCollection.fullCollection, + "remove", + function(model) { + that.classificationTreeUpdate = false; + that.classificationTreeRefresh(); }, this ); @@ -236,6 +241,13 @@ define([ }); }, + classificationTreeRefresh: function() { + if (this.ui.classificationSearchTree.jstree(true)) { + this.ui.classificationSearchTree.jstree(true).refresh(); + } else { + this.renderClassificationTree(); + } + }, findSearchResult: function(tagValue) { if (tagValue) { var params = { @@ -463,7 +475,7 @@ define([ var child = collection.find({ name: name }); - var tagEntityCount = that.entityCountObj?that.entityCountObj.tag.tagEntities[name]:null; + var tagEntityCount = that.entityCountObj ? that.entityCountObj.tag.tagEntities[name] : null; var tagname = tagEntityCount ? name + " (" + _.numberFormatWithComma(tagEntityCount) + ")" : name; if (that.options.value) { @@ -506,7 +518,7 @@ define([ collection.each(function(model) { var modelJSON = model.toJSON(), name = modelJSON.name, - tagEntityCount = that.entityCountObj?that.entityCountObj.tag.tagEntities[name]:null, + tagEntityCount = that.entityCountObj ? that.entityCountObj.tag.tagEntities[name] : null, tagname = tagEntityCount ? name + " (" + _.numberFormatWithComma(tagEntityCount) + ")" : name, isSelectedChildted = false, isSelected = false;