Commit d604085e by kevalbhatt

ATLAS-3882:- Classic UI: Loader not disappearing while assigning category to term

(cherry picked from commit a43b49c33f93ef2819b747caed7a9baae91d09a4)
parent 5f956110
......@@ -354,6 +354,9 @@ define(['require',
},
fetchCollection: function() {
this.collection.fetch({ reset: true });
if (this.searchVent) {
this.searchVent.trigger('entityList:refresh');
}
},
getEntityDef: function(entityObj) {
if (this.activeEntityDef) {
......@@ -382,9 +385,6 @@ define(['require',
hideLoader: that.hideLoader.bind(that),
tagName: tagName,
callback: function() {
if (that.searchVent) {
that.searchVent.trigger("Classification:Count:Update");
}
that.fetchCollection();
}
}));
......@@ -466,9 +466,6 @@ define(['require',
guid: that.id,
tagList: tagList,
callback: function() {
if (that.searchVent) {
that.searchVent.trigger("Classification:Count:Update");
}
that.fetchCollection();
},
showLoader: that.showLoader.bind(that),
......
......@@ -74,7 +74,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'guid', 'callback', 'showLoader', 'entityDefCollection', 'typeHeaders'));
_.extend(this, _.pick(options, 'guid', 'callback', 'showLoader', 'entityDefCollection', 'typeHeaders', 'searchVent'));
var that = this,
entityTitle, okLabel;
this.selectStoreCollection = new Backbone.Collection();
......@@ -791,6 +791,9 @@ define(['require',
trigger: true
});
}
if (that.searchVent) {
that.searchVent.trigger('entityList:refresh');
}
}
}
},
......@@ -801,7 +804,6 @@ define(['require',
that.modal.$el.find('button.ok').hideButtonLoader();
}
});
} catch (e) {
Utils.notifyError({
content: e.message
......
......@@ -174,7 +174,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'guid', 'glossaryCollection', 'glossary', 'collection', 'typeHeaders', 'value', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection'));
_.extend(this, _.pick(options, 'guid', 'glossaryCollection', 'glossary', 'collection', 'typeHeaders', 'value', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection', 'searchVent'));
if (this.value && this.value.gType) {
if (this.value.gType == "category") {
this.isCategoryView = true;
......@@ -241,6 +241,7 @@ define(['require',
"enumDefCollection": that.enumDefCollection,
"classificationDefCollection": that.classificationDefCollection,
"glossaryCollection": that.glossaryCollection,
"searchVent": that.searchVent,
"getSelectedTermAttribute": function() {
return that.selectedTermAttribute;
},
......@@ -376,6 +377,9 @@ define(['require',
tagList: tagList,
callback: function() {
that.getData();
if (that.searchVent) {
that.searchVent.trigger('entityList:refresh');
}
},
showLoader: that.showLoader.bind(that),
hideLoader: that.hideLoader.bind(that),
......@@ -398,6 +402,9 @@ define(['require',
guid: that.guid,
callback: function() {
that.getData();
if (that.searchVent) {
that.searchVent.trigger('entityList:refresh');
}
}
}));
},
......@@ -442,12 +449,7 @@ define(['require',
},
renderSearchResultLayoutView: function(options) {
var that = this;
require(['views/search/SearchResultLayoutView'], function(SearchResultLayoutView) {
var value = {
'tag': "PII",
'searchType': 'basic'
};
if (that.RSearchResultLayoutView) {
that.RSearchResultLayoutView.show(new SearchResultLayoutView(_.extend({}, options, {
"value": { "searchType": "basic", "term": that.data.qualifiedName },
......
......@@ -480,8 +480,8 @@ define(['require',
if (id) {
options.$el.jstree('activate_node', id);
}
that.changeLoaderState(false);
}
that.changeLoaderState(false);
},
createAction = function(options) {
var $el = options.el,
......@@ -540,9 +540,7 @@ define(['require',
}).on("clear_search.jstree", function(e, data) {
createAction(_.extend({}, options, data));
}).bind('loaded.jstree', function(e, data) {
if (that.query[type].isNodeNotFoundAtLoad == true) {
treeLoaded({ "$el": $el, "type": type });
}
});
},
initializeTermTree = function() {
......
......@@ -210,6 +210,9 @@ define(['require',
this.listenTo(this.typeHeaders, "reset", function(value) {
this.initializeValues();
}, this);
this.listenTo(this.searchVent, "entityList:refresh", function(model, response) {
this.onRefreshButton();
}, this);
},
initializeValues: function() {
this.renderTypeTagList();
......
......@@ -640,7 +640,7 @@ define(['require',
nameCheck = 0,
columnToShow = null,
col = {};
this.value = Utils.getUrlState.getQueryParams() || this.value;
this.value = this.fromView === "glossary" ? this.value : Utils.getUrlState.getQueryParams() || this.value;
if (this.value && this.value.searchType === "basic" && this.searchTableColumns && (this.searchTableColumns[this.value.type] !== undefined)) {
columnToShow = this.searchTableColumns[this.value.type] == null ? [] : this.searchTableColumns[this.value.type];
}
......@@ -1047,6 +1047,9 @@ define(['require',
that.multiSelectEntity = [];
that.$('.multiSelectTag,.multiSelectTerm').hide();
that.fetchCollection();
if (that.searchVent) {
that.searchVent.trigger('entityList:refresh');
}
},
tagList: that.getTagList(guid, multiple),
showLoader: that.showLoader.bind(that),
......@@ -1120,7 +1123,6 @@ define(['require',
that.multiSelectEntity = [];
that.$('.multiSelectTag,.multiSelectTerm').hide();
that.fetchCollection();
},
glossaryCollection: that.glossaryCollection,
});
......@@ -1143,6 +1145,9 @@ define(['require',
hideLoader: that.hideLoader.bind(that),
callback: function() {
that.fetchCollection();
if (that.searchVent) {
that.searchVent.trigger('entityList:refresh');
}
}
});
......@@ -1210,6 +1215,7 @@ define(['require',
var view = new CreateEntityLayoutView({
entityDefCollection: that.entityDefCollection,
typeHeaders: that.typeHeaders,
searchVent: that.searchVent,
callback: function() {
that.fetchCollection();
}
......
......@@ -44,7 +44,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'tag', 'value', 'glossaryCollection', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'enumDefCollection'));
_.extend(this, _.pick(options, 'tag', 'value', 'glossaryCollection', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'enumDefCollection', 'searchVent'));
this.collection = this.classificationDefCollection;
},
bindEvents: function() {},
......@@ -68,6 +68,7 @@ define(['require',
enumDefCollection: that.enumDefCollection,
classificationDefCollection: that.classificationDefCollection,
glossaryCollection: that.glossaryCollection,
searchVent: that.searchVent,
fromView: "classification"
}));
}
......
......@@ -256,6 +256,7 @@ define(['require',
"enumDefCollection": that.enumDefCollection,
"classificationDefCollection": that.classificationDefCollection,
"glossaryCollection": that.glossaryCollection,
"searchVent": that.searchVent,
"getSelectedTermAttribute": function() {
return that.selectedTermAttribute;
},
......@@ -465,10 +466,6 @@ define(['require',
var that = this;
require(['views/search/SearchResultLayoutView'], function(SearchResultLayoutView) {
var value = {
'tag': "PII",
'searchType': 'basic'
};
if (that.RSearchResultLayoutView) {
that.RSearchResultLayoutView.show(new SearchResultLayoutView(_.extend({}, options, {
"value": { "searchType": "basic", "term": that.data.qualifiedName },
......
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